gmag11/EnigmaIOT

Support for BMP280 sensor

ator1811 opened this issue · 3 comments

Hi, impressive work you have done. I try to understand how to make a sensornode with a BMP280 pressure/temperature sensor, but I get lost in the number of examples. So if you can help me a little...?

What example node should I use as a starting point? And where do I put library, setup and loop functions for this sensor? I like to use the EnigmaIOT MsgPack example because I have no experience with Cayenne.

Thx in advance.
Aernout

Thank you @ator1811. I've documented about the internals but basic starting point lacks some words :)

Right now I'm preparing a how-to-start guide to help others to begin programming their own nodes. It will take a while though. I hope less than one month.

Anyway I will leave some guidelines here. Let me know if it is useful and what challenges you find. It will be useful for my guide.

You can start with a regular Arduino Sketch where you design what you want your node does. A simple setup() and loop() is enough. You can use Serial.printf() where you will finally place message sending.

Point of start is EnigmaIOT JSON Controller Template. It is an empty but already configured template where you can add your code.

Inside BasicController.cpp there are a setup () and loop ()methods where you can insert your code. You can rename CONTROLLER_CLASS_NAME if you like, but it is not mandatory.

You can look at EnigmaIOT-Sensor-Controller example. It is very close what you need but using DS18B20 instead of BMP280.

If you want to make your board go to deep sleep mode after sending data you need to add #define SLEEPY 1 to BasicController.h, then all your code will be contained on setup() method.

If SLEEPY is not defined or it is not 1, then you need to do your periodic stuff inside loop ()

@ator1811 First version of how to guide is finished in dev branch. Check it there. I will be releasing last version before 1.0 in a few days anyway.

How to guide is released in main branch: https://github.com/gmag11/EnigmaIOT/blob/master/docs/howto.md