Hi.. I’m seeing so many ways to interconnect devices, and need an overview perspective. In a sense, everything is about controlling something (e.g. LEDs) or receiving data (e.g. temperature sensor data).
So, in the “Building WebServers” book, extensive use is made of asyncWebServer/socket (using the server.on(“/xxxx”…) code in the server to handle requests by the client). Then in the “Home Automation” book, extensive use is made of Mosquitto to connect server to client (using onMqttConnect, on MqttMessage, etc code in the server). Then in a tutorial for Raspberry Pi, you introduced Flask+Jinja to handle communications (using @app.route(“/xxxx”…) code in the server). Finally, recently, you published an article with micropython for the RPi Pico (using the more obvious socket.socket() in the server).
This is a daunting collection of ways to connect server and clients. I assume any of these can be used – why would I pick Flask, for example, over Mosquitto or sockets? (I have successfully gone through all the tutorials using ESP32s and Raspberry Pis, and especially use Flash in recent RPi designs, but now I’m scratching my head wondering if I’m using the “best” protocol). Can you comment on these various approaches?
Thanks for any illumination :–)
It depends on your preferences and your project requirements and the board you’re using and the libraries available for what you want to do.
There isn’t the “best” protocol, it will really depend on your project and the hardware you have available, and also the way you like to do things (if you’re more of a coding person, or if you like to use “already-made” dashboards.
I’m sorry if this is confusing, but this is my opinion about this subject,
Hi Sara, Thanks for your answer. You prompted me to again look at that terrific 600+ page book on Building Web Servers ! …Whew ! … a lot of content, but I’m better informed now with all the protocols in that book, so thanks for the motivation! I’m happy with using the AsyncWebServer for ESP32 applications, and Flask for Raspberry Pi applications (though I have to dig into Apache since Flask really doesn’t have a production server). This link (from William Lucid’s questions) helped a little in weighing Firebase, Moquitto and Node-Red.
Since this was a very broad question, and the answer is sort of “depends”, I’m good with closing this question out. – JoeM