Open malyjak opened 1 year ago
I think that I missed adding CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
define during compilation, I will look into that
Any update? I can help with testing if needed.
Actually, it should work, because in every esp-matter example it's turned on. I started working on migrating new esp-matter version and will look at this once again.
Okay, so it turned out that not every esp-matter
example ships with OTA. I tried turning it ON it newest version of this lib (beta5
). However, I haven't tested it.
I'll test it tomorrow and give you feedback. Thanks!
Short story: It WORKS!
Long story:
ESP's requestor seemed to be working:
I (517134) chip[SWU]: OTA Requestor received AnnounceOTAProvider
D (517139) chip[SWU]: FabricIndex: 1
D (517143) chip[SWU]: ProviderNodeID: 0x0000000000003039
D (517148) chip[SWU]: VendorID: 0x0
D (517151) chip[SWU]: AnnouncementReason: 0
D (517155) chip[SWU]: Endpoint: 0
However, linux provider failed at this point:
[1684331556.146219][4117:4117] CHIP:DMG: InvokeRequestMessage =
[1684331556.146267][4117:4117] CHIP:DMG: {
[1684331556.146311][4117:4117] CHIP:DMG: suppressResponse = false,
[1684331556.146365][4117:4117] CHIP:DMG: timedRequest = false,
[1684331556.146416][4117:4117] CHIP:DMG: InvokeRequests =
[1684331556.146474][4117:4117] CHIP:DMG: [
[1684331556.146524][4117:4117] CHIP:DMG: CommandDataIB =
[1684331556.146578][4117:4117] CHIP:DMG: {
[1684331556.146632][4117:4117] CHIP:DMG: CommandPathIB =
[1684331556.146694][4117:4117] CHIP:DMG: {
[1684331556.146758][4117:4117] CHIP:DMG: EndpointId = 0x0,
[1684331556.146826][4117:4117] CHIP:DMG: ClusterId = 0x29,
[1684331556.146892][4117:4117] CHIP:DMG: CommandId = 0x0,
[1684331556.146956][4117:4117] CHIP:DMG: },
[1684331556.147018][4117:4117] CHIP:DMG:
[1684331556.147074][4117:4117] CHIP:DMG: CommandFields =
[1684331556.147135][4117:4117] CHIP:DMG: {
[1684331556.147200][4117:4117] CHIP:DMG: 0x0 = 65521,
[1684331556.147268][4117:4117] CHIP:DMG: 0x1 = 32768,
[1684331556.147335][4117:4117] CHIP:DMG: 0x2 = 1,
[1684331556.147402][4117:4117] CHIP:DMG: 0x3 = [
[1684331556.147470][4117:4117] CHIP:DMG: 0,
[1684331556.147544][4117:4117] CHIP:DMG: ],
[1684331556.147612][4117:4117] CHIP:DMG: 0x4 = 0,
[1684331556.147682][4117:4117] CHIP:DMG: 0x5 = "XX" (2 chars),
[1684331556.147751][4117:4117] CHIP:DMG: 0x6 = false,
[1684331556.147816][4117:4117] CHIP:DMG: },
[1684331556.147876][4117:4117] CHIP:DMG: },
[1684331556.147935][4117:4117] CHIP:DMG:
[1684331556.147984][4117:4117] CHIP:DMG: ],
[1684331556.148041][4117:4117] CHIP:DMG:
[1684331556.148088][4117:4117] CHIP:DMG: InteractionModelRevision = 1
[1684331556.148138][4117:4117] CHIP:DMG: },
[1684331556.148210][4117:4117] CHIP:DMG: AccessControl: checking f=1 a=c s=0x0000000000007283 t= c=0x0000_0029 e=0 p=o
[1684331556.148270][4117:4117] CHIP:DMG: AccessControl: allowed
[1684331556.148316][4117:4117] CHIP:DMG: Received command for Endpoint=0 Cluster=0x0000_0029 Command=0x0000_0000
[1684331556.148377][4117:4117] CHIP:ZCL: OTA Provider received QueryImage
[1684331556.148419][4117:4117] CHIP:ZCL: VendorID: 0xfff1
[1684331556.148458][4117:4117] CHIP:ZCL: ProductID: 32768
[1684331556.148498][4117:4117] CHIP:ZCL: SoftwareVersion: 1
[1684331556.148538][4117:4117] CHIP:ZCL: ProtocolsSupported: [
[1684331556.148629][4117:4117] CHIP:ZCL: 0
[1684331556.148673][4117:4117] CHIP:ZCL: ]
[1684331556.148712][4117:4117] CHIP:ZCL: HardwareVersion: 0
[1684331556.148752][4117:4117] CHIP:ZCL: Location: XX
[1684331556.148792][4117:4117] CHIP:ZCL: RequestorCanConsent: 0
[1684331556.152805][4117:4117] CHIP:SWU: Error parsing OTA image header: ../../third_party/connectedhomeip/src/lib/core/OTAImageHeader.cpp:112: CHIP Error 0x000000DA: The file identifier, encoded in the first few bytes of a processed file, has unexpected value
[1684331556.152908][4117:4117] CHIP:SPT: VerifyOrDie failure at ../../third_party/connectedhomeip/examples/ota-provider-app/ota-provider-common/OTAProviderExample.cpp:359: ParseOTAHeader(parser, mOTAFilePath, header) == true
This error was provided while using the firmware.bin
from .pio\build\esp32dev
as the new firmware directly.
After running it through the ota_image_tool.py
as described HERE and using it, the OTA udate was successful!
Question/request:
Do you think it'd be possible to generate one more binary, called for example firmware_ota.bin
in the post-compilation step via the ota_image_tool.py
automatically?
PS: It would be great to modify arguments like versionNumber
and versionString
for this script through platfromio.ini
because if it stays the same, matter requestor will ignore the update:
D (297196) chip[SWU]: Available update version 1 is <= current version 1, update ignored
Proposal: I can summarize my findings and help create a new doc for this project for using OTA if you want ;)
Any luck/progress on the OTA documentation? I would be more than happy to be a tester, proof reader, guinea pig, newbie sounding board, etc. if that will help.
Hi. I stopped working with matter and completely forgot about my promise here. Basically you need chip-tool running on the same network. I highly suggest to use Linux as standalone PC or virtual machine. Then you need to follow several steps that I attached at the end of the first post.
To summarize: 1) Do ble-wifi commisioning of your ESP device though the chip-tool 2) Try that LED on your device can be toggle via matter network (also through the chip-tool) 3) Start chip-ota-provider-app in a new terminal / as a background process 4) Set correct permissions for OTA provider 5) Observe your ESP device being updated
Note: You need to use ota_image_tool.py provided by matter to properly pack your .bin files for OTA update via matter network
As noted here the Espressif's Matter SDK supports ota requestor out of the box. However, after announcing the provider via chip tool to the ESP32 running the light app code based on this library, an unsupported cluster error emerges:
My partitions.csv:
Commands prior to the announcement: