Close
0%
0%

Remote AVR ISP/Bus Pirate

Development workstation on one side of the room, workbench on the other...

Similar projects worth following
938 views
I've done this before for Arduino development, however, the setup had some limitations. It only worked with serial devices (using ser2net), the Arduino IDE couldn't be configured to use the export serial port (is supported by AVRDude).

This time I will run through the setup that should allow almost any USB device to be used. In my case I export a USBTiny ISP and a BusPirate. On the client the devices show up as if they are plugged in locally, no special configuration required for avrdude etc.

This setup requires GNU/Linux (examples are for Debian/Ubuntu distributions).

usbip-client-tools.conf

Ensures that the kernel module is loaded. On Debian systems, this should be copied to /etc/modules-load.d/

conf - 143.00 bytes - 02/25/2017 at 11:02

Download

usbip-server-tools.conf

Ensures that the kernel module is loaded. On Debian systems, this should be copied to /etc/modules-load.d/

conf - 38.00 bytes - 02/25/2017 at 10:46

Download

91-usbip-server-tools.rules

UDEV rules file for FTDI and USBTiny. On Debian systems, this should be copied to /etc/udev/rules.d/

rules - 315.00 bytes - 02/25/2017 at 10:46

Download

  • Bus Pirate and Kernel Deadlocks

    Tim Savage03/06/2017 at 20:58 0 comments

    One of the downsides I've come accross is the bus pirates USB connection can be flaky at times, this manifests itself with a Kernel deadlock on the client system (whole machine freezes) I've not managed to obtain any debug information as the only way to resolve the situation is with a hard reboot.

    The USB Tiny does not suffer the same issue. The work around is to simply access the Bus Pirate serial port over SSH or using the previous serial2tcp tool for the bus pirate and leaving this work around for the USBTiny.

View project log

  • 1
    Step 1

    Intro

    This guide goes through the setup of both client and server. It was written with a Debian/Ubuntu GNU/Linux system in mind, however, all of the tools are common to all Linux distributions, instructions can easily be adapted (instructions will happily be accepted and added for other distributions).

    A deb package is available that automates steps 2 & 3, these are available from https://github.com/timsavage/usbip-tools/releases

    This solution uses USBIP to export the USB device and some UDEV rules to automate the exporting when a device is plugged in.

    Security

    A note on the security of this solution. usbipd does not include any security mechanisms, similar to other UNIX protocols (eg NFS). To make this solution secure some suggestions would be:

    • Configure your firewall rules to only allow access from white listed IPs
    • Configure usbipd to listen on localhost only and tunnel over SSH
  • 2
    Step 2

    Server Setup

    Note: Before continuing ensure you do not have the Debian usbip package installed. This package is out of date and the project has since been merged into the kernel proper.

    Install the USBIP kernel module and tools:

    # Install the Linux tools package
    $ sudo apt install linux-tools-generic
    
    # Ensure the kernel module is inserted
    $ sudo modprobe usbip_host
    

    To ensure the module is loaded on restart add the following to the file /etc/modules-load.d/usbip-server-tools.conf

    # USBIP Host module loaded
    usbip_host
    

    Finally start the usbip daemon to export the devices:

    # Start USB IP as a daemon (-P will create a PID file /var/run/usbipd.pid)
    $ sudo usbipd -D -P
    

    Add UDEV rules to automatically export devices when they are plugged in, add the following to the file
    /etc/udev/rules.d/91-usbip-server-tools.rules

    # Auto bind any FTDI device (well any product that includes an FTDI interface).
    SUBSYSTEM=="usb" ATTRS{idVendor}=="0403" ATTRS{idProduct}=="6001" RUN+="/usr/bin/usbip bind -b $kernel"
    # Auto bind a USBTiny ISP
    SUBSYSTEM=="usb" ATTRS{idVendor}=="1781" ATTRS{idProduct}=="0c9f" RUN+="/usr/bin/usbip bind -b $kernel"
    
  • 3
    Step 3

    Client Setup

    Install the USBIP kernel module and tools:

    # Install the Linux tools package
    $ sudo apt install linux-tools-generic
    
    # Ensure the kernel module is inserted
    $ sudo modprobe vhci-hcd
    

    To ensure the module is loaded on restart add the following to the file /etc/modules-load.d/usbip-client-tools.conf

    # USBIP Host module loaded
    vhci-hcd
    

View all 5 instructions

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates