Stuck getting started on COM.NB-IoT (SIM7020G) with Core2

  • Have a new COM.NB-IoT (SIM7020G) with Core2 but can't get get anything much to work.

    Have an external 5v power supply for the COM.NB-IoT and inserted a SIM card and attached to the Core2. POwering on the external power supply starts LEDs flashing in the COM.NB-IoT and the Core2 boots up, so that looks like its all connected together properly.

    Flashing the Core2 with the EasyLoader from the COM.NB-IoT doc page and connecting a Serial Monitor shows:
    M5Stack initializing... AT+CSQ
    with the AT+CSQ repeating every 10 seconds.

    So it looks like there is a problem with the serial connection to the COM.NB-IoT.

    Hunting around I found this repo:

    That uses #include <M5Stack.h> which doesn't appear to work with the Core2 so changing it to #include <M5Core2.h> and adding #include <AXP192.h> to fix another compile error, and
    this doc page talks about changing:

    Serial2.begin(115200, SERIAL_8N1, 5, 13);


      M5.begin(true, true, true, false, kMBusModeInput);
      Serial2.begin(115200, SERIAL_8N1, 13, 14);

    So all that gets it compiling cleanly, but still it doesn't talk to the COMX_NB-IoT and just gets repeating AT+CSQ.

    Any help would be greatly appreciated.

  • Hello @torntrousers

    if you use GPIO 13, 14 in your code (as suggested) then in the COM.NB-IoT module you'll need to set dip switches for GPIO 16, 17 to on (the other four to off).

    The GPIO numbering in modules are (so far) always matching the numbering in M5Stack (Base, Gray, Fire) devices but unfortunately M5Core2 uses some different GPIOs on the M5 bus.

    This comparison I've put together a while ago might help.