Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SetupClient_GSM does not compile #4

Open
reusables-official opened this issue Apr 9, 2024 · 9 comments
Open

SetupClient_GSM does not compile #4

reusables-official opened this issue Apr 9, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@reusables-official
Copy link

reusables-official commented Apr 9, 2024

Board

esp32s3

Device Description

dev kitc1

Arduino-ESP32 Version

latest

Bytebeam Arduino SDK Version

latest

IDE Name

arduino IDE

Operating System

macOs 13.6.6

Problem Description

Running the SetupClient_GSM does not compile. The first error is due to a bad signature for Bytebeam.begin(&modem), which can be resolved by adding:

#define BYTEBEAM_ARDUINO_USE_MODEM to the top of the file.

However, the errors (pasted below) cannot be resolved with this line:

#undef BYTEBEAM_ARDUINO_USE_WIFI

and it is unclear how to override the definitions set in BytebeamArduinoDefines.h

Sketch

#define TINY_GSM_MODEM_SIM7600
// Added next two lines
#define BYTEBEAM_ARDUINO_USE_MODEM
#undef BYTEBEAM_ARDUINO_USE_WIFI

#include <TinyGsmClient.h>
#include <BytebeamArduino.h>
#include "arduino_secrets.h"

//
// By including the above header you got the access to the gloabl object named Bytebeam
// Use Bytebeam global object to perform the required operations
//

#define LED_PIN 42
#define MODEM_PWRKEY  20
#define MODEM_FLIGHT  19
#define MODEM_TX  36
#define MODEM_RX  37

// set GSM PIN, if any
#define GSM_PIN SECRET_PIN

#define SerialMon Serial
#define SerialAT Serial1

// Your GPRS credentials, if any
const char apn[]      = SECRET_APN;

TinyGsm modem(SerialAT);

// function to setup the modem with predefined credentials
void setupModem() {
  // configure your reset, enable pins here if needed
  pinMode(LED_PIN, OUTPUT);
  pinMode(MODEM_PWRKEY, OUTPUT);
  pinMode(MODEM_FLIGHT, OUTPUT);

  // set the status led pin low to indicate the start process
  digitalWrite(LED_PIN, LOW);

  // pull up power pin (IO:4) Modulator power key, need to powered up the modem
  // this pin must be held high for more than 1 second according to manual requirements
  digitalWrite(MODEM_PWRKEY, LOW);
  delay(100);
  digitalWrite(MODEM_PWRKEY, HIGH);
  delay(1000);
  digitalWrite(MODEM_PWRKEY, LOW);  
  
  // pull up the power pin (IO:25) Modulator flight mode control, need to enable modulator 
  // this pin must be set to high
  digitalWrite(MODEM_FLIGHT, HIGH);

  SerialMon.println("Modem Powered ON");

  // start the serial communication b/w esp32 and modem
  SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);
  delay(6000);

  // Restart takes quite some time
  // To skip it, call init() instead of restart()
  // modem.restart();
  modem.init();

  // set the network mode (2 : Automatic)
  modem.setNetworkMode(38);

  String modemName = modem.getModemName();
  SerialMon.printf("Modem Name : ");
  SerialMon.println(modemName);

  String modemInfo = modem.getModemInfo();
  SerialMon.print("Modem Info : ");
  SerialMon.println(modemInfo);

  // Unlock your SIM card with a PIN if needed
  if(GSM_PIN && modem.getSimStatus() != 3) { 
    modem.simUnlock(GSM_PIN); 
  }

  SimStatus simStatus = modem.getSimStatus();

  if(simStatus != SIM_READY) {
    SerialMon.println("Couldn't Ready the SIM.");
    return;
  }
  SerialMon.println("SIM is Ready.");

  // high indicates the modem is initialized successfully
  digitalWrite(LED_PIN, HIGH);
  SerialMon.println("Modem Initialized Successfully !");

  SerialMon.println("Waiting for network...");
  if(!modem.waitForNetwork()) {
    SerialMon.println(" fail");
    delay(10000);
    return;
  }
  SerialMon.println(" success");

  if(modem.isNetworkConnected()) {
    SerialMon.println("Network connected");
  }

  // GPRS connection parameters are usually set after network registration
  SerialMon.print("Connecting to apn : ");
  SerialMon.println(apn);
  
  if (!modem.gprsConnect(apn)) {
    SerialMon.println(" fail");
    delay(10000);
    return;
  }
  SerialMon.println(" success");

  if(modem.isGprsConnected()) {
    SerialMon.println("GPRS connected");
  }
}

// function to sync time from ntp server with predefined credentials
void syncTimeFromNtp() {
  String dateTime = modem.getGSMDateTime(DATE_FULL);

  SerialMon.print("Current Time : ");
  SerialMon.println(dateTime);
  SerialMon.println();
}

void setup() {
  // put your setup code here, to run once:
  SerialMon.begin(115200);
  SerialMon.println();

  setupModem();
  syncTimeFromNtp();

  //
  //  Your other application setup stuff goes here
  //

  // setting up the device info i.e to be seen in the device shadow
  Bytebeam.status          = "Device is Up!";
  Bytebeam.softwareType    = "setup-gsm-client-ino";
  Bytebeam.softwareVersion = "1.0.0";
  Bytebeam.hardwareType    = "ESP32 Dev Module";
  Bytebeam.hardwareVersion = "rev1";

  // This method will initialize and start the bytebeam client
  // You can over-ride the default file system, file name and library logging options, if needed
  // eg. Bytebeam.begin(BytebeamArduino::LITTLEFS_FILE_SYSTEM, "/my_device_config.json", BytebeamLogger::LOG_INFO)
  if(!Bytebeam.begin(&modem)) {
    Serial.println("Bytebeam Client Initialization Failed.");
  } else {
    Serial.println("Bytebeam Client is Initialized Successfully.");
  }

  //
  // If above call is successfull then the bytebeam client is now configured for the use
  // You can always check for the logs in serial monitor for the status of the above call
  //

  // check if bytebeam client is connected or disconnected
  bool connectionStatus = Bytebeam.isConnected();

  if(!connectionStatus) {
    SerialMon.println("Bytebeam Client is Disconnected.");
  } else {
    SerialMon.println("Bytebeam Client is Connected.");
  }

  // Call the end method to stop and de-initialize the bytebeam client at any point of time in the code
  // Bytebeam.end();
}

void loop() {
  // put your main code here, to run repeatedly:

  //
  //  Your application regular stuff goes here
  //

  // This method will let you maintain the connection with the bytebeam cloud, In case
  // the connection is lost, it will attempt to reconnect to the bytebeam cloud
  Bytebeam.loop();

  // software delay, you can customize it as per your application needs
  delay(5000);
}

Debug Message

In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:44,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamHTTPUpdate.h:24:5: error: 'HTTP_UPDATE_FAILED' conflicts with a previous declaration
     HTTP_UPDATE_FAILED,
     ^~~~~~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:37,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/libraries/HTTPUpdate/src/HTTPUpdate.h:48:5: note: previous declaration 'HTTPUpdateResult HTTP_UPDATE_FAILED'
     HTTP_UPDATE_FAILED,
     ^~~~~~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:44,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamHTTPUpdate.h:25:5: error: 'HTTP_UPDATE_NO_UPDATES' conflicts with a previous declaration
     HTTP_UPDATE_NO_UPDATES,
     ^~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:37,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/libraries/HTTPUpdate/src/HTTPUpdate.h:49:5: note: previous declaration 'HTTPUpdateResult HTTP_UPDATE_NO_UPDATES'
     HTTP_UPDATE_NO_UPDATES,
     ^~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:44,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamHTTPUpdate.h:26:5: error: 'HTTP_UPDATE_OK' conflicts with a previous declaration
     HTTP_UPDATE_OK
     ^~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:37,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/libraries/HTTPUpdate/src/HTTPUpdate.h:50:5: note: previous declaration 'HTTPUpdateResult HTTP_UPDATE_OK'
     HTTP_UPDATE_OK
     ^~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:44,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamHTTPUpdate.h:29:34: error: conflicting declaration 'typedef enum BytebeamHTTPUpdateResult t_httpUpdate_return'
 typedef BytebeamHTTPUpdateResult t_httpUpdate_return; // backward compatibility
                                  ^~~~~~~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduinoDefines.h:37,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamTime.h:4,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamLog.h:6,
                 from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:7,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/libraries/HTTPUpdate/src/HTTPUpdate.h:53:26: note: previous declaration as 'typedef enum HTTPUpdateResult t_httpUpdate_return'
 typedef HTTPUpdateResult t_httpUpdate_return; // backward compatibility
                          ^~~~~~~~~~~~~~~~~~~
In file included from /Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:9,
                 from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamOTA.h:60:23: error: redeclaration of 'SSLClient BytebeamOTA::secureOTAClient'
             SSLClient secureOTAClient;
                       ^~~~~~~~~~~~~~~
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamOTA.h:54:30: note: previous declaration 'WiFiClientSecure BytebeamOTA::secureOTAClient'
             WiFiClientSecure secureOTAClient;
                              ^~~~~~~~~~~~~~~
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamOTA.h:61:51: error: redeclaration of 'BytebeamHTTPUpdate& BytebeamOTA::BytebeamUpdate'
             BytebeamHTTPUpdate& BytebeamUpdate =  BytebeamhttpUpdate;
                                                   ^~~~~~~~~~~~~~~~~~
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamOTA.h:55:43: note: previous declaration 'HTTPUpdate& BytebeamOTA::BytebeamUpdate'
             HTTPUpdate& BytebeamUpdate =  httpUpdate;
                                           ^~~~~~~~~~
In file included from /private/var/folders/c0/j9v4g6bd73v6r7pmyn31jb000000gn/T/.arduinoIDE-unsaved202438-41671-j9mlnv.2j8dd/SetupClient_GSM/SetupClient_GSM.ino:6:
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:182:23: error: redeclaration of 'SSLClient BytebeamArduino::secureClient'
             SSLClient secureClient;
                       ^~~~~~~~~~~~
/Users/enzo/Documents/Arduino/libraries/BytebeamArduino/src/BytebeamArduino.h:177:30: note: previous declaration 'WiFiClientSecure BytebeamArduino::secureClient'
             WiFiClientSecure secureClient;
                              ^~~~~~~~~~~~
Multiple libraries were found for "WiFi.h"
  Used: /Users/enzo/Library/Arduino15/packages/esp32/hardware/esp32/2.0.14/libraries/WiFi
  Not used: /Users/enzo/Documents/Arduino/libraries/WiFiNINA
exit status 1

Compilation error: exit status 1


### More Information

_No response_
@reusables-official reusables-official added the bug Something isn't working label Apr 9, 2024
@reusables-official
Copy link
Author

@narangmayank please take a look at this new issue. using gsm is important for our use case. ideally I'd like to be able to use both WiFi and GSM. Our codebase has routines to use SSLClients for each one depending on what is available.

@narangmayank
Copy link
Collaborator

Can you try compiling with the following BytebeamArduinoDefines.h file

#ifndef BYTEBEAM_ARDUINO_DEFINES_H
#define BYTEBEAM_ARDUINO_DEFINES_H

//
// Enable the define as per your connectivity interface
// Make sure you enable only one interface at a time
//

// defines for using the wifi interface
// #define BYTEBEAM_ARDUINO_USE_WIFI

// defines for using the modem interface
#define TINY_GSM_MODEM_SIM7600
#define BYTEBEAM_ARDUINO_USE_MODEM

#if defined(ESP32) || defined(ARDUINO_ARCH_ESP32)
    // ESP32 architecture dependent defines
    #define BYTEBEAM_ARDUINO_ARCH_ESP32
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_FS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_FATFS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_SPIFFS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_LITTLEFS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_SD

    // ESP32 architecture dependent includes
    #include <FS.h>
    #include <FFat.h>
    #include <SPIFFS.h>
    #include <LittleFS.h>
    #include <Preferences.h>

    #ifdef BYTEBEAM_ARDUINO_USE_WIFI
        #include <WiFi.h>
        #include <WiFiUdp.h>
        #include <NTPClient.h>
        #include <WiFiClientSecure.h>
        #include <HTTPUpdate.h>
    #endif
    
    #ifdef BYTEBEAM_ARDUINO_USE_MODEM
        #include <time.h>
        #include <TinyGsmClient.h>
        #include <SSLClient.h>
        #include "BytebeamHTTPUpdate.h"
    #endif
#elif defined(ESP8266) || defined(ARDUINO_ARCH_ESP8266)
    // ESP8266 architecture dependent defines
    #define BYTEBEAM_ARDUINO_ARCH_ESP8266
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_FS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_SPIFFS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_LITTLEFS
    #define BYTEBEAM_ARDUINO_ARCH_SUPPORTS_SD

    // ESP8266 architecture dependent includes
    #include <FS.h>
    #include <LittleFS.h>
    #include <WiFiClientSecureBearSSL.h>
    #include <ESP8266httpUpdate.h>
    #include <EEPROM.h>
    #include <ESP8266WiFi.h>
    #include <WiFiUdp.h>
    #include <NTPClient.h>
#endif

#endif /* BYTEBEAM_ARDUINO_DEFINES_H */

@reusables-official
Copy link
Author

@narangmayank Yes, updating BytebeamArduinoDefines.h accordingly does compile the code. However, Bytebeam does not initialize. Are you able to try on your end? I'm confused about what kind of testing you are doing with these example sketches, because in no way would this sketch work as is given that the library does not expose a way to override these variables...

This is my log output:

BytebeamLogger::LOG_ERROR (BytebeamArduino) loop : Bytebeam Client is not Initialized.
BytebeamLogger::LOG_ERROR (BytebeamArduino) loop : Bytebeam Client is not Initialized.
BytebeamLogger::LOG_ERROR (BytebeamArduino) loop : Bytebeam Client is not Initialized.
BytebeamLogger::LOG_ERROR (BytebeamArduino) loop : Bytebeam Client is not Initialized.
BytebeamLogger::LOG_ERROR (BytebeamArduino) loop : Bytebeam Client is not Initialized.
Modem Powered ON
Modem Name : SIMCOM SIM7600G-H
Modem Info : Manufacturer: SIMCOM INCORPORATED Model: SIMCOM_SIM7600G-H Revision: SIM7600G_V2.0.2 IMEI: 862636052593322 +GCAP: +CGSM
SIM is Ready.
Modem Initialized Successfully !
Waiting for network...
 success
Network connected
Connecting to apn : 
 success
GPRS connected
Current Time : 24/04/09,10:51:58-28

BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : * ****************************************************************** *
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : *			 Architecture : ESP32 				*
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : *			 Chip Model   : ESP32-S3 			*
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : *			 CPU Freq     : 240 MHz 			*
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : *			 Flash Size   : 8 MB 				*
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : *			 Free Heap    : 354 KB 				*
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : *			 SDK Version  : v4.4.6-dirty 				*
BytebeamLogger::LOG_INFO (BytebeamArduino) printArchitectureInfo : * ****************************************************************** *
BytebeamLogger::LOG_INFO (BytebeamArduino) readDeviceConfigFile : SPIFFS file system detected !
BytebeamLogger::LOG_INFO (BytebeamArduino) readDeviceConfigFile : Reading file : /device_config.json
BytebeamLogger::LOG_INFO (BytebeamArduino) readDeviceConfigFile : - read from file
BytebeamLogger::LOG_DEBUG (BytebeamArduino) readDeviceConfigFile : deviceConfigStr : {"project_id":"srbv3","broker":"cloud.bytebeam.io","port":8883,"device_id":"1","authentication":{"ca_certificate":etc... }

BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : deserializeJson() success
BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : Obtaining device config file variables
BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : - obtain device config file variables
BytebeamLogger::LOG_DEBUG (BytebeamArduino) parseDeviceConfigFile : mqttPort : 8883
BytebeamLogger::LOG_DEBUG (BytebeamArduino) parseDeviceConfigFile : mqttBrokerUrl : cloud.bytebeam.io
BytebeamLogger::LOG_DEBUG (BytebeamArduino) parseDeviceConfigFile : deviceId : 1
BytebeamLogger::LOG_DEBUG (BytebeamArduino) parseDeviceConfigFile : projectId : srbv3
BytebeamLogger::LOG_DEBUG (BytebeamArduino) parseDeviceConfigFile : caCertPem : 

... certs

BytebeamLogger::LOG_DEBUG (BytebeamArduino) parseDeviceConfigFile : clientId : BytebeamClient
BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : Project Id : srbv3 and Device Id : 1
BytebeamLogger::LOG_INFO (BytebeamOTA) retrieveOTAInfo : NVS: Retrieving OTA Information
BytebeamLogger::LOG_INFO (BytebeamArduino) initSDK : RESTART: Normal Reboot !
BytebeamLogger::LOG_INFO (BytebeamArduino) setupBytebeamClient : Connecting To Bytebeam Cloud ... 
BytebeamLogger::LOG_ERROR (BytebeamArduino) setupBytebeamClient : ERROR
BytebeamLogger::LOG_ERROR (BytebeamArduino) initSDK : Initialization failed, error while connecting to cloud.

Bytebeam Client Initialization Failed.
BytebeamLogger::LOG_ERROR (BytebeamArduino) isConnected : Bytebeam Client is not Initialized.
Bytebeam Client is Disconnected.
BytebeamLogger::LOG_ERROR (BytebeamArduino) loop : Bytebeam Client is not Initialized.

These are my installed libraries:

  • TinyGSM: v0.11.7
  • SSLClient (govorox): 1.1.7
  • ArduinoJSON v6.21.5
  • PubSubClient (by Nick O'leary) v2.8

The same device (esp32) and device configuration json from Bytebeam works over WiFi as per the issue you just closed.

@narangmayank
Copy link
Collaborator

@reusables-official

I'm able to connect and send the data to bytebeam successfully. I've used the following board https://robu.in/product/ttgo-sim7600e-h-module-esp32-wrover-b-chip-wifi-bluetooth-18560-battery-holder-solar-charge-development-board-unsoldered/

Unfortunately, I don't have ESP32-S3 alternative at the moment to test. Can you test with ESP32?

BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : deserializeJson() success
BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : Obtaining device config file variables
BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : - obtain device config file variables
BytebeamLogger::LOG_INFO (BytebeamArduino) parseDeviceConfigFile : Project Id : ota and Device Id : 1
BytebeamLogger::LOG_INFO (BytebeamOTA) retrieveOTAInfo : NVS: Retrieving OTA Information
BytebeamLogger::LOG_INFO (BytebeamArduino) initSDK : RESTART: Normal Reboot !
BytebeamLogger::LOG_INFO (BytebeamArduino) setupBytebeamClient : Connecting To Bytebeam Cloud ... 
BytebeamLogger::LOG_INFO (BytebeamArduino) setupBytebeamClient : CONNECTED
BytebeamLogger::LOG_INFO (BytebeamArduino) subscribe : subscribe success, {topic : /tenants/ota/devices/1/actions, qos : 1}
BytebeamLogger::LOG_INFO (BytebeamArduino) publishDeviceHeartbeat : publishing device heartbeat.
BytebeamLogger::LOG_INFO (BytebeamArduino) publish : publish success, {topic : /tenants/ota/devices/1/events/device_shadow/jsonarray, message : [{"timestamp":1712748185671,"sequence":1,"Reset_Reason":"Power On Reset","Uptime":37671,"Status":"Device is Up!","Software_Type":"setup-gsm-client-ino","Software_Version":"1.0.0","Hardware_Type":"ESP32 Dev Module","Hardware_Version":"rev1"}]}
BytebeamLogger::LOG_INFO (BytebeamArduino) initSDK : Bytebeam Client Initialized Successfully !

Bytebeam Client is Initialized Successfully.
Bytebeam Client is Connected.
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()
BytebeamLogger::LOG_INFO (BytebeamArduino) loop : I am BytebeamArduino::loop()

@reusables-official
Copy link
Author

@narangmayank what is it that you want me to test? have you updated the examples? I tried running the tinyGsm example and the output is what I pasted above, no information about why the connection failed.

@narangmayank
Copy link
Collaborator

@reusables-official I tested ESP32 <> SIM7600 and it worked for me. Can you tell me which ESP and Modem you are using?

@narangmayank
Copy link
Collaborator

@reusables-official Are you able to connect to bytebeam?

@reusables-official
Copy link
Author

esp32s3-dekvit-C1
modem: SIMCOM 7600G-H

no I was not able to connected and we ended up using a different provider

@narangmayank
Copy link
Collaborator

@reusables-official Okay. Can you tell me which backend solution you are using now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants