Using USB Accessories¶
The SNAPconnect E20 has drivers to support many USB devices, such as a second SNAP-powered bridge (using an SN220 or SN132 carrier board), Wi-Fi devices, cell modems, or external storage. While the complete details of configuration options available on these devices fall outside the scope of this document, there are some common considerations that may prove useful.
USB Power¶
The USB 2.0 connection on the E20 is not rated as a “battery-charging” connection, and may not provide sufficient current for high-drain devices, such as some external hard drives. If you find you are having problems with your USB devices (e.g., external hard drives failing to mount, or cellular connections losing their connections), we recommend you try connecting the device to the E20 through a powered USB hub.
Connecting to an Additional SNAP Device¶
The E20 can support a second SNAP-powered node through its USB port. You can connect an SN132 or SN220 SNAPstick, or you can use an FTDI USB-serial cable to connect to an SN171 ProtoBoard or some other hardware that uses a DB9 connector to make an RS232 serial connection. This can allow your E20 to act as a bridge between two radio subnets, where radios are on some combination of different frequencies, different network IDs, and/or different channels.
Whichever device you use, plug the device into the E20’s host USB port and (among other messages) you should see something similar to:
usb 1-1: FTDI USB Serial Device converter now attached to ttyUSB0
or:
usb 1-1: cp210x converter now attached to ttyUSB0
The key here is the line that says converter now attached to ttyUSB#
.
You will use this device handle,``ttyUSB#``, to communicate with the SNAP device.
In your SNAPconnect application, you would open a connection to the device like this:
com.open_serial(type=SERIAL_TYPE_RS232, '/dev/ttyUSB0')
Using usb_modeswitch¶
Many USB Wi-Fi and cell modems now come with a small amount of onboard storage,
typically used to automatically install drivers when connected to a Windows host.
When the device first connects, it appears as a small flash drive or virtual CD-ROM.
After installing the necessary drivers, the Windows host sends a signal to the device instructing it to
“mode switch” – to unmount the storage and expose itself as a Wi-Fi (or cellular) device.
Ubuntu Linux also automatically handles many of these devices, but there may be some out there
that Ubuntu does not recognize by default.
If you find that the E20 is not recognizing your device, consider installing usb_modeswitch
,
which contains a library of parameters for converting devices like these.
sudo apt-get install usb-modeswitch
Then, plug your device in again and you are likely to find that it works as expected.