Wifi Robot – 2

June 27, 2013 § 3 Comments

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


#!/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

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.


# make sure it's above 'exit 0'!

/etc/serial1234.sh &

exit 0

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…

Advertisements

Tagged: , , , , , , ,

§ 3 Responses to Wifi Robot – 2

  • You’ve made some good points there. I looked on the web for
    more info about the issue and found most people will go along with your views on this site.

  • avast keygen says:

    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!

  • 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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading Wifi Robot – 2 at khairulhasanmd.

meta

%d bloggers like this: