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:
0:f2815503561f
Child:
4:2674bd4168f8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/TaskGPS.cpp	Wed Jul 06 20:40:36 2016 +0000
@@ -0,0 +1,94 @@
+/*
+ * TaskGPS.cpp
+ *
+ *  Created on: May 30, 2016
+ *      Author: Adrian
+ */
+
+#include "TaskGPS.h"
+
+TaskGPS::TaskGPS(uBlox* uBlox,Mutex* mutexUART, Queue<UBloxGPSMessage,GPS_QUEUE_LENGHT>* queue){
+	this->mUBlox = uBlox;
+	setMutex(mutexUART);
+	setQueue(queue);
+}
+
+TaskGPS::TaskGPS(uBlox* uBlox,rtos::Mutex* mutexUART,
+		rtos::Queue<UBloxGPSMessage,GPS_QUEUE_LENGHT>* queue,
+		osPriority priority, uint32_t stackSize, unsigned char *stackPointer){
+	this->mUBlox = uBlox;
+	setMutex(mutexUART);
+	setQueue(queue);
+	setPriority(priority);
+	setStackSize(stackSize);
+	setStackPointer(stackPointer);
+	setState(SLEEPING);
+}
+
+TaskGPS::~TaskGPS() {
+	// TODO Auto-generated destructor stub
+}
+
+osStatus TaskGPS::start(){
+	setState(RUNNING);
+	this->thread = new rtos::Thread(callBack,this);
+}
+
+osStatus TaskGPS::stop(){
+	thread->terminate();
+	setState(SLEEPING);
+	delete this->thread;
+}
+
+void TaskGPS::callBack(void const* data){
+	// WOODHAMMER METHOD of Casting!
+	const TaskGPS* constInstance = static_cast<const TaskGPS* >(data);
+	TaskGPS* instance = const_cast<TaskGPS*>(constInstance);
+
+	instance->measureGps();
+}
+
+void TaskGPS::measureGps(){
+	UBloxGPSMessage uBloxGPSMessage;
+
+	while(true){
+		mutexUART->lock(osWaitForever);
+		uBloxGPSMessage.setLongitude(mUBlox->getLongitude());
+		uBloxGPSMessage.setLatitude(mUBlox->getLatitude());
+		mutexUART->unlock();
+
+		queue->put(&uBloxGPSMessage,osWaitForever);
+		osDelay(GPS_TASK_DELAY_MS);
+	}
+
+
+}
+
+void TaskGPS::setQueue(Queue<UBloxGPSMessage,GPS_QUEUE_LENGHT>* queue){
+	this->queue = queue;
+}
+
+void TaskGPS::setMutex(Mutex* mutex){
+	this->mutexUART = mutex;
+}
+
+void TaskGPS::setPriority(osPriority priority){
+	this->priority = priority;
+}
+
+void TaskGPS::setStackSize(uint32_t stacksize){
+	this->stack_size = stacksize;
+}
+
+void TaskGPS::setStackPointer(unsigned char* stackPointer){
+	this->stack_pointer = stackPointer;
+}
+
+void TaskGPS::setState(TASK_STATE state){
+	this->state = state;
+}
+
+TASK_STATE TaskGPS::getState(){
+	return state;
+}
+