Is Varia Radar sensor available?

Former Member
Former Member
I have an idea for an app. Is the Varia Radar sensor data available? (for a Vivoactive HR device).
  • The answer is complicated.

    The AntPlus module (of the ConnectIQ SDK) doesn't have direct support for the Bike Radar profile. Despite that, an app developer could write code to communicate directly to the ANT+ device using the Ant module. To do so they'd need access to the ANT+ device profile specification so that they knew how to read the data coming from the device.

    All ANT+ device profile specifications are published and available for download on thisisant.com. Anyone can create an ANT+ Adopter account which gets you access to public profile specifications. Unfortunately, the ANT+ device profile for Bike Radar sensors has existed for more than a year (link), but hasn't yet been made available to ANT+ Adopters (link). It is currently only available to ANT+ Members ($1500/year).

    So, the bottom line is, yes it is possible. Unfortunately, it it unlikely that anyone playing with these technologies will have access to the specification. Companies like Garmin will have access, but for the normal software nerd, the cost makes it difficult to justify.

    Travis
  • Former Member
    Former Member over 8 years ago
    The answer is complicated.

    The AntPlus module (of the ConnectIQ SDK) doesn't have direct support for the Bike Radar profile. Despite that, an app developer could write code to communicate directly to the ANT+ device using the Ant module. To do so they'd need access to the ANT+ device profile specification so that they knew how to read the data coming from the device.

    All ANT+ device profile specifications are published and available for download on thisisant.com. Anyone can create an ANT+ Adopter account which gets you access to public profile specifications. Unfortunately, the ANT+ device profile for Bike Radar sensors has existed for more than a year (link), but hasn't yet been made available to ANT+ Adopters (link). It is currently only available to ANT+ Members ($1500/year).

    So, the bottom line is, yes it is possible. Unfortunately, it it unlikely that anyone playing with these technologies will have access to the specification. Companies like Garmin will have access, but for the normal software nerd, the cost makes it difficult to justify.

    Travis


    Thanks for the detailed nice response. Yes, I'm a normal software nerd. All I want to do is make a Vivoactive HR vibrate when the Varia Radar picks up something. So maybe I can reverse-engineer enough of the ANT+ data to do that.
  • Former Member
    Former Member over 8 years ago
    The answer is complicated.

    The AntPlus module (of the ConnectIQ SDK) doesn't have direct support for the Bike Radar profile. Despite that, an app developer could write code to communicate directly to the ANT+ device using the Ant module. To do so they'd need access to the ANT+ device profile specification so that they knew how to read the data coming from the device.

    All ANT+ device profile specifications are published and available for download on thisisant.com. Anyone can create an ANT+ Adopter account which gets you access to public profile specifications. Unfortunately, the ANT+ device profile for Bike Radar sensors has existed for more than a year (link), but hasn't yet been made available to ANT+ Adopters (link). It is currently only available to ANT+ Members ($1500/year).

    So, the bottom line is, yes it is possible. Unfortunately, it it unlikely that anyone playing with these technologies will have access to the specification. Companies like Garmin will have access, but for the normal software nerd, the cost makes it difficult to justify.

    Travis


    Well I wrote a little scanner utility using raw Toybox.Ant and found the Varia Radar sending out messages for DeviceType=35...progress!
  • Hi  After 3+ years, the RADAR ANT+ profile has finally been made available to members (w/o paying the adopter fee! Yay!) but the Light profile is still not available. Anyhow, Been poking around with it and go the page 48 part and the deciphering. Now this is where I am confused over the little endian and big endian (some youtube and google set me partially straight :-p)

    Now the payload is like this

     

    payload = [
        48, // page #48 (0x30)
        21, // Threat Level Target [1,2,3,4] each 2 bits
        0, 
        195, // Range Target [1,2,3,4], each 6 bits
        130, // Range Target [1,2,3,4], each 6 bits
        137, // Range Target [1,2,3,4], each 6 bits
        64, 
        4
    ]

    Based on the ANT+ profile, bits 3-5 is the range of each target respective to the user. my current confusion (and I've been banging my head for 2 days trying to figure out which endian it is (I believe it should be little endian) or which bit is where or if I am supposed to combine bits 3 to 5 into 1 long 24bit number.)

    is it 137-130-195(10001001-10000010-11000011) or 195-130-137 (11000011-10000010-10001001) and since these numbers are in decimal (confusion sets in because in the common data pages, the examples given are using HEX) am I supposed to concatenate them together to form one 24bit number? And then slice them down to each individual 6 bit? (0-5)/(6-11)/(12-17)/(18-23)?

    (For the threat level, I figured that since I'm not sure how to do the bit mask / bit shift, I'll just make it simple and make it an array with 4 numbers and use that instead)

    Appreciate if someone can school me on this and lift me out of my confusion or let me know what to google to read up on.

    Many Thanks!!

  • I think you are probably making this more complicated than it needs to be. The data format lists out the bytes in the packet from least significant (byte 0) to most significant (byte 7). The bits in each byte are also explicitly listed in order.

    To simplify decoding, you can pack bytes 3, 4, and 5 into a single 24-bit value, and then unpack that into the individual target ranges. You could do something similar for the speed.

  • I'm pretty sure that this code is correct:

    const LEVEL_MASK = 0x03;
    const LEVEL_BITS = 2;
    
    const SIDE_MASK = 0x03;
    const SIDE_BITS = 2;
    
    const RANGE_MASK = 0x3F;
    const RANGE_BITS = 6;
    
    const SPEED_MASK = 0x0F;
    const SPEED_BITS = 4;
    
    enum {
        THREAT_LEVEL_NONE          = 0,
        THREAT_LEVEL_APPROACHING   = 1,
        THREAT_LEVEL_FAST_APPROACH = 2,
        THREAT_LEVEL_UNKNOWN       = 3,
    }
    
    enum {
        THREAT_SIDE_BEHIND  = 0,
        THREAT_SIDE_RIGHT   = 1,
        THREAT_SIDE_LEFT    = 2,
        THREAT_SIDE_UNKNOWN = 3,
    }
    
    class Threat
    {
        var level;
        var side;
        var range;
        var speed;
    }
    
    // return an array of 0-4 threats
    // will return null if there are no threats at all
    function decode_page_48(payload)
    {
        var threats = [];
    
        // pack the bits
        var level_bits = payload[1];
        var side_bits  = payload[2];
        var range_bits = payload[5] << 16 | payload[4] <<  8 | payload[3];
        var speed_bits = payload[7] <<  8 | payload[6];
    
        for (var i = 0; i < 4; ++i)
        {
            var threat_level = (level_bits >> (i * LEVEL_BITS)) & LEVEL_MASK;
    
            if (threat_level != THREAT_NONE)
            {
                var threat = new Threat();
                threat.level = threat_level;
                threat.side  = ( side_bits >> (i *  SIDE_BITS)) & SIDE_MASK;
                threat.range = (range_bits >> (i * RANGE_BITS)) & RANGE_MASK;
                thread.speed = (speed_bits >> (i * SPEED_BITS)) & SPEED_MASK;
    
                // apply scale and offset
                threat.range *= 3.125;
                threat.speed *= 3.04;
    
                threats.append(threat);
            }
        }
    
        return threats;
    }

  • honestly this is way more than I expected. Truly helpful especially on the bit masking and bit shifting tho I still need to get schooled on it. eg: the difference between (payload[7] & 0x70) >> 4 and 4  >> (payload[7] & 0x70) 

    Other than that, it works, except for the last bit (append) which had me stumped as there is no append (i think you meant add).

    Once i changed that, i get an array of objects 

    thanks to this... 

    www.javawithus.com/.../array-of-objects

    I finally figured out how to decipher the object. (it just took me 17 hours :-(

    Thanks

  •  It sounds like you've spent a LOT of time on this. I just need to know, from a data field, if the RADAR is paired and therefore displaying the radar status bitmap, so I can adjust my layout around that obstruction. Any tips on how to inquire if a radar sensor is paired? I don't need the data from it. Just a true/false thing. Thanks!! "getRadarInfo" might work?

  • Yes.. spent a LOT of time on this.. and then got rejected by Garmin on grounds of safety. (legalese) and thus I am now using it (for over 3 years apparently)..

    https://www.youtube.com/channel/UCyn4PapiMm5-X4KFKwtASEQ

    There's 2 videos on the link above showing how it works..

    can't recall how I got it to work, but definitely not the getRadarInfo as this is a CIQ3 and I'm using this on my Fenix3 and since that watch has no support in firmware for Radar, I didn't have that issue of it obstructing. It was a direct ANT+ connection.