|
|
|
|
|
by willemmerson
1275 days ago
|
|
It's not completely related but I've been thinking that having a router connected via wireguard might be a good way to do IoT deployments. Generally IoT devices make an outbound connection to a server and use MQTTS for bi-directional data flow, because of the difficulty of inbound connections due to firewalls, NAT etc. But this has some downsides in that you have to run an MQTT server, each device is doing it's own TLS (which uses a lot of ram and increases firmware size on an ESP32), and MQTT doesn't really have end-to-end message confirmation. It seems like a better way would be for each esp32 device to be in a wireshark network and to be running it's own HTTP webserver (which is easy to do with the SDK). Therefore any device can be sent a message from the server using a simple POST request to its ip address, and can send messages to the server using the servers HTTP api. It's much easier to test HTTP api's than mess about with MQTT, and individual devices don't need to do SSL because all data between the devices and server is encrypted by wireguard. I suspect there's something I've overlooked, I think addressing individual devices could be difficult if you only know their IP addresses. |
|
MQTT, aside from being pubsub, has more functionality that is especially useful in IoT though: robust sessions with LW&T to monitor onlineness, and retained topics to deliver messages as devices come online again