Difference between Synology and PI Lua scripts?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Difference between Synology and PI Lua scripts?

Post 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
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: Difference between Synology and PI Lua scripts?

Post 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 1180 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!!
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: Difference between Synology and PI Lua scripts?

Post 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)
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
PimJanse
Posts: 6
Joined: Saturday 03 June 2017 7:55
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Difference between Synology and PI Lua scripts?

Post 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
bertbigb
Posts: 147
Joined: Thursday 13 August 2015 13:36
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: Netherlands
Contact:

Re: Difference between Synology and PI Lua scripts?

Post 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
Best regards Bert

Synology DS1517+ - DSM 6.2
Raspberry PI2-B, Raspberry Nano - Raspberry PI3 - model B
Xiaomi Gateway - Philips HUE Lights - Zwave - RFXCom(E) with KaKu and other 433MHz devices - Yeelight Lights - Toon
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest