diff --git a/cmake_targets/autotests/v2/actions/bandrich.txt b/cmake_targets/autotests/v2/actions/bandrich.txt index 94a6f3f4c0e514f4649d4c3024cb653c4e2e7c5d..8533750c5b1e2633ce8b0d41e7c22257ae596218 100644 --- a/cmake_targets/autotests/v2/actions/bandrich.txt +++ b/cmake_targets/autotests/v2/actions/bandrich.txt @@ -1,29 +1,47 @@ -To get /dev/bandrich (so that you don't need to look for which /dev/ttyUSBx -is used by your dongle, and always use /dev/bandrich), add a udev file: +The configuration for the bandrich in the test setup is a bit hackish. + +Here come some notes explaining what we do here. + +To get /dev/bandrich.data and /dev/bandrich.control (so that you don't need +to look for which /dev/ttyUSBx are used by your dongle, and always use +the same files, no matter what), add a udev file: /etc/udev/rules.d/bandrich.rules -containing one line: +containing lines: - SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich", MODE="0666" + SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="00", SYMLINK+="bandrich.data", MODE="0666" + SUBSYSTEM=="tty", ENV{ID_VENDOR_ID}=="1a8d", ENV{ID_MODEL_ID}=="100d", ENV{ID_SERIAL_SHORT}=="357473040068155", ENV{ID_USB_INTERFACE_NUM}=="02", SYMLINK+="bandrich.control", MODE="0666" Change vendor_id/model_id/serial/interface num to match yours. -Use lsusb -v to find values. For interface num, I'm not sure. -It corresponds to /dev/ttyUSBx (the x). I did: +Use lsusb -v to find values. + +At first we used /dev/ttyUSB2 linked to /dev/bandrich for both data (in +the wvdial configuration file) and control (in the python code, opening +/dev/bandrich the standard unix way and read and write into it, with no +special libusb commands). - cat /dev/ttyUSBx +But it turned out that using /dev/ttyUSB2 for data gives bad throughput +results. We tested downlink UDP at 15Mb/s but the maximum throughput for +a 5MHz cell was around 13, and we had a lot of packets lost at the iperf's +UDP level. Radio was looking fine (all packets acked correctly), so it was +not a radio problem. The dongle in a windows machine was working fine, +15Mbs/s. Using the wvdial configuration file from test setup v1 gave also +good results. The only difference was the use of /dev/ttyUSB0 instead of +/dev/ttyUSB2. Using /dev/ttyUSB0 solved the throughput issue. -in one terminal, and: +But using /dev/ttyUSB0 for control in the pyton code did not work. The +output was incorrect. - echo -e "AT\r" > /dev/ttyUSBx +So we decided to have /dev/bandrich.data linked to /dev/ttyUSB0 for data +(wvdial) and /dev/bandrich.control linked to /dev/ttyUSB2 for control +(in python code). -in another one. And I took a number for which the first terminal displayed: +It may not be the correct way to go, but it seems to do the trick so far. - AT - OK +Your device may need some other solution. -"02" (/dev/ttyUSB2) worked for me. -Here, I get, as result of lsusb -v: +Here, we get, as result of lsusb -v: [SNIP] Bus 003 Device 009: ID 1a8d:100d BandRich, Inc. 4G LTE adapter @@ -56,7 +74,7 @@ The command: is also important to get the right identifier to put in ENV{}. (It also gives the correct value.) -Here is extracted what I have for my dongle: +Here is extracted what we have for our dongle: P: /devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2/3-1.2:1.2/ttyUSB2/tty/ttyUSB2 N: ttyUSB2 @@ -90,7 +108,13 @@ Here is extracted what I have for my dongle: E: SUBSYSTEM=tty E: USEC_INITIALIZED=672068596 -Note: you need to unplyg/replug your dongle for /dev/bandrich to appear. +You can also run: + + udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB0 + udevadm info -a -p /sys/bus/usb-serial/devices/ttyUSB2 + +Note: after creating the udev files, you need to unplug/replug your +dongle for /dev/bandrich.data and /dev/bandrich.control to appear. Note: the mode 0666 is for everyone to access the dongle (no need for root privileges). If you prefer you can set it to 0600 (only root) diff --git a/cmake_targets/autotests/v2/actions/start_bandrich.py b/cmake_targets/autotests/v2/actions/start_bandrich.py index edd74644060d35c07debcd74727e6e1dd4a2a0ca..698694df052d2dda034f422ac5d1fa70ea62a3dc 100644 --- a/cmake_targets/autotests/v2/actions/start_bandrich.py +++ b/cmake_targets/autotests/v2/actions/start_bandrich.py @@ -3,7 +3,7 @@ import time from modem import quit, Modem try: - modem = Modem("/dev/bandrich") + modem = Modem("/dev/bandrich.control") #test that modem is there print "INFO: check modem's presence" diff --git a/cmake_targets/autotests/v2/actions/stop_bandrich.py b/cmake_targets/autotests/v2/actions/stop_bandrich.py index cb449d8890eadc71b2f9a6be6a7e51037b3b60a6..d539faa9f8a85b46e3e3852a38ecf51df0a903bc 100644 --- a/cmake_targets/autotests/v2/actions/stop_bandrich.py +++ b/cmake_targets/autotests/v2/actions/stop_bandrich.py @@ -3,7 +3,7 @@ import time from modem import quit, Modem try: - modem = Modem("/dev/bandrich") + modem = Modem("/dev/bandrich.control") #test that modem is there print "INFO: check modem's presence" diff --git a/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf b/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf index 2825b67ff34c66ca5eb0dfab407071d390734a99..d3146e3a2af6e6d56a8cb15f58a7731bdfb65d2b 100644 --- a/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf +++ b/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf @@ -1,5 +1,5 @@ [Dialer Defaults] -Modem = /dev/bandrich +Modem = /dev/bandrich.data ISDN = off Modem Type = Analog Modem Baud = 9600