Arduino Forum

Forum 2005-2010 (read only) => Hardware => Interfacing => Topic started by: igorreal on Oct 16, 2009, 06:48 pm

Title: Linksys + dd-wrt + arduino
Post by: igorreal on Oct 16, 2009, 06:48 pm
Hi,

I´m tinkering with a linksys router with dd-wrt. I´ve just fitted a serial port and it´s connected with Arduino (there´s a lot of info in internet).

I´m using a telnet connection to send commands like:
echo S1F > /dev/cua/1
or
echo S0F > /dev/cua/1

My Arduino receives it and turn on (S1F)/off (S0F) a led.
Ok, no problem... It´s working and I can turn on/off the led using WIFI connection.

I haven´t knowledge about linux....
How I can receive data from rs232 to the router´s shell?
Now, I know how to send from router to rs232 but I would like to know the opposite direction (from rs232 to router´s shell).


Thank-u!!   ;)



Igor R.
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Oct 16, 2009, 09:10 pm
Hi again,

I´ve found the solution....http://www.herbert-dingfelder.de/WRT54GL_add_on/WRT54GL_add_on.html

I´ve to open two connection, one to send and other to receive with cat < /dev/cua/1


;)
Title: Re: Linksys + dd-wrt + arduino
Post by: Reggie on Oct 17, 2009, 12:07 am
Hi Igor, I'd be interested if you could keep this thread updated, I'm currently looking for a suitable (e.g. FREE :D) router to use for DD-wrt/openwrt.  

You should be able to toggle the LEDs like you can with arduino pins which means they can be used for GPIO (search ddwrt/openwrt for GPIO), this makes it useful for adding sensors/ breakout boards directly to the router, so makes the system very flexible, 266Mhz means it should be able to handle some higher quality audio projects with it handling the processing and teh arduino handling the interfaces.

I like the idea of an arduino as a quick and easy breakout board for an Arm device for some reason :D
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Oct 17, 2009, 10:43 am
Hi Reggie,

Now, I´m able to communicate using telnet arduino with Linksys router.
My router is Linksys WRT54GL v1.1 with DD-WRT.
I bought this routers to use as WDS repeaters and universal repeaters. But now, I´m tinkering with this.

I´ve to use two telnet´s connection:
- first to send data: echo whatyouwantintoserialport > /dev/cua/1
- second to receive data from serial to port to the shell: cat < /dev/cua/1

I´m been looking into internet and there´re many project which use linksys as web server, php, ....

http://www.jbprojects.net/projects/wifirobot/
http://ahorcandoeltiempo.blogspot.com/search/label/Arduino [Spanish]
http://www.mightyohm.com/blog/2009/05/building-a-wifi-radio-part-10-building-the-box/
http://www.lecad.uni-lj.si/~leon/other/wlan/wrt54ow/index.html

Now, it would be interesting to learn how to make your own scripts inside the router....

;)





Title: Re: Linksys + dd-wrt + arduino
Post by: Reggie on Oct 17, 2009, 08:24 pm
I've got a homehub version 1.5 and a voyager 2091, I think both are targets, for either dd-wrt or open-wrt, I just want a small portable expandle unit with everything onboard already.

I'm not so interested in it functioning as a router so much but more to be able to process data for the things an arduino can't quite manage.  for instance it would be great to use an arduino as the controller for a nice tactile control surface while the 'router' box handles some audio processing, or the arduino handles incoming sensor data while the 'router' handles GPS and map display.  

As the dd-wrt/open-wrt boxes tend to have serial, GPIO (so you can implement software versions of all your favourite IC protocols, spi,12c, 2wire), ethernet, wirelss and USB in they are obviously an ideal platform for building 'stuff'.
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Oct 18, 2009, 01:55 am
And.... what about http://netus.acmesystems.it/doku.php?id=products:foxboardg20 ?

[edit]Maybe this could help you:
http://books.google.com/books?id=GBtJdvMeAJQC&printsec=frontcover&hl=es&source=gbs_v2_summary_r&cad=0#v=onepage&q=&f=false[/edit]

;)
Title: Re: Linksys + dd-wrt + arduino
Post by: Reggie on Oct 18, 2009, 02:06 am
They cost money, plain and simple :)  I'm looking at this from the cheap point of view as well :)  Although 80 GPIO lines is very appealing.  At the moment I'm 'discovering' all the different boards, I want something cheap to dev on first then move onto something 'built for purpose' when I know more about exactly what I want to do with it.
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Nov 07, 2009, 11:11 am
Hi,

As I don´t want go into linux´s scripts in depth, but I want to have wifi access into my aduino board,I´ve done an Excel sheet with telnet connection.
I can control Arduino via serial port.
You can follow an easy example (typical switch led on/off): http://real2electronics.blogspot.com/2009/10/linksys-arduino.html
Now I can use the power of excel to graph, math channels, VBA,... in "real time".

It´s in spanish, but google translate works quite good....

Regards



Igor R.
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Nov 14, 2009, 12:20 am
Hi again,

I´ve added a new example (Graph with data acquired from Arduino and sent via Wifi):


(http://2.bp.blogspot.com/_t8Ozc8jIT9I/Sv3itNXKhBI/AAAAAAAAAKo/gRWbBDeWE1I/s640/scheme_wifi.JPG)



[media]http://www.youtube.com/watch?v=OhKh4_D8-Ac[/media]



Kind Regards,




Igor R
http://real2electronics.blogspot.com/
Title: Re: Linksys + dd-wrt + arduino
Post by: Erac on Dec 13, 2010, 07:44 am
Hi Igor,

Would you know how to get the data sent by a proximity sensor?

My setup is controlling the arduino wirelessly through my linksys router using visual basic 6.0 ( in your case, excell)

Check my thread: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1292040169/4#4

Hope for your support :-[
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Dec 13, 2010, 11:00 am
Hi Erac,

I didn't use a C program inside the router.

I did it much easier. I'm connecting to the router using telnet. When you are connected, i.e. WIFI, you can use typical UNIX commands, as:
echo "string_to_send" > /dev/cua/1
or
cat < /dev/cua/1

I did a "protocol" inside Arduino to respond to my serial commands, an easy example :
S0E or S1E where,
char S -> Start byte
char 0 or 1 -> is led OFF or led ON
char F -> End byte

You can do the same to ask for an analog signal or whatever....  ;)
Also you are receiving the "answer".

Something to start, you could open 2 shell (two console connection against the router):
- First shell --> cat < /dev/cua/1
- Second shell -> you can send your "orders" using echo "string_to_send" > /dev/cua/1

http://2.bp.blogspot.com/_t8Ozc8jIT9I/Sttq6jcGFpI/AAAAAAAAAIA/9nmsqF-R-XI/s1600-h/Captura+Putty.JPG

I'm sorry, it's in spanish.
The feedback "ENCENDIDO" means SWITCH ON and "APAGADO" switch off.
You can find the code in http://real2electronics.blogspot.com/2009/10/linksys-arduino.html

Summarazing, I'm using the router as a telnet <=> serial port gateway. I'm connecting to the router using telnet ActiveX client. When I've connected (2 connections, one to receive and one to send), I'm "polling" serial commands to my Arduino or your Arduino could send all the time and you can get the data.

For expample=> http://real2electronics.blogspot.com/2009/12/linkduino-software-para-telemetria.html

I'm plotting using Zedgraph and the telnet  connection using Minimalistic ( the soft was done in C# (.NET) ):
? Minimalistic Telnet: http://www.codeproject.com/KB/IP/MinimalisticTelnet.aspx
? ZedGraph: http://zedgraph.org/wiki/index.php?title=Main_Page


I have other examples using a PHP server inside the router ( DD WRT + OPTWARE), but in my opinion this is the easiest method I've found. It depends if you want to use the router to process or only as a "shield"....

I hope this helps....




:D


Title: Re: Linksys + dd-wrt + arduino
Post by: Erac on Dec 13, 2010, 11:33 am
Thanks Igor, appreciated it. I'll study your way and I'll keep you posted for any progress

Thanks again
Title: Re: Linksys + dd-wrt + arduino
Post by: Erac on Dec 15, 2010, 07:20 am
Hello Igor,

My router firmware is white russian; do I have to change it to DD WRT?

I tried the echo "string_to_send" > /dev/cua/1 and cat < /dev/cua/1 , but it didn't work.

Regards,
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Dec 15, 2010, 03:15 pm
Maybe the serial ports is  /dev/tts/1 in your device??
Title: Re: Linksys + dd-wrt + arduino
Post by: Erac on Dec 16, 2010, 12:41 am
Thanks! it already worked my problem now is how to transfer the sensor feedback from the console to visual basic or excell
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Dec 16, 2010, 09:49 am
Hi,



You can download an example excel from my blog http://real2electronics.blogspot.com/2009/10/linksys-arduino.html

;)
Title: Re: Linksys + dd-wrt + arduino
Post by: Erac on Dec 17, 2010, 10:21 am
Hi Igor,

My router firmware is White Russian 0.9 ( open WRT) , and my problem now is[glow] I can't access Telnet[/glow] so I can transfer the sensor feedback to visual basic..


Any suggestions? Or Will I have to change my firmware to dd-wrt?

Regards :-[
Title: Re: Linksys + dd-wrt + arduino
Post by: martin_bg on Dec 17, 2010, 10:37 am
would this work if lets say i would like to upload a sketch to a remotely located arduino?
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Dec 17, 2010, 10:40 am
I suppuse that you can activate to load telnet service again when the router starts..... I'm not a linux expert, but I can't believe that you can't activate it...
http://ram.squat.net/tech/openwrt/whiterussian_client_setup.html
(here you can see how the telnet service is disable)

If you don't have telnet, I imagine that you have ssh, which it's more safe. I've never checked if there are free ActiveX ssh clients.....


;)
Title: Re: Linksys + dd-wrt + arduino
Post by: Erac on Dec 17, 2010, 01:31 pm
Hi Igor,

Do you know the code in Visual Basic 6.0 or Excell that will get the data via SSH? When I try Winsock the access is denied, maybe because it gets data via telnet? which is problematic for my firmware

Regards :-/
Title: Re: Linksys + dd-wrt + arduino
Post by: igorreal on Dec 19, 2010, 12:56 am
Hi,

Look at this method..... it´s nice. You can download ser2net
http://www.andrewhazelden.com/blog/2010/01/how-to-use-the-serial-ports-on-a-linksys-wrt54gs-with-dd-wrt-v24/
http://todbot.com/blog/2010/12/16/wifi-for-arduino-with-asus-wl-520gu/

And use a virtual serial port:
http://www.hw-group.com/products/hw_vsp/index_en.html


;)
Title: Re: Linksys + dd-wrt + arduino
Post by: mrmeval on Dec 19, 2010, 05:47 am
http://www.dailywireless.org/2009/02/24/marvells-99-wall-wart-computer/

I've not seen this disassembled but it is Arm based and 99 dollars.