cc2652-stick icon indicating copy to clipboard operation
cc2652-stick copied to clipboard

[REQUEST] OpenThread Border Router (OTBR) RCP and NCP firmware images for slaesh CC2652-stick adapter?

Open Hedda opened this issue 2 years ago • 44 comments

@slaesh Can you please consider providing new OpenThread Border Router (OTBR) "RCP mode" firmware images as well as "NCP mode" firmware images (with support for the OpenThread spinel+hdlc+uart protocol) and preferably using the latest SDK for your Texas Instruments CC2652 based radio adapter dongle?

https://slae.sh/projects/cc2652/#openthread-border-router

UPDATE: There is at least an official OpenThread project from Texas Instruments here:

https://github.com/TexasInstruments/ot-ti

The reason for wanting such OpenThread RCP and NCP firmware image builds are mainly to get compatibility with the Thread and OTBR (OpenThread Border Router) integrations + matchinng OpenThread Border Router add-on for Home Assistant that enable using Thread-based Matter standard devices and HomeKit devices, see:

https://www.home-assistant.io/integrations/thread

https://www.home-assistant.io/integrations/otbr/

https://github.com/home-assistant/addons/tree/master/openthread_border_router

https://www.home-assistant.io/integrations/matter

https://www.home-assistant.io/integrations/homekit

Please see related feature request discussion in Home Assistant’s community forum:

https://community.home-assistant.io/t/thread-rpc-firmware-with-spinel-interface-for-texas-instruments-cc2652-cc1352-to-use-openthread-border-router-otbr-add-on-for-use-with-thread-based-devices-like-some-matter-and-homekit-products/433278/

Also check out the discussion about compatibility with the "OpenThread Border Router Add-on" that Home Assistant developer agners (Nabu Casa employee Stefan Agner) is currently developing?

https://github.com/home-assistant/addons-development/issues/38

https://github.com/home-assistant/addons-development/tree/master/openthread_border_router

https://github.com/openthread/ot-br-posix/

https://github.com/agners

https://community.home-assistant.io/u/agners/summary

Thread Spinal RCP mode vs Thread Spinal NCP mode is summarized here:

https://openthread.io/platforms/co-processor

https://groups.google.com/g/openthread-users/

OTBR should be a "Thread Certified Component" Texas Instruments CC2652 based chips:

https://github.com/openthread/ot-cc13x2-cc26x2/blob/main/src/cc2652/README.md

https://github.com/openthread/ot-cc13x2-cc26x2

https://github.com/openthread/openthread/tree/main/examples/platforms

https://dev.ti.com/tirex/explore/node?node=APzU0zOtgnQIe0sFnHCfxg__BSEc4rl__LATEST

https://openthread.io/vendors/texas-instruments

https://www.threadgroup.org/What-is-Thread/Thread-Benefits#certifiedproducts

https://training.ti.com/thread-cc2652-cc1352

The main reason for this request is that an "RPC" firmware with OTBR (OpenThread Border Router) support will make your adapter will be compatible with upcoming Thread based "Matter" (Project CHIP / Connected Home over IP) devices if used in Home Assistant with their other add-ons for the that is also in development. This addon by agners require that the radio hard a firmware in "RPC" mode instead of the no traditional "NCP" mode:

https://github.com/home-assistant/addons-development/tree/master/chip_controller_repl

https://github.com/home-assistant/addons-development/tree/master/chip_tool

https://github.com/project-chip/connectedhomeip

https://buildwithmatter.com

https://csa-iot.org/all-solutions/matter/

Also having optional OpenThread "NCP" border router firmware would allow users to alternatively use other existing OpenThread applications that use "NCP" mode instead of the newer "RPC" mode which require additional component running on the host. Ex:

https://github.com/openthread/wpantund

Note that so far agners has only worked with Silicon Labs based adapter with OpenThread "RPC" firmware for Thread based Matter (as well as ESP32-C3 based devkit for Matter over WiFi) and that is only because it is a Silabs EFR32MG21 chip based adapter that will ship inside the official Home Assistant Yellow (formerly Home Assistant Amber) hardware:

https://github.com/zigpy/zigpy/discussions/894

https://github.com/home-assistant/addons-development/tree/master/silabs-multiprotocol

https://www.home-assistant.io/blog/2021/09/13/home-assistant-yellow/

https://www.crowdsupply.com/nabu-casa/home-assistant-yellow

PS: By the way, you might be interested in the the "Matter" workshop that Home Assistant is holding on the 15th of June even if they are in that specific workshop will not use a Thread based controller or devices and instead use a WiFi (+ Bluetooth) based "Matter" devices:

https://www.home-assistant.io/blog/2022/05/29/matter-in-home-assistant-workshop-announcement/

https://www.youtube.com/watch?v=9fOHBl5w0_k

https://community.home-assistant.io/t/matter-in-home-assistant-workshop-announcement/426129/

Hedda avatar Jun 10 '22 10:06 Hedda

@slaesh Again please also see this and if possible contribute to that discussion too -> https://github.com/home-assistant/addons-development/issues/38

Hedda avatar Jun 22 '22 06:06 Hedda

Thanks Hedda. We are currently testing the RCP firmware. NCP is already available to download from the beginning on :) We are out of the office, but will keep on this topic soon =)

Hedda @.***> schrieb am Mi., 22. Juni 2022, 09:44:

@slaesh https://github.com/slaesh Again please see this and if possible also contribute to that discussion -> home-assistant/addons-development#38 https://github.com/home-assistant/addons-development/issues/38

— Reply to this email directly, view it on GitHub https://github.com/slaesh/cc2652-stick/issues/23#issuecomment-1162710311, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANHZHR6GFXRXEJQQ2NXALQ3VQKY4TANCNFSM5YNHABFQ . You are receiving this because you were mentioned.Message ID: @.***>

slaesh avatar Jun 22 '22 07:06 slaesh

Now Matter 1.0 is released is there any news?

Cadsters avatar Oct 06 '22 11:10 Cadsters

FYI, while those builds will not work on Slaesh CC2652 stick but for referencce know that that tube0013 posted on Twitter that be uploaded OpenThread RCP firmware images for the CC2652P (TubesZB devices) and CC2652R (zzh!) that could be used for development and testing as he confirmed those working with agners OTBR addon from addons-development so that could be of interest for those interestrd in being beta testers and early adopters of Thread (and Matter over Thread) support inside Home Assistant:

https://twitter.com/TubesZb/status/1552823766136373251

https://github.com/tube0013/tube_gateways/tree/main/openthread_boarder_router_fw

Hedda avatar Oct 07 '22 05:10 Hedda

I've been trying with the NCP firmware and wpantund, but I've been seeing this for the last few hours now. I've even tried compiling ot-ncp-ftd from source, that firmware doesn't work either. The above ncp 115200 firmware has the orange LED flashing slowly, while the ot-ncp-ftd I compiled has no visual feedback. ot-cli-ftd also doesn't respond in any way to my typings in screen. I'm flashing with Jelmer's tool.

Any clue?

wpantund[3145914]: Initializing NCP
wpantund[3145914]: Removing all NCP originated addresses
wpantund[3145914]: NCP is now BUSY.
wpantund[3145914]: [->NCP] (1) PROP_VALUE_GET(PROTOCOL_VERSION)
wpantund[3145914]: SpinelNCPInstance-Protothreads.cpp:412: Requirement Failed (IS_EVENT_FROM_NCP(event) && GetInstance(this)->mInboundHeader == mLastHeader)
wpantund[3145914]: Resetting and trying again... (retry 1)
wpantund[3145914]: [->NCP] (2) RESET
wpantund[3145914]: SpinelNCPInstance-Protothreads.cpp:396: Requirement Failed (event == EVENT_NCP_RESET)
wpantund[3145914]: Resetting and trying again... (retry 2)
wpantund[3145914]: SuperSocket::reset()
wpantund[3145914]: Setting baud rate to 115200
wpantund[3145914]: SpinelNCPInstance-Protothreads.cpp:396: Requirement Failed (event == EVENT_NCP_RESET)
wpantund[3145914]: Resetting and trying again... (retry 3)
wpantund[3145914]: [->NCP] (3) RESET
wpantund[3145914]: SpinelNCPInstance-Protothreads.cpp:396: Requirement Failed (event == EVENT_NCP_RESET)
wpantund[3145914]: The NCP is misbehaving: Repeatedly unable to initialize NCP. Entering fault state.
wpantund[3145914]: State change: "uninitialized" -> "uninitialized:fault"

rubdos avatar Mar 03 '23 16:03 rubdos

Trying to get the stick working as OTBR with the firmware posted above and the Home Assistant OTBR addon. ~~No luck yet. Is this still relevant or is there any other firmware available somewhere?~~

Little further, I can get the addon working as a Border Router with my CC2652RB stick using the rcp_CC2652RB_115200_v6.20.00.29.bin.zip firmware. But when I try to add the Thread/Matter device I have, the stick (and so the addon) seems to crash.

00:02:02.076 [C] P-RadioSpinel-: Failed to communicate with RCP - no response from RCP during initialization
00:02:02.076 [C] P-RadioSpinel-: This is not a bug and typically due a config error (wrong URL parameters) or bad RCP image:
00:02:02.076 [C] P-RadioSpinel-: - Make sure RCP is running the correct firmware
00:02:02.076 [C] P-RadioSpinel-: - Double check the config parameters passed as `RadioURL` input
00:02:02.076 [C] Platform------: HandleRcpTimeout() at radio_spinel.cpp:1931: RadioSpinelNoResponse
[20:31:15] WARNING: otbr-agent exited with code 6 (by signal 0).

fbloemhof avatar Jul 05 '24 16:07 fbloemhof

Little further, I can get the addon working as a Border Router with my CC2652RB stick using the rcp_CC2652RB_115200_v6.20.00.29.bin.zip firmware. But when I try to add the Thread/Matter device I have, the stick (and so the addon) seems to crash.


That version is over 2-years old so you are probably going to build newer firmware.

Hedda avatar Jul 06 '24 15:07 Hedda

@Hedda indeed, I figured. I don't know how to build firmware for sticks like this. Ended up buying an other stick (sonoff) that has recent and maintained OT firmware available.

fbloemhof avatar Jul 08 '24 08:07 fbloemhof

@slaesh can you please keep releasing new/updated OpenThread RCP firmware images for your USB radio dongle so that it will work as a Open Thread Boarder Router in newer Home Assistant?

https://www.home-assistant.io/integrations/thread

https://www.home-assistant.io/integrations/otbr/

Hedda avatar Jul 08 '24 14:07 Hedda

freshly compiled this project here: https://github.com/TexasInstruments/ot-ti

flashing as usual the *.bin file in the given zip-file :)

couldnt test it properly yet, dont have a border router by hand currently. can someone verify if it works as intended? =) but it can be flashed, and that more than once - so it does not brick! thats what I could test so far :))

@fbloemhof @Hedda @rubdos

ot-rcp-115200.zip ot-rcp-230400.zip

slaesh avatar Jul 22 '24 09:07 slaesh

seems to work using the otbr docker container:

image

slaesh avatar Jul 22 '24 13:07 slaesh

freshly compiled this project here: https://github.com/TexasInstruments/ot-ti

flashing as usual the *.bin file in the given zip-file :)

couldnt test it properly yet, dont have a border router by hand currently. can someone verify if it works as intended? =) but it can be flashed, and that more than once - so it does not brick! thats what I could test so far :))

@fbloemhof @Hedda @rubdos

ot-rcp-115200.zip ot-rcp-230400.zip

@slaesh i could not flash it on my sonoff zigbee dongle-P with C2652P , it gave an ERROR using the Texas instrument flasher. I am newbie to this , i need help .

erumaithi avatar Jul 25 '24 04:07 erumaithi

its another MCU, you cant and shouldnt flash any firmware which is not compiled

  1. for your MCU
  2. four your specific board!

the firmware also includes the bootloader pin config, which could be wrong and your device would be bricked !!!! =)

Take care!

I can try to compile another version though :) Let me check the pinout, but there is no warranty!! be warned, I dont have one of these to test it ;)

slaesh avatar Jul 25 '24 06:07 slaesh

its another MCU, you cant and shouldnt flash any firmware which is not compiled

  1. for your MCU
  2. four your specific board!

the firmware also includes the bootloader pin config, which could be wrong and your device would be bricked !!!! =)

FYI, while that is true in general it should be noted are a few other radio adapters/dongles happen to use the same model of CC2652 MCU (SoC chip) type and board pin mapping as each other, see reference which can be used to match compatible adapters:

https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/bin/README.md

There you can see that no other adapter to use same MCU/SoC-chip model type and pin mappings as the Slaesh dongle, so you can not use a a firmware image built for Slaesh dongle on a Sonoff dongle because they are not using the same MCU/SoC-chip nor are the others using the same pin mappings on their adapter boards. It is only possible if both MCU/SoC-chip model type AND the pin mappings are a match.

Hedda avatar Jul 25 '24 08:07 Hedda

its another MCU, you cant and shouldnt flash any firmware which is not compiled

  1. for your MCU
  2. four your specific board!

the firmware also includes the bootloader pin config, which could be wrong and your device would be bricked !!!! =)

Take care!

I can try to compile another version though :) Let me check the pinout, but there is no warranty!! be warned, I dont have one of these to test it ;)

@slaesh appreciate your help , Yes go ahead if you can compile one for me i can test it and provide the results ( it is useless for me at the moment without thread ).

also attached a pic for the internal maybe it will help Screenshot 2024-07-25 at 7 04 42 PM

erumaithi avatar Jul 25 '24 15:07 erumaithi

no idea which of these two you should use tbh.. :D just pick the two which seemed the most obvious from this list

set(TI_BOARD_VALUES
    "CC1352P1_LAUNCHXL"
    "CC1352P_2_LAUNCHXL"
    "CC1352P_4_LAUNCHXL"
    "CC1352R1_LAUNCHXL"
    "CC26X2R1_LAUNCHXL"
    "LP_CC1352P7_1"
    "LP_CC1352P7_4"
    "LP_CC2652PSIP"
    "LP_CC2652R7"
    "LP_CC2652RB"
    "LP_CC2652RSIP"
    "LP_CC2653P10"
    "CC2674P10RGZ"
    "CC2674P10RSK"
    "CC2674R10RGZ"
    "CC2674R10RSK"
)

CC1352P2_CC2652P_launchpad => CC1352P_2_LAUNCHXL.zip

CC2652P (but without SIP?) LP_CC2652PSIP.zip

maybe try the CC1352P_2_LAUNCHXL one? most of this list https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/bin/README.md has the CC1352P2_CC2652P_launchpad in it?

slaesh avatar Jul 25 '24 15:07 slaesh

regarding flashing, this tool is pretty handy: https://zig-star.com/radio-docs/zigstar-multi-tool/

slaesh avatar Jul 25 '24 15:07 slaesh

no idea which of these two you should use tbh.. :D just pick the two which seemed the most obvious from this list

FYI, ITead’s Sonoff ZBDongle-P is based on CC2652P (CC2652P1/CC2652P1F) and uses the same pin mappings as the TI LAUNCHXL-CC1352P-2

https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/Z-Stack_3.x.0/bin/README.md

Hedda avatar Jul 25 '24 20:07 Hedda

ok, i have flashed the Sonoff ZBDongle-P using [CC1352P_2_LAUNCHXL.zip], it flashed successfully , but it was not recognize by the Open-thread add on for home assistance.

so i tried to use the second file . but the usb would not go to boot mode or even flash. i used the both official TI flasher and zigstar, but no luck. i already have the ZBDongle-E on order. Any how thank you all for your support , if there's an update to this , i will sure post it here

erumaithi avatar Jul 26 '24 08:07 erumaithi

ok, i have flashed the Sonoff ZBDongle-P using [CC1352P_2_LAUNCHXL.zip], it flashed successfully , but it was not recognize by the Open-thread add on for home assistance.

so i tried to use the second file . but the usb would not go to boot mode or even flash. i used the both official TI flasher and zigstar, but no luck.

@erumaithi If using Texas Instruments OpenThread firmware on CC2652/CC1352 then you must manually enter the bootloader mode by holding the physical boot button on the board when power it on or plug it in.

At least I do not believe that the TI flasher programmer software have a way to send a bootloader reset command when using OpenThread application firmware? Or at least not yet?

The reason why that is not need when using Nabu Casa’s OpenThread firmware or OpenThread firmware by @darkxst on Silicon Labs based adapters is that they added their own additional function patches to the application firmware that allow reset to bootloader mode from application mode which is not included in the default OpenThread application firmware, this enable third-party flasher programmers to utilize that bootloader reset feature.

@slaesh I guess you could copy that bootloader reset patch and implement it in your TI-OT fork and then also submit patches for ZigStar Multitool and other flasher programs for CC2652/CC1352?

https://github.com/darkxst/silabs-firmware-builder

https://github.com/NabuCasa/silabs-firmware-builder

Hedda avatar Jul 26 '24 12:07 Hedda

application firmware that allow reset to bootloader mode from application mode which is not included in the default OpenThread application firmware,

The reset patches are upstream, however there is no way to reboot into the bootloader from an application on TI chips, it can only be activated by gpio pins. cc2538-bsl and most of the forks of this, support entering bootloader on sonoff P dongle with dtr/rts toggles though.

freshly compiled this project here: https://github.com/TexasInstruments/ot-ti

I've tested extensively builds from here with 460800 on various chips and they work fine with homeassistant otbr. There were some stability issues, but the most recent release solves many of those.

darkxst avatar Jul 26 '24 13:07 darkxst

Off-topic but related, FYI, I just read in the latest Open Home Foundation newsletter that the Matter integration inside Home Assistant has now started the process of getting officially as a Matter standard solution by the CSA, so it with probably not be long before that Matter integrated will go out of beta stage, and that in turn should mean that Nabu Casa’s developers as well consider their Thread and OTBR (OpenThread Border Router) integrations as well as as their matching OpenThread Border Router add-on as being mature enough to go through certification as those are dependecies for devices that uses Matter over Thread via Home Assistant’s OTBR integration:

https://www.home-assistant.io/integrations/matter

https://www.home-assistant.io/integrations/thread

https://www.home-assistant.io/integrations/otbr/

https://github.com/home-assistant/addons/tree/master/openthread_border_router

Hedda avatar Jul 26 '24 13:07 Hedda

sadly HA via docker cant make use of addons. so its not that "fast" tested for me.. will try to play around with it at the weekend though :)

slaesh avatar Jul 26 '24 13:07 slaesh

you can run the upstream OTBR Docker container and just connect to it with HA otbr integration.

darkxst avatar Jul 26 '24 13:07 darkxst

if there is no other big difference, then it works :) at least with the CC2652RB ;)

seems to work using the otbr docker container:

image

slaesh avatar Jul 26 '24 14:07 slaesh

application firmware that allow reset to bootloader mode from application mode which is not included in the default OpenThread application firmware,

The reset patches are upstream, however there is no way to reboot into the bootloader from an application on TI chips, it can only be activated by gpio pins. cc2538-bsl and most of the forks of this, support entering bootloader on sonoff P dongle with dtr/rts toggles though.

@darkxst do you happen to know if those bootloader reset patches have also made their way from upstream OpenThread to the downstream ot-ti fork by in TexasInstruments repository here? -> https://github.com/TexasInstruments/ot-ti

Hedda avatar Jul 26 '24 14:07 Hedda

@erumaithi If using Texas Instruments OpenThread firmware on CC2652/CC1352 then you must manually enter the bootloader mode by holding the physical boot button on the board when power it on or plug it in.

I did and i was able to flash the firmware the first time , but when i tried to re flash it i tried but will not go into bootload mode no matter what i do

erumaithi avatar Jul 26 '24 14:07 erumaithi

do you happen to know if those bootloader reset patches have also made their way from upstream OpenThread to the downstream ot-ti fork by in TexasInstruments repository here

That is pretty irrelevant, as its not possible to reset into bootloader (via software reset) on TI chips.

darkxst avatar Jul 27 '24 04:07 darkxst

but when i tried to re flash it i tried but will not go into bootload mode no matter what i d

I did and i was able to flash the firmware the first time , but when i tried to re flash it i tried but will not go into bootload mode no matter what i do

If it that is true, then the bootloader config in @slaesh images is wrong and can only be recovered by JTAG.

I dont know if TI ever fixed this bug: https://e2e.ti.com/support/wireless-connectivity/zigbee-thread-group/zigbee-and-thread/f/zigbee-thread-forum/1344453/lp-cc1352p7-openthread-syscfg-is-not-loading-board-specific-ccfg-settings/5124929#5124929

darkxst avatar Jul 27 '24 04:07 darkxst