-
Notifications
You must be signed in to change notification settings - Fork 0
Sodaq One configuration
David Salek edited this page Jul 23, 2017
·
4 revisions
- Download the latest Arduino IDE from https://www.arduino.cc/en/Main/Software
- Add the SODAQ board manager URL http://downloads.sodaq.net/package_sodaq_index.json to File → Preferences → Additional Board Manager URLs and install the SODAQ board files.
- Select SODAQ ONE board from Tools.
- Install the SODAQ RN2483 library. Search for RN2483 under Sketch → Include Library → Manage Libraries...
The configuration is based on the code from https://github.com/SodaqMoja/SodaqOne-UniversalTracker-v2
In order to reduce the battery consumption, the GPS usage is disabled and only the temperature and the battery status are sent. The following modifications are made in the code:
Modifications in SodaqOneTracker_v2/Config.cpp
- Default settings in
void ConfigParams::reset()
_defaultFixInterval = 0;//15;
_repeatCount = 5;//0;
_isAdrOn = 0;//1;
_spreadingFactor = 12;//7;
_isGpsOn = 0;//1;
_isDebugOn = 1;//0;
_isLedEnabled = 1;
_isCayennePayloadEnabled = 1;
Modifications in SodaqOneTracker_v2/SodaqOneTracker_v2.ino
- Specify the ABP keys:
#define DEFAULT_DEVADDR_OR_DEVEUI "0000000000000000"
#define DEFAULT_APPSKEY_OR_APPEUI "00000000000000000000000000000000"
#define DEFAULT_NWSKEY_OR_APPKEY "00000000000000000000000000000000"
- Comment out everything in
void loop()
and put the following code there:
//sodaq_wdt_safe_delay(15000);
sodaq_wdt_safe_delay(10*60*1000);
if (getGpsFixAndTransmit()) {
setLedColor(GREEN);
sodaq_wdt_safe_delay(800);
}
- Comment out the filling of the GPS record in
void updateSendBuffer()
/*
// Add GPS record on data channel 1
float latitude = (float)pendingReportDataRecord.getLat() / 10000000.0f;
float longitude = (float)pendingReportDataRecord.getLong() / 10000000.0f;
float altitude = (float)pendingReportDataRecord.getAltitude();
cayenneRecord.addGPS(1, latitude, longitude, altitude);
*/
- Leave only the following lines in
bool getGpsFixAndTransmit()
// populate all fields of the report record
pendingReportDataRecord.setTimestamp(getNow());
pendingReportDataRecord.setBatteryVoltage(getBatteryVoltage());
pendingReportDataRecord.setBoardTemperature(getBoardTemperature());
if (params.getIsDebugOn()) {
pendingReportDataRecord.printHeaderLn(&DEBUG_STREAM);
pendingReportDataRecord.printRecordLn(&DEBUG_STREAM);
debugPrintln();
}
updateSendBuffer();
transmit();
return true;//isSuccessful;