I am completely new to this toolchain and how it works.
I was trying to add a UART sensor to the matter sample project on the nrf52840dk. Is there anyone who can help me configure the uart in this project?
thnx in advance!
I am completely new to this toolchain and how it works.
I was trying to add a UART sensor to the matter sample project on the nrf52840dk. Is there anyone who can help me configure the uart in this project?
thnx in advance!
Hi,
Is it the UART part or the Matter part you need help with?
In Matter it does not matter what communication protocol you are using for the sensor (UART, SPI, I2C, etc.), so the UART part you can set up regardless of Matter. You can use the UART driver in Zephyr. We do have a lesson about UART in our DevAcademy, Lesson 5 – Serial communication (UART), with some theory and with an exercise teaching you how to set up UART. Unfortunately, there are no examples of using the UART driver this in nRF Connect SDK as of yet, but there is an example in Zephyr SDK v3.0.0, UART Driver Sample (nRF Connect SDK v1.9.1 is using Zephyr v2.7.99) that you can also take a look at.
As for the Matter part, I recommend going through the Creating Matter accessory device guide in our documentation, as this shows how to create a temperature sensor in Matter. Depending on what type of sensor you are using you might need to use another cluster and/or attribute and it is possible you will have to implement some parts differently, as that guide is for using the Temperature Measurement cluster specifically, but it should help as a starting point. If you need more help with this I would need to know what type of sensor it is, i.e. what you are sensing with it. As stated in the guide, the example value there is random, so in SensorMeasureHandler you will have to use the sensor value from your sensor instead.
Best regards,
Marte
Hi,
Is it the UART part or the Matter part you need help with?
In Matter it does not matter what communication protocol you are using for the sensor (UART, SPI, I2C, etc.), so the UART part you can set up regardless of Matter. You can use the UART driver in Zephyr. We do have a lesson about UART in our DevAcademy, Lesson 5 – Serial communication (UART), with some theory and with an exercise teaching you how to set up UART. Unfortunately, there are no examples of using the UART driver this in nRF Connect SDK as of yet, but there is an example in Zephyr SDK v3.0.0, UART Driver Sample (nRF Connect SDK v1.9.1 is using Zephyr v2.7.99) that you can also take a look at.
As for the Matter part, I recommend going through the Creating Matter accessory device guide in our documentation, as this shows how to create a temperature sensor in Matter. Depending on what type of sensor you are using you might need to use another cluster and/or attribute and it is possible you will have to implement some parts differently, as that guide is for using the Temperature Measurement cluster specifically, but it should help as a starting point. If you need more help with this I would need to know what type of sensor it is, i.e. what you are sensing with it. As stated in the guide, the example value there is random, so in SensorMeasureHandler you will have to use the sensor value from your sensor instead.
Best regards,
Marte