Does node-red supports over the air (OTA) update?


#1

I have to upgrade my Sonoff Tasmoda firmware through OTA using node-red platform. Please help me to achieve this. It would be highly appreciated.

Best Regards:
Ahmad


#2

Iā€™m struggling to understand why you have to use Node-RED to do this. There are step by step tutorials to do this online using software someone else has developed (sonOTA), you could in theory rewrite this in Node-RED but why would you want to?


#3

Have a look at this: https://flows.nodered.org/flow/888b4cd95250197eb429b2f40d188185 maybe you can use it or parts from it.


#4

@ukmoose Sir let me clear my problem.. I have different sonoffs deployed in different cities having dymamic ips addresses (not static ips). And I have to update their firmware from my current location. I think you got it.
Plz help me to do this


#5

this is not cleared what should i do in node red or what node i hv to drag and drop and where i shoud copy this json code?


#6

So...

  • you don't know the IP of the SonOff's
  • they are NOT on your local network - they are remote devices
  • you don't know how to import a flow to your pi
  • and your knowledge of NR seems to be very basic
    So did I summerize that correctly?

Are you the owner of the remote networks where the sonoff's are installed?

First off, OTA doesn't mean you send a signal over the air to the sonoff to do the upgrade, it means the sonoff will do the update wirelessly. You still have to connect to the device to send it a command to do this. This means you need to be on the same network as the sonoff is.

Now you could install a pi on each network that a device is on and have it send the command to the sonoff, but you would still need a way to tell the remote pi to do it.

Even that is not insurmountable, there are different ways you could communicate - a remote MQTT broker, telegraph are two ways. If you search the forums you will find other ways that you could communicate from one Pi to another on different networks, BUT you must do it securely otherwise you could open each network to hacking.

I would break your issue into different parts

  1. on your local network, figure out how to have NR send a command to a sonoff (on the same network) that would start the OTA update.
  2. figure out how to have two pi's running NR to talk together (get it running on your local network, then get a extra router and plug one pi into it (eithor wirelessly or with a network cable) and get the cross communication working.
  3. test the security
  4. test the security again.

Only then should you try getting this to work on the remote networks.

You have your work cut out for you and probably a lot of learning to do. Good luck and keep us informed of your progress.

One other question: Why? If the sonoff device is working, why do you need to update it?


#7

Thanks alot for such an elaborated response.

In our reality we are providing devices to the client situated at different areas spread out at different geo locations.

Since we are constantly developing the solution. we want the changes to be pushed to all the devices we have installed at the clients premises. Just like EWelink does in case of sonoff basic firmware.

Is it possible that we provide link to the server at the time of flashing the sonoff? on device boot-up it would check at the provided link for any update and install it automatically ?

Thanks in advance
Regards


#8

So you want the sonoff device, when it is booted/plugged in, to go out and grab an update. Seems to me you would have to alter your code on the sonoff to check for and do the OTA somehow. But that's not a question for this forum.


#9

Thanks :slight_smile:


#10

You have already been given ideas on how to do this on the Sonoff list. There is no need to get node red involved. The devices need to watch for a new version available on your server and update themselves when it appears.


#11

Thanx for the replay @Colin.