• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
API - Curl.... {message:failed}
#1
Trying the API

If a do the following request in a Webbrowser (chrome, safari doesn't matter):

http://raspi-off.localnet:5001/control?device=Light-1&state=on

I get back {messageConfuseduccess} and the light goes on. If a do the request again and again, I get {messageConfuseduccess} again, and the light remains on. If I change the request to

http://raspi-off.localnet:5001/control?device=Light-1&state=off

I get back {messageConfuseduccess} and the light goes off. If a do the request again and again, I get {messageConfuseduccess} again, and the light remains off.

So everything works as expected.

But doing the same procedure with CURL (bash-script, php-script or command-line)

curl --request POST 'http://raspi-off.localnet:5001/control' --data 'device=Light-1&state=on'

then I get
{message:failed} setting the device to on, (and the light doesn't go to on if it was off)
{message:failed}Confused setting the device to off (and the light doesn't switch off if it was on).

In the log I see following message:
[Dec 04 15:04:50:258258] pilight-daemon: INFO: client connected, ip 192.168.10.2, port 55349
[Dec 04 15:04:50:259251] pilight-daemon: ERROR: arctech_switch_old: insufficient number of arguments

What is wrong?

pilight-Versio v7.0-59-g6f3a679 (nightly)

Thanks.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  WebSocket connection failed: One or more reserved bits gregnau 8 2,181 02-16-2018, 10:02 PM
Last Post: curlymo
  Upgrade to jessie+pilight+kernel failed witty 10 1,924 01-04-2018, 12:27 PM
Last Post: witty
  Using API webserver send page "message":"failed" fips 1 1,546 01-08-2016, 09:21 AM
Last Post: fips
  api doesn't report failed koos147 15 6,207 04-23-2015, 09:01 PM
Last Post: koos147
  DIO switch can't send message algodrill 1 3,027 04-20-2015, 08:05 AM
Last Post: wo_rasp

Forum Jump:


Browsing: 1 Guest(s)