Need help using Socat to use z-wave usb stick over network

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Need help using Socat to use z-wave usb stick over network

Post by Evelen »

This is the deal:
I have two USB devices I have connect to a server, but will use on another server.
 
The server which are connected physical with the USB sticks are a raspary pi, the Domoticz server I use them on is a 64bit virtual ubnutu server.
 
The two units are as follows:
1. RFXtrx433E http: //www.rfxcom.co...nsceivers/14103
2. UZB1 https://www.z-wave.me/index.php?id=28
 
On the Pi I have isntalled and configurated ser2net. and added the following to ser2net.conf

Code: Select all

10001:raw:0:/dev/ttyUSB0:38400 8DATABITS NONE 1STOPBIT
10003:raw:0:/dev/ttyACM0:38400 8DATABITS NONE 1STOPBIT
10001 is RFXtrx433E, this I know works because In Ubuntu server I use the RFX-over-IP feature.
But Domoticz does not support using UZB1 directly on IP, so I must therefore emulate it as a local unit of ubuntu.

I hear Socat should be a good program for this, but I get it simply not to work.
 
Here are device pi-one:

Code: Select all

[    1.139817] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.340108] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[    1.340121] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.619853] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    1.720170] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[    1.721799] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber    =0
[    1.795420] smsc95xx 1-1.1:1.0 eth0: register 'smsc95xx' at usb-3f980000.usb-    1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:2c:90:58
[    1.899860] usb 1-1.3: new full-speed USB device number 4 using dwc_otg
[    1.989817] usb 1-1.3: device descriptor read/64, error -32
[    2.179825] usb 1-1.3: device descriptor read/64, error -32
[    2.369836] usb 1-1.3: new full-speed USB device number 5 using dwc_otg
[    2.449854] usb 1-1.3: device descriptor read/64, error -32
[    2.639829] usb 1-1.3: device descriptor read/64, error -32
[    2.829827] usb 1-1.3: new full-speed USB device number 6 using dwc_otg
[    3.249848] usb 1-1.3: device not accepting address 6, error -32
[    3.371954] usbcore: registered new interface driver brcmfmac
[    3.509806] usb 1-1.3: new full-speed USB device number 8 using dwc_otg
[    3.614989] usb 1-1.3: New USB device found, idVendor=0658, idProduct=0200
[    3.616735] usb 1-1.3: New USB device strings: Mfr=0, Product=0, SerialNumber    =1
[    3.618455] usb 1-1.3: SerialNumber: 12345678-9012-3456-7890-123456789012
On Ubuntu / Domoticz server I have tried a bit of everything:

Code: Select all

flemmingss@VM4:~$ sudo socat pty,link=/dev/UZB1overIP,raw,echo=0 tcp:pi1:10003
2017/01/20 00:01:52 socat[18873] E connect(7, AF=2 192.168.1.115:10003, 16): Connection refused
flemmingss@VM4:~$ sudo socat pty,link=/dev/lio3,raw,echo=0 tcp:pi1:10003
2017/01/20 00:02:34 socat[18884] E connect(7, AF=2 192.168.1.115:10003, 16): Connection refused
flemmingss@VM4:~$
flemmingss@VM4:~$ sudo socat pty,link=/dev/ttyACM0,raw,echo=0 tcp:pi1:10003
[sudo] password for flemmingss:
2017/01/20 00:22:58 socat[19131] E connect(7, AF=2 192.168.1.115:10003, 16): Connection refused
flemmingss@VM4:~$
So, how do I get this to work?
"pi1" is the hostname for pi
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Re: Need help using Socat to use z-wave usb stick over network

Post by Evelen »

Code: Select all

root@pi1:~# dmesg | grep tty
[    0.000000] Kernel command line: 8250.nr_uarts=0 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2709.boardrev=0xa02082 bcm2709.serial=0xf12c9058 smsc95xx.macaddr=B8:27:EB:2C:90:58 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3ea00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 elevator=deadline root=/dev/mmcblk0p2 rootfstype=ext4 fsck.repair=yes rootwait
[    0.001354] console [tty1] enabled
[    0.901950] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[    2.456391] systemd[1]: Starting system-getty.slice.
[    2.460487] systemd[1]: Created slice system-getty.slice.
[    3.991631] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[    4.019465] usb 1-1.5: FTDI USB Serial Device converter now attached to ttyUSB0
Evelen
Posts: 234
Joined: Thursday 09 July 2015 12:03
Target OS: Linux
Domoticz version: 2.4538
Location: Norway
Contact:

Re: Need help using Socat to use z-wave usb stick over network

Post by Evelen »

I found out the listning of port 20001 was missing

Code: Select all

root@pi1:~# ss -lnp | grep ser2net
tcp    LISTEN     0      1                      *:2000                  *:*      users:(("ser2net",pid=340,fd=4))
tcp    LISTEN     0      1                      *:10001                 *:*      users:(("ser2net",pid=340,fd=8))
tcp    LISTEN     0      1                      *:2001                  *:*      users:(("ser2net",pid=340,fd=5))
tcp    LISTEN     0      1                      *:3000                  *:*      users:(("ser2net",pid=340,fd=6))
tcp    LISTEN     0      1                      *:3001                  *:*      users:(("ser2net",pid=340,fd=7))
But after running this command it worked:

Code: Select all

ser2net -p 10002
But I need to run this everytime I reboot the pi...

Also, the socat dommand on domoticz server works and I cant add the UZB1 interface in domoticz, but ut don't work.
0 nodes.
also, it looks like it realy dont work, no blinking blue in the USB stick when scanning for incklusion or other things.
When I put it back directly in the domoticz server it works.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest