USB/IP WiFi programming with openwrt

Status
Not open for further replies.

ian

Well-known member
I've noticed a few people on here using openwrt. Some time ago I posted a link to some of my dabbling with openwrt on a TP-Link 703.
I've recently extended this using USB/IP to program a remote Arduino over WiFi. This works wonderfully BUT I can only get it to work with a plain vanilla Arduino :(
Teensy (2.0 & 3.0) doesn't want to know & a Leonardo 'blue screens' my PC!

Maybe this isn't the place to post this as it doesn't work with Teensy, then again, maybe someone with a little more time & skill will have better success?
I did succeed in attaching a Teensy programmed as a HID device; this worked ALMOST perfectly :)

The page describing this stuff is here: http://www.cse.dmu.ac.uk/~sexton/ENGD2003/openwrt/arduino teensy openwrt.html

The USB/IP stuff is half way down the page.

This began as a kind of blog to enthuse some of my students, hopefully it's of wider interest.

Cheers

Ian
 
Who cares where you post it. It would be very nice to get this to work on the Teensy platform.
In my LED lighting system http://trippylighting.com I am using a Teensy++2 connected to a WIZ812MJ Ethernet Module and that is connected to a TP-Link 703 Router. The ability to program remotely through WiFi is very interesting.

I just skimmed through your blog but I guess I'd loose the ability to use UDP/OSC through that connection. I use TouchOSC on my iDevices to control my lighting system. The Teensy++2 runs a little OSC server and announces the OSC service on my network.
 
Last edited:
Actually, with the Arduino Yún being announced your post could not be more timely. The Yún uses the same WiFi chip as the TP-Link TL WN 703n.
It would be interesting to see what interface they are using for communication between the Arduino and WiFi chip ;-)
 
Last edited:
I believe it is SPI. Maybe this will motivate development of a higher performance SPI library....

My reaction to the Arduino Yún is: Why were they content to put a 32u4 in it when they could have put a faster chip with capacitive sensing in
like a PIC32 or the ARM that Paul chose for Teensy 3.0?
 
Speed is not necessarily the issue. Before the Teesny3 was introduced I chose a Teensy++2 for a project because De to the libraries used the code size started exceeding the available memory on the Arduino board.
Whatever their rationale is, it may not be only for technical reasons. However, performanvce wise it seems a bit mismatched to match an Atheros 400MHz WiFi chip with several hundred MB of memory with a little 16 MHz microprocessor.
There are at least a couple of FastSPI libraries in development, with one being discussed on this forum.
 
I've noticed a few people on here using openwrt. Some time ago I posted a link to some of my dabbling with openwrt on a TP-Link 703.
I've recently extended this using USB/IP to program a remote Arduino over WiFi. This works wonderfully BUT I can only get it to work with a plain vanilla Arduino :(
Teensy (2.0 & 3.0) doesn't want to know & a Leonardo 'blue screens' my PC!

Maybe this isn't the place to post this as it doesn't work with Teensy, then again, maybe someone with a little more time & skill will have better success?
I did succeed in attaching a Teensy programmed as a HID device; this worked ALMOST perfectly :)

The page describing this stuff is here: http://www.cse.dmu.ac.uk/~sexton/ENGD2003/openwrt/arduino teensy openwrt.html

The USB/IP stuff is half way down the page.

This began as a kind of blog to enthuse some of my students, hopefully it's of wider interest.

Cheers

Ian

Hi Ian,

I've managed to program my Teensy3 over USBIP once before it disconnects and re-enumerates and having to set it all up again...
Forgot how I did it now ;) But will definitely try again next time [Did it on a Carambola2, but will of course try TL-WR703N].

PS : Madox = He :p
 
It almost works with Teensy! We'll have to lobby Paul to take a look at this ;) I might have persevered longer with USBIP but the BSODs were becoming a nuisance.

Cheers

Ian
 
I googled the Arduino Yun. Looks interesting :)

$69 +tax isn't cheap though, that's twice the price of a TPLink 703 & Teensy. Closer integration is a good idea from a s/w perspective but I'm not sure about h/w. Apparently the interface is SPI & UART so why not just make a WiFi shield with the Atheros SoC? It wouldn't be limited to the 32u4 that way.

Keeping the devices separate has some less obvious advantages too. My current project uses the TPLink box purely for comms, a Teensy captures data & passes it on. A webserver shows live data and daily reports are created & sent via SFTP to a remote machine as a cron job. Another cron job creates 'empty' files first thing in the morning.

I'm using the Teensy as a keyboard for now - it types linux shell commands to manipulate/transfer data, eg

Keyboard.println("file=/www/log_`date +'%d%m%Y'`.html");

Creates a shell variable for the daily page.

Because I'm using a keyboard interface I can connect (SSH) to the TPLink with eg putty from my laptop. Plug in Teensy to my laptop and it types into the terminal window. Remotely programming Teensy would be better but this isn't a bad compromise! ;)

At $20 a pop the TPLink 703 will give you hours of err fun...

Ian
 
What's the difference between a TPlink 702 vs 703? Turns out I actually have a 703 here, brand new and still in the box. But I could pretty easily get a 703 if it's different....
 
What's the difference between a TPlink 702 vs 703? Turns out I actually have a 703 here, brand new and still in the box. But I could pretty easily get a 703 if it's different....

The 702 doesn't have enough memory to install opeenwrt.

Ian
 
It almost works with Teensy! We'll have to lobby Paul to take a look at this ;)

Sure, I'm open to suggestions. I've also got an extremely long to-do list, but if this is already pretty close, maybe it won't be a big deal?

Please start a thread in the suggestions forum. The odds of it ever happening are much better if you put more work into writing a good message that contains all the info, links to all necessary technical resources, and a good explanation about why this is needed.

I usually can implement stuff pretty easily, but setting up the hardware, software and configuration to test is usually a time consuming effort. It really helps if you can be very specific about what hardware and software are needed. I strive to implement everything on Linux, Mac and Windows (in that order), so it really helps if you can give me detailed setup info for all 3 platforms. If I have to figure out how to set up unfamiliar hardware and software, it's a huge drain on my time that could be used for writing code!
 
Cheers Paul,

I'll try to start a constructive thread in suggestions on this subject. As you're playing with Beaglebones already I'm sure you understand the interfacing issues.

Ian
 
The 702 doesn't have enough memory to install opeenwrt.

Ok, I ordered a 703 from Amazon. That doesn't necessarily mean I'll actually do anything with it (the 702 is still unopened), but it will be here probably in a week.

I do keep a written to-do list with links to forum threads for stuff I intend to implement. So I'll be looking for that suggestion thread. Remember, I've never used one of these... not even opened the 702, so the more specific you can be about all the steps I need to take here to set up the system where Teensy should work, the more time I can spend on actually writing code vs fiddling with Linux and routers.
 
Hi Ian/Paul -

I don't think your BSODs are actually the fault of Paul in any way...You might be better off digging up if they've ever gotten around to compiling newer Windows client drivers for USBIP.

It would be useful if Paul tells me how the Teensy load sequence works :) Then I can spend my useless time trying to get WiFi programming working, and he use his valuable to improve the Teensy3!
-----
Just generally a fact of life is that after a Teensy3 has been programmed, it will re-enumerate on the USB bus I believe. The trick might be as simple as a script that re-attaches the Teensy3 ASAP.

I have a particular interest in this WiFi programming as we're marrying the Carambola2 & K20 & Paul's MINI54TAN on a custom hobby board. It will not look like this...

The TL-WR703N probably has more people using it so I'll move to testing using that...
Also now that I know Paul is alive... I'll bug him again on MINI54s :)
 
I don't know, the Yun seems a bit odd to me. Kinda like, Would you like an arduino with your wifi module?

It's kinda cool, but too expensive (for what else is out now), and why such a big USB connector? As an aside, it seems there's a need for a small connector to replace the RJ-45 connector, and use a dongle.

For the price, you could have a teensy3, Rpi, and a usb-wifi module, which is a lot more powerful, and be the same size.
 
Whatever their rationale is, it may not be only for technical reasons. However, performanvce wise it seems a bit mismatched to match an Atheros 400MHz WiFi chip with several hundred MB of memory with a little 16 MHz microprocessor.
 
Status Update : I have just tested USBIP over a TL-WR703N with some success.

Currently testing with the USBIP image from http://www.madox.net/blog/projects/tp-link-tl-wr703n/ (2013-02-23)

1)The Teensy is connected to the USB port of the TL-WR703N
2)The TL-WR703N is connected to my home WiFi, it has an IP address of 192.168.1.8, with the firewall settings set to LAN

I am currently testing with Ubuntu 10.04 but will move to Windows XP and Windows 7 later...

On the TL-WR703N, I set up with these following commands
root@Madox_USBIP_Test:/# usbip list -l
Local USB devices
=================
- busid 1-1 (16c0:0487)
1-1:1.0 -> unknown
1-1:1.1 -> unknown
1-1:1.2 -> unknown
1-1:1.3 -> unknown
1-1:1.4 -> unknown

root@Madox_USBIP_Test:/# usbip bind -b 1-1
bind device on busid 1-1: complete

root@Madox_USBIP_Test:/# usbip list -l
Local USB devices
=================
- busid 1-1 (16c0:0487)
1-1:1.0 -> usbip-host
1-1:1.1 -> usbip-host
1-1:1.2 -> usbip-host
1-1:1.3 -> usbip-host
1-1:1.4 -> usbip-host

root@Madox_USBIP_Test:/# usbipd -D

On the Ubuntu 10.04 x64 Laptop I have I set up with these commands
sudo modprobe vhci-hcd
sudo modprobe usbip

johnchan@johnchan-laptop:~$ sudo usbip -l 192.168.1.8
- 192.168.1.8
1-1: VOTI : unknown product (16c0:0487)
: /sys/devices/platform/ehci-platform/usb1/1-1
: Miscellaneous Device / ? / Interface Association (ef/02/01)
: 0 - Communications / Abstract (modem) / AT-commands (v.25ter) (02/02/01)
: 1 - CDC Data / Unused / unknown protocol (0a/00/00)
: 2 - Human Interface Device / Boot Interface Subclass / Keyboard (03/01/01)
: 3 - Human Interface Device / Boot Interface Subclass / Mouse (03/01/02)
: 4 - Human Interface Device / No Subclass / None (03/00/00)

johnchan@johnchan-laptop:~$ sudo usbip -x 192.168.1.8
- 192.168.1.8
8 ports available

port 0 attached

On every programming/reboot, the USB on the Teensy reboots and the USBIP connection is lost.

To compensate I tried to hack it...
johnchan@johnchan-laptop:~/arduino-1.0.5$ cat hardware/tools/teensy_reboot
#!/bin/sh

./hardware/tools/teensy_reboot_original

sudo usbip -x 192.168.1.8

Basically I renamed the original teensy_reboot into teensy_reboot_original, then substituted a new teensy_reboot script that calls the original as well as try to reattach the usbip connection.

This kind of works - but programming only goes through (the progress bar flashes up) on the Teensy loader every second attempt. i.e. I have to press Upload twice before it programs.

Status update end :p 30 minutes of testing was fruitful...
 
I tried Windows - I give up on Windows ;)

ian : Please see this thread regarding your BSODs
http://sourceforge.net/p/usbip/discussion/418507/thread/7ff86875/

It appears the 'current' (aka 2011) 0.2.0.0 drivers don't handle HID devices well and I think Teensy3 is a HID device for programming purposes...
There are a number of compiled windows clients in that thread but I've not been able to get them to work. You might have better luck.

Sorry for giving up on Windows :) I normally don't use Windows :)
 
Status
Not open for further replies.
Back
Top