• 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
Change settings via API calls
I am using pilight mainly as a background service and would like to configure it purely via API calls rather than edit the config.json by hand.

The problem is that you have removed the automatic detection of platform in recent nightly builds. This makes it necessary to edit the config.json to set the gpio-platform parameter to make pilight to work right after installation.

In the stable versions I did not need to do anything after installation. pilight worked just out of the box with the default config.json.

Basically, it would be enough to tell pilight via API the correct gpio-platform.
Editing the settings is not possible through the API, because they are loaded at startup.
Then we have to think about a way how to solve this.

The old pilight version could detect the platform automatically - no user input needed. Could you re-implement this in the new version?

If not, then we need some sort of API call to tell pilight the platform.

Editing some JSON files is nothing that I would like to do on my own or tell end-users to do.
Quote:The old pilight version could detect the platform automatically - no user input needed. Could you re-implement this in the new version?
No, because as soon as wiringX (the library driving the GPIO) was extended further with new devices, we discovered that the auto-detect was not detecting the right platforms anymore. The only reliable way is to let the user input the right device. So no, this feature won't make it back.

You can always reimplement something similar yourself if you are only using Raspberry Pi's.
Ok, for now I am only using and compiling for RPis.

Is there a difference between raspberrypi1b+, raspberrypi2, raspberrypizero and raspberrypi3 regarding the GPIO setting, or can I just use raspberrypi3 for all of these platforms in the config and it will work?
No, because if they were all the same i would just have called them raspberrypi Wink
Ok, it was worth the try. Wink

Any chance you can at least implement automatic detection for raspberry pis?
Maybe based on this: https://raspberrypi.stackexchange.com/qu...-is-2-or-3

It just does not feel right if I am developing an external program to set the correct parameter in the config.json that belongs to pilight. I can do it, but it is really a dirty workaround.
I know how to detect Raspberry Pi's. That's not the issue. There is just no way to for example tell Odroids apart from BananaPi's. And because those are also both supported, the autodetection was removed. Partially implementing auto-detect would be a dirty fix.

Forum Jump:

Browsing: 1 Guest(s)