This examples shows how to query the module the current firmware version.
Required Materials
1 x Waspmote
1 x Battery
1 x LoRaWAN EU or US or AU or IN or ASIA-PAC / LATAM module
1 x 868/900 MHz antenna
Notes
- This example can be executed in Waspmote v12 and Waspmote v15
Code
/*
* ------ LoRaWAN Code Example --------
*
* Explanation: This example shows how display the Firmware version
*
* Copyright (C) 2018 Libelium Comunicaciones Distribuidas S.L.
* http://www.libelium.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* Version: 3.0
* Design: David Gascon
* Implementation: Yuri Carmona
*/
#include <WaspLoRaWAN.h>
//////////////////////////////////////////////
uint8_t socket = SOCKET0;
//////////////////////////////////////////////
// variable
uint8_t error;
void setup()
{
USB.ON();
USB.println(F("LoRaWAN example - Firmware version"));
//////////////////////////////////////////////
// 1. switch on
//////////////////////////////////////////////
error = LoRaWAN.ON(socket);
// Check status
if( error == 0 )
{
USB.println(F("Switch ON OK"));
}
else
{
USB.print(F("Switch ON error = "));
USB.println(error, DEC);
}
//////////////////////////////////////////////
// 2. show firmware version
//////////////////////////////////////////////
LoRaWAN.showFirmwareVersion();
}
void loop()
{
}
Output
J#
LoRaWAN example - Firmware version
Switch ON OK
Firmware version: RN2903 SA1.0.3 Jan 23 2018 14:34:40