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:
Fri Nov 02 17:01:02 2018 +0000
Revision:
10:4051c38bf73f
Parent:
6:90655031d4f7
wtf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /*
mitea1 0:f2815503561f 2 * TaskGyroscope.cpp
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * Created on: May 30, 2016
mitea1 0:f2815503561f 5 * Author: Adrian
mitea1 0:f2815503561f 6 */
mitea1 0:f2815503561f 7
mitea1 0:f2815503561f 8 #include "TaskGyroscope.h"
mitea1 0:f2815503561f 9
mitea1 0:f2815503561f 10 TaskGyroscope::TaskGyroscope(MPU9250* mpu9250,Mutex* mutexI2C, Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>* queue){
mitea1 0:f2815503561f 11 this->mpu9250 = mpu9250;
mitea1 0:f2815503561f 12 setMutex(mutexI2C);
mitea1 0:f2815503561f 13 setQueue(queue);
mitea1 0:f2815503561f 14 }
mitea1 0:f2815503561f 15
mitea1 0:f2815503561f 16 TaskGyroscope::TaskGyroscope(MPU9250* mpu9250,rtos::Mutex* mutexI2C,
mitea1 0:f2815503561f 17 rtos::Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>* queue,
mitea1 0:f2815503561f 18 osPriority priority, uint32_t stackSize, unsigned char *stackPointer){
mitea1 0:f2815503561f 19 this->mpu9250 = mpu9250;
mitea1 0:f2815503561f 20 setMutex(mutexI2C);
mitea1 0:f2815503561f 21 setQueue(queue);
mitea1 0:f2815503561f 22 setPriority(priority);
mitea1 0:f2815503561f 23 setStackSize(stackSize);
mitea1 0:f2815503561f 24 setStackPointer(stackPointer);
mitea1 0:f2815503561f 25 setState(SLEEPING);
mitea1 0:f2815503561f 26 }
mitea1 0:f2815503561f 27
mitea1 0:f2815503561f 28 TaskGyroscope::~TaskGyroscope() {
mitea1 0:f2815503561f 29 // TODO Auto-generated destructor stub
mitea1 0:f2815503561f 30 }
mitea1 0:f2815503561f 31
mitea1 6:90655031d4f7 32 void TaskGyroscope::measure(){
mitea1 0:f2815503561f 33 MPU9250GyroscopeMessage mpu9250GyroscopeMessage;
mitea1 0:f2815503561f 34
mitea1 0:f2815503561f 35 while(true){
mitea1 6:90655031d4f7 36 mutexInterface->lock(osWaitForever);
mitea1 0:f2815503561f 37 mpu9250GyroscopeMessage.setXGyro(mpu9250->getXAxisGyro());
mitea1 0:f2815503561f 38 mpu9250GyroscopeMessage.setYGyro(mpu9250->getYAxisGyro());
mitea1 0:f2815503561f 39 mpu9250GyroscopeMessage.setZGyro(mpu9250->getZAxisGyro());
mitea1 6:90655031d4f7 40 mutexInterface->unlock();
mitea1 0:f2815503561f 41
mitea1 0:f2815503561f 42 queue->put(&mpu9250GyroscopeMessage,osWaitForever);
mitea1 0:f2815503561f 43 osDelay(GYROSCOPE_TASK_DELAY_MS);
mitea1 0:f2815503561f 44 }
mitea1 0:f2815503561f 45
mitea1 0:f2815503561f 46
mitea1 0:f2815503561f 47 }
mitea1 0:f2815503561f 48
mitea1 0:f2815503561f 49 void TaskGyroscope::setQueue(Queue<MPU9250GyroscopeMessage,GYROSCOPE_QUEUE_LENGHT>* queue){
mitea1 0:f2815503561f 50 this->queue = queue;
mitea1 0:f2815503561f 51 }