Page 1 of 1

Lua scripts from Pi to win - not working

Posted: Wednesday 15 August 2018 23:33
by buzzzy
My pi crashed, so I installed a backup of the db on a Windows machine I had running. It seems there is some pb with the curl command, is this expected? I tried executing it in a Lua interpreter, and then it works, but not in Domoticz, in the log I just see

LUA:

The code that's failing in the LUA script is:

Code: Select all

   	local f = assert(io.popen('curl -g -s -k -X "POST" -H "Content-Type: text/xml" -H "User-Agent: SpiderControl/1.0 (iniNet-Solutions GmbH)" --data "<item_list><n>G0.RaumTemp</n><n>G1.RaumTemp</n><n>G2.RaumTemp</n><n>G3.RaumTemp</n><n>G4.RaumTemp</n></item_list>" "http://192.168.1.132/cgi-bin/ILRReadValues.cgi" ', 'r'))
The script ran just fine on the pi, and can be run standalone on a different pi machine (without Domoticz).

Re: Lua scripts from Pi to win - not working

Posted: Thursday 16 August 2018 10:18
by ben53252642
curl will not work on Windows, you need to use Linux (eg Raspberry Pi, or Ubuntu / Debian).

Now I'm sure someone here will try and tell me that curl can work on Windows somehow with modifications but I'm just saying, it's not included by default.

You are better off running Domoticz on Linux, if you were not happy with the stability of the Raspberry I suggest buying a cheap Intel i3 NUC with an actual SSD and installing Debian on it (Raspbian is directly based on Debian), Raspbian is modified Debian to run on the Raspberry Pi processor.

Understand the Raspberry generally runs off the SD card which has a very limited life expectancy.

Re: Lua scripts from Pi to win - not working

Posted: Tuesday 02 October 2018 19:56
by zicht
Wrong info above

I have curl.exe running on windows :)
Just dont know where i got it but there is a repository where a special curl version with almost all functionalities can be downloaded
It works like a charm

example :
https://curl.haxx.se/windows/
there are others to, not sure wich i am useing currently

Remember your curl.exe has to be in the domoticz dir and nowhere else or you need to include it in the path :) but there you can run into some limitations.