A multifunctional and modular Firmware for Multitech's mDot based on ARM mBed provides a widerange of functionality for several Sensors such as MAX44009, BME280, MPU9250, SI1143 and uBlox. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.

Dependencies:   mDot_LoRa_Sensornode_Flowmeter_impl mbed-rtos mbed

LoRa-Sensornode Firmware for Multitech mDot

A multifunctional and modular Firmware for Multitech's mDot which provides a widerange of functionality for several Sensors. It allows you to quickly build a Sensornode that measures specific data with its sensors and sends it via LoRaWAN.

/media/uploads/mitea1/logo-lora-600x370.png /media/uploads/mitea1/mt_mdot_family_642px.png

Supported Sensors

Idea

The Firmware has some predefined Application Modes running different Tasks(Measurements). Each mode can be used in a different Scenario. Application_Modes define which sensors are used, how often they aquire data and how often the data has to be sent via LoRa. Lets say you just want to measure the Light then you choose an Application_Mode (or define one) that only runs TaskLight for light measurement. As a standard all measurements are taken every second and sent via LoRa but you can change that interval depending on your usage Scenario

Committer:
mitea1
Date:
Wed Jul 06 20:40:36 2016 +0000
Revision:
0:f2815503561f
initial commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /*
mitea1 0:f2815503561f 2 * uBloxConfig.cpp
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * Created on: May 30, 2016
mitea1 0:f2815503561f 5 * Author: Adrian
mitea1 0:f2815503561f 6 */
mitea1 0:f2815503561f 7
mitea1 0:f2815503561f 8 #include "uBloxConfig.h"
mitea1 0:f2815503561f 9
mitea1 0:f2815503561f 10 uBloxConfig::uBloxConfig() {
mitea1 0:f2815503561f 11 uint8_t commandArray_1 [16] = {0xB5,0x62,0x06,0x57,0x08,0x00,0x01,0x00,0x00,0x00,0x20,0x4E,0x55,0x52,0x7B,0xC3};
mitea1 0:f2815503561f 12 connectCommandAndString(UBLOX_GNSS_ON,commandArray_1,16);
mitea1 0:f2815503561f 13
mitea1 0:f2815503561f 14 uint8_t commandArray_2 [16] = {0xB5,0x62,0x06,0x57,0x08,0x00,0x01,0x00,0x00,0x00,0x50,0x4F,0x54,0x53,0xAC,0x85};
mitea1 0:f2815503561f 15 connectCommandAndString(UBLOX_GNSS_OFF,commandArray_2,16);
mitea1 0:f2815503561f 16
mitea1 0:f2815503561f 17 uint8_t commandArray_3 [10] = {0xB5,0x62,0x06,0x11,0x02,0x00,0x08,0x00,0x21,0x91};
mitea1 0:f2815503561f 18 connectCommandAndString(UBLOX_CONTINUOUS_MODE,commandArray_3,10);
mitea1 0:f2815503561f 19
mitea1 0:f2815503561f 20 uint8_t commandArray_4 [10] = {0xB5,0x62,0x06,0x11,0x02,0x00,0x08,0x01,0x22,0x92};
mitea1 0:f2815503561f 21 connectCommandAndString(UBLOX_POWER_SAVE_MODE,commandArray_4,10);
mitea1 0:f2815503561f 22
mitea1 0:f2815503561f 23 uint8_t commandArray_5 [10] = {0xB5,0x62,0x06,0x11,0x02,0x00,0x08,0x04,0x25,0x95};
mitea1 0:f2815503561f 24 connectCommandAndString(UBLOX_ECO_MODE,commandArray_5,10);
mitea1 0:f2815503561f 25
mitea1 0:f2815503561f 26 uint8_t commandArray_6 [28] = {0xB5,0x62,0x06,0x00,0x14,0x00,0x01,0x00,0x00,0x00,0xD0,0x08,0x00,0x00,0x80,
mitea1 0:f2815503561f 27 0x25,0x00,0x00,0x01,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x9A,0x79};
mitea1 0:f2815503561f 28 connectCommandAndString(UBLOX_DISABLE_ALL_STRING,commandArray_6,28);
mitea1 0:f2815503561f 29
mitea1 0:f2815503561f 30 uint8_t commandArray_7 [16] = {0xB5,0x62,0x06,0x01,0x08,0x00,0x01,0x02,0x00,0x01,0x00,0x00,0x00,0x00,0x13,0xBE};
mitea1 0:f2815503561f 31 connectCommandAndString(UBLOX_ENABLE_POSLLH_STRING,commandArray_7,16);
mitea1 0:f2815503561f 32
mitea1 0:f2815503561f 33 }
mitea1 0:f2815503561f 34
mitea1 0:f2815503561f 35 uBloxConfig::~uBloxConfig() {
mitea1 0:f2815503561f 36 // TODO Auto-generated destructor stub
mitea1 0:f2815503561f 37 }
mitea1 0:f2815503561f 38
mitea1 0:f2815503561f 39 void uBloxConfig::build(uBLOX_MODE desiredMode){
mitea1 0:f2815503561f 40 switch(desiredMode){
mitea1 0:f2815503561f 41
mitea1 0:f2815503561f 42 case uBLOX_MODE_0:
mitea1 0:f2815503561f 43 initialCommands.push_back(configCommands[UBLOX_DISABLE_ALL_STRING]);
mitea1 0:f2815503561f 44 initialCommands.push_back(configCommands[UBLOX_ENABLE_POSLLH_STRING]);
mitea1 0:f2815503561f 45 initialCommands.push_back(configCommands[UBLOX_ECO_MODE]);
mitea1 0:f2815503561f 46 initialCommands.push_back(configCommands[UBLOX_GNSS_ON]);
mitea1 0:f2815503561f 47 break;
mitea1 0:f2815503561f 48
mitea1 0:f2815503561f 49 case uBLOX_MODE_1:
mitea1 0:f2815503561f 50 initialCommands.push_back(configCommands[UBLOX_DISABLE_ALL_STRING]);
mitea1 0:f2815503561f 51 initialCommands.push_back(configCommands[UBLOX_ENABLE_POSLLH_STRING]);
mitea1 0:f2815503561f 52 initialCommands.push_back(configCommands[UBLOX_CONTINUOUS_MODE]);
mitea1 0:f2815503561f 53 initialCommands.push_back(configCommands[UBLOX_GNSS_ON]);
mitea1 0:f2815503561f 54 break;
mitea1 0:f2815503561f 55
mitea1 0:f2815503561f 56 case uBLOX_MODE_2:
mitea1 0:f2815503561f 57 initialCommands.push_back(configCommands[UBLOX_DISABLE_ALL_STRING]);
mitea1 0:f2815503561f 58 initialCommands.push_back(configCommands[UBLOX_ENABLE_POSLLH_STRING]);
mitea1 0:f2815503561f 59 initialCommands.push_back(configCommands[UBLOX_POWER_SAVE_MODE]);
mitea1 0:f2815503561f 60 initialCommands.push_back(configCommands[UBLOX_GNSS_ON]);
mitea1 0:f2815503561f 61 break;
mitea1 0:f2815503561f 62
mitea1 0:f2815503561f 63 case uBLOX_MODE_3:
mitea1 0:f2815503561f 64 initialCommands.push_back(configCommands[UBLOX_DISABLE_ALL_STRING]);
mitea1 0:f2815503561f 65 initialCommands.push_back(configCommands[UBLOX_GNSS_OFF]);
mitea1 0:f2815503561f 66 break;
mitea1 0:f2815503561f 67
mitea1 0:f2815503561f 68 }
mitea1 0:f2815503561f 69
mitea1 0:f2815503561f 70
mitea1 0:f2815503561f 71 }
mitea1 0:f2815503561f 72
mitea1 0:f2815503561f 73 std::vector< std::vector<uint8_t> > uBloxConfig::getInitialConfigurationString(){
mitea1 0:f2815503561f 74 return initialCommands;
mitea1 0:f2815503561f 75 }
mitea1 0:f2815503561f 76
mitea1 0:f2815503561f 77 void uBloxConfig::connectCommandAndString(std::string command, uint8_t* string, uint8_t stringSize){
mitea1 0:f2815503561f 78 std::vector <uint8_t> commandVector(string, string + stringSize);
mitea1 0:f2815503561f 79 configCommands[command] = commandVector;
mitea1 0:f2815503561f 80 }
mitea1 0:f2815503561f 81