Recent

Author Topic: Infrared connection via USB on linux - did someone already hack this?  (Read 9212 times)

hy

  • Full Member
  • ***
  • Posts: 221
Hi,
I am a sports enthusiast. I am training with a polar RS400 Trainingscomputer/-watch and have to rely on the very bad
polar-protrainer to program my RS400 or to download the excercise-data to the computer.

The Polar-Protrainer-Program runs only on windows (within a virtual machine here).
I would love to write my own training application.
I can read the data that Polar Protrainer produces but I also want to get rid of the Polar Pro trainer as well.
so the questions are:
+ did anyone here already access a Infrared-USB-Stick on a linux-machine?
+ did anyone implement the protocol to read and write to/from devices of Polar?
+ could someone translate OpenSource Java- or C-Source-Code that alread fullfills the requirements
(There are already samples. The Java Application is not sufficient for me and the C-Code doesn't compile)
Thanks
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #1 on: October 20, 2014, 04:14:07 pm »
Would the usb stick not perhaps be recognized as a regular usb to serial converter? In that case you can use the existing serial components such as lazserialx (IIRC) to access the data...
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

hy

  • Full Member
  • ***
  • Posts: 221
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #2 on: October 20, 2014, 04:18:21 pm »
Thanks Bigchimp. I will give it a try.
but I haven't found any spec for the protocol yet and I do not want to invent the wheel for a second time
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

hy

  • Full Member
  • ***
  • Posts: 221
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #3 on: October 20, 2014, 04:51:40 pm »
Cant find any lasserial* also searched for serial in all the sources but couldn't find anything related.
the wiki has a reference to lazlibusb but the file is not there.
the unit serial in fpc is w/o doc - source only.
)-;
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #4 on: October 20, 2014, 05:24:01 pm »
What happens if you search on TLazSerial then...

Edit: also there is a page about hardware access on the wiki that surely should have links to serial port libraries/codes
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

sam707

  • Guest
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #5 on: October 20, 2014, 05:54:32 pm »
look that link please

http://forum.lazarus.freepascal.org/index.php?topic=20481.0

if it can help...

i was watching miniupnpc lib to open ports on routers, it is a C library and i am going to check if I can convert headers to FPC imports in a while, when i will need it

http://miniupnp.tuxfamily.org

hy

  • Full Member
  • ***
  • Posts: 221
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #6 on: October 20, 2014, 08:35:35 pm »
Thanks for the hints. I will give it a try and write about later this week.
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

sam707

  • Guest
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #7 on: October 24, 2014, 08:57:32 pm »
Pascal_SCADA is bundled with my Lazarus installation (CodeTyphon 4.8 )

I do not use it but I am wondering... it may be the (large) set of components that you are looking for (Windows, Linux, FreeBSD, Lazarus/Delphi package compatible)

data acquisition and  external controlers management...

please have a look at the following :

https://sourceforge.net/projects/pascalscada/

http://www.pascalscada.com

they have prebuilt (TForm dropable) components like as follow on my Lazarus components palette ->

- TSerialPortDriver
- TModBus...Driver (Tcp, Udp, AscII, etc...)
- Block and Text Cmd Controlers
- Graphic, curves, animations, check components
... and more

simply ask "pascalscada" to google, you will also have a look at some industrial UI screenshots
« Last Edit: October 24, 2014, 09:18:22 pm by sam707 »

hy

  • Full Member
  • ***
  • Posts: 221
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #8 on: October 25, 2014, 11:01:34 am »
Thanks looks promising. I downloaded it - but will take some time to evaluate...
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #9 on: October 29, 2014, 09:48:25 am »
+ did anyone here already access a Infrared-USB-Stick on a linux-machine?
+ did anyone implement the protocol to read and write to/from devices of Polar?
Have you searched the net? The first link after searching for 'polar rs400 protocol' is polar4linux which can be found here:
http://code.google.com/p/polar4linux
Browsing sources will tell you more about the protocol.

It seams to use IrComm IrDA serial emulation, so if my understanding of the link below is correct then it should be doable with Lazarus serial components:
http://courses.cs.washington.edu/courses/cse476/01wi/projectwebs/ball/HOWTO/IrDA/1.html
« Last Edit: October 29, 2014, 09:49:59 am by avra »
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

hy

  • Full Member
  • ***
  • Posts: 221
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #10 on: October 29, 2014, 10:21:34 am »
Thanks avra. Sure I was searching. I didn't find the sources you mentioned.
Still, when I enter these keywords: "polar rs400 protocol"
I do not get this result here (spain) at all. And I am pretty sure I also added +lazarus or +linux at least...

But thanks very much. This is very promising. The hrm and  pdd files are easy to read.
But the more interesting thing is the IR-conection.

I will give it a try. As far as I am concerned I do not work as a programmer (but I used to for 25 years).
So currently my time to do some experiments is very limited. Converting from C or Java will take a lot of time for me.

Please be patient. I will tell how far I got when I did some test.
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #11 on: October 30, 2014, 03:30:01 pm »
Still, when I enter these keywords: "polar rs400 protocol"
I do not get this result here (spain) at all. And I am pretty sure I also added +lazarus or +linux at least..
I don't know why your results differ, maybe it's location specific or google presonalized them. Screenshot shows what I get on google.com, google.rs and google.es. Never mind, it's important that you have something to start with. If I were you I would just look at protocol details in C code and try to adapt that to Laz/FPC.
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

hy

  • Full Member
  • ***
  • Posts: 221
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #12 on: October 30, 2014, 07:31:20 pm »
I am even getting different results with different browsers...

As far as I am concerned the binary (when I compile source) does not talk to my RS400 at all. So I don't knw whether it's a waste of time (to look at foreign source code in a language I do not fully understand) or if the problem is LIRC-related or IRDA or whatever.
Thanks for trying.
_____
***hy
OS: debian sid(64bit)  [fpc 3.20] Lazarus 2.0.12

Antarian

  • Newbie
  • Posts: 1
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #13 on: January 09, 2015, 08:31:38 am »
Hello, I'm also owner of Polar (RS400). Is it possible for it to communicate via IRDA using just regular IRDA adapter, not their brand Polar IRDA ? I though irda is just irda but so far I've failed to use it with regular windows app not to mention linux.

CM630

  • Hero Member
  • *****
  • Posts: 1082
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Infrared connection via USB on linux - did someone already hack this?
« Reply #14 on: January 09, 2015, 09:03:33 am »
Some theory:
Most likely and someone already confirmed the IR to USB adapter emulates a RS232 (COM) port. I windows it can be checked the following way: when the device manager is open, a new serial port shall be shown when the device is plugged in and respectively it will disappear when it is unplugged. If so, go get TLazSerial. Pay attention, that the latest version is not in the first page of the forum.
After that, you have to use a RS232 sniffer. Plug in the IR adapter, check in the device manager which COM port number is assigned to it. Start the sniffer on that port and run the Polar software. Check what they are talking to each other and try to understand it.
Ask for additional assistance, if needed.

Лазар 3,2 32 bit (sometimes 64 bit); FPC3,2,2; rev: Lazarus_3_0 on Win10 64bit.

 

TinyPortal © 2005-2018