Pages

Wednesday, February 22, 2012

It Worked for Me - Serial Proxy, Arduino and Windows 7

Tonight I was working on getting an Arduino accessible via TCP/IP using serproxy on Windows 7 64bit.  I got it to the point where I can connect to my pc via telnet using the port in the serproxy.cfg file and get output from the Arduino.

I used a copy from tinkerit on google code in the comments by lanj... The modified source code can be downloaded from Alejandro Valenzuela Roca's blog.

Initially I had a the problem described on the comments where I could connect via telnet to the port and get output once but after that I would get 'Failed to open comm port - Connection refused' errors.  The fix was to change the _close statement in sio.c in the sio_close routine to CloseHandle.

To compile serproxy I used CodeBlocks and imported the serproxy.dsp project file.  After doing this and making the above change I was able to recompile it and successfully connect to the Arduino multiple times.

I tested successfully using both COM5 and COM14.

1 comment:

Anonymous said...

What is the exact fix in the below code??

_close(sio->fd);
sio->fd = 0;
sio->hComm = INVALID_HANDLE_VALUE;