Skip to content

Instantly share code, notes, and snippets.

@KornWtp
Created October 23, 2019 08:13
Show Gist options
  • Save KornWtp/2efb603ec72e9ef872a0c82732d8eb49 to your computer and use it in GitHub Desktop.
Save KornWtp/2efb603ec72e9ef872a0c82732d8eb49 to your computer and use it in GitHub Desktop.
sim7000-at-bridge.ino
#include <Arduino.h>
#include <CMMC_NB_IoT.h>
#define FONA_PWRKEY 18
#define FONA_RST 5
CMMC_NB_IoT nb;
CMMC_AT_Bridge &Bridge = nb.Bridge;
// Power on the module
void powerOn() {
digitalWrite(FONA_PWRKEY, LOW);
delay(100); // For SIM7000
digitalWrite(FONA_PWRKEY, HIGH);
}
void setup()
{
Serial.begin(9600);
Serial.println(F("*** SIM7000 MQTT Example ***"));
pinMode(FONA_RST, OUTPUT);
digitalWrite(FONA_RST, HIGH); // Default state
pinMode(FONA_PWRKEY, OUTPUT);
powerOn(); // Power on the module
Serial2.begin(9600);
Serial.println("Chiang Mai Maker Club's AT-Bridge engine is started.");
Bridge.init(&Serial, &Serial2);
}
void loop()
{
Bridge.loop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment