thingsboard-gateway icon indicating copy to clipboard operation
thingsboard-gateway copied to clipboard

[HELP] How to implement ota on tb-gateway?

Open lincoln310 opened this issue 2 years ago • 12 comments

Describe the issue How to implement ota on tb-gateway? Do you have this play? What should i do if i want to add it?

Versions (please complete the following information):

  • OS: [e.g. Ubuntu 20.04]
  • Thingsboard IoT Gateway version [e.g. 3.4.2]
  • Python version[e.g. 3.9]

lincoln310 avatar Oct 17 '22 02:10 lincoln310

Hi @lincoln310, for OTA API you can use our Python SDK.

samson0v avatar Oct 17 '22 07:10 samson0v

@samson0v Thanks! But what i want is : my device connect to tb-gateway, and get firmware from it. So the tb-gateway should work with ota message as other attribute message. Like a bridge.

lincoln310 avatar Oct 18 '22 05:10 lincoln310

@lincoln310, Gateway doesn't support OTA API for now.

samson0v avatar Oct 18 '22 08:10 samson0v

@lincoln310, Gateway doesn't support OTA API for now.

Indeed, so what should i do to add it? Any suggestion? I can send a pull request when i finish.

lincoln310 avatar Oct 18 '22 09:10 lincoln310

Hi @lincoln310,

Unforunately at the moment ThingsBoard doesn't have API to get firmware for devices through the gateway, we will discuss this point with team and let you know about the results.

imbeacon avatar Oct 18 '22 09:10 imbeacon

@imbeacon I need 2 function: 1 ota for my device. This should connect to tb or tb-edge 2 custom binary data process on custom topic from device. This should use tb-Gateway

Any suggestion?

lincoln310 avatar Oct 19 '22 01:10 lincoln310

@imbeacon Can you give me some suggestion if i want to add it by myself? Maybe i should look into attribute as reference?

lincoln310 avatar Oct 19 '22 01:10 lincoln310

@lincoln310 ,

  1. There is no API on ThenigsBoard for the gateway to get firmware for devices connected through it, so there is no way at the moment to implement this on the gateway by now, unfortunatly.
  2. We are going to add different types for default mqtt converter like string, bytes in the nearest future, we will write here when add them.

imbeacon avatar Oct 19 '22 07:10 imbeacon

@lincoln310 ,

  1. There is no API on ThenigsBoard for the gateway to get firmware for devices connected through it, so there is no way at the moment to implement this on the gateway by now, unfortunatly.
  2. We are going to add different types for default mqtt converter like string, bytes in the nearest future, we will write here when add them.

...ok, when would it be implemented?

lincoln310 avatar Oct 20 '22 01:10 lincoln310

I can get latest attribute about firmware on device that connected to gw, when update firmware on web. So maybe i can just impletment in tb-gateway like this: subscribe topic v2/fw/request/${deviceName}/chunk/${chunkIdx} and send http request to tb to get the response, and then send as mqtt msg to v2/fw/response/${deviceName}/chunk/${chunkIdx} and then combind the chunk data.

How about it?

lincoln310 avatar Oct 21 '22 02:10 lincoln310

Any news on this topic ? I try to implement OTA with the gateway too

arthurgustin avatar Mar 07 '24 16:03 arthurgustin

Any news on this topic ? I try to implement OTA with the gateway too

Sorry, i give it up.

lincoln310 avatar Mar 14 '24 08:03 lincoln310