lsusb
...
Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
opkg update
opkg install kmod-usb-serial kmod-usb-serial-pl2303

USB serial adapters

Install software:

opkg update
opkg list |grep serial |grep python
pyserial - 2.4-1 - serial port python bindings
opkg install pyserial
cd /usr/lib/python2.7
wget https://raw.githubusercontent.com/Xuth/tp4000_dmm/master/tp4000zc.py
nano /mnt/sda1/read.py
# load the module
import tp4000zc
# the port that we're going to use.  This can be a number or device name.
# on linux or posix systems this will look like /dev/tty2 or /dev/ttyUSB0
# on windows this will look something like COM3
port = '/dev/ttyUSB0'
# get an instance of the class
dmm = tp4000zc.Dmm(port)
# read a value
val = dmm.read()
print val.text       # print the text representation of the value
                     # something like: -4.9 millivolts DC
print val.numericVal # and the numeric value
                     # ie: -0.0048
# recycle the serial port
dmm.close()
python /mnt/sda1/read.py
-50.2 millivolts DC
-0.0502

Comments powered by CComment