I am using nRF52832 board to un provision the device using the button from the hardware.how to configure this
I am using nRF52832 board to un provision the device using the button from the hardware.how to configure this
Hi,
I'm not sure I understand you 100% but if you are asking about unprovisioning a mesh device using nRF Mesh SDK , please have a look at the button_event_handler() in light switch server example. When you press button 4 , the provisioning data will be erased and all configuration information in flash will be erased.
In sample example of nrf52 for light switch server handled for RTT pressing button4 from serial terminal it is getting unprovisioned.I need to unprovision by pressing the button on the hardware manually.How to give input via button instead of RTT.plz suggest your answer
Hi,
Please don't click Verify Answer if it's not a solution for your problem.
If you have a look at the code inside app_rtt_input_handler() to handle RTT input, you can find that it in turn will call button_event_handler(). So in the light switch or light_lc example if you press button 4 on the board, it's the same as when you input '4' in RTT. Both of them will end up executing this code:
case 4: { /* Clear all the states to reset the node. */ if (mesh_stack_is_device_provisioned()) { #if MESH_FEATURE_GATT_PROXY_ENABLED (void) proxy_stop(); #endif mesh_stack_config_clear(); node_reset(); } else { __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "The device is unprovisioned. Resetting has no effect.\n"); } break; }
So I'm not sure why you don't get the same effect when you press button 4 on your board, what's the issue here ?
Hi,
yes i found this,my issue is how to call the button event handler inorder to give input from the board
Ok, so you based your application on light_lc example. And in that example the buttons are not handled.
You would need to have a look into the light switch server example. In that example we include the simple_hal.c module to handle the buttons. Note that we don't use nrfx_gpio in that example but use simple_hal.c instead.
You need to include simple_hal.c to your project just like in the light switch example.
Then you need to call ERROR_CHECK(hal_buttons_init(button_event_handler)); inside intialize() function.
Please refer to the code inside light switch server example.
In samplehal.c they handled it only for rtt not for the button from the board.
Hi,
Have you tried to test with the light switch server example ?
Have you looked at the hal_buttons_init() function ?
Hi,
Have you tried to test with the light switch server example ?
Have you looked at the hal_buttons_init() function ?
Hi,
I tested with that didnt worked with button pressed externally.
Is this sample server example works for the dongle?as it has only one button i.e reset button
if yes,please explain how it is possible to un provision tthe dongle with the buttons
If you have different hardware you need to match the button GPIO pin with the pin configured in the BUTTON_LIST define. If you have a look inside hal_buttons_init() you will find NRF_GPIO->PIN_CNF[] is called to define the buttons configuration. And GPIOTE_IRQHandler() is to handle when there is a button press.