This post is more of a changelog combined with an explanation of my thought process for the changes.
c50b112 - Use the
publish function only from
common instead of directly from
mqtt. Doing this removes the requirement from the client to verify if the
mqtt object has been initialized.
f576c69 - Require subscription topics to be provided as a list, this simplifies client setup. Move OTA logic out of mqtt client creation
$ tree firmware firmware/ ├── common.py ├── curtains │ ├── common.py -> ../common.py │ ├── HOSTNAME │ ├── main.py │ └── mqtt.py -> ../mqtt.py ├── mqtt.py └── rfsocket.py
With this setup, you can cd into a device's directory and run
mpfshell ttyUSB0 -c 'put common.py; put main.py; put mqtt.py; put HOSTNAME; repl'
to bootstrap a new device.
Subsequent updates can be done OTA.
fdf76d9 - Set hostname in AP config – this change makes it more clear which device is which on network inspection, there's no longer a list of ESP-8D... devices.