Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Fitness Equipment → Thread

   

ANT+ FEC page 51 scanning

Rank

Total Posts: 7

Joined 2014-10-29

PM

Hi all,

I am trying to “spy on” two ANT+ devices talking to each other:
- The first device is a bike trainer running the ANT+ FEC profile
- The second device is a computer (running Zwift and sending commands to the trainer)
My goal is to receive the ANT+ messages coming from the computer on a nRF52832 (and especially page 51 of the FEC profile).

I managed so far only to receive the bike trainer ANT+ messages, but not the messages sent from the computer.
(The bike sends pages 16 and 25 – speed and power- , and the computer should be sending acknowledged data page 51 – simulated slope -).

What should I change in my configuration ?

I am using a continuous scanner to listen from the nRF5232 configured as follows:

ant_channel_config_t channel_config =
    
{
        
.channel_number    0x00,
        .
channel_type      CHANNEL_TYPE_SLAVE,
        .
ext_assign        0x00,
        .
rf_freq           0x39,
        .
transmission_type WILDCARD_TRANSMISSION_TYPE,
        .
device_type       FEC_DEVICE_TYPE,
        .
device_number     0x00,          // Wildcard
        
.channel_period    0x00,          // Not used, since this is going to be scanning
        
.network_number    ANTPLUS_NETWORK_NUMBER,
    
}


     
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

I recommend checking that you are not opening with the "Synchronous Channel Packets Only" option when calling sd_ant_rx_scan_mode_start. This feature is intended to filter out the slave to master messages.

You can also open a scanning channel with ANTwareII as a second method of checking the packets going over the air.

Ian      

Signature

Ian Haigh

Rank

Total Posts: 7

Joined 2014-10-29

PM

Hi,

I have managed to receive the packets in antware, by going in the advance tab and "Open in scan mode".
However i don't know what precise configuration it corresponds to...
(I am still receiving in my nRF52 only the BROADCAST_DATA_0x4E)

Opened in scan mode
Received BROADCAST_DATA_0x4E
:: 4e, 00-19-CA-00-00-00-00-60-20-80-1E-0B-11-05
Received BROADCAST_DATA_0x4E
:: 4e, 00-10-19-00-00-00-00-FF-24-80-1E-0B-11-05
Received BROADCAST_DATA_0x4E
:: 4e, 00-19-CB-00-00-00-00-60-20-80-1E-0B-11-05
Received BROADCAST_DATA_0x4E
:: 4e, 00-10-19-00-00-00-00-FF-24-80-1E-0B-11-05
Received ACKNOWLEDGED_DATA_0x4F
:: 4f, 00-33-FF-FF-FF-FF-72-51-00-80-1E-0B-11-05 <--------- Desired packet
Received BROADCAST_DATA_0x4E
:: 4e, 00-F0-00-00-00-00-00-00-00-80-1E-0B-11-05      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

"Synchronous Channel Packets Only" is described in section 9.5.4.5 of the "ANT Message Protocol and Usage" document.

ANTwareII does not allow control of this feature through the GUI. It always sets to false, which means you will receive both the master and slave transmissions. How are you configuring ANTwareII? You should be opening with "Advanced" -> "Open in Scan Mode" rather than "Auto-Open". You can hit "Auto-Open" then "Close" then "Open in Scan Mode" to ensure all radio settings have been configured.

You mentioned earlier that you want to receive using a nRF52832. For this device you use the softdevice function sd_ant_rx_scan_mode_start to start the scan, with the parameter set to 0 if you want to receive slave transmissions as well as master transmissions.

Are you not receiving the slave transmissions with both ANTwareII and the nRF52832?
     

Signature

Ian Haigh

Rank

Total Posts: 7

Joined 2014-10-29

PM

Dear haighi: thank you !!

It now works ! The key was indeed to call this magical sd_ant_rx_scan_mode_start, instead of opening the channel normally. (As done in AntWare II).

I now have it working everywhere thanks to you, and here is the code for other users:

/**@brief initialize scan
 */
static void continuous_scan_init()
{
    uint32_t err_code
;

    
// Set library config to report RSSI and Device ID
    
err_code sd_ant_lib_config_set(
        
ANT_LIB_CONFIG_MESG_OUT_INC_RSSI ANT_LIB_CONFIG_MESG_OUT_INC_DEVICE_ID);
    
APP_ERROR_CHECK(err_code);

    
// Configure channel 0 for scanning mode
    
ant_channel_config_t channel_config =
    
{
        
.channel_number    CT_CHANNEL_NUMBER,
        .
channel_type      CHANNEL_TYPE_SLAVE,
        .
ext_assign        0x00,
        .
rf_freq           FEC_ANTPLUS_RF_FREQ,
        .
transmission_type 0x05u,
        .
device_type       FEC_DEVICE_TYPE,
        .
device_number     TACX_DEVICE_NUMBER,
        .
channel_period    FEC_MSG_PERIOD,          // Not used, since this is going to be scanning
        
.network_number    ANTPLUS_NETWORK_NUMBER,
    
};

    
err_code ant_channel_init(&channel;_config);
    
APP_ERROR_CHECK(err_code);

    
// Activate message reception from the slave as well
    // This function starts receive scanning mode feature. Channel 0 must be assigned.  All other channels must be closed.
    
err_code sd_ant_rx_scan_mode_start(0);
    
APP_ERROR_CHECK(err_code);