-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] [zephyr] Use connectedhomeip as a zephyr module #33471
Comments
The standalone Zephyr platform in Matter was added by one developer who abandoned the platform maintenance shortly after :), so I'm afraid, you will have to update the platform yourself if you want to use it. Note that there are 3 other Zephyr-based platforms in Matter - nrfconnect, telink and NXP. Because of that, we don't keep the Zephyr module manifest in the root directory (I mean not in this repo, but we do in our forks) but rather use Also, some files in |
All right, in the end, the Zephyr platform can't be used as such for pure Zephyr projects (without a manufacturer's SDK). The platform only works thanks to nRF, NXP and Telink implementations? |
I mean if you use vanilla Zephyr, it should be OK with you to use the standalone Zephyr platform in Matter. I just wanted to let you know that it's currently lacking a maintainer so it's not surprising that it doesn't work at the moment :). But if you can resurrect it, it may be the right choice. We as a Nordic use a separate platform because our SDK is a superset of Zephyr so we want to have a chance to use some extra features of our SDK in Matter. |
That being said, if you need to modify shared Zephyr files in Matter, feel free to ping me to review the changes. |
Hi @Damian-Nordic ! I'm currently working on the Zephyr standalone app for STM32. I'm working with the stm32wb5mm_dk. CONFIG_CHIP=y
CONFIG_CHIP_DEVICE_PRODUCT_ID=32773
CONFIG_STD_CPP17=y
CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y
CONFIG_BT=y
CONFIG_NETWORKING=y
CONFIG_NET_L2_OPENTHREAD=y
CONFIG_IEEE802154=y
CONFIG_ENTROPY_STM32_RNG=y When I build the app, I have this error /home/quentin/github/workspace/zephyr/include/zephyr/device.h:91:41: error: '__device_dts_ord_DT_CHOSEN_zephyr_ieee802154_ORD' undeclared here (not in a function)
91 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~~~
/home/quentin/github/workspace/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
137 | #define _DO_CONCAT(x, y) x ## y
| ^
/home/quentin/github/workspace/zephyr/include/zephyr/device.h:91:33: note: in expansion of macro '_CONCAT'
91 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
| ^~~~~~~
/home/quentin/github/workspace/zephyr/include/zephyr/device.h:228:37: note: in expansion of macro 'DEVICE_NAME_GET'
228 | #define DEVICE_DT_NAME_GET(node_id) DEVICE_NAME_GET(Z_DEVICE_DT_DEV_ID(node_id))
| ^~~~~~~~~~~~~~~
/home/quentin/github/workspace/zephyr/include/zephyr/device.h:245:34: note: in expansion of macro 'DEVICE_DT_NAME_GET'
245 | #define DEVICE_DT_GET(node_id) (&DEVICE_DT_NAME_GET(node_id))
| ^~~~~~~~~~~~~~~~~~
/home/quentin/github/workspace/zephyr/modules/openthread/platform/radio.c:96:9: note: in expansion of macro 'DEVICE_DT_GET'
96 | DEVICE_DT_GET(DT_CHOSEN(zephyr_ieee802154)); I can't find a resource linked to this Thanks in advance ! |
@QuentinCaldeira-eaton sorry for late response. |
@Damian-Nordic Yes, thanks for the response. I decided to move to nucleo h536zi with ethernet connectivity, to be independant of stm32 drivers. But again, can't compile as a Zephyr module. I should work on that. Alongside, I try to use connectedhomeip as a library, by adding all .cpp files with CMake, but I don't get better results. Where can I found some support to do that ? |
@Damian-Nordic sorry to bother you, but could you try to build a Zephyr sample like blinky, with the CONFIG_CHIP=y in prj.conf, for an ARM (or stm32) board, using connectedhomeip as a zephyr module ? |
Hi @Damian-Nordic, I've worked a bit on the zephyr module, and here are my changes so far https://github.com/QuentinCaldeira-eaton/connectedhomeip
Is it the good direction ? What do you think ? Thanks in advance for your review ! |
@QuentinCaldeira-eaton But the changes you've made look OK. You can delete |
@Damian-Nordic, yes, of course, sorry to ping you so much. Just a quick question, so. Do you think the Ethernet implementation should follow the Wi-Fi implementation (with a dedicated folder and driver) ? Then, why we don't do the same thing for Thread ? Thanks for your time, really ! |
For Wi-Fi we need the driver for scanning and managing Wi-Fi credentials. For Thread it's shared among all OpenThread platforms - hence it's in |
My guess is, as ESP32 or Tizen, I should have an Ethenet 'object', in order to instance it in the AppTask. The Ethernet object might have some functions like Next, Count etc... I'm not very comfortable with C++ but that's what I've understood. I called it driver, but in fact Zephyr already as a good implementation of Ethernet. It's more the link between Matter and the Zephyr Ethernet |
Hi @Damian-Nordic, sorry to bother you, but I have a quick question linked to our previous discussion. After the PR, I continue to work on my Ethernet example, but it doesn't work. I cannot figure it out, but I think it's because Matter don't find the Zephyr interface. I think I should have, in the Zephyr platform directory, a driver which perform a DHCP IPv6 attribution, at least. When I debug my application with Wireshark, I see my device, but it has no ipv6 address (appears with ::). Even with the CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=y, I can't see mdns messages in wireshark. When debugging, the sin6.address is always full of zeros. I understand that Ethernet don't need more functions, because it inherits from BaseDriver with no functions added, but I think it should perform at least a DHCP. #ifdef CONFIG_NET_CONFIG_MY_IPV6_ADDR
address = CONFIG_NET_CONFIG_MY_IPV6_ADDR
#else
address = start_dhcpv6()....
#endif And Matter should use this ip address (I don't know how yet). What do you think ? You could find my whole application and logs here for further information #34317 |
Things like DHCP don't need to be called from the Matter stack - normally, auto-configuration is triggered by Zephyr when the interface is brought up. Also, in the case of IPv6, Ethernet driver should assign a link-local IPv6 address that should be enough to communicate with devices in the same network. Apologies, but I don't have time to analyze your issue more carefully... |
@Damian-Nordic No need to apologies, I just can't find any support or forum for connectedhomeip. I've attribute a static IP address. My application says that it publish mDNS, but can't see it in Wireshark. I thought it was because there is no CONFIG_MDNS (resolver, sd, etc.), but when I put this in my prj.conf, InitChipStack exit with an error. |
The question is how you publish the services. Matter has the minimal mDNS implementation and if you use it, it tries to join ff02::fb multicast group using You probably just need to read more of the Zephyr networking bits, enable verbose logging and analyze what happens under the hood. I won't be able to assist with such general challenges, especially that you use a hardware platform that I'm not familiar with. |
@Damian-Nordic it already help me a lot understanding what was done in |
connectedhomeip doesn't have the pw_rpc_lib error anymore |
Reproduction steps
Hello, I'm trying to use connectedhomeip as a zephyr OS module. To do so, connectedhomeip is pulled from zephyr's west.yaml like this:
Next, I moved the zephyr folder in
config/zephyr/chip-module
to the root, and changed the paths to Kconfig and CMakeList.My goal is to include the Kconfig
CONFIG_CHIP=y
in a standalone zephyr application, and see it compiled. My final goal is to compile a Matter zephyr application on an STM32 target. For now, I've added the KconfigCONFIG_CHIP
to the hello_world sample inzephyr/samples/cpp
.When I west build, I first get an error about chip_build_pw_rpc_lib = false, like this one. Then if I bypass this error, I get hundreds of other errors.
I had understood that the zephyr platform could be used standalone. Is there another way to use connectedhomeip as a zephyr module?
Bug prevalence
Whenever I do this
GitHub hash of the SDK that was being used
648d7bf
Platform
other
Platform Version(s)
No response
Anything else?
log.txt
The text was updated successfully, but these errors were encountered: