Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 20 of 20

Thread: USB/IP WiFi programming with openwrt

  1. #1

    USB/IP WiFi programming with openwrt

    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/ENG...20openwrt.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

  2. #2
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    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 by Headroom; 05-22-2013 at 01:09 AM.

  3. #3
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    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 by Headroom; 05-22-2013 at 10:41 PM.

  4. #4
    Senior Member
    Join Date
    Mar 2013
    Posts
    125
    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?

  5. #5
    Senior Member
    Join Date
    Jan 2013
    Posts
    966
    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.

  6. #6
    Quote Originally Posted by ian View Post
    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/ENG...20openwrt.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

  7. #7
    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

  8. #8
    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

  9. #9
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,326
    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....

  10. #10
    Quote Originally Posted by PaulStoffregen View Post
    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

  11. #11
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,326
    Quote Originally Posted by ian View Post
    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!

  12. #12
    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

  13. #13
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,326
    Quote Originally Posted by ian View Post
    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.

  14. #14
    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

  15. #15
    Senior Member
    Join Date
    Jan 2013
    Location
    San Francisco Bay Area
    Posts
    641
    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.

  16. #16
    puser
    Guest
    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.

  17. #17
    Senior Member
    Join Date
    Mar 2013
    Posts
    125
    They don't need to have a rationale. Arduino designs emerge from exercises of charismatic authority: http://en.wikipedia.org/wiki/Tripart...n_of_authority

  18. #18
    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...

  19. #19
    I tried Windows - I give up on Windows

    ian : Please see this thread regarding your BSODs
    http://sourceforge.net/p/usbip/discu...read/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

  20. #20
    I think Ian started the thread as http://forum.pjrc.com/threads/23741-...g-with-openwrt but it looks like the issue might be that USB/IP cli connects a specific remote USB to a local USB on invocation, but perhaps USB/IP isn't re-connecting as needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •