Here is a little tutorial to be able to use a device connected via USB on openLuup.
1/ Retrieve the usb device
With the command “dmesg”, you will find the mounted point.
[ 7.151351] usbcore: registered new interface driver usbserial
[ 7.151525] usbcore: registered new interface driver usbserial_generic
[ 7.151663] usbserial: USB Serial support registered for generic
[ 7.230878] usbcore: registered new interface driver pl2303
[ 7.231047] usbserial: USB Serial support registered for pl2303
[ 7.231167] pl2303 1-1.3:1.0: pl2303 converter detected
[ 7.323296] usb 1-1.3: pl2303 converter now attached to ttyUSB0
My USB device is reachable on /dev/ttyUSB0
2/ Install Serial to Network Proxy
Install ser2net
sudo apt-get update
sudo apt-get install ser2net
3/ Configuration
Edit the file “ser2net.conf”
sudo nano /etc/ser2net.conf
Add this line (it depends on your device; see config on your Vera in Apps->Develop apps->Serial Port configuration)
3481:raw:0:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT
Restart the deamon
sudo /etc/init.d/ser2net restart
4/ Open the connection
In openLuup :
luup.io.open( lul_device, "127.0.0.1", "3481" )
then your plugin will react as on a Vera (incoming tag in implementation file)
5/ TODO
The proxy ser2net is also used on the Vera. The config made in the UI is used to launch the deamon ser2net directly.
e.g. : (get from “ps -x” on a Vera)
/bin/sh -c ser2net -n -C "3483:raw:0:/dev/ttyUSB0:57600 1STOPBIT NONE" -C "3482:raw:0:/dev/ttyUSB1:38400 1STOPBIT NONE" -C "3481:raw:0:/dev/ttyUSB2:9600 1STOPBIT NONE"
It will be great to find a way to propose this to openLuup’s users