Used MQTT a lot a decade ago. Its big limitation is that is has no authentication nor encryption (regardless of the hardware and energy requirements, it could have been built as an optional feature just like what HTTPS is to standalone HTTP). MQTT was originally created to monitor gas and petrol pipeline sensors, so its deployment and application environment was always inside a closed intranet or some kind of network back then. Anyways awesome video as it shows the vast application capabilities of the Pi Pico W. Such an awesome device!
Hi nice video! Would also love to see LTE communication with raspberry pi zero 2 w. Also long term study would be interesting. How much data you transmit and how much power it consumes…
6:25 If we think of the dashboard as part display, part control panel, we might prefer it if at power-on the device state changed to match the state of the toggle (rather than switching the toggle off). Is that possible - can a subscriber get the *current* state, rather than having to wait for a state change?
I added the umqtt folder with the simple.py into my project in vscode. But I get a lot of errors. Does anyone know why? Do I have to install anything else?
A slightly advanced question - I've an application on the pico w that is publishing data at 50HZ. Now when I try the same thing with a regular python script on an actual RPi 3B, it works splendidly, but when I try running the same script on the pico, I have some lost packets. I was wondering if the issue was because of the way the umqtt works, or if it was an issue with how the clock is configured. I did not touch the clk, so I did not mess that up afaik. Does anyone know what could be happening? Can the pico with its default clk config publish at 50 Hz? (once every 20ms)
Nice video, it's not clear however how the switch on the adafruit dashboard can communicate from the web back into an internal network. I assume the mqtt publisher on the LAN keeps a NAT session open for incoming traffic.
Does this need updating? I got an error install umqtt simple:- '--upgrade-strategy', 'only-if-needed', 'micropython-umqtt.simple', '--index-url', '127.0.0.1:36628']' returned non-zero exit status 1.
Great Video, but I want to monitor my Garage Door Status while away from home, so I need to SUBSCRIBE through an iPhone. I got you code to work, then replaced the slide button with a MOMENTARY one, and put in a 1.5 second to allow a relay to function (to close door if open). Do you have knowledge of the MQTT Apps and what I have to do to get this to function on a phone? Apps are available, but don't have good explanations of connection to Adafruit's site. THanks
Also, the Pico is NOT doing an "infinite wait". If I don't change the state of the slide or button in a couple minutes, then the Pico does not get the message. I have to stop/run the program.
Just started with MQTT. I got your example working, but was surprised to see, that an IP address is not being set up after establishing the wifi connection. Why is that not needed?
When a device connects to a Wifi network and DHCP is enabled, it is assigned an IP address by the server. In this case there is an IP address but you don't see it because is not required to be known to connect to the MQTT broker
You can setup an MQTT broker running on your local network rather than on the cloud using something like Mosquitto. For direct communication between devices just use simple socket connections.