We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Exercise Bike to Processing
Page Index Toggle Pages: 1
Exercise Bike to Processing (Read 500 times)
Exercise Bike to Processing
Mar 14th, 2008, 11:28am
 
Hello!

I'm looking for a little advice on a project of mine where I try to control a video with an exercise bike.

The exercise bike (Kettler Ergometer X3) has a serial RS232 interface and it comes with a software (Tour Concept 1.0) that can receive all kind of information like the pulse, distance, rpm, speed and so on. The driven distance is what I would like to get access to in processing.

I used a serial port monitor to see what information is exchanged between the computer and the bike when the software is running.
This is what I found:

Request: 13.03.2008 12:55:46.37464 (+0.6563 seconds)

50 57 20 32 35 0D 0A                              
--
PW 25..        


Answer: 13.03.2008 12:55:46.43664 (+0.0625 seconds)

30 30 30 09 30 30 30 09 30 30 30 09 30 30 34 09
30 32 35 09 30 30 30 37 09 30 31 3A 31 30 09 30  
30 30 0D 0A                                      
--
000.000.000.004.
025.0007.01:10.0
00..            


You can see that with the request PW 25.. the bike will answer with 000.000.000.004.025.0007.01:10.000..
In this sting I can find all data necessary for me. If I can get it into processing my problem would be salved.

I assume I can use the serial library with some kind of myPort.write(PW 25..);
But as the communication goes on in HEX I'm not sure how to do this.

Anyone out there that has done something like this before or can give me some advice?


cheers    andy
Re: Exercise Bike to Processing
Reply #1 - Mar 26th, 2008, 8:06pm
 
I'm afraid this is out of my skill level, as I've only done very basic Serial stuff.

That said, the stuff I did do was based in Arduino (http://www.arduino.cc/),  which I'm pretty sure uses the same Serial library.  If no one can help here try out their forum, as they're more likely to have dealt with this problem.
Re: Exercise Bike to Processing
Reply #2 - Mar 27th, 2008, 8:25am
 
In the meantime, I’ve got a workable solution:
As I mentioned, the request I have to send is:

50 57 20 32 35 0D 0A   -->   PW 25 ..

I now found out that the 4 chars at the end of the the ASCI-Code (0D 0A) are in fact a line-break.
My serial monitor couldn’t identify that and printed two points instead.

And this is how it worked out in processing:

myPort.write("PW 25"); // send request of data
myPort.write("\n"); // send line-break

The answer I get is a nice string where I can pick up the informations I need.

Thanks for your attention!

Cheers

Andy
Page Index Toggle Pages: 1