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
LoRa Modes¶
The Table below shows you some predefined LoRa_Modes. You can use them or adapt them for your usage. The Modes define the settings for the LoRa Module.
LORA_MODE | NetworkPublicity | Activity | Frequency Subband | Spreading Factor | Tx Power [dbm] | Acknowledge Retries | JOIN_MODE |
---|---|---|---|---|---|---|---|
LORA_MODE_0_OFF | true | false | 0 | 7 | 16 | 1 | ABP |
LORA_MODE_1 | true | true | 1 | 8 | 16 | 1 | OTA |
LORA_MODE_2 | true | true | 0 | 12 | 16 | 1 | ABP |
LORA_MODE_3 | true | true | 0 | 7 | 16 | 1 | ABP |
LORA_MODE_4 | true | true | 0 | 7 | 16 | 1 | ABP |
LORA_MODE_5 | true | true | 0 | 7 | 20 | 1 | ABP |
definition of a LoRa_Mode inside LoRaConfig::build(LORA_MODE)
... case LORA_MODE_1: setNetworkPublicity(true); setActivity(true); setFrequencySubBand(LORA_SUBBAND_1); setSpreadingFactor(LORA_SPREADING_FACTOR_8); setTxPowerdBm(LORA_TX_POWER_16_DBM); setAcknowledgeRetries(LORA_ACKNOWLEDGE_RETRIES_0); setJOIN_MODE(OTA); break; ...
If you want to adapt a specific Mode just adapt the Parameters. Adding a new Mode just requires a new LORA_MODE-enum and an additional switch case insid LoRaConfig::build(LORA_MODE) that defines the attribute of the mode.
Join Modes¶
ABP¶
If you are using a LoRa_Mode that uses ABP as its JOIN_MODE make sure you've defined the LORA_NETWORK_NAME and LORA_NETWORK_PASSPHRASE inside LoRaConfig.h
definition of LORA_NETWORK_NAME and LORA_NETWORK_PASSPHRASE inside LoRaConfig.h
#define LORA_NETWORK_NAME "conduitgwy" #define LORA_NETWORK_PASSPHRASE "conduitgwy"
OTAA¶
If you are using a LoRa_Mode that uses OTA as its JOIN_MODE make sure you've defined LORA_APP_EUI and LORA_APP_KEY correctly
definition of LORA_NETWORK_NAME and LORA_NETWORK_PASSPHRASE inside LoRaConfig.h
static uint8_t LORA_APP_EUI[] = {0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88}; static uint8_t LORA_APP_KEY[] = {0x11,0x22,0x33,0x44,0x55,0x66,0x77,0x88,0x99,0xaa,0xbb,0xcc,0xdd,0xee,0xff,0x00};
for TTN Users you can find them on your Application Dashboard at https://staging.thethingsnetwork.org/applications
More Information for TTN Users about how to get the APP EUI and APP Key can be found at https://www.thethingsnetwork.org/labs/story/getting-started-with-the-multitech-mdot/step/connect-with-otaa#step-anchor