XML and streaming data display

ginsu777's picture

so i have been working on/off on this project whenever i want to add a feature or use a new video -- it works good. however, i ran into an issue.

I send a command to the terminal via TCP socket client to run a little program that interfaces with the usb stick receiver. It listens for the data on port 8168, and when its just the HR, it is all fine. however, i use another program to see the data in realtime and it also is getting the cadence and speed data in XML over the same port. my string truncate is seeing different data, and the output is not right.

now, I would like to use that data, but I am unsure as to how to get it, since it all comes over the same port, and my work is all in strings to truncate, etc to then display it. so i am not parsing the XML, and the extra data is now messing up my HR display. I'd like to use that data somehow.

This is complicated by the fact that both Cadence and Speed values I am interested in are reported as "RPM" so using a string components tool is getting complicated.

any ideas?

PreviewAttachmentSize
TestXML.qtz86.83 KB

cybero's picture
Re: XML and streaming data display

I'd be interested to look into this, but your composition requires -

v002_TCP_Socket_ClientPlugIn

which I don't currently have installed.

& I can't seem to find that anywhere at present.

ginsu777's picture
Re: Streaming XML Solution

so first off, DUST ROCKS! He really gave me a hand with this and took the time to teach me a thing or two, so I am passing along this comp here. It wont be of use unless you have quarqd, the garmin ANT+ stick and speed/cadence controller and a heart strap, but other than that, it's a nice learning tool as to how to parse xml in real time and display it in discrete ways.

Issues: Data recorder does not work. Attempting to playback the data results in QC crashing and then the next time you play the comp everything is like zoomed in 2x - every time. it gets all blown out. a restart of QC is required. Would like to use it, but who knows what i did wrong. Live is the on position with the checkbox clicked.

The other issue is that I want the two red/blue colored numbers in the center of the screen to go to zero if they haven't gotten a new reading. for cadence this makes sense. for speed, the same. if i stop pedaling, i should not have to see my cadence as the last cadence i had. it should be 0. like 0 should be the default, and any other number should bump to off until no more numbers are there. or something like that with a timeout to 0. the watch displays 0 immediately if you stop pedaling for cadence, while still displaying speed.

down the line: plotting things like hr on an x/y axis over the screen. we'll see if those graph tools can help.

so, thanks to DUST, and hope you all enjoy the possibilities. I'll be tweaking the heck out of it this weekend.

PreviewAttachmentSize
TestXML.qtz93.58 KB

dust's picture
Re: Streaming XML Solution

thanks... glad to help solve some problems my friend. i know how hard it can be dealing with sensors and controllers. sometimes i want to throw my arduino against the wall but i want to kiss kinect sensor.

gtoledo3's picture
Re: XML and streaming data display

Instead of trying to use Dust's data recorder macro, you could always try the Value Historian plugin. The composition crashes my system when I run it... I'm not sure about it b/c I don't have the tcp socket plugin.

dust's picture
Re: XML and streaming data display

gt this patch is taking sensor data from various networked monitors like mph, cadence, rpm, bpm, gps, distance etc... teams like to use various data while training and racing etc.. so my simple value recorder wouldn't work as it is queue based and brendant is dealing with infinit loop of socket based data streams.

this patch is visualizing various types of data that get augmented by video overlays. at least that what it seemed like so he is using the value historian as it's a bit more user friendly than my simple value recorder. Maybe you and I think it is a simple value recorder but to others it's not the same.

i was helping brendant deal with constant influx of data and indexing out the most current data. what the main issue is that the stream sometimes drops a packet and was messing up his displays. to give ginsu777 some credit I actually didn't do anything he did everything i just gave him some tips while looking at his patch over a screen cast. I think what ginsu777 wants do is record the stream of data so he can work on his patch without having to be strapped in. actually now that I think about it scratch my first statement he could actually use my value recorder for this purpose as a few seconds of looping dummy data would certainly work for testing purposes.

ginsu777 I think you might want to open qc in 32 bit mode to get the value recorder to work ? Get info on the qc app and set to 32 bit mode. And see if that helps I'm notnentirley certain though it's been awhile since I have the historian.

gtoledo3's picture
Re: XML and streaming data display

If the recorder isn't for playback, or actually recording, just to enforce evaluation, can't one hook to a billboard enable, or transform, or whatnot, and monitor the tooltip? If the structure extends too far, you can chop it with an index and/or range.

The semantics of the post made me think he was using your patch, not value historian (I think you called your patch value recorder(?)). The qtz doesn't restore for me, so I didn't look too much.

Looking more now...

I see a bunch of stuff running through queues. Is it dropping packets, or is it that at some point the data out of the mystery non-existent tcp/ip thingy being sent is an empty string, so that when you attempt to get to the desired data, you end up with an empty index? It's a guess, but that would make sense. It's hard to tell. If that's the case, maybe one could test for existence of data, run everything through a sample and hold, and when data doesn't exist, sample the last value, so that there's never a blank. Again... all conjecture, as the qtz can't be run.

dust's picture
Re: XML and streaming data display

Yes that's the idea George. Not sure what happens maybe the IRS not dropping packets but a port binding overflow issue. Either way the system is smart enough to throw an exception so testing for this is possible although I suggested he just queue the last frame farms and turn off continuous evaluation so he can store the last value so when an overflow happens the last know data is displayed while the systems catches up with himself. The recorder thing is just so he doesn't have to be riding the bike to see the data as I think it would be hard to ride a bike and program at the same time but to give brendant more credit he was actually showing me how the system works for sone time while strapped up and riding. I don't how maybe his laptop was on his handle bars maybe.

(edit) haha the ipad thinks i was talking about the IRS not the TCP (edit)

ginsu777's picture
Re: XML and streaming data display

It would be nice to get this data thing figured out. Right now, clicking the toggle into "RECORD" function (after selecting record on value historian) results in a crash of the QC player, but not the whole program. It works just fine when in "LIVE" mode - although I want the cadence and speed values to go to "0" when no new data is present. Maybe a string compare or sample and hold?

vade has posted a link to the TCP plugin in this very thread. However, this comp won't work without also installing QuarqD, buying a Garmin FR60 and installing a GSC-10 on your bike. without these - its going to be reliant on the data playback, which is obviously not working for some reason.

And like I was talking to dust about, getting an (X-Y) plot overlay of the HR data would be very cool for me too. I couldn't get the graph tools to work, so I removed it without registering after it expired.

ginsu777's picture
Re: XML and streaming data display

yes, vade kicks butt for making this TCP plugin available. thank you!