IoT Hardware - Page 1
Forum section: electronics / beginners

author: csheldon
author_rank: Contributor
timestamp: September 18, 2018, 06:32:45 pm
content: Dear all,I am starting to explore some IoT concepts and architectures both regarding SW and HW. Since I am beginning with all of this, there is really large amount of informationthat I would really like to put to its place. I would appreciate if someone with knowledge and experience can answer a couple of (maybe stupid) begginner questions.First let's begin with HW:I've noticed good ammount of RFM69 RF-to-mqtt gateways.1) Can somebody please explain how these work and what is the purpose of having RF-to-MQTT gateway?2) How does the ESP8266 fit into all of this? (for example there are ESP32's and ESP8266's packed with RFM69 on same board)3) What is the purpose of ESP8266 in such gateway (transciever)There are also some RFM2PI boards with rfm69 and atmega chips that attach to RaspberryPi, so:1) What is the idea behind this?2) What job RPi does in such cases? What is it used for?3) Can it replace the above ESP8266 + RFM69C concept or both concepts have their own purpose?Regarding the IoT SW arhitecture:1) Can somebody please explain the idea behind MQTT, Node-Red and how all this SW arhitecture fits in to two of the above mentioned concepts.2) What OS does Rpi need to have in order to be deployed as MQTT broker?

author: Naguissa
author_rank: Regular Contributor
timestamp: September 19, 2018, 11:01:23 am
content: Quote from: csheldon on September 18, 2018, 06:32:45 pmMQTT: A simple message protocol. Using a server you can connect several clients and all are connected.Node-Red: Tool that produces JavaScript code able to run using Node.jsSW: In the end, you can use watever you want. For experimenting, I've used PHP + MongoDB + MQTT (only for user identification on MQTT, using same users as PHP page) here:https://www.foroelectro.net/arduino/en/mqtt-doc(sorry, I just noted that english translation is not done)Quote from: csheldon on September 18, 2018, 06:32:45 pmThe Linux flavor you are best comfortable with....

author: rjp
author_rank: Regular Contributor
timestamp: September 19, 2018, 11:11:18 am
content: Quote from: csheldon on September 18, 2018, 06:32:45 pm1.1) ultra low power LoRa radios need to get their data onto the network, the gateway does this1.2/3) the esp8266 handles the mqtt over wifi bit and can communicate with sensors or LoRa radios via its GPIO's2) same stuff but having an rpi with LoRa radio doing the gateway work instead of the ESP module3) MQTT is a way of seperating producers from consumers - you have devices and sensors providing new data events on the network and then you can have multiple listeners recording/reacting to those events.many will argue you can use http rpc or custom udp servers instead of MQTT but you then need to replicate the multiple listener feature and thats not as simple as it seems.multiple listeners means you can have one stable daemon recording the data that never gets touched.then you have other listeners doing screen displays or alarm events, all seperate to each other without over loading the one program with too many features that make it slow or unstable.it allows you to isolate all the features of your IOT app from each other and things that are stable can stay stable.you can also then have the MQTT brokers push events out across different networks (bridging) and build complicated public/private scenarios.

author: iainwhite
author_rank: Unknown
timestamp: September 19, 2018, 03:31:42 pm
content: Adafruit has a basic tutorialhere.

author: csheldon
author_rank: Contributor
timestamp: September 20, 2018, 07:02:58 pm
content: Quote from: iainwhite on September 19, 2018, 03:31:42 pmThanks everyone for all your answers, Let+s clarify them a bit more please..Still haven't undestood whats the idea of RFM69 RF to MQTT gateway...Let's put things this way:In no specific order, I have a:1) small sensor node with 8-bit atmel and RFM69 on board (for RF to MQTT function), lets say it's measuring temperature (https://harizanov.com/wiki/wiki-home/funky/)2) RF69CW receiver board, something like RFM2PI? (https://wiki.openenergymonitor.org/index.php/RFM12Pi_V2)3) Raspberry Pi4) ESP32/ESP8266 with onboard RFM69 (https://harizanov.com/2015/11/rfm69-to-mqtt-gateway-using-esp8266/)Can somebody describe the example use-case of all of these devices and what is their purpose in that particular hypotethical example.Also questions:1) Can ESP32/ESP8266 replace RPi+RFM2Pi , if not, can you please describe what are their respective functions2) In a case where we have multiple small sensor nodes with RFM69. How can multiple RFM nodes communicate to single reciever? Do they use time division multiplex or some kind of an CSMA/CA..

author: rjp
author_rank: Regular Contributor
timestamp: September 21, 2018, 05:08:21 am
content: The RFM69 gear is much lower power than the esp wifi and with the right antennas can transmit large distances - the downside is the messages must be small, typically 50 bytes or less.The reason you would choose it is if it needs to run on a battery or small solar panel for a long time in places without access to wired power.An RPI gateway will have more features than an esp8266 gateway and can run the MQTT daemon (mosquitto) locally and run databases locally - so on small setups it can be the gateway and the server - the ESP gateway will still need a mosquitto server and database to send to.As i recall the RFM69 stuff doesnt handle multiplexing, you need to build that logic into your system yourself - simple time allocations or error retries with random pauses are common solutions.

author: csheldon
author_rank: Contributor
timestamp: September 21, 2018, 06:56:06 pm
content: Ok, so in what situations would you choose Rpi for MQTT broker, and in what situations would you choose ESP? Is there any downside of ESPBroker having to send data to server in order to perform MQTT functionality in comparison with RPi?

author: rjp
author_rank: Regular Contributor
timestamp: September 22, 2018, 01:39:50 am
content: Id never use an rpi for an installation that was serious - Id only use it for hacks and around the house, i may change that opinion with the new rpi3 network boot but the SD card thing turns them into toys, not reliable machines.ESP cant do mqtt broking, it can only do gateway - it will listen on the RFM69 network for new data and then forward it to another machine as an MQTT client, not server.if you want a stable long lasting setup then you would use a server (ARM or x86) with hard drives or emmc instead of an SD card and then use gateway devices like the ESP to forward the data.most of the ESP stuff is very cheap on fragile breakouts, id probably not use that in a serious application either.

author: csheldon
author_rank: Contributor
timestamp: September 22, 2018, 12:19:17 pm
content: Ok, let's see if I got things right:1) RF to MQTT gateway (e.g. atmel + rfm69) is used if there is a need for low power nodes which can run on small batteries and consume small ammounts of energy.2) Raspberry Pi is used as a MQTT device which can both run it locally (as a server) or be used as a gateway? It is not recommended though to use RPi in serious applciation, rather the best solution is to design embedded system with emmc onboard-2 Questions here...If above is true..why do we then need boards like RFM2Pi which connect to RPi?, Also Why do we even need additional embedded system to run MQTT server locally if it can be set up on a remote server?3) ESP onboard with RFM69 is used to gather data from RF to MQTT gateways (small sensors nodes, see 1. bullet) and then to publish that data to Raspberry Pi with onboard RFM2Pi, using the sam RFM69 on it's own board?

author: rjp
author_rank: Regular Contributor
timestamp: September 22, 2018, 01:14:03 pm
content: Quote from: csheldon on September 22, 2018, 12:19:17 pmyou dont *need* an rpi or an embedded at all.rpi is just a linux server, it could be a huge x86 machine, it could be another type of embedded board, it doesnt matter.rpi is trendy and well supported, so one of the feature it has is pluggable hats that do things like provide LoRa gateways - you can also buy those as standalone boxes that work with regular machines.Quote from: csheldon on September 22, 2018, 12:19:17 pmyou would not need both the esp and the rpi RF gateway - you only need one of them, the gateway just joins the RF network and the WIFI networki would not bother with the esp gateway if i was running the rpi one.i would not bother setting up the rpi gateway if i already had a server on my wifi network and i used the esp to gateway the RF packets to it.both the esp and the rpi do WIFI/TCP so only one of them needs to also do RFM69.