This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

can any one please tell me how to identify the nRF24L01 uniquely

i m trying to do a tree topology using this module. please help me find the unique i.d of the device.

Parents
  • Hi NISHIL

    The nRF24L01 devices do not have a unique id, I am currently working in a similar project. You will have to come up with another scheme to uniquely identify a node/device using an nrf24l01 module.

    A few options:

    • A unique ID chip such as this
    • Program an ID per device
    • Generate a unique ID using some seed data and then store in device eeprom

    I use the generation mechanism, basically I sample the ADC as the source of the seed values.

    uint16_t rng16(uint16_t seed)
    {
    	// Call four times with non-zero args to seed.
    	// Period is greater than one quintillion.
    	static uint32_t k=1148543851;
    	static uint32_t i=1234567891;
    	if(seed)
    	{
    		i=(i<<16)+((k<<16)>>16);
    		k=(k<<16)+seed;
    		return(0);
    	}
    	
    	k=30903*(k&65535)+(k>>16);
    	i=31083*(i&65535)+(i>>16);
    	return(k+i);
    }
    
    uint16_t system_generate_id()
    {
    	uint16_t voltage = 0;
    	
    	for (uint8_t i = 0; i < 4; i++)
    	{
    		system_read_battery_voltage(&voltage);
    		rng16(voltage);
    	}
    	
    	return rng16(0);
    }
    

    The above rng16 function is based on work by George Marsaglia. The method of seeding would not be useful for cryptographic uses but it was random enough for what I needed, which was a unique device ID.

Reply
  • Hi NISHIL

    The nRF24L01 devices do not have a unique id, I am currently working in a similar project. You will have to come up with another scheme to uniquely identify a node/device using an nrf24l01 module.

    A few options:

    • A unique ID chip such as this
    • Program an ID per device
    • Generate a unique ID using some seed data and then store in device eeprom

    I use the generation mechanism, basically I sample the ADC as the source of the seed values.

    uint16_t rng16(uint16_t seed)
    {
    	// Call four times with non-zero args to seed.
    	// Period is greater than one quintillion.
    	static uint32_t k=1148543851;
    	static uint32_t i=1234567891;
    	if(seed)
    	{
    		i=(i<<16)+((k<<16)>>16);
    		k=(k<<16)+seed;
    		return(0);
    	}
    	
    	k=30903*(k&65535)+(k>>16);
    	i=31083*(i&65535)+(i>>16);
    	return(k+i);
    }
    
    uint16_t system_generate_id()
    {
    	uint16_t voltage = 0;
    	
    	for (uint8_t i = 0; i < 4; i++)
    	{
    		system_read_battery_voltage(&voltage);
    		rng16(voltage);
    	}
    	
    	return rng16(0);
    }
    

    The above rng16 function is based on work by George Marsaglia. The method of seeding would not be useful for cryptographic uses but it was random enough for what I needed, which was a unique device ID.

Children
No Data
Related