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:
Sat Sep 10 11:23:35 2016 +0000
Revision:
6:90655031d4f7
Parent:
4:2674bd4168f8
Base Task Class added and inheritance from Task Class implemented for other TaskClasses

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /**
mitea1 0:f2815503561f 2 * @file TaskLight.h
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * @author Adrian
mitea1 0:f2815503561f 5 * @date 27.05.2016
mitea1 0:f2815503561f 6 *
mitea1 0:f2815503561f 7 */
mitea1 0:f2815503561f 8
mitea1 0:f2815503561f 9 #include <Thread.h>
mitea1 0:f2815503561f 10 #include <Queue.h>
mitea1 0:f2815503561f 11 #include <Mutex.h>
mitea1 0:f2815503561f 12 #include "MAX44009.h"
mitea1 0:f2815503561f 13 #include "MAX44009Message.h"
mitea1 0:f2815503561f 14 #include "main.h"
mitea1 6:90655031d4f7 15 #include "Task.h"
mitea1 0:f2815503561f 16
mitea1 0:f2815503561f 17 #ifndef TASKLIGHT_H_
mitea1 0:f2815503561f 18 #define TASKLIGHT_H_
mitea1 0:f2815503561f 19
mitea1 0:f2815503561f 20 /**
mitea1 0:f2815503561f 21 * @class TaskLight
mitea1 0:f2815503561f 22 * @brief This TaskLight Class handles the light measurement using the MAX44009.
mitea1 0:f2815503561f 23 * Starting the task using the start() starts the measurement.
mitea1 0:f2815503561f 24 * It can be used alongside with other measurement Tasks inside the mbed::rtos
mitea1 0:f2815503561f 25 * environment. The Task Class basically wraps mbeds Thread functionality.
mitea1 0:f2815503561f 26 */
mitea1 6:90655031d4f7 27 class TaskLight : public Task{
mitea1 0:f2815503561f 28 public:
mitea1 0:f2815503561f 29 TaskLight(MAX44009*,Mutex*, Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>*);
mitea1 0:f2815503561f 30 TaskLight(MAX44009*,Mutex*,Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>*,
mitea1 0:f2815503561f 31 osPriority, uint32_t, unsigned char*);
mitea1 0:f2815503561f 32 virtual ~TaskLight();
mitea1 0:f2815503561f 33
mitea1 0:f2815503561f 34 private:
mitea1 0:f2815503561f 35 rtos::Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>* queue;
mitea1 0:f2815503561f 36
mitea1 0:f2815503561f 37 MAX44009* max44009;
mitea1 0:f2815503561f 38
mitea1 0:f2815503561f 39 /**
mitea1 0:f2815503561f 40 * @brief A thread safe method that measures the light. After measuring the light
mitea1 0:f2815503561f 41 * it stores the value inside a MAX44009Message
mitea1 0:f2815503561f 42 */
mitea1 6:90655031d4f7 43 void measure();
mitea1 0:f2815503561f 44
mitea1 0:f2815503561f 45 /**
mitea1 0:f2815503561f 46 * @brief Sets the message Queue of the Task where the measured values will be stored
mitea1 0:f2815503561f 47 * after the measurement
mitea1 0:f2815503561f 48 * @param queueLight the queue where the MAX44009Message will be stored
mitea1 0:f2815503561f 49 */
mitea1 0:f2815503561f 50 void setQueue(Queue<MAX44009Message,LIGHT_QUEUE_LENGHT>* queueLight);
mitea1 0:f2815503561f 51
mitea1 0:f2815503561f 52 };
mitea1 0:f2815503561f 53 #endif /* TASKLIGHT_H_ */