thingsboard / thingsboard-edge

Apache License 2.0
98 stars 74 forks source link

Device Profile "Assigned Firmware" not synced from CE Docker 3.4 #18

Closed joinke closed 2 years ago

joinke commented 2 years ago

I'm trying to perform OTA update from a Device connected to Edge. The OTA firmware is visible in Edge and can be downloaded from the Edge UI.

However :

Am I missing something obvious here ?

Edge

image

CE

image

Edge Log when modifying the Assigned firmware of device profile on the CE

2022-08-04 20:44:49,479 [TB-Scheduling-1] INFO o.t.s.c.t.s.DefaultTransportService - Transport Stats: openConnections [0] 2022-08-04 20:45:26,024 [grpc-default-executor-67] INFO o.t.s.s.c.r.p.BaseCloudProcessor - Adding ATTRIBUTES_REQUEST/RELATION_REQUEST fd1ecb60-133d-11ed-908a-d922e38596b1 DEVICE 2022-08-04 20:45:28,129 [sql-log-1-thread-1] INFO o.t.s.dao.sql.TbSqlBlockingQueue - Queue-0 [TS] queueSize [0] totalAdded [2] totalSaved [2] totalFailed [0] 202

CE log when modifying assigned firmware of device profile on CE

2022-08-04 10:45:23,917 [rule-dispatcher-3-3] INFO o.t.rule.engine.action.TbLogNode - Incoming message: {"id":{"entityType":"DEVICE_PROFILE","id":"7dafec70-0ca2-11ed-b7a7-5d88a11bd8fd"},"createdTime":1658812755127,"tenantId":{"entityType":"TENANT","id":"6d046130-f474-11ec-b746-1bfa669193d7"},"name":"Water Level","description":"","image":null,"type":"DEFAULT","transportType":"DEFAULT","provisionType":"CHECK_PRE_PROVISIONED_DEVICES","defaultRuleChainId":null,"defaultDashboardId":null,"defaultQueueName":null,"profileData":{"configuration":{"type":"DEFAULT"},"transportConfiguration":{"type":"DEFAULT"},"provisionConfiguration":{"type":"CHECK_PRE_PROVISIONED_DEVICES","provisionDeviceSecret":"ayrubtxsal0l09mg9jra"},"alarms":null},"provisionDeviceKey":"s6ymhzoxhan5l7k9kwwq","firmwareId":{"entityType":"OTA_PACKAGE","id":"70f1fb40-13d2-11ed-ad99-cdc5dc232715"},"softwareId":null,"externalId":null,"default":false} Incoming metadata: {"user

volodymyr-babak commented 2 years ago

@joinke thanks for creating this ticket.

This is a bug in the 3.4 release. The fix for this is going to be in the 3.4.1 release.

Please use a workaround at the moment and assign firmware to the device using Edge UI. Sorry for any inconviences.

Pull request to this issue is going to be created today/tomorrow.

joinke commented 2 years ago

Many thanks for replying superfast and for proposing alternative/fix !

volodymyr-babak commented 2 years ago

Fixed in the 3.4.1 release https://thingsboard.io/docs/edge/releases/#v341-august-19-2022

joinke commented 2 years ago

Hello @volodymyr-babak ,

I've tested this fix . The device firmware on the TB edge is now updated when I update the device profile in the TBCE. I can see that in the fw_tag, fw_version .. attributes. So, that solves the problem. One observation though , on the TB edge , in the device profile details , I still can't see the Firmware details :

I can see a message from Cloud => Edge indicating the device has been updated with relevant attributes. Thats perfect. But no update on the deviceprofile itself . Note if I change the description field in the device profile on the TB CE, that is reflected/sync'ed to the edge immediately.

incoming message: {"attributes":{"mac_address":"24:0A:C4:xx:yy:zz","fw_title":"Tank_Level","fw_cycle":4,"deepsleep":82,"fw_version":"1.0.30","fw_tag":"Tank_Level 1.0.30","fw_size":969968,"fw_checksum_algorithm":"SHA256","fw_checksum":"d20ed30fb003d0f58bed0bce998066d416fc4badb1665fac90a05e459c72beed"},"metadata":{"scope":"SHARED_SCOPE","source":"cloud","type1":"Water Level","name1":"ESP32-N1"},"msgType":"ATTRIBUTES_UPDATED"} Incoming metadata: {"scope":"SHARED_SCOPE","source":"cloud","type1":"Water Level","name1":"ESP32-N1"}

(both TB and TB edge are 3.4.1) (TB CE docker and TBEdge Ubuntu) CE: image

Edge : image