Ir blaster HOME AUTOMATION wiwo orvibo & S20

I try this config on timeout :slight_smile:

And change it by modifying that value:

echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout

Or permanently by adding it to nano /etc/sysctl.conf

net.ipv4.tcp_fin_timeout=30

and in 10 test is work. I try

It is work better but after 20 time i have :slight_smile:

root@raspberrypi:~# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 raspberrypi.local:46258 li464-188.members:https ESTABLISHED
tcp 0 0 raspberryp:microsoft-ds 192.168.1.21:53700 ESTABLISHED
tcp 0 0 raspberrypi.local:49105 192.168.1.35:20000 ESTABLISHED
tcp 0 0 raspberrypi.local:49100 192.168.1.35:20000 TIME_WAIT
tcp 0 0 raspberrypi.local:46257 li464-188.members:https TIME_WAIT
tcp 0 0 raspberrypi.local:46259 li464-188.members:https TIME_WAIT
tcp 0 0 raspberrypi.local:49104 192.168.1.35:20000 ESTABLISHED
tcp 0 0 raspberrypi.local:50532 r1.ycpi.vip.dea.ya:http TIME_WAIT
tcp 0 0 raspberrypi.local:46255 li464-188.members:https TIME_WAIT
tcp 0 0 raspberrypi.local:ssh 192.168.1.21:53679 ESTABLISHED
tcp 0 0 raspberrypi.local:60788 r1.ycpi.vip.dea.ya:http ESTABLISHED
tcp 0 0 raspberrypi.local:43529 r1.ycpi.vip.dea.ya:http ESTABLISHED
tcp 0 0 raspberrypi.local:33621 ZGEMMA-H2.local:http TIME_WAIT
tcp 0 0 raspberrypi.local:60788 r1.ycpi.vip.dea.ya:http ESTABLISHED
tcp 0 0 raspberrypi.local:49109 192.168.1.35:20000 TIME_WAIT
udp 0 0 raspberrypi.local:44003 192.168.1.11:10000 ESTABLISHED

and in my lan i dont have 192.168.1.11

i think i found problem in home.tems openhab i have :slight_smile:

String String_recive_Test “Test String[%h]” (ZG_salone, AV) {udp="<[192.168.1.11:10000:‘REGEX((.*))’]" }

my test line i delete and try

i dont solve , now :slight_smile:

root@raspberrypi:~# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 raspberrypi.local:50714 192.168.1.35:20000 TIME_WAIT
tcp 0 0 raspberrypi.local:42446 ZGEMMA-H2.local:http TIME_WAIT
tcp 0 0 raspberrypi.local:50719 192.168.1.35:20000 TIME_WAIT
tcp 0 0 raspberrypi.local:50713 192.168.1.35:20000 ESTABLISHED
tcp 0 0 raspberrypi.local:40041 li464-188.members:https ESTABLISHED
tcp 0 0 raspberrypi.local:42447 ZGEMMA-H2.local:http TIME_WAIT
tcp 0 0 raspberrypi.local:ssh 192.168.1.21:54616 ESTABLISHED
tcp 0 0 raspberrypi.local:42448 ZGEMMA-H2.local:http TIME_WAIT
tcp 0 0 raspberrypi.local:53580 r2.ycpi.vip.dea.ya:http TIME_WAIT
tcp 0 0 raspberrypi.local:50720 192.168.1.35:20000 TIME_WAIT
tcp 0 0 raspberrypi.local:50709 192.168.1.35:20000 TIME_WAIT
tcp 0 0 raspberryp:microsoft-ds 192.168.1.21:54633 ESTABLISHED
tcp 0 0 raspberrypi.local:50718 192.168.1.35:20000 TIME_WAIT
tcp 0 0 raspberrypi.local:42881 r2.ycpi.vip.dea.ya:http TIME_WAIT
Active UNIX domain sockets (w/o servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ] DGRAM 6323 /var/run/thd.socket
unix 10 [ ] DGRAM 6342 /dev/log
unix 3 [ ] STREAM CONNECTED 7146
unix 3 [ ] STREAM CONNECTED 7370 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7471 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7226
unix 3 [ ] STREAM CONNECTED 7415
unix 3 [ ] STREAM CONNECTED 7300 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7015
unix 3 [ ] STREAM CONNECTED 7394 @/dbus-vfs-daemon/socket-3cGOMhwH
unix 3 [ ] STREAM CONNECTED 7483 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7214
unix 3 [ ] STREAM CONNECTED 7233
unix 3 [ ] STREAM CONNECTED 7418
unix 3 [ ] STREAM CONNECTED 7251 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 6435
unix 3 [ ] STREAM CONNECTED 6875
unix 2 [ ] DGRAM 7126
unix 2 [ ] STREAM CONNECTED 7501
unix 3 [ ] STREAM CONNECTED 7470
unix 3 [ ] STREAM CONNECTED 7328
unix 3 [ ] STREAM CONNECTED 7369
unix 3 [ ] STREAM CONNECTED 7299
unix 3 [ ] STREAM CONNECTED 7017
unix 3 [ ] STREAM CONNECTED 7161 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7482
unix 3 [ ] STREAM CONNECTED 7185 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7393
unix 3 [ ] STREAM CONNECTED 7419 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7250
unix 3 [ ] STREAM CONNECTED 6436 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 6876 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7366 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7473 @/tmp/dbus-CObfCNddrO
unix 2 [ ] DGRAM 7327
unix 3 [ ] STREAM CONNECTED 7154
unix 3 [ ] STREAM CONNECTED 7496 /var/run/sdp
unix 3 [ ] STREAM CONNECTED 6908
unix 3 [ ] STREAM CONNECTED 6477
unix 3 [ ] STREAM CONNECTED 6389
unix 3 [ ] STREAM CONNECTED 7411
unix 3 [ ] STREAM CONNECTED 7395
unix 3 [ ] STREAM CONNECTED 7184
unix 3 [ ] STREAM CONNECTED 7168 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7002
unix 3 [ ] STREAM CONNECTED 6861
unix 3 [ ] STREAM CONNECTED 7412
unix 3 [ ] STREAM CONNECTED 7259 @/tmp/dbus-CObfCNddrO
unix 2 [ ] DGRAM 6476
unix 3 [ ] STREAM CONNECTED 7472
unix 3 [ ] STREAM CONNECTED 7221 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7365
unix 3 [ ] STREAM CONNECTED 7147 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7495
unix 3 [ ] STREAM CONNECTED 6909 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 6390
unix 3 [ ] STREAM CONNECTED 7416 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7329 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 6478 /var/run/dbus/system_bus_socket
unix 2 [ ] DGRAM 7194
unix 3 [ ] STREAM CONNECTED 7167
unix 3 [ ] STREAM CONNECTED 7003 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7413 @/dbus-vfs-daemon/socket-t2y6qWXc
unix 3 [ ] STREAM CONNECTED 7258
unix 3 [ ] STREAM CONNECTED 7177 @/tmp/dbus-CObfCNddrO
unix 2 [ ] DGRAM 6551
unix 3 [ ] STREAM CONNECTED 7289 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7024 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7157
unix 2 [ ] STREAM CONNECTED 7519
unix 3 [ ] STREAM CONNECTED 7389 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7466 /var/run/dbus/system_bus_socket
unix 2 [ ] DGRAM 6865
unix 3 [ ] STREAM CONNECTED 7453
unix 3 [ ] STREAM CONNECTED 7255 /var/run/dbus/system_bus_socket
unix 2 [ ] DGRAM 6427
unix 3 [ ] STREAM CONNECTED 7363 /tmp/.menu-cached-:0-pi
unix 3 [ ] STREAM CONNECTED 7220
unix 3 [ ] DGRAM 4162
unix 3 [ ] STREAM CONNECTED 7414 @/dbus-vfs-daemon/socket-NJcVKIB6
unix 3 [ ] STREAM CONNECTED 7288
unix 3 [ ] STREAM CONNECTED 7155 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7465
unix 3 [ ] STREAM CONNECTED 7231 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7388
unix 3 [ ] STREAM CONNECTED 7254
unix 3 [ ] STREAM CONNECTED 6429
unix 3 [ ] STREAM CONNECTED 7014
unix 3 [ ] STREAM CONNECTED 7234 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7219 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 7454 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7018 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 6526
unix 3 [ ] DGRAM 4163
unix 3 [ ] STREAM CONNECTED 7386 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7462 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7230
unix 3 [ ] STREAM CONNECTED 7160
unix 2 [ ] DGRAM 7547
unix 3 [ ] STREAM CONNECTED 6898
unix 3 [ ] STREAM CONNECTED 6862 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7450
unix 3 [ ] STREAM CONNECTED 7249 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 6430
unix 3 [ ] STREAM CONNECTED 7479 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7218
unix 3 [ ] STREAM CONNECTED 7023
unix 3 [ ] STREAM CONNECTED 7361
unix 3 [ ] STREAM CONNECTED 6527 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7461
unix 3 [ ] STREAM CONNECTED 7227 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7385
unix 3 [ ] STREAM CONNECTED 7158 /tmp/.X11-unix/X0
unix 3 [ ] STREAM CONNECTED 6899 /var/run/dbus/system_bus_socket
unix 3 [ ] STREAM CONNECTED 7451 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7248
unix 3 [ ] STREAM CONNECTED 7478
unix 3 [ ] STREAM CONNECTED 7215 @/tmp/dbus-CObfCNddrO
unix 3 [ ] STREAM CONNECTED 7396 @/dbus-vfs-daemon/socket-Wbws7pRk
unix 3 [ ] STREAM CONNECTED 7176

I DONT KNOW

udp 0 0 raspberrypi.local:44003 192.168.1.11:10000 ESTABLISHED
and in my lan i dont have 192.168.1.11

Looks like you do have 192.168.1.11 in your lan :slight_smile:

this point i resolve i have line in home.items openhab String String_recive_Test “Test String[%h]” (ZG_salone, AV) {udp="<[192.168.1.11:10000:‘REGEX((.*))’]" }

but now i dont have connection on port 10000 and i have problem see last nestat

after 1-2 minute when i reboot raspberry some service go up and i cant send command on port 10000 of orvibo-master

if i use :slight_smile:

lsof -i :10000

i see:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 2894 openhab 80u IPv4 7552 0t0 UDP *:10000

with command :slight_smile:

kill 2894

it is work now witout reboot.

what do i found this process?

IN openhab.cfg i have :slight_smile:

################################# TCP - UDP Binding ###################################

all parameters can be applied to both the TCP and UDP binding unless

specified otherwise

#udp:refreshinterval=250
#udp:port=10000
#udp:addressmask=true
#udp:buffersize=1024
tcp:refreshinterval=250
tcp:port=20000
tcp:addressmask=true
tcp:buffersize=1024

i comment now it is ok

ok. I’ll close your issue on github then. Have a good day!

Now i resolve problem with open connection pot 10000.

But i have new problem and i dont know solution.

Script work every time on the grab code, but when i send ir code sometimes work and sometimes doesnt work in any case i dont have error code :

python /usr/share/openhab/addons/orvibo.py -i 192.168.1.3 -e /usr/share/openhab/addons/ir/test.ir
Orvibo[type=irda, ip=192.168.1.3, mac=accf235671c6]
Done.

It is solve with :slight_smile:

change python in python3

Switch IR “IR” (ZG_salone, AV) {exec=">[ON:python3 /usr/share/openhab/addons/orvibo.py -i 192.168.1.3 -e /usr/share/openhab/addons/ir/hifipower.ir]"}

Hi

Thank you @Pavel_Cherezov for your python module. I started using your module to control my AC with the AllOne IR blaster. I recently bought a S20 smart socket for use with a lamp eventually. I got it to work. All of my Orvibo integration is through the exec command running separate python3 scripts. I am absolutely loving openHAB and now have a mix of INSTEON and Orvibo products working.

The problem I am having is the delay. The WiWo app controls the AllOne and the S20 socket pretty much instantly while running the python script seems to have a little delay.

From what I understand, you need to subscribe to the device before you can control it and perhaps this is introducing a delay in the python script.

Is there something I need to keep running in the background to keep subscribed? The delay is alright but since the app is so zippy I was wondering if there was a way to make openHAB and the orvibo python module behave just as quick.

Thanks

Thank you @robinson for your feedback!

AFAIU you have already digged my module, and you absolutely right - it connects and then subscribes to the divice before each request. It actually was done mainly by couple reasons:

  1. Having active connection and/or active subscription to the device breaks discovering devices.
  2. Another reason is current behavior allows user to not thinking about unplanned disconnection from devices by whatever reasons (power outage, wifi router reboot, etc)

I guess, it is not a problem to add a parameter to tell the lib keep the connection and subscription alive, which may be useful in case user not going to discover new devices, but it’ll take some time to test and think about the second issue above.

  • Pavel

I would be happy to give up device discovery and test it out. All of my network devices are on the static lease list and get assigned the same IP each time.

Thanks

@robinson I’ve just prepared all changes in the new branch keep_connection for you. Documentation is updated accordingly.
So, please feel free to test it. Any feedback is welcome =)

BTW, discovering devices works as well in case of keeping connection.

I’ve read your ir guide and figured out that new keeping connection functionality will not help to you in getting rid of delays, because you create Orvibo instance for each request.

Also, from my point of view having separate ac-turn-on.py is an extra here, since you can just execute a shell command, so I’d replace

ON:python3 /home/pi/orvibo/ac-turn-on.py

with

ON:orvibo.py -e /home/py/orvibo/ac-turn-on.ir

- Pavel

Thanks for that. I have updated the guide to reflect this. It is one less step which is great.

Since I am now using the orvibo script directly from the command line, is there something I need to keep running perhaps with a cron job that will keep the connection alive?

Thanks again

-robinson

Using orvibo from command line is just the same you did with a separate file - creates instance, sends request, destroys instance on exit.

I’m afraid, I can’t get you a simple solution how to keep connection without extending lifetime of Orvibo class instance.
The only thing on the top of my head is to make an orvibo daemon, which will redirect commands from OpenHab to connected devices, but as for me it’s not a beauty solution.

I know not exactly connected - but are there any firmware updates - giving a better database of devices?

Hey guys, I think I might have thought up a solution for this, and that’s a very simply HTTP server that keeps the connections alive as the module already checks whether they are subscribed, it’s a matter of not creating new instances so a http server that’s running in the background does just that.

Server is ran by specifying IP address and port.

Three GET commands are accepted:
/STATUS/_IP of plug_ /ON/_IP of plug_ /OFF/_IP of plug_

I’m completely new at this (it’s my first Python program ever) so bear with me and would love to have your feedback.