This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I²C sensor data transfer over BLE

(Protocol of my I²C Device)

I have tried the nRF52832 DK for a while now with the examples and so. I want to program a different Bluetooth Module, the EYSHSNZWZ from Taiyo Yuden.

I have tried the examples on the new module and they kind of worked but I had difficulties with bonding devices after I turned bluettoth on my Smartphone on and off. I thinks it's a problem in the device manager. Didn't figure it out yet.

Finding out the hard way that simple copy paste won't work out for my project I am now trying to adjust the services and functions for my purposes. 

My question is how I can realize it and which parameters I have to change to get the results I want and maybe solve the problem with the device manager.

Parents
  • Hi,

    1. Is there a specific reason you believe it is related to device manager? 
    2. You say "difficulties", did it work at all or just sometimes?
    3. Does I2C have anything to do with this?
    4. Did you base you application on a specific example in the SDK? What changes have you made?
    5. Can you describe your use case in more details?
  • Hi,

    1. When I try to bond with the device it says that the module denied the bonding. I have read some forum posts and I thought it could be the device manager.

    2. When I delete the whole RAM of the device, build an example solution and try to bond, it works. If I delete the bonding informations, problem 1. appears. As long as I don't turn off bluetooth from my phone or reset the module, it stays bonded even if I power off and on the module.

    3. I only mentioned I²C because the protocol of my I²C device is different from the temperature sensor of the nRF DK and wanted to know how I can change it.

    4. I tried the hrs and twi example, but I want to merge both functions.

    5. It's a project where I want to read out data from sensors with I²C and process them with the module. I have a smartphone app which sends a request to read out the register where I store the results from the sensors.

  • "... delete the bonding information..." do you mean delete the bonding info from the nRF52 device only? Have you tried to delete the bond info in your smartphone also and see if the two can bond again?

  • I've tried it with the hrs example, because I read that it has the device manager.

    First I've flashed the RAM of the module and build the hrs example. I turned on Bluetooth on my smartphone and bonded with the module successfully.

    I turned my smartphone bluetooth off and on and it still worked. Even shut down the module and powering on again the bonding was successfull.

    Then I went to my bluetooth settings on my phone and deleted the bonding with the module. Afterwards I tried to bond again --> module denied bonding. I flashed the RAM again and did everything from the first step. --> worked again.

Reply
  • I've tried it with the hrs example, because I read that it has the device manager.

    First I've flashed the RAM of the module and build the hrs example. I turned on Bluetooth on my smartphone and bonded with the module successfully.

    I turned my smartphone bluetooth off and on and it still worked. Even shut down the module and powering on again the bonding was successfull.

    Then I went to my bluetooth settings on my phone and deleted the bonding with the module. Afterwards I tried to bond again --> module denied bonding. I flashed the RAM again and did everything from the first step. --> worked again.

Children
  • Of course it fails! The nRF stores the LTK (long term key) from the very first bonding into the flash so if you wipe out the corresponding LTK on the smartphone and let the smartphone to initiate the pair/bond process the nRF will use the LTK that corresponds to the smartphone BLE id to set up the encryption, and since your smartphone does not have the corresponding LTK your smartphone will fail the encryption setup on its end.

    So if you wipe out the bond info in your smartphone, you should do the same in your nRF device. If you are using the PCA10040 for testing you just need to press the reset button and button 2 at the same time, and the bond info will be erased from the PCA10040 after the reset [so you don't need to keep erasing the whole nRF52 and flashing in the softdevice and the app image again.]

Related