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:
Wed Jul 06 20:40:36 2016 +0000
Revision:
0:f2815503561f
initial commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 0:f2815503561f 1 /*
mitea1 0:f2815503561f 2 * MPU9250AccelerationMessage.cpp
mitea1 0:f2815503561f 3 *
mitea1 0:f2815503561f 4 * Created on: Jun 1, 2016
mitea1 0:f2815503561f 5 * Author: Adrian
mitea1 0:f2815503561f 6 */
mitea1 0:f2815503561f 7
mitea1 0:f2815503561f 8 #include "MPU9250AccelerationMessage.h"
mitea1 0:f2815503561f 9 #include "main.h"
mitea1 0:f2815503561f 10
mitea1 0:f2815503561f 11 MPU9250AccelerationMessage::MPU9250AccelerationMessage() {
mitea1 0:f2815503561f 12 loraMessageId.push_back(MPU9250_X_ACCELERATION_MESSAGE_ID);
mitea1 0:f2815503561f 13 loraMessageId.push_back(MPU9250_Y_ACCELERATION_MESSAGE_ID);
mitea1 0:f2815503561f 14 loraMessageId.push_back(MPU9250_Z_ACCELERATION_MESSAGE_ID);
mitea1 0:f2815503561f 15
mitea1 0:f2815503561f 16 }
mitea1 0:f2815503561f 17
mitea1 0:f2815503561f 18 MPU9250AccelerationMessage::~MPU9250AccelerationMessage() {
mitea1 0:f2815503561f 19 // TODO Auto-generated destructor stub
mitea1 0:f2815503561f 20 }
mitea1 0:f2815503561f 21
mitea1 0:f2815503561f 22 void MPU9250AccelerationMessage::setXAcceleration(float xAcceleration){
mitea1 0:f2815503561f 23 this->xAcceleration = xAcceleration;
mitea1 0:f2815503561f 24 }
mitea1 0:f2815503561f 25
mitea1 0:f2815503561f 26 void MPU9250AccelerationMessage::setYAcceleration(float yAcceleration){
mitea1 0:f2815503561f 27 this->yAcceleration = yAcceleration;
mitea1 0:f2815503561f 28 }
mitea1 0:f2815503561f 29
mitea1 0:f2815503561f 30 void MPU9250AccelerationMessage::setZAcceleration(float zAcceleration){
mitea1 0:f2815503561f 31 this->zAcceleration = zAcceleration;
mitea1 0:f2815503561f 32 }
mitea1 0:f2815503561f 33
mitea1 0:f2815503561f 34 float MPU9250AccelerationMessage::getXAcceleration(){
mitea1 0:f2815503561f 35 return xAcceleration;
mitea1 0:f2815503561f 36 }
mitea1 0:f2815503561f 37
mitea1 0:f2815503561f 38 float MPU9250AccelerationMessage::getYAcceleration(){
mitea1 0:f2815503561f 39 return yAcceleration;
mitea1 0:f2815503561f 40 }
mitea1 0:f2815503561f 41
mitea1 0:f2815503561f 42 float MPU9250AccelerationMessage::getZAcceleration(){
mitea1 0:f2815503561f 43 return zAcceleration;
mitea1 0:f2815503561f 44 }
mitea1 0:f2815503561f 45
mitea1 0:f2815503561f 46 char* MPU9250AccelerationMessage::getLoRaMessageString(){
mitea1 0:f2815503561f 47
mitea1 0:f2815503561f 48 char buffer[20];
mitea1 0:f2815503561f 49 loraMessage.clear();
mitea1 0:f2815503561f 50 sprintf(buffer,"%s:%.2f,",loraMessageId.at(0).c_str(),getXAcceleration());
mitea1 0:f2815503561f 51 loraMessage.append(buffer);
mitea1 0:f2815503561f 52 sprintf(buffer,"%s:%.2f,",loraMessageId.at(1).c_str(),getYAcceleration());
mitea1 0:f2815503561f 53 loraMessage.append(buffer);
mitea1 0:f2815503561f 54 sprintf(buffer,"%s:%.2f,",loraMessageId.at(2).c_str(),getZAcceleration());
mitea1 0:f2815503561f 55 loraMessage.append(buffer);
mitea1 0:f2815503561f 56 return (char*) loraMessage.c_str();
mitea1 0:f2815503561f 57 }
mitea1 0:f2815503561f 58
mitea1 0:f2815503561f 59
mitea1 0:f2815503561f 60
mitea1 0:f2815503561f 61
mitea1 0:f2815503561f 62