I want to interface Client Sensor over UART in light_switch_client code. Can you please give me the idea,how to do it.
I am using Mesh_V4.0 and SDK 16.0
I want to interface Client Sensor over UART in light_switch_client code. Can you please give me the idea,how to do it.
I am using Mesh_V4.0 and SDK 16.0
Hi,
I suggest you have a look at the UART Coexistence example from our Mesh SDK. The example integrates UART into the light switch client example.
Hi thanks for the reply.It compiled successfully.
1.Now will you please explain me which part in the code exhibits UART functionality ? Basically I want to send some commands from development kit,for which my sensor will send the response. (PHYSICAL WIRED INTERFACE)
2,Which pins I should use on the development kit to interface my external sensor ? (External sensor has RX,TX,RTS,CTS pins).
Hi,
1. For sending and receiving over UART, have a look at these functions:
app_uart_get(..)
app_uart_put(..)
2. I suggest you have a look at the Product Specification for the nRF52832. P0.05 - P0.08 are connected to the interface MCU. Choose some other GPIO for communicating with the sensor.
Initialize the UART module with uart_init().
1.OK in that case I have to change the pins in default uart_init() function or I need to write separate uart_init() function for new pins ? can you please specify which four pins I shall use ?
2.I understand ble_app_uart_coexist doesn't have functionality to provision the device using nRF BLE mesh application so how I suppose to add the device in the same group to which server device is added ?
Basically I want to take data from sensor and then want to publish it over mesh from the client (I suppose ble_app_uart_coexist has client functionality ) to server.
Hi Mttrinh,
I am waiting for your reply.
Hi Mttrinh,
I am waiting for your reply.
Hi,Could you please look into my doubt
1. Like I mentioned in the previous reply, you can use any other GPIO pins. Have a look at the Pin assignments section in the the Product Specification for the nRF52832. Then you configure the UART peripheral to use those pins, change the pins in the default uart_init() function.
2. Yes, that is correct. The example doesn't have support for GATT provisioning so you can't use the nRF Mesh app to provision. You need to use our static provisioner in the SDK to provision. You can find it in the Light switch example.
1.Hi I have changed the RX_PIN_NUMBER (8---->19) and TX_PIN_NUMBER(6----->20) in uart_init() function and connected these connections to my sensor and short GROUND too.Now when I run and start to debug the code I am receiving NRF_BREAKPOINT_COND in app_error_weak.c
2.Also uart_event_handle function will get called if sensor is sending the data OR I need to write anything for that
Thanks
Hi just to check UART part I am using UART code from examples\peripheral folder.To check the loopback I short default UART pins 6 to 8 and 7 to 9 and it worked.
Now in the same code in uart_init() function I changed RX,TX,RTS,CTS to 31,30,29,28 and short RX toTX and RTS to CTS but I am not getting any loopback data now.
I can not use 28,29,30,31 (P0) for uart functionality ? I also tried with 18,19,20,21 but it did not happen.
Please help
Hi will you please respond for my 2nd query