vshymanskyy / TinyGSM

A small Arduino library for GSM modules, that just works
GNU Lesser General Public License v3.0
1.97k stars 726 forks source link

Use with Blues Wireless Notecard #801

Open drewcssv opened 5 months ago

drewcssv commented 5 months ago

[x ] Request to support a new module

[ ] Bug or problem compiling the library [] Bug or issue with library functionality (ie, sending data over TCP/IP) [ ] Question or request for help

Modem: Blues Wireless Notecard with BG91/95 modem Processor: ESP32 with Arduino IDE TinyGSM Library, latest

Hello, trying to understand if I can use my Blues Wireless Notecard (which uses the BG91/95 modem) with the tinyGSM library. The basic code flow is this:

// Blues Notecard info
#define serialDebug Serial

#define productUID "org.sustainablesv.dclark:#########" 
#define version "V0.1"

Notecard notecard; // Blue Wireless Notecard instance

// Your GPRS credentials, if any
const char apn[]  = "";
const char user[] = "";
const char pass[] = "";

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
const char auth[] = BLYNK_AUTH_TOKEN;

TinyGsm modem(SerialAT);

void setup() {
  // Set console baud rate
  SerialMon.begin(115200);
  delay(10);

  notecard.begin();
  notecard.setDebugOutputStream(serialDebug);
  J *req = notecard.newRequest("hub.set");
  JAddStringToObject(req, "product", productUID);
  JAddStringToObject(req, "mode", "continuous");
  notecard.sendRequest(req);

  // Set GSM module baud rate
  SerialAT.begin(115200);
  delay(6000);

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

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

  // Unlock your SIM card with a PIN
  // modem.simUnlock("1234");

 Blynk.begin(auth, modem, apn, user, pass);

}

Will this work with tinyGSM and Blynk?

Thanks!