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

nrf5144 ANT+ two network can't work at same time

I am using the nrf51422 with softdevice 5144_2.0.1 , I set two network number using the "sd_ant_network_address_set" api , network number 0 for ANT+ cadence/heardrate.. network number 1 for shinamo di2 . I assign di2 channel to network number 1 then i can get the di2 broadcast message and if i assign cadence channel to network number 0 then i can get di2 and cadence message together .

But if i lost the cadence message (eg: uncheck the Bike cadence transmitting box in ANT+ sensor simulator tool) then i also lost the di2 message , if i close the cadence channel then di2 message back .

any comment . thanks

  • Could you please provide some more details on how to reproduce this behavior? What application are you running on nRF51422? Maybe you can upload the project? Are you using SimulANT+ to simulate the cadence? Exactly which sensor in the list are you simulating?

  • But the project is mixed with some other codes, it takes time for me to remove some other codes to become another project. May i confirm one thing first , if i received the event MESG_CHANNEL_ID_ID with correct ID it mean the channel is paired with this ID , Am i right ? I am curious if the Di2 is paired or not. thanks .

  • I'm sorry, I don't understand. Could you explain a bit more about what you are doing?

  • let me explain more specific . I open two network one for ANT+ another for Di2 sensor (Di2 request another network key ). I use SimulANT+ to simulate the heardrate . nrf51422 boot up and open the heard rate channel and Di2 channel and both of them do not paired. If i click the Transmitting box in the SimulANT+ for heardrate i can't get any message from heard rate channel it is not normal. But if i wake up my Di2 device then both Di2 and heard rate channel can receive the message. I don't understand why the heard rate channel can't receive any message while the Di2 channel is opened but not paired . I will upload my project later. thanks

  • I post my code as below : If HRM channel not paired then i will not receive any ANT event from channel ANT_DI2RX_ANT_CHANNE.

    It look like network 1 will NOT receive ANT event until all channels paired or close on network 0. Why ?? Thanks .

    #define ANT_HRMRX_ANT_CHANNEL           0                                           
    #define ANT_DI2RX_ANT_CHANNEL           5 
    #define ANT_DI2RX_CHANNEL_TYPE          0x00                                         
    #define ANT_HRMRX_CHANNEL_TYPE          0x40                                         
    #define ANT_HRMRX_DEVICE_TYPE           0x78                                        
    #define ANT_DI2RX_DEVICE_TYPE           0x01                                        
    #define ANT_HRMRX_DEVICE_NUMBER         0                                           
    #define ANT_HRMRX_TRANS_TYPE            0                                           
    #define ANT_HRMRX_MSG_PERIOD            0x7E18                                       
    #define ANT_DI2RX_MSG_PERIOD            0x2006                                       
    #define ANT_HRMRX_EXT_ASSIGN            0x00                                         
    #define ANT_HRM_TOGGLE_MASK             0x80                                         
    #define ANTPLUS_NETWORK_NUMBER          1                                           
    #define DI2_NETWORK_NUMBER              0   
    #define ANTPLUS_RF_FREQ                 0x39                                         
    #define ANT_BUFFER_INDEX_MESG_ID        0x01                                         
    #define ANT_BUFFER_INDEX_MESG_DATA      0x03                                        
    #define ANT_DI2RX_NETWORK_KEY           {     under NDA                         }    
    #define ANT_NETWORK_KEY                 {0xB9,0xA5,0x21,0xFB,0xBD,0x72,0xC3,0x45} 
    
    static uint8_t                          m_ant_network_key[] = ANT_NETWORK_KEY; 
    static uint8_t                          m_di2_network_key[] = ANT_DI2RX_NETWORK_KEY;
    
        
        err_code = sd_ant_network_address_set(ANTPLUS_NETWORK_NUMBER, m_ant_network_key);
        APP_ERROR_CHECK(err_code);
    	
        err_code = sd_ant_network_address_set(DI2_NETWORK_NUMBER, m_di2_network_key); 
        APP_ERROR_CHECK(err_code);
    		// for HRM config 		
        err_code = sd_ant_channel_assign(ANT_HRMRX_ANT_CHANNEL,
                                         0,
                                         ANTPLUS_NETWORK_NUMBER,
                                         0);
        APP_ERROR_CHECK(err_code);				
        err_code = sd_ant_channel_id_set(ANT_HRMRX_ANT_CHANNEL,
                                         0x0001, // HRM ID
                                         ANT_HRMRX_DEVICE_TYPE,
                                         0);
        APP_ERROR_CHECK(err_code);		
    		err_code = sd_ant_channel_low_priority_rx_search_timeout_set(ANT_HRMRX_ANT_CHANNEL,0xFF);
    		APP_ERROR_CHECK(err_code);    
        err_code = sd_ant_channel_radio_freq_set(ANT_HRMRX_ANT_CHANNEL, ANTPLUS_RF_FREQ);
        APP_ERROR_CHECK(err_code);
        err_code = sd_ant_channel_period_set(ANT_HRMRX_ANT_CHANNEL, ANT_HRMRX_MSG_PERIOD);
        APP_ERROR_CHECK(err_code);		
        err_code = sd_ant_channel_open(ANT_HRMRX_ANT_CHANNEL);
        APP_ERROR_CHECK(err_code);
        // For Di2 config
        err_code = sd_ant_channel_assign(ANT_DI2RX_ANT_CHANNEL,
                                         0,
                                         DI2_NETWORK_NUMBER,
                                         0);
        APP_ERROR_CHECK(err_code);				
        err_code = sd_ant_channel_id_set(ANT_DI2RX_ANT_CHANNEL,
                                         0x9D5F, // Di2 ID 
                                         ANT_DI2RX_DEVICE_TYPE,
                                         0);
        APP_ERROR_CHECK(err_code);
    		err_code = sd_ant_channel_low_priority_rx_search_timeout_set(ANT_DI2RX_ANT_CHANNEL,0xFF); 
    		APP_ERROR_CHECK(err_code);
        err_code = sd_ant_channel_radio_freq_set(ANT_DI2RX_ANT_CHANNEL, ANTPLUS_RF_FREQ);
        APP_ERROR_CHECK(err_code);
        err_code = sd_ant_channel_period_set(ANT_DI2RX_ANT_CHANNEL, ANT_DI2RX_MSG_PERIOD);
        APP_ERROR_CHECK(err_code);
    		err_code = sd_ant_channel_open(ANT_DI2RX_ANT_CHANNEL);
        APP_ERROR_CHECK(err_code);
    
Related