Need help : Lua reading log Topic is solved

Moderator: leecollings

Post Reply
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Need help : Lua reading log

Post by zicht »

Hi

I am trying to read some status value from the log from json

Code: Select all

curl http://192.168.xxx.xxx:8080/json.htm?type=command&param=getlog&lastlogtime=0&loglevel=268435455
Response i get :

Code: Select all

{ "status" : "ERR" }
 
If i copy the same url to my browser i get perfecty i json respond with the log entries.
What am i doing wrong ?
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)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Need help : Lua reading log

Post by waaren »

zicht wrote: Thursday 30 August 2018 21:42 I am trying to read some status value from the log from json

Code: Select all

curl http://192.168.xxx.xxx:8080/json.htm?type=command&param=getlog&lastlogtime=0&loglevel=268435455
Response i get :

Code: Select all

{ "status" : "ERR" }
 
If i copy the same url to my browser i get perfecty i json respond with the log entries.
you could try with

Code: Select all

curl -s -X GET http://192.168.xxx.xxx:8080/json.htm?type=command&param=getlog&lastlogtime=0&loglevel=268435455"
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
zicht
Posts: 272
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Need help : Lua reading log

Post by zicht »

Hi Waaren,

Thanx !!

Tried it with same result.
Somehow it works in every browser but with curl it reports an error.

Tried also other json commands, those work well in browser and with curl (setting a switch)
Just not the log.

SOLVED :

Code: Select all

	commando='curl "http://192.168.xxx.xxx:8080/json.htm?type=command&param=getlog"'
I added the " and it worked, thanks for ehm inspiring me to test a bit more
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)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Need help : Lua reading log

Post by waaren »

zicht wrote: Friday 31 August 2018 22:35 SOLVED :

Code: Select all

	commando='curl "http://192.168.xxx.xxx:8080/json.htm?type=command&param=getlog"'
I added the " and it worked, thanks for ehm inspiring me to test a bit more
Yes sorry for omitting the first "
curl does not like the ? and & so they need to be escaped by adding a \ before them or put the whole http string between double quotes.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest