Wifi Robot – 2

Adding a Serial Port (Usb To Serial Converter) To TL-MR3020.

To connect a arduino, a serial port is necessary. I have used here a FT232RL usb to serial converter to acheive this.

The software installation/settings script is here. You must install drivers, and for communication,  socat is necessary.  The program ser2net hangs after few hundred bytes transmission.

You dont need to add a startup script (this socat tcp-l:1234,reuseaddr,fork file:/dev/ttyACM0,nonblock,raw,echo=0,waitlock=/var/run/tty,b9600) directly to /etc/rc.local or system>startup. I don’t know why but it hangs the function of indicator leds. Though the router works fine.

Instead you need to add this script (somewhat edited from here) to a file via winscp.

Say the file name is /etc/serial1234.sh

[code language=”powershell”]

#!/bin/ash

DEV=/dev/ttyUSB0
PORT=1234
BAUD=115200

while true; do
if [ -e $DEV ]
then
socat tcp-l:$PORT,reuseaddr,fork file:$DEV,nonblock,raw,echo=0,waitlock=/var/run/tty,b$BAUD
else
sleep 2
fi
done
[/code]

Save this script and make this executable. And then system>startup tab or, /etc/rc.local before exit 0 add a line. this file should look like this.

[code language=”powershell”]

# make sure it’s above ‘exit 0’!

/etc/serial1234.sh &

exit 0

[/code]

Then the program socat will run whenever you connect the FT232RL in the USB port.  And you can connect it by putty at your routerip:1234 and RAW connection.

After this i will make a vb program to connect without putty and control arduino by keyboard buttons. Of course I must program the arduino too.

More about this comes later.. till then…

Comments (3)

  1. Hey there, I think your site might be having browser compatibility issues.
    When I look at your blog in Chrome, it looks fine but when opening in Internet Explorer, it has some overlapping.
    I just wanted to give you a quick heads up! Other
    then that, awesome blog!

  2. hi!,I love your writing so so much! share we be in contact more approximately your article on AOL?
    I need an expert in this space to solve my problem. May be
    that’s you! Having a look ahead to see you.

Leave a Reply

Your email address will not be published. Required fields are marked *