SparkFun Satellite Transceiver Kit - Swarm M138 Hookup Guide

Pages
Contributors: Ell C, PaulZC
Favorited Favorite 3

Arduino Example: Get Firmware Version

The SparkFun Swarm Satellite Arduino Library contains a full set of tried and tested examples which will run on almost all Arduino boards (RAM permitting).

The code below is a stripped-down version of Example3_getFirmwareVersion. Copy and paste the code into a new window in the Arduino IDE:

language:c
#include <SparkFun_Swarm_Satellite_Arduino_Library.h> // http://librarymanager/All#SparkFun_Swarm_Satellite

SWARM_M138 mySwarm;

#define swarmSerial Serial1 // Use Serial1 to communicate with the modem. Change this if required.

void setup()
{
  Serial.begin(115200);

  if (mySwarm.begin(swarmSerial) == false) // Begin communication with the modem
  {
    Serial.println(F("Could not communicate with the modem. Please check the serial connections. Freezing..."));
    while (1)
      ;
  }

  char *firmwareVersion = new char[SWARM_M138_MEM_ALLOC_FV]; // Create storage for the configuration settings

  mySwarm.getFirmwareVersion(firmwareVersion); // Get the firmware version

  Serial.print(F("The firmware version is: "));
  Serial.println(firmwareVersion);

  delete[] firmwareVersion; // Free the storage
}

void loop()
{
  //Nothing to do here
}

Save the file and click on the Upload button to upload the example onto your board.

Open Tools\Serial Monitor to see the modem firmware version.

Check that the baud rate is set to 115200.