I have an Arduino Uno connected via usb to my oPi One running Node-Red 1.2.6. The Arduino runs a modified Firmata example sketch and I use node-red-node-arduino to send/receive data to/from the Arduino etc. Is it difficult to use Node-Red to upload a new sketch binary instead of having to plug the Arduino into my desktop each time?
I'm thinking there's two components to solve here:
1st: How to get the binary onto my oPi or how to retrieve it.
2nd: How to do the actual upload. If there's no existing, convenient node for that then I think I'll just keep doing what I'm doing.
On further consideration, it would probably be worth the effort to figure it out. I'm using an oPi One running armbian. I don't want to compile, just upload.
I use mqtt to upload new firmware to esp devices, using just 4 nodes. The new firmware sits on my web server, and gets uploaded via ssh from VS Code. The whole process is quite simple.
I would imagine the whole process would be the same using an arduino. Hope this gives you some ideas from where to start.
Addendum: Sorry, just noticed your requirement for usb delivery, so the above won't be of much help.
Yeah. Looks like I'll have to take a look at the sketch upload output from the ide on my windows machine for clues as to how to configure avrdude on my oPi.
Any suggestions on getting the compiled file from Windows to the oPi? Network share? I could copy the file to my local web server...
Do note that the serial port can't be shared - so if your flow is running (ie Node-RED is stared and connected to the arduino) then you can't also grab it for upload use, as the arduino node has held it already. So you would need to stop Node-RED - then upload - then restart Node-RED, which obviously means it can't be done by Node-RED itself...