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:
6:90655031d4f7
Parent:
4:2674bd4168f8
--- a/app/TaskAcceleration.cpp	Sun Aug 21 08:43:27 2016 +0000
+++ b/app/TaskAcceleration.cpp	Sat Sep 10 11:23:35 2016 +0000
@@ -29,38 +29,16 @@
 	// TODO Auto-generated destructor stub
 }
 
-osStatus TaskAcceleration::start(){
-	setState(RUNNING);
-	this->thread = new rtos::Thread(callBack,this);
-}
 
-osStatus TaskAcceleration::stop(){
-	thread->terminate();
-	setState(SLEEPING);
-	delete this->thread;
-}
-
-void TaskAcceleration::callBack(void const* data){
-	// WOODHAMMER METHOD of Casting!
-	const TaskAcceleration* constInstance = static_cast<const TaskAcceleration* >(data);
-	TaskAcceleration* instance = const_cast<TaskAcceleration*>(constInstance);
-
-	instance->measureAcceleration();
-}
-
-void TaskAcceleration::attachIdleHook(void (*fptr) (void)){
-	this->thread->attach_idle_hook(fptr);
-}
-
-void TaskAcceleration::measureAcceleration(){
+void TaskAcceleration::measure(){
 	MPU9250AccelerationMessage mpu9250AccelerationMessage;
 
 	while(true){
-		mutexI2C->lock(osWaitForever);
+		mutexInterface->lock(osWaitForever);
 		mpu9250AccelerationMessage.setXAcceleration(mpu9250->getXAxisAcceleration());
 		mpu9250AccelerationMessage.setYAcceleration(mpu9250->getYAxisAcceleration());
 		mpu9250AccelerationMessage.setZAcceleration(mpu9250->getZAxisAcceleration());
-		mutexI2C->unlock();
+		mutexInterface->unlock();
 
 		queue->put(&mpu9250AccelerationMessage,osWaitForever);
 		osDelay(ACCELERATION_TASK_DELAY_MS);
@@ -69,31 +47,14 @@
 
 }
 
+/**
+ * @brief Sets the message Queue of the Task where the measured values will be stored
+ * after the measurement
+ * @param queueAcceleration the queue where the MPU9250AccelerationMessage will be stored
+ */
 void TaskAcceleration::setQueue(Queue<MPU9250AccelerationMessage,ACCELERATION_QUEUE_LENGHT>* queue){
 	this->queue = queue;
-}
 
-void TaskAcceleration::setMutex(Mutex* mutex){
-	this->mutexI2C = mutex;
-}
-
-void TaskAcceleration::setPriority(osPriority priority){
-	this->priority = priority;
 }
 
-void TaskAcceleration::setStackSize(uint32_t stacksize){
-	this->stack_size = stacksize;
-}
 
-void TaskAcceleration::setStackPointer(unsigned char* stackPointer){
-	this->stack_pointer = stackPointer;
-}
-
-void TaskAcceleration::setState(TASK_STATE state){
-	this->state = state;
-}
-
-TASK_STATE TaskAcceleration::getState(){
-	return state;
-}
-