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.
Supported Sensors
- MAX44009 (Lux Measurment) http://www.ebay.ie/itm/MAX44009-Ambient-Light-Sensor-Module-for-Arduino-with-4P-Pin-Header-/381676089124?hash=item58ddaaef24:g:-ecAAOSwzJ5XZm5E
- BME280 (Temperature, Pressure and Humdity Measurment) At the moment there are some known problem using this. https://www.adafruit.com/product/2652 https://www.amazon.com/Diymall-Pressure-Temperature-Sensor-Arduino/dp/B0118XCKTG
- MPU9250 (Acceleration, Gyroscope and Magnetometer) http://www.watterott.com/de/9-DOF-IMU-Module-With-MPU-9250
- Si1143 (Proximity up to 50cm) https://moderndevice.com/product/si1143-proximity-sensors/
- uBlox M8Q (GPS Position) http://www.dx.com/de/p/gygpsv3-m8n-u-blox-neo-m8n-001-flight-controller-gps-module-blue-394557#.V4lFW-uLRhE
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
app/TaskTemperature.h@10:4051c38bf73f, 2018-11-02 (annotated)
- Committer:
- mitea1
- Date:
- Fri Nov 02 17:01:02 2018 +0000
- Revision:
- 10:4051c38bf73f
- Parent:
- 6:90655031d4f7
wtf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mitea1 | 0:f2815503561f | 1 | /** |
mitea1 | 0:f2815503561f | 2 | * @file TaskTemperature.h |
mitea1 | 0:f2815503561f | 3 | * |
mitea1 | 0:f2815503561f | 4 | * @author Adrian |
mitea1 | 0:f2815503561f | 5 | * @date 30.05.2016 |
mitea1 | 0:f2815503561f | 6 | * |
mitea1 | 0:f2815503561f | 7 | */ |
mitea1 | 0:f2815503561f | 8 | |
mitea1 | 0:f2815503561f | 9 | #include "BME280.h" |
mitea1 | 0:f2815503561f | 10 | #include "BME280TemperatureMessage.h" |
mitea1 | 0:f2815503561f | 11 | #include "main.h" |
mitea1 | 6:90655031d4f7 | 12 | #include "Task.h" |
mitea1 | 0:f2815503561f | 13 | |
mitea1 | 0:f2815503561f | 14 | #ifndef TASKTEMPERATURE_H_ |
mitea1 | 0:f2815503561f | 15 | #define TASKTEMPERATURE_H_ |
mitea1 | 0:f2815503561f | 16 | |
mitea1 | 0:f2815503561f | 17 | /** |
mitea1 | 0:f2815503561f | 18 | * @class TaskTemperature |
mitea1 | 0:f2815503561f | 19 | * @brief This TaskTemperature Class handles the temperature measurement using the BME280. |
mitea1 | 0:f2815503561f | 20 | * Starting the task using the start() starts the measurement of all axis. |
mitea1 | 0:f2815503561f | 21 | * It can be used alongside with other measurement Tasks inside the mbed::rtos |
mitea1 | 0:f2815503561f | 22 | * environment. The Task Class basically wraps mbeds Thread functionality. |
mitea1 | 0:f2815503561f | 23 | */ |
mitea1 | 6:90655031d4f7 | 24 | class TaskTemperature : public Task { |
mitea1 | 0:f2815503561f | 25 | public: |
mitea1 | 0:f2815503561f | 26 | TaskTemperature(BME280*,Mutex*, Queue<BME280TemperatureMessage,TEMPERATURE_QUEUE_LENGHT>*); |
mitea1 | 0:f2815503561f | 27 | TaskTemperature(BME280*,Mutex*,Queue<BME280TemperatureMessage,TEMPERATURE_QUEUE_LENGHT>*, |
mitea1 | 0:f2815503561f | 28 | osPriority, uint32_t, unsigned char*); |
mitea1 | 0:f2815503561f | 29 | virtual ~TaskTemperature(); |
mitea1 | 0:f2815503561f | 30 | |
mitea1 | 0:f2815503561f | 31 | private: |
mitea1 | 0:f2815503561f | 32 | rtos::Queue<BME280TemperatureMessage,TEMPERATURE_QUEUE_LENGHT>* queue; |
mitea1 | 0:f2815503561f | 33 | |
mitea1 | 0:f2815503561f | 34 | BME280* bme280; |
mitea1 | 0:f2815503561f | 35 | |
mitea1 | 4:2674bd4168f8 | 36 | /** |
mitea1 | 0:f2815503561f | 37 | * @brief A thread safe method that measures the temperature. After measuring |
mitea1 | 0:f2815503561f | 38 | * the temperature it stores the data inside a BME280TemperatureMessage |
mitea1 | 0:f2815503561f | 39 | */ |
mitea1 | 6:90655031d4f7 | 40 | void measure(); |
mitea1 | 0:f2815503561f | 41 | |
mitea1 | 0:f2815503561f | 42 | /** |
mitea1 | 0:f2815503561f | 43 | * @brief Sets the message Queue of the Task where the measured values will be stored |
mitea1 | 0:f2815503561f | 44 | * after the measurement |
mitea1 | 0:f2815503561f | 45 | * @param queueGyro the queue where the MPU9250GyroscopeMessage will be stored |
mitea1 | 0:f2815503561f | 46 | */ |
mitea1 | 0:f2815503561f | 47 | void setQueue(Queue<BME280TemperatureMessage,TEMPERATURE_QUEUE_LENGHT>* queueTemperature); |
mitea1 | 0:f2815503561f | 48 | |
mitea1 | 0:f2815503561f | 49 | }; |
mitea1 | 0:f2815503561f | 50 | |
mitea1 | 0:f2815503561f | 51 | #endif /* TASKTEMPERATURE_H_ */ |