Replies: 7 comments 18 replies
-
This looks great
I haven't got any ESP32, but the price they are now there doesn't seem much point using esp8266 (though if one wanted to run off a battery perhaps the consumption is lower). I have ordered 6 off Wemos S2 Mini from Ali Express, total cost £14.08, which is ridiculous. I hope those are ok with node-red-mcu. |
Beta Was this translation helpful? Give feedback.
-
In the initial notes above, I forgot to mention the biggest design choice. As you see, the OTA feature is implemented by nodes in the flow. The alternative would be to make OTA updates a feature of the Node-RED MCU runtime host itself. That would not require adding any nodes to the flow to support OTA. But, it would need some way to be configured, triggered, etc. That might be less work to implement (for me!) but would offer less control for developers building flows. I think the approach of having an OTA Update node (with a supporting MCU Restart node) is the more powerful approach. For example, it makes it very straightforward to initiate an OTA Update by posting the firmware URL to an MQTT topic, which would allow for batch updates of devices. It does mean adding a couple nodes to a project that wants to use OTA, but that seems manageable. I'm curious to see how that plays out for people. |
Beta Was this translation helpful? Give feedback.
-
@phoddie, Some remarks from first quick look:
BTW I will be computerless this week, but I will try to follow this discussion and test it next weekend. So unfortunately I can't test it now... Bart |
Beta Was this translation helpful? Give feedback.
-
Thanks for the great work I have I can see from the error this is a path issue, but not sure how to fix it |
Beta Was this translation helpful? Give feedback.
-
Hi @phoddie,
Aaaah, I fell into this trap again. After years of doing Node-RED, my brain is so used that all nodes run on the NodeJs backend. So after I had a quick look at your push and pull flow, it made no sense to me at all. However when I look again (knowing that the Ota-Update node runs on the MCU), it indeed looks very logical ;-) Allthough it might look very obvious (from your point of view) that it runs on the MCU, it might perhaps be helpfull if you put in bold letters (at the start of the docs in the info panel) that it runs on the MCU...
I have the same error as @mtoko, although I think everything is up-to-date:
If you have any tips, please let us know! |
Beta Was this translation helpful? Give feedback.
-
BTW thanks for implementing some of my feedback!!! Some other remarks:
|
Beta Was this translation helpful? Give feedback.
-
My S2 Minis have arrived. What device should I specify for mcconfig? There doesn't seem to be an specific device type for it. |
Beta Was this translation helpful? Give feedback.
-
I've been working on an OTA Update node to allow firmware updates to be installed on remote devices.
The OTA Update Node sources are part of this repository at $NODEREDMCU/nodes/ota-update. It is available via npm as @moddable-node-red/ota-update.
The OTA Update node works in both push and pull modes. In pull mode, the firmware update is downloaded by the microcontroller and installed. The download is triggered by a message sent to the OTA Update with the URL of the firmware image to install. In push mode, the firmware image is uploaded to the microcontroller, for example using
curl
. Push mode is enabled by specifying the path of the http end-point to receive the firmware upload.When the firmware has been received, the OTA Update node sends a message. The message can be routed to the MCU Restart node to reboot the MCU to begin using the new firmware. The OTA Update does not automatically restart the microcontroller so that the flow controls the timing of the restart.
There are two example flows, one that demonstrates push / upload mode and the other pull / download.
The node's documentation includes important details, including where to locate the firmware image created by a build.
It could be interesting for the MCU Plugin to use push mode to directly deploy updates to remote devices. I'm not sure how that might fit, but if it could be done, it would simplify the process of managing the firmware on devices.
Important notes:
The ESP32 must have OTA partitions configured in the build (as required by the ESP-IDF). This is not normally the case with Moddable SDK builds. With an update to the Moddable SDK in the coming days, any firmware build that contains the OTA Update node will automatically have the required OTA partitions. I'll update this note when that's available.(The Moddable SDK support is live as of April 12, 2023)and the Moddable SDK updates are available, this node will added to the Node-RED Library so it can be installed and managed from the Node-RED Palette.Beta Was this translation helpful? Give feedback.
All reactions