Dear all,
Greetings!!!
I am using the NRF24LE1E module. I want to pair my device with host using a button. Button is available on device side. Please help me to do it. Please share the solution links related to this task.
Dear all,
Greetings!!!
I am using the NRF24LE1E module. I want to pair my device with host using a button. Button is available on device side. Please help me to do it. Please share the solution links related to this task.
Thank you very much Håkon Alseth. This helped me a lot. Now I am confused about how to set the id of Host and Device. Now I am stuck at this point. If any support is provided, I will be grateful.
Thanks again,
Nitesh Dubey
Hi,
In nRFgo SDK, under docs, there's a documentation file nrf_sdk.chm.
Here you can find detailed information about how both Gazell and GZP works, under modules ->firmware -> RF protocol -> Gazell Pairing Library.
Here it is, in case you don't have it:
0121.docs_nrfgo_sdk_v2.3.0.10040.zip
Nitesh Dubey said:Now I am confused about how to set the id of Host and Device. Now I am stuck at this point. If any support is provided, I will be grateful.
Which ID? Is there anything specific that is unclear?
Kind regards,
Håkon
Hi,
In nRFgo SDK, under docs, there's a documentation file nrf_sdk.chm.
Here you can find detailed information about how both Gazell and GZP works, under modules ->firmware -> RF protocol -> Gazell Pairing Library.
Here it is, in case you don't have it:
0121.docs_nrfgo_sdk_v2.3.0.10040.zip
Nitesh Dubey said:Now I am confused about how to set the id of Host and Device. Now I am stuck at this point. If any support is provided, I will be grateful.
Which ID? Is there anything specific that is unclear?
Kind regards,
Håkon
I want to give a unique ID to each device (multiple hosts and multiple devices). If I will press buttons on host and device simultaneously, then they will get paired using this unique ID. Once they will get paired, only these two will communicate and other will get restricted.
The device sends a request, as per the functions in my first post.
The host, can choose to accept this, like this:
// If Host ID request received
if(gzp_id_req_received())
{
// Always grant request
gzp_id_req_grant();
}
If you do not want to disable new pairing entries, you can disable the pairing pipe on the host using the function gzp_pairing_enable()
Kind regards,
Håkon
Thanks for your support. But, still the problem is same. Two or more deices getting paired with on host. This causes the out to fluctuate.
#include "gzll_mcu.h"
#include "gzll.h"
#include "gzp.h"
#ifdef GZP_CRYPT_DISABLE
#error This example project uses gzp_crypt, please remove the definition "GZP_CRYPT_DISABLE".
#endif
void main(void)
{
bool send_crypt_data = false;
bool tx_success = false;
gzp_id_req_res_t id_req_status;
uint8_t payload[GZLL_MAX_PAYLOAD_LENGTH];
mcu_init();
// Initialize Gazell Link Layer
gzll_init();
// Initialize Gazell Pairing Library
gzp_init();
EA = 1;
for(;;)
{
payload[0] = P0;
// Send every other packet as encrypted data
if(send_crypt_data)
{
// Send encrypted packet using the Gazell pairing library
tx_success = gzp_crypt_data_send(payload, GZP_ENCRYPTED_USER_DATA_MAX_LENGTH);
}
else
{
// Send packet as plaintext on pipe 2
gzll_tx_data(payload, GZLL_MAX_FW_PAYLOAD_LENGTH, 2);
while(gzll_get_state() != GZLL_IDLE){
}
tx_success = gzll_tx_success();
}
send_crypt_data = !send_crypt_data;
// If data transfer failed
if(!tx_success)
{
// Send "system address request". Needed for sending any user data to Host.
gzp_address_req_send();
// Send "Host ID request". Needed for sending encrypted user data to host.
id_req_status = gzp_id_req_send();
}
// If waiting for Host to grant or reject ID request
if(id_req_status == GZP_ID_RESP_PENDING)
{
// Send new ID request for fetching response
id_req_status = gzp_id_req_send();
}
}
}
//program for device
#include "gzll_mcu.h"
#include "gzll.h"
#include "gzp.h"
#ifdef GZP_CRYPT_DISABLE
#error This example project uses gzp_crypt, please remove the definition "GZP_CRYPT_DISABLE".
#endif
void main(void)
{
bool send_crypt_data = false;
bool tx_success = false;
gzp_id_req_res_t id_req_status;
uint8_t payload[GZLL_MAX_PAYLOAD_LENGTH];
mcu_init();
// Initialize Gazell Link Layer
gzll_init();
// Initialize Gazell Pairing Library
gzp_init();
EA = 1;
for(;;)
{
payload[0] = P0;
// Send every other packet as encrypted data
if(send_crypt_data)
{
// Send encrypted packet using the Gazell pairing library
tx_success = gzp_crypt_data_send(payload, GZP_ENCRYPTED_USER_DATA_MAX_LENGTH);
}
else
{
// Send packet as plaintext on pipe 2
gzll_tx_data(payload, GZLL_MAX_FW_PAYLOAD_LENGTH, 2);
while(gzll_get_state() != GZLL_IDLE){
}
tx_success = gzll_tx_success();
}
send_crypt_data = !send_crypt_data;
// If data transfer failed
if(!tx_success)
{
// Send "system address request". Needed for sending any user data to Host.
gzp_address_req_send();
// Send "Host ID request". Needed for sending encrypted user data to host.
id_req_status = gzp_id_req_send();
}
// If waiting for Host to grant or reject ID request
if(id_req_status == GZP_ID_RESP_PENDING)
{
// Send new ID request for fetching response
id_req_status = gzp_id_req_send();
}
}
}This is a restriction with gazell and gzp.
There is only one device that can be used for an encrypted pipe. If you allow two devices to connect and request the "Host ID", the former will be overwritten.
Thanks for your support. I am using more than two pairs of host and device. Let me explain again, I named them as D1 and D2 to two devices and H1 and H2 to two hosts. There is buttons on host and devices for pairing. Now, If I want to pair H1 with D1 then I will press the buttons on H1 and D1 and same for H2 and D2.
If I will press buttons on H1 and D2 then they will get paired and H1 and D1 will get free.
Please suggest some solutions and ideas if any.
It will be appreciable.