Page 1 of 1

Difference between Synology and PI Lua scripts?

Posted: Saturday 18 February 2017 9:25
by bertbigb
I have a Synology DS1515, running Domoticz (latest beta) V3.6708.
To the domoticz I have a few Yeelights connected and to controle these lights I have to send a command like:
echo -ne '{"id":1, "method":"set_hsv", "params":[273, 65, "smooth", 2000]}\r\n' | nc -w1 192.168.2.81 55443

when I send this command from the command prompt (ssh to the DS1515) then it works perfectly. So no unknown commands.
I installed busybox previously to have the command "nc"

But when I send the command from a lua script like:

Code: Select all

runcommandYeelight ="echo -ne '{"id":1, "method":"set_hsv", "params":[273, 65, "smooth", 2000]}\r\n' | nc -w1 192.168.2.81 55443"
os.execute(runcommandYeelight)
Then nothing happens, however if i send the same command as above from a raspberry Pi then the bulb reacts as expected, so I expect that the syntax is also ok.
But what is now the difference between Synology and RaspberryPi running the same command?

Can anyone help me to point out what I should do to make this work for Domoticz on my Synology?
For me it is rather important since I made a whole script for many lights I want to steer with these commands, so help is apreciate.


Many thanks

Re: Difference between Synology and PI Lua scripts?

Posted: Saturday 18 February 2017 10:36
by bertbigb
In the mean time I found the following in the log-file
log file nc command
log file nc command
Domoticz NC command.jpg (46.02 KiB) Viewed 1177 times
So the nc command can't be found by domoticz is my conclusion. For a "normal" user I put this in the PATH.
Can someone help me what to do that the commands in this PATH can be executed by domoticz also?
Is there a domoticz user on the system? Or do I have to change someing in my Apache settings? I really do not know.

Help is really appreciated!!

Re: Difference between Synology and PI Lua scripts?

Posted: Thursday 06 April 2017 20:47
by bertbigb
Finally I solved it I installed BusyBox - The Swiss Army Knife of Embedded Linux on my Synology

http://www.mit.edu/afs.new/sipb/project ... syBox.html

and now the Synology also recognise the nc command (and many more)

Re: Difference between Synology and PI Lua scripts?

Posted: Thursday 29 June 2017 21:30
by PimJanse
Hello Bert, it seems that I have the same problem with not recognized nc-command on my Synology NAS.
Can you please let me know HOW you installes busybox on your NAS?

Thanks!
Pim

Re: Difference between Synology and PI Lua scripts?

Posted: Friday 30 June 2017 10:00
by bertbigb
Hi Pim,

On my Synology I first installed the package Easy Bootstrap Installer (EBI) and then then the package IPKGui.

IPKGui and EBI I installed as a package available at http://packages.synocommunity.com.

You can find more information about EBI at http://www.synology-forum.de/showthread ... -Installer

You can find more information about IPKGui at http://www.synology-forum.de/showthread ... 3%BCr-iPKG

With the IPKGui you can install all the wanted ipkg packages you want on your Synology.
So from there I downloaded and installed Busybox and afterwards my system recognized the nc command also.

Et Voila. I hope this helps you and others.

Best regards
Bert