Author Topic: Asus router & Axon  (Read 2821 times)

0 Members and 1 Guest are viewing this topic.

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Asus router & Axon
« on: November 10, 2011, 07:57:09 PM »
http://todbot.com/blog/2010/12/16/wifi-for-arduino-with-asus-wl-520gu/

     Is there Axon equivalent software (step 4 in the project linked) to interface easily with this Asus WL-520gu router?  I'm new to networking/programming and am hoping this step by step build won't be too hard to follow.

My goal is to use a router & webcam to control a vehicle from a laptop. 

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #1 on: November 11, 2011, 01:48:29 AM »
Do you just want wireless or must it be wifi? Does it have to be the Asus specifically or any router?

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #2 on: November 11, 2011, 09:55:02 AM »
I've read that WiFi can have more range than bluetooth.  And if this will work with an Asus, it will be cheaper than buying the bluesmirf and dongle.  

The router doesn't have to be an Asus, but it's nice to have the steps laid out like in the linked build.
« Last Edit: November 11, 2011, 10:29:57 AM by Rent2Own »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #3 on: November 11, 2011, 11:06:04 AM »
What range you need? You can get 100m with bluetooth class 1.

Plenty of serial to wifi adapters.

Also worth considering my Zigbee wireless product:
http://www.societyofrobots.com/axon_mote/

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #4 on: November 11, 2011, 12:02:26 PM »
The Asus router used in that project is $25 on Amazon (after a rebate).  The serial to wifi adapters I browsed were several times as expensive.  I've already bought the Axon, so the mote would be overkill and still more money than this router.  I had also planned to run the webcam through the router. Bluetooth can't send as much info. (i.e. video) as WiFi, right?

I would like as much range as I can get for the least amount of money.
« Last Edit: November 11, 2011, 12:03:40 PM by Rent2Own »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #5 on: November 11, 2011, 12:08:40 PM »
hmmmm in that case I will forward this to Webbot.

(my personal opinion is it's sometimes better to spend $50 more if it saves you 30 hours of headaches :P)

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #6 on: November 11, 2011, 12:16:21 PM »
Thanks for the help.   I'm just on a tight budget.

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 752
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Asus router & Axon
« Reply #7 on: November 11, 2011, 01:37:57 PM »
My impression on reading that is that you don't need any special software for the Axon, it's just acting like a giant xbee serial connection.  USB on router to USB on Axon, and serial port on computer end sends/receives stuff.
I

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,166
  • Helpful? 111
Re: Asus router & Axon
« Reply #8 on: November 11, 2011, 01:57:47 PM »
My impression on reading that is that you don't need any special software for the Axon, it's just acting like a giant xbee serial connection.  USB on router to USB on Axon, and serial port on computer end sends/receives stuff.
That's my 'first impression' as well. But if we are wrong then I don't have the time and hardware to work on it at the moment. I've got other more pressing stuff to concentrate on. Not enough hours in the day....
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #9 on: November 11, 2011, 03:55:01 PM »
NOTACON 6 - Hacking the Asus WL-520gU Wireless Router


This video explains how to hack/setup this specific router.  I'm linking this for anyone who may want to do something similar in the future.  Towards the end of the video there are links to both his website/forum and step by step instructions.
----Edit----
The video has good background info, but I wound up not using his build at all. Keep reading for more relevant instructions for this project.
« Last Edit: December 04, 2011, 02:02:44 PM by Rent2Own »

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 752
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Asus router & Axon
« Reply #10 on: November 11, 2011, 05:40:07 PM »
I should get a router of my own so I'm not paying $10/month to my internet provider to use one of theirs... but I'm so busy >.>
I

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #11 on: November 11, 2011, 05:42:06 PM »
Asus WL-520gu is $25 after rebate on Amazon & free shipping with the "prime" trial.

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 752
  • Helpful? 23
  • Nuclear Engineer Roboticist
Re: Asus router & Axon
« Reply #12 on: November 11, 2011, 05:56:12 PM »
Asus WL-520gu is $25 after rebate on Amazon & free shipping with the "prime" trial.

Ya, but is it a good router, is the question in my case. I don't have the time or will to research routers to define and then find what fits my idea of good :)
I

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #13 on: November 13, 2011, 11:46:31 AM »
Found this detailed page on how to install dd wrt firmware on the router.
http://www.dd-wrt.com/wiki/index.php/Asus_WL-520GU#New_Wiki_Install_Material

This is the first of two things you have to do.  Within the page there are instructions for uploading all the software: both the initial firmware flash (.trx file) & the final build (.bin file).  The easiest method is to use the "Asus Firmware Restoration Utility" on a Windows XP machine (or bootcamp partition on mac - do not use a virtual machine running WinXP).
« Last Edit: December 04, 2011, 02:06:25 PM by Rent2Own »

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #14 on: November 29, 2011, 08:47:30 PM »
I've spent a lot of time so far on setting this router up for this project but no luck.  I've made some posts on the dd wrt forums with specific questions that I'm now waiting on, but in the mean time I have a general question about this project I figured I'd leave here.

Could I connect both a wired webcam (via ethernet) and the axon (via USB) to this wireless router the way it is (factory default setup) and have the router communicate wirelessly with my laptop (I have a wireless card)?  I'm making sure all this dd-wrt trouble is necessary.  (I assume it is necessary based off a few RC car//router build threads I've seen elsewhere)

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #15 on: November 29, 2011, 09:26:45 PM »
Could I connect ... the axon (via USB) to this wireless router the way it is (factory default setup) and have the router communicate wirelessly with my laptop (I have a wireless card)? 
I'd assume this will work, but I've never tried. I'm concerned about USB driver issues. What software on the computer side do you plan to use to access the Axon over wi-fi? (it's probably in that video, but I didn't watch it)

Just hook it up and see what happens :P

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #16 on: November 29, 2011, 09:31:44 PM »
I connected the axon (it's programmed) & a servo to the router via USB.  I sent a command over Z Term but nothing happened.  The baud rate was 115,200. 

I tried this with the laptop connected wirelessly to the router, just an ethernet cable to the router, & even both at the same time.  I did not change anything to do with IP addresses, but I was definitely  connected to the router via both wireless and ethernet (I checked network preferences to see).
--------

I also had a serial (ttl) to usb cable connected to the router.  I have the driver installed and this cable def works.  (I soldered a serial connection on the router)
« Last Edit: November 29, 2011, 09:33:52 PM by Rent2Own »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #17 on: November 29, 2011, 10:00:48 PM »
I did a 3 sec google search and found this:
http://homepage.mac.com/dalverson/zterm/

Read the section "Why can't ZTerm talk to my device?"
Code: [Select]
For any non-Apple ports (like a USB to Serial adapter), you usually need a driver installed that
will allow applications to use that port. This is true of OS 8/9 and OS X - and a driver for OS X is very
different from older OS 8/9 drivers. Under OS X, ZTerm searches the IO Registry for entries of type
IOSerialBSDClient to build its list of available serial ports. If ZTerm is not showing your serial port,
you can look in the IO Registry to see what is there. Open Terminal.app and type the command
ioreg -c IOSerialBSDClient which will dump out all entries in the registry. For entries that are in the
IOSerialBSDClient class, it will show the properties under that entry. If your device does not show
up in the list, or does not have an IOSerialBSDClient entry with it, then ZTerm will not be able to use
it. You probably need an OSX driver for the device (which may or may not exist).
Here is a part of the ioreg output for an internal modem:

 +-o AppleSCCSerial 
   +-o AppleSCCRS232SerialStreamSync 
     +-o AppleSCCModem 
       +-o IOSerialBSDClient 
           {
             "IOTTYBaseName" = "modem"
             "IOPersonalityName" = "IOSerialBSDClientSync"
             "IODialinDevice" = "/dev/tty.modem"
             "IOProviderClass" = "IOSerialStreamSync"
             "CFBundleIdentifier" = "com.apple.iokit.IOSerialFamily"
             "IOCalloutDevice" = "/dev/cu.modem"
             "IOMatchCategory" = "IODefaultMatchCategory"
             "IOTTYDevice" = "modem"
             "IOClass" = "IOSerialBSDClient"
             "IOProbeScore" = 1000
             "IOTTYSuffix" = ""
             "ParentKey" = "KEXTBundle?com.apple.iokit.IOSerialFamily"
             "IOSerialBSDClientType" = "IOModemSerialStream"
           }

Are you sure zterm is showing the proper port for the Axon? Make sure you have the USB driver installed. Then program your Axon to send out a continuous stream of data using rprintf to verify, first by plugging it in directly to your mac USB port to make sure the adapter/code is working, and then to the router.

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #18 on: November 29, 2011, 10:17:49 PM »
I can boot up the router with that serial/usb cable connected and see all the router's code while it's doing it.  Doesn't that mean the cable's driver is installed?

Based on alot of networking stuff I've read over the last week or more, I wonder if the communication barrier here has to do with how IP stuff is setup?  (I think my cables all work and have the appropriate drivers). 
« Last Edit: November 29, 2011, 10:25:58 PM by Rent2Own »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #19 on: November 29, 2011, 10:52:42 PM »
Program your Axon to send out a continuous stream of data using rprintf to verify. Plug it in directly to your mac USB port to make sure the adapter/code is working, then try again using the router.


ps - I know almost nothing about macs  :P

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #20 on: November 30, 2011, 11:18:21 PM »
Admin, I plan to use your rprintf idea soon.  Would that be something like:

while (1) {                        //I took a java class in college and have forgotten most of it.
             rprintf("Working");
                 }
       
     

After doing some reading, I'm almost sure I don't need to do anything (installing dd-wrt, etc) to the router to view a network (IP) cam that would be on the vehicle. 

*So the only thing left to sort out is whether all that dd-wrt stuff (installing linux on the router) is necessary to send commands in this chain:  Laptop wirelessly over closed LAN to router, router to Axon via USB.  (I just realized I think this means setting an IP address to the axon somehow)


« Last Edit: November 30, 2011, 11:20:41 PM by Rent2Own »

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,666
  • Helpful? 169
    • Society of Robots
Re: Asus router & Axon
« Reply #21 on: November 30, 2011, 11:29:05 PM »
Yeap it's correct. Best to add in a delay, though.
Code: [Select]
while (1) {
        rprintf("Working");
        delay_ms(250);
}

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #22 on: December 04, 2011, 02:34:31 AM »
Ok.  I have the dd wrt software installed on the router.  All that's left now is to change some settings (looking them up tonight), and it will be ready to interface with the Axon and an IP camera. 

For anyone considering this project:
If you use this router (asus wl-520gu) and have access to Windows XP, it's very easy to get the software installed.  It took me a long time because I kept trying to flash it with WinXP running on a virtual machine on the mac.  This won't work.  You have to setup a boot camp partition, or use a windows machine.  I'll be back soon with more info. 

Offline seawolf

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 2
Re: Asus router & Axon
« Reply #23 on: December 17, 2011, 02:34:50 PM »
I'm a grad student working on a robotics project. We've been able to send signals to an arduino Mega over wireless using this router.

We were able to make the whole wireless interface transparent to serial commands using the following commands (on a linux maching)((on the laptop side)).   I believe this should work for any router with a serial device attached, but don't quote me on that.

socat -d -d pty,raw,echo=0 TCP:192.168.1.1:3001
sudo ln -s /dev/pts/12 /dev/ttyS4


The first command creates a virtual serial port (pty) with one end 'connected' to the router.  Note, you'll have to get socat before you can use this command.
The second command renames the virtual connection from a 'fake' serial port to a 'real' one, so that it appears as a device plugged into the computer.

Some quick notes:
 192.168.1.1:3001 is the IP address of the router and the port number for the USB interface.
/dev/pts/12 is the virtual comm port that is created. This value should be displayed after the socat command is called.
/dev/ttyS4 is a valid, unused name for a comm port. Check to make sure you're not using the name of an existing comm port. That would be bad.



We tested this interface using the arduino's serial monitor, and were able to successfully sent and receive messages. (note that the baud rate has to be set to match the ser2net baud rate). In theory we should be able to reprogram our arduino wirelessly using this method, but we haven't tried to do so.

I apologize if any information here is incomplete or inaccurate, I'm a hardware guy.

For more information, look up pseudoterminals and socat.

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #24 on: December 17, 2011, 03:22:30 PM »
Thanks for information.  Just recently I installed some drivers and ser2net on my router. I've been trying to change parts in this script to get it all to work:

# ser2net -C "3001:raw:600:/dev/usb/tts/0:57600 NONE 1STOPBIT 8DATABITS -XONXOFF -LOCAL -RTSCTS"

I imagine your method doesn't require a program like ser2net on the router?  And did I read your post correctly; I need a computer running linux to use that? 

This project has required a lot of learning on my part to really interpret and use advice when given.  So it may be a while before post any results.  Thanks again for the input.


Offline seawolf

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 2
Re: Asus router & Axon
« Reply #25 on: December 17, 2011, 03:49:31 PM »
You'll still need Ser2net running on the router. 
The commands I gave are for the laptop side of things. When you have both the router and the laptop configured properly, whatever device you plug into the router should behave as though it was plugged directly into a USB port on the computer.

Can you explain what troubles you are experiencing with ser2net? I might be able to help.

Offline seawolf

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 2
Re: Asus router & Axon
« Reply #26 on: December 17, 2011, 04:33:08 PM »
I threw together a couple of pictures to help you understand whats going on.

http://imgur.com/a/HFKZj#0

Note that there are actually two different images there.

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #27 on: December 17, 2011, 04:35:40 PM »
When I use the top command in Terminal.app (SSHd into router), I see ser2net running (after I've used the script below).  I've seen the drivers installed and recognized by using the lsmod command.

# ser2net -C "3001:raw:600:/dev/usb/tts/0:57600 NONE 1STOPBIT 8DATABITS -XONXOFF -LOCAL -RTSCTS"

*When I run this in the router's web GUI "Commands" section, it gives me the error message:
"sh: eval: line 1: ser2net: not found"

I pulled up a second Terminal box:
# telnet 192.168.1.1 3001     
..and got "connected" then "rejected by a foreign host"  (I wasn't connected to my home network/router, just the dd wrt router I'm working on.  But the dd wrt router is connected as a "Client" to my home network)

1)  Axon uses a baud of 115,200 (from what I've read).  Other than just putting that in place of 57,600 in this script, is there anywhere else on the router I need to change this?

2)  I'm also unsure of how I can know for sure if my single USB port on the router, to which my Axon is connected, is /usb/tts/0.         (the router's firmware uses "tts" not "ttyS")

*Note:  The Axon MCU is programmed to say "working" over and over.

Offline Rent2OwnTopic starter

  • Jr. Member
  • **
  • Posts: 39
  • Helpful? 0
Re: Asus router & Axon
« Reply #28 on: December 17, 2011, 04:38:18 PM »
Man I've been looking for a flow diagram that explains what's going on like that for a while.  I appreciate you putting that up.

So when everything's set up, I will see the Axon saying "Working" over and over through Terminal? 
« Last Edit: December 17, 2011, 04:47:52 PM by Rent2Own »

Offline seawolf

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 2
Re: Asus router & Axon
« Reply #29 on: December 17, 2011, 05:04:30 PM »
I'll forward this on the the software guys and see if they can be of any help. (Winter break just started, so it could be a while.)

Until then, i'll take a stab at it.
1.  Throwing 115200 into the ser2net command should be all you need to do.
2.  Can you use the 'ls' command to look for the USB port? Linux commands are a little different on the router, but you should be able to do:

cd /dev/usb
ls 

and

cd /dev/usb/tts
ls


I have no idea what the output of that will actually be (if it works at all), but it might help in tracking down the usb port.
If anything remotely interesting looking pops up, screen cap it and post it here.


Oh, and how much programming experience do you have? That way I can give you the appropriate amount of instruction.

 


Get Your Ad Here

data_list