Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT-FS → Thread

   

Problem downloading data from ANT-FS device

Rank

Total Posts: 17

Joined 0

PM

Hi

I'm having some problems receiving the download response from a ANT-FS device.
The host device is a iPhone with a Wahoo Key.

This is the communication that i've been doing:

/assign channel
03 42 00 [00 00]

//set channel id
//device number 0
// device type 18
// Transmission type 0
05 51 00 [00 00 12 00]

//set radio frequency (57MHz)
02 45 00 [39]

//set channel period 8192
03 43 00 [00 20]

//open channel
01 4B 00

//device Link beacon broadcast
09 4E 00 [43 2B 00 02 12 00 16 00]

//Link command with channel change request to x40
//Host device serial number: 0x48509A61
09 4E 00 [44 02 40 04 61 9A 50 48]
//set radio frequency for x40 64 Mhz
02 45 00 [40]

//device Authentication beacon broadcast
09 4E 00 [43 2B 01 02 61 9A 50 48]

//Authentication command
09 4E 00 [44 04 02 00 61 9A 50 48]

//device Authentication response
09 50 00 [43 2B 01 02 61 9A 50 48]
09 50 20 [44 84 01 04 7E 51 BA 12]
09 50 C0 [08 08 08 08 00 00 00 00]

//device Transport beacon broadcast
09 4E 00 [43 2B 02 02 61 9A 50 48]

//Download request Package 1
09 50 00 [44 09 00 00 00 00 00 00]
//Download request Package 2
09 50 A0 [00 01 00 00 FF FF FF FF]

//What i receive as a response from
//the device in broadcast mode
09 4E 00 [43 2B 03 02 61 9A 50 48]

The status byte 2 in this message have the value 0x03 indicating that it is busy and I don't receive any burst response from the BPM in the host device

The BPM continues sending this broadcast message until it gives a error.

The strangest thing is that sometimes when the AntWare II is running at the same time as the Host device and listening to what the BPM transmits with the same configuration (device number 0 / device type 18 / transmission type 0 / frequency 0x40), after receiving the Download request from the Host device, it sends the correct Download response message but only to the AntWare II.

This appears to happen randomly and when this happen, the host device instead of the previous busy response, only receives this:
03 40 00 [01 02] x 7
03 40 00 [01 08]

Can someone see if there is some problem in the configuration of the channel in the Host device, by looking to my setup? Or have something like this already happened to you?      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Did you try to use the ANTFS-Host software available on thisisant.com for communication with the device (ANTFS-Client)?
Just to make sure that the device behaves well.      
Rank

Total Posts: 17

Joined 0

PM

Yes, i can pair with it and then download the directory file from index 0 using ANTFS PC-Host.

What is strange in this is the fact that it only sends the download response when i have AntWare on.

And only then, the download response is sended, but once again just to AntWare and not to the iPhone.

All the commands (link, auth, download) are sended through the iPhone, and i receive in it, all the responses (link, auth), except the download response that is only received in the AntWare.

Can it be because this response is in burst mode? but the Authentication response also is in this mode i can see it in the iPhone.      
Rank

Total Posts: 17

Joined 0

PM

Solved...

i change the period in the link command
from:
09 4E 00 [44 02 40 04 61 9A 50 48]
to:
09 4E 00 [44 02 40 01 61 9A 50 48]

Now the iPhone (Host) can receive the download request from the client device.

But is this really necessary? I configured the iPhone with a period of 8192 (4Hz), so when i transmit the link command, i should state the same, defining a period of 4 or not?

With this new configuration, after i pass the link layer, in the authentication and the transport layers, in the iPhone i see the respective beacons interspersed with EVENT_RX_FAIL messages, but i think that its expected because of the different periods.

Does anyone knows the reason why it must be used a lower period in the client device than in the host?

Or if this is just a "workaround" another problem i still can't see... help?      
Avatar
RankRankRankRank

Total Posts: 662

Joined 2012-10-09

PM

The host sets the channel period that will be used for the rest of the session in the link command. If the client is not using the requested channel period, causing errors in the communication, this would seem like an implementation error in the client.      
Rank

Total Posts: 6

Joined 0

PM

joaofca can you tell me what is the BPM device you are using? I am using the antfs protocol to communicate a bpm device with android and I also receive a lot of EVENT_RX_FAIL messages. It doesn't happen all the time, so I have not been able to find out why, yet. Although I'm also suspecting on implementation errors on the client device.

ps: the device I am using is the A&D UA-851      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

ricardo.lagido wrote:
joaofca can you tell me what is the BPM device you are using? I am using the antfs protocol to communicate a bpm device with android and I also receive a lot of EVENT_RX_FAIL messages. It doesn't happen all the time, so I have not been able to find out why, yet. Although I'm also suspecting on implementation errors on the client device.

ps: the device I am using is the A&D UA-851

Just FYI: I have built a PC application that downloads data from ANT+ BPM devices, and the UA-851 communicates perfectly with it.      
Rank

Total Posts: 17

Joined 0

PM

@ricardo.lagido
I'am using HMM profi+. By changing the period in the BPM like i stated in a previous message on this thread, solved the problem for me, i still receive EVENT_RX_FAIL messages intercalated with the the beacon messages after link layer, but that is expected because the period on the iPhone 4 times higher that in the BPM with this configuration, so i receive 3 EVENT_RX_FAIL and one beacon every time. I believe thats a ugly fix, but it works when it gets to the download of the BPM data, and i couldn't see any other problem, so i'm happy smile      
Rank

Total Posts: 6

Joined 0

PM

old_man_biking wrote:

Just FYI: I have built a PC application that downloads data from ANT+ BPM devices, and the UA-851 communicates perfectly with it.


Thank you! but by the way, I would like to ask you some questions!

Is there a way to know the exact moment when the blood pressure monitor has received and saved a new reading?
I need a similar use case to the weight scale profile, when in broadcast. This way the collection device is noticed whenever a new value is received. For what I've read of the ANT-FS protocol, I found no way of knowing that.

So the first workaround I tried, was to erase the FIT file every time the user takes a blood pressure reading and establishes a connection. That way the status byte would indicate that there is no data available to download and I would keep asking for it until there is. But...

Have you tried to erase the FIT file with all the measurements on the device?
I was able to send the erase command and successfully receive the erase response. Problem is after erasing it, the device enters in some kind of timeout. This is, when I open the channel after erasing the file, I simply don't receive any beacon from the device and therefore I can't see the value of the status bytes and therefore cannot continue the ANT-FS communication process.
The situation only goes back to "normal" if I manually press the START button on the device itself (a complete reading is not necessary, I can turn it off immediately after it starts working). By "normal" I mean that I receive link beacons with the status byte indicating there is no data available to download.

I also wanted to erase it because some time ago, the FIT file reached its size limit (at least it looked like that) and stopped saving new blood pressure readings, so I erased the file and everything went back to normal.

The final workaround I came up was to keep downloading the entire FIT file and check if there is a new record in it. For now it works... but it's a pretty rough solution don't you think?


I would really appreciate your help!
Thanks!      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Everything below refers to an A&D UA-851ANT and of course to the Blood Pressure ANT+ profile.

Yes, erasing works flawlessly.
Once the readings are erased, the BPM stops sending ANTFS beacons.
Why? The ANT+ profile specifies that a BPM without valid data should be silent.
So what you observe is correct behaviour. As soon as there's a new reading, the BPM should start beaconing again.

Re Weight Scale:
The weight scale profile is completely different. Scales don't use the "store and provide for ANTFS download" pattern, but transmit values immediately during measurement. Reading the profiles will provide you the insight you need.

OMB