christianTF/LoxBerry-Plugin-Any

Simultanous command mixup

Opened this issue · 3 comments

Hi,

Thanks for this plugin. Is it still under (active) development?

What would be the best practice to get a status of my heater into Loxone? Let Loxone call the Virtual Output each 5 seconds or so?

I was trying to do just that but run multiple requests (apparently at the same time) and it seems it then could mix up received commands:

####### New Connection ### 120-0-13 22:33:5 LOCAL TIME ######
Remote: 192.168.0.xxx
New guest connection accepted from 192.168.0.xxx.
GUEST: EuromOn rc command ./euromOn.shEuromSwing rc command ./euromSwing.sh
1. Parameter (Name) is EuromOn
2. Parameter is rc (will return exit code)
3. Parameter is command (will run following command)
No MS defined. Setting to msnr=1
Miniserver used is 1 (xxx-MS)
Calling exec_command
exec_command Commandline: './euromOn.shEuromSwing rc command ./euromSwing.sh '
Try to fork
Command forked.
Exit Code: 127
Output:
sh: 1: ./euromOn.shEuromSwing: not found

DEBUG: #EuromOn# #127#
SEND via HTTP-REST to MS1: -->URL http:// xxx:*****@192.168.0.xxx:8888/dev/sps/io/EuromOn/127
####### New Connection ### 120-0-13 22:33:10 LOCAL TIME ######
Remote: 192.168.0.xxx
New guest connection accepted from 192.168.0.xxx.
GUEST: EuromOn rc command ./euromOn.sh
1. Parameter (Name) is EuromOn
2. Parameter is rc (will return exit code)
3. Parameter is command (will run following command)
No MS defined. Setting to msnr=1
Miniserver used is 1 (xxx-MS)
Calling exec_command
exec_command Commandline: './euromOn.sh '
Try to fork
Command forked.
Exit Code: 0
Output:
false

As you could see, sometimes the EuromOn command is ran successfully, the next time it's mixed up with the next command coming in, EuromSwing.

The plugin is active, but currently not in focus, as no issues arrive 🙂

In Loxone, Could you try to terminate your Command with \n.
With line separating, no issue should occur (hopefully!).

Additionally, you could check the Loxone setting “Close connection after send” (or similar).

Thanks for your quick reply, will try that!

Is a poll of 5s for multiple values too much for the plugin/MS? As the log window in LB was not that responsive anymore (scrolling / selecting) when polling 2 values each 5s...

On LB side, it depends on the command, the script executes. Pi slows down possibly, but who cares 😉

On MS side, only two return codes do not affect stability or performance.

To not have both commands run in parallel, you may want to implement a delay on Loxone side: Use one pulse generator (5 sec) to call the first VO, and the delayed impulse block (don’t know English name), that is connected to the pulse generator with 2 sec delay, and pulses the second VO.