• 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
http GET request error 404 Not Found
I have two servers with pilight on it. Both have pilight 7.0.
Server-Two has been setup recently, Server-One is already running for quite a while. 
Both pilight configurations have the same entries (same devices configured, etc.).
With Server-One I am able to switch devices via:
http://Server-One:5001/control?device= ...

The same url on Server Two (of course with Server-Two in the ip address) leads to the error:
Not Found (error 404). It seems the server does not recognize '/control'

However, Server-Two is able to switch devices via:
This http request does NOT work on Server-One

Is there some configuration setting which controls how GET http requests?
Thanks - P.
You've missed this in your pilight setup: http://https://manual.pilight.org/en/adhoc-network

Basically, it means that all pilight instances in your network will automatically connect with each other and communicate over the network. The first instance of the pilight-daemon (the one that is started before any others) will become the main daemon, while any subsequent pilight-daemon instances will become clients to this main daemon. All clients are sent the configuration file from the main-daemon, so all nodes work with the same config.

So, your Server-One has become the main daemon which provides the REST api, the webgui, etc. Your Server-Two has become a client node to this main-daemon, and therefore does not serve a webgui or offer the REST api. Therefore, your call to /control? does not work.
Thanks! - the ad-hoc network looks very interesting! I need to take a closer look at it... (I have currently implemented a similar solution by using a mosquitto mqtt broker on my "main" server", the other clients may just subscribe to mqtt messages and just do the switching...) 

However, Server-Two:
- also provides the WebUI 
- also accepts REST calls, just a different url notation:
  (the above url works on Server-Two)
rather than:

  (The above does NOT work on Server-Two, only on Server-One, and vice versa!)
The result (switching the device) - is the same...
There is just this differenz in the url syntax - which I do not understand. So both server may switch devices, the url syntax is different
If the syntax is different you are also running two different versions.
That's what I thought as well, but calling 'pilight-daemon -V' on

Server-One returns:
  version v7.0-146-g001f2ea

and Server-Two just returns:
  version v7.0

I really don't want to stress that - it's just a bit strange and confusing to me...
It works, which is the important part - it's just not nice to use two different mechanisms
Hmm. I think I see a difference between those numbers Wink

v7.0 is the latest pilight stable version.
v7.0-146-g001f2ea is a developmental nightly version. This means that it is newer than the latest stable and contains developmental code for the next pilight release. The syntax for the REST API has been changed in this version.

So, if you want to use the same API on both Servers, you will need to install the (exact) same version of pilight on both devices.
OK thanks - makes sense.
I like the new API better, it's simpler.
Cheers P.
Yes, that was the point of the new API - it is actually a proper REST API Smile

Possibly Related Threads...
Thread Author Replies Views Last Post
  API Requests by HTTP from other devices fore use in pilight scootermacro 2 422 05-10-2020, 08:19 AM
Last Post: scootermacro
  ERROR: failed to read config. stack: 2 Stefan 6 568 02-03-2020, 09:37 PM
Last Post: curlymo
  Raspberry 4B installation error royw 3 600 12-05-2019, 10:58 AM
Last Post: royw
  pilight error after update to 8.1.5 on Odroid C2 WitchDoctor 3 814 11-29-2019, 09:56 PM
Last Post: curlymo
  "FOR '2 MINUTE' FROM off" resulting in error hansrijn2 5 631 11-15-2019, 02:04 PM
Last Post: hansrijn2
  433gpio platform error after raspbian dist upgrade HuberDe 2 772 10-12-2019, 07:35 PM
Last Post: HuberDe
Sad Raspberry Pi: "NOTICE: no pilight ssdp connections found" abusch 8 1,878 04-30-2019, 09:10 PM
Last Post: curlymo
  error pilightsend, recieve and control hansipi 2 781 11-04-2018, 03:46 PM
Last Post: hansipi
  pilight-receive not found Pikeman 7 1,659 07-06-2018, 10:44 AM
Last Post: curlymo
  Error with loading LPF firmware Rschnauzer 14 8,389 02-10-2018, 04:21 PM
Last Post: Rschnauzer

Forum Jump:

Browsing: 1 Guest(s)