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

ANT background scanning network key issue

Hi all,
I have a little problem regarding "background scanning" example.

Setup:
- SDK 17.0.2, softdevice s212, Segger
- Master ANT+ = Nordic DK PCA1040 with ANT+ Tx profiles/simulators (e.g. HRM)
- Slave ANT = Nordic DK PCA1040 with background scanning example

Parameters:
- RF = 57
- Device type = 0 (wildcard) or 120 (e.g. HRM)
- Trans type and channel as in datasheet

Results:
- when ANT_PLUS_NETWORK_KEY (master and slave) = 0, 0, 0, 0, 0, 0, 0, 0 it works
- when ANT_PLUS_NETWORK_KEY (master and slave) = 0xB9,... it does NOT work
- With ANT_PLUS_NETWORK_KEY (master and slave)  = 0xB9... my Garmin watch can detect Nordic DK simulator, when it is 0,... it can not (logical)

Change of setup:
- Both DK are using "background scanning" example and ANT_PLUS_NETWORK_KEY  = ANT+ (0xB9,...)
- in this case it works normally

My question is what am I doing wrong, when I am using correct ANT_PLUS_NETWORK_KEY with "background scanning" + "ANT+ HRM_Tx", it does not work, but it does with a public key. But at the same time when I am using 2 "background scanners" it works fine with ANT+ key.
Thank you :)

Ram

Parents
  • Hi,

    Not sure where the problem is, but you can look into this:

    I would assume you would need to call sd_ant_network_address_set() on both master and slave, for instance network_number = 0 and network_key = ant_plus_key. You can call sd_ant_network_address_set() multiple times to add several network keys, just make sure that network_number is incrementing for each key added.

    Once keys are set, then make sure that when you later call sd_ant_channel_assign() that the network_number equal the network_key you want to use.

    I can't really think what may cause this to go wrong, maybe the byte order in keys are reversed or wrong, but that seems a bit odd.

    Best regards,
    Kenneth

  • Hi Kenneth

    First thank you for your reply :)

    is it allowed to use ant_plus_key = ANT+ on background scanning since it is not an ANT+ protocol?

    From what I see now in the background scanning example, it does not have ant_Key_manager file, is this example meant to detect / scan for ANT+ devices or only a regular ANT? And if not, which other example would show how to do that?

    We are developing an interface between an ANT+ sensors and bluetooth, so we will need a scanner to detect nearby ANT+ devices and then connect to the one that we would like. If my assumption is wrong please let me know, thank you

    Regards,

    Ram

  • I do not see any reason why you can't use sd_ant_network_address_set() with any channel configuration (including background channel), if sd_ant_network_address_set() is not called, then it will use the default ant network key (0, 0, 0, ..). However you may need to direct this question to www.thisisant.com, for instance I can find somewhat similar question here:
    https://www.thisisant.com/forum/viewthread/6266/ 

    To use the ANT+ network key, you will need to be an ANT+ adopter.

    Kenneth

Reply Children
No Data
Related