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

Revision:
1:fe242f3e341b
Parent:
0:f2815503561f
Child:
4:2674bd4168f8
--- a/app/LoRaConfig.h	Wed Jul 06 20:40:36 2016 +0000
+++ b/app/LoRaConfig.h	Fri Aug 12 11:19:14 2016 +0000
@@ -8,11 +8,12 @@
 
 #include <string>
 #include <stdint.h>
+#include <vector>
 #ifndef LORACONFIG_H_
 #define LORACONFIG_H_
 
-#define LORA_NETWORK_NAME				"conduitgwy"
-#define LORA_NETWORK_PASSPHRASE			"conduitgwy"
+#define LORA_NETWORK_NAME			"conduitgwy"
+#define LORA_NETWORK_PASSPHRASE		"conduitgwy"
 
 #define LORA_SUBBAND_0						0
 #define LORA_SUBBAND_1						1
@@ -54,6 +55,18 @@
 };
 
 /**
+ * Join Modes for LoRa
+ */
+enum JOIN_MODE{
+	OTA = 0,//!< OTTA
+	ABP = 1 //!< ABP
+};
+
+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};
+static uint8_t LORA_DEVICE_EUI[] = {0x00,0x80,0x00,0x00,0x00,0x00,0xff,0xff};
+
+/**
  * @class LoRaConfig
  * @brief A configuration container for the LoRa Module.
  * All its configuration values are stored an held inside
@@ -99,6 +112,30 @@
 	std::string getNetworkPassphrase();
 
 	/**
+	 * @brief Gets the Network Address. Only used when using ABP JoinMode
+	 * @return
+	 */
+	std::string getNetworkAddress();
+
+	/**
+	 * @brief Gets the App EUI
+	 * @return
+	 */
+	std::vector<uint8_t> getAppEUI();
+
+	/**
+	 * @brief Gets the App Key
+	 * @return
+	 */
+	std::vector<uint8_t> getAppKey();
+
+	/**
+	 * @brief Gets the Device EUI
+	 * @return
+	 */
+	std::vector<uint8_t> getDeviceEUI();
+
+	/**
 	 * @brief Gets the frequency SubBand that will be used by the LoRa Module to
 	 * send and receive its data from its Configuration
 	 * @return
@@ -132,10 +169,21 @@
 	 */
 	LORA_MODE getLORA_MODE();
 
+	/**
+	 * @brief Gets the Actual JOIN_MODE of the built LoRaConfiguration
+	 * form its Configuration
+	 * @return
+	 */
+	JOIN_MODE getJOIN_MODE();
+
 
 private:
 	std::string* networkName;
 	std::string* networkPassphrase;
+	std::string* networkAddress;
+	std::vector<uint8_t>* appEUI;
+	std::vector<uint8_t>* appKey;
+	std::vector<uint8_t>* deviceEUI;
 	bool publicity;
 	bool activity;
 	uint8_t frequencySubBand;
@@ -144,6 +192,7 @@
 	uint8_t acknowledgeRetries;
 
 	LORA_MODE loraMode;
+	JOIN_MODE joinMode;
 
 
 	/**
@@ -171,6 +220,31 @@
 	void setNetworkPassphrase(char* networkPassphrase);
 
 	/**
+	 * @brief Sets the Networkaddress of the Network that will be used in the Configuration
+	 * @param networkAddress
+	 */
+	void setNetworkAddress(char* networkAddress);
+
+	/**
+	 * @brief Sets the APP EUI for OTAA
+	 * @param appEUI
+	 */
+	void setAppEUI();
+
+	/**
+	 * @brief Sets the APP Key for OTAA
+	 * @param appKey
+	 */
+	void setAppKey();
+
+	/**
+	 * @brief Sets the device EUI for OTAA
+	 * @param deviceEUI
+	 */
+	void setDeviceEUI();
+
+
+	/**
 	 * @brief Sets the SubBand that will be used in by the LoRa Module in the Configuration
 	 * @param subBand the SubBand that will be used
 	 */
@@ -200,6 +274,12 @@
 	 */
 	void setLORA_MODE(LORA_MODE);
 
+	/**
+	 * @brief Sets the Join Mode to a Network
+	 * @param
+	 */
+	void setJOIN_MODE(JOIN_MODE);
+
 };
 
 #endif /* LORACONFIG_H_ */