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 16:58:23 2018 +0000
Revision:
9:c4e378f4801d
[MOD]initial commit for flowsensor

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mitea1 9:c4e378f4801d 1 /*
mitea1 9:c4e378f4801d 2 * FlowMeterMessage.cpp
mitea1 9:c4e378f4801d 3 *
mitea1 9:c4e378f4801d 4 * Created on: 23.10.2018
mitea1 9:c4e378f4801d 5 * Author: Adrian
mitea1 9:c4e378f4801d 6 */
mitea1 9:c4e378f4801d 7
mitea1 9:c4e378f4801d 8 #include "FlowMeterMessage.h"
mitea1 9:c4e378f4801d 9 #include "main.h"
mitea1 9:c4e378f4801d 10
mitea1 9:c4e378f4801d 11 FlowMeterMessage::FlowMeterMessage() {
mitea1 9:c4e378f4801d 12 this->flowMessageId.push_back(FLOWMETER_CURRENT_FLOW_MESSAGE_ID);
mitea1 9:c4e378f4801d 13 this->flowMessageId.push_back(FLOWMETER_CURRENT_VOLUME_MESSAGE_ID);
mitea1 9:c4e378f4801d 14 this->flowMessageId.push_back(FLOWMETER_TOTAL_FLOW_MESSAGE_ID);
mitea1 9:c4e378f4801d 15 this->flowMessageId.push_back(FLOWMETER_TOTAL_VOLUME_MESSAGE_ID);
mitea1 9:c4e378f4801d 16
mitea1 9:c4e378f4801d 17 }
mitea1 9:c4e378f4801d 18
mitea1 9:c4e378f4801d 19 FlowMeterMessage::~FlowMeterMessage() {
mitea1 9:c4e378f4801d 20 // TODO Auto-generated destructor stub
mitea1 9:c4e378f4801d 21 }
mitea1 9:c4e378f4801d 22
mitea1 9:c4e378f4801d 23 void FlowMeterMessage::setCurrentFlowrate(double currentFlowrate){
mitea1 9:c4e378f4801d 24 this->currentFlowrate = currentFlowrate;
mitea1 9:c4e378f4801d 25 }
mitea1 9:c4e378f4801d 26 double FlowMeterMessage::getCurrentFlowrate(){
mitea1 9:c4e378f4801d 27 return this->currentFlowrate;
mitea1 9:c4e378f4801d 28 }
mitea1 9:c4e378f4801d 29 void FlowMeterMessage::setCurrentVolume(double currentVolume){
mitea1 9:c4e378f4801d 30 this->currentVolume = currentVolume;
mitea1 9:c4e378f4801d 31 }
mitea1 9:c4e378f4801d 32 double FlowMeterMessage::getCurrentVolume(){
mitea1 9:c4e378f4801d 33 return this->currentVolume;
mitea1 9:c4e378f4801d 34 }
mitea1 9:c4e378f4801d 35 void FlowMeterMessage::setTotalFlowrate(double totalFlowrate){
mitea1 9:c4e378f4801d 36 this->totalFlowrate = totalFlowrate;
mitea1 9:c4e378f4801d 37 }
mitea1 9:c4e378f4801d 38 double FlowMeterMessage::getTotalFlowrate(){
mitea1 9:c4e378f4801d 39 return this->totalFlowrate;
mitea1 9:c4e378f4801d 40 }
mitea1 9:c4e378f4801d 41 void FlowMeterMessage::setTotalVolume(double totalVolume){
mitea1 9:c4e378f4801d 42 this->totalVolume = totalVolume;
mitea1 9:c4e378f4801d 43 }
mitea1 9:c4e378f4801d 44 double FlowMeterMessage::getTotalVolume(){
mitea1 9:c4e378f4801d 45 return this->totalVolume;
mitea1 9:c4e378f4801d 46 }
mitea1 9:c4e378f4801d 47 char* FlowMeterMessage::getLoRaMessageString(){
mitea1 9:c4e378f4801d 48 char buffer[20];
mitea1 9:c4e378f4801d 49 flowMessage.clear();
mitea1 9:c4e378f4801d 50 sprintf(buffer,"%s:%.3f,",flowMessageId.at(0).c_str(),(float)getCurrentFlowrate());
mitea1 9:c4e378f4801d 51 flowMessage.append(buffer);
mitea1 9:c4e378f4801d 52 sprintf(buffer,"%s:%.3f,",flowMessageId.at(1).c_str(),(float)getCurrentVolume());
mitea1 9:c4e378f4801d 53 flowMessage.append(buffer);
mitea1 9:c4e378f4801d 54 sprintf(buffer,"%s:%.3f,",flowMessageId.at(2).c_str(),(float)getTotalFlowrate());
mitea1 9:c4e378f4801d 55 flowMessage.append(buffer);
mitea1 9:c4e378f4801d 56 sprintf(buffer,"%s:%.3f,",flowMessageId.at(3).c_str(),(float)getTotalVolume());
mitea1 9:c4e378f4801d 57 flowMessage.append(buffer);
mitea1 9:c4e378f4801d 58 return (char*) flowMessage.c_str();
mitea1 9:c4e378f4801d 59 }