Lua scripts from Pi to win - not working

Moderator: leecollings

Post Reply
buzzzy
Posts: 7
Joined: Wednesday 24 January 2018 22:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Lua scripts from Pi to win - not working

Post 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).
ben53252642
Posts: 543
Joined: Saturday 02 July 2016 5:17
Target OS: Linux
Domoticz version: Beta
Contact:

Re: Lua scripts from Pi to win - not working

Post 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.
Unless otherwise stated, all my code is released under GPL 3 license: https://www.gnu.org/licenses/gpl-3.0.en.html
zicht
Posts: 251
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Lua scripts from Pi to win - not working

Post 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.
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests