• 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
pilight does nothing via API
#1
Hi,

I got a really stupid problem with pilight:
I just bought a second Raspberry Pi 3 and have the same 433 MHz transmitter on there as on my first one.
I installed pilight first from GitHub (since you guys were down on the weekend) and later also tried from apt-get (stable repo).
I can switch my things via bash but interestingly I am trying to use FHEM to communicate with pilight via the api port...
If I set it to use the API port on the old Raspberry it works (so it's not FHEMs fault).. on the new one (localhost) it SAYS it works (see log further down) but simply nothing happens!

So I figured it must be some stupid config stuff... I just don't know where to look anymore. Crying Even tried to copy the four folders in which pilight installs stuff from the first to the second Raspberry.. still no luck.

Log of FHEM says:
Quote:2017.04.04 22:09:50 5: Cmd: >set SternLampe off<
2017.04.04 22:09:50 5: SternLampe(Set): off 1 of 1
2017.04.04 22:09:50 4: pilight(Write): RCV (pilight_switch) -> SternLampe,off
2017.04.04 22:09:50 4: pilight(Write): {"action":"send","code":{"protocol":["elro_800_switch"],"systemcode":31,"unitcode":1,"off":1}}
2017.04.04 22:09:50 5: pilight(SendNonBlocking): queue size 1
2017.04.04 22:09:50 4: BlockingCall (pilight_ctrl_Send): created child (1034), uses telnetForBlockingFn_1491336558 to connect back
2017.04.04 22:09:50 4: WEB: /fhem?cmd.SternLampe=set%20SternLampe%20off&room=Wohnzimmer&room=Wohnzimmer&XHR=1&fwcsrf=csrf_235239318560161&fw_id=167 / RL:20 / text/plain; charset=UTF-8 / Content-Encoding: gzip
/
2017.04.04 22:09:50 5: pilight(Send): {"action":"send","code":{"protocol":["elro_800_switch"],"systemcode":31,"unitcode":1,"off":1}}
2017.04.04 22:09:50 4: pilight(Send): RCV -> {"status":"success"}
2017.04.04 22:09:50 4: Connection accepted from telnetForBlockingFn_1491336558_127.0.0.1_59050
2017.04.04 22:09:50 5: Cmd: >{BlockingStart('2')}<
2017.04.04 22:09:50 5: Cmd: >{pilight_ctrl_SendDone('pilight|1')}<
2017.04.04 22:09:50 4: pilight(SendDone): message successfully send
2017.04.04 22:09:50 5: pilight(Parse): RCV -> {"origin":"sender","protocol":"elro_800_switch","message":{"systemcode":31,"unitcode":1,"state":"off"},"repeat":1,"uuid":"0000-b8-27-eb-93904a"}
2017.04.04 22:09:50 5: Starting notify loop for pilight, 1 event(s), first is rcv_raw: {"origin":"sender","protocol":"elro_800_switch","message":{"systemcode":31,"unitcode":1,"state":"off"},"repeat":1,"uuid":"0000-b8-27-eb-93904a"}
2017.04.04 22:09:50 5: createNotifyHash
2017.04.04 22:09:50 5: End notify loop for pilight
2017.04.04 22:09:50 4: pilight(Dispatch): PISWITCH,elro_800_switch,31,1,off,31
2017.04.04 22:09:50 5: pilight: dispatch PISWITCH,elro_800_switch,31,1,off,31
2017.04.04 22:09:50 4: pilight_switch_Parse: RCV -> PISWITCH,elro_800_switch,31,1,off,31

Anyone got any suggestions? Crying
 
Reply
#2
Just a question about the version you're using?
To find use:
Code:
$ pilight-daemon -V
If the answer is like this :
Code:
pilight-daemon version v7.0-172-g9249fd0
- more that 'v7.0' you're using a development version which may work with different control strings!
 
Reply
#3
Hey,

thanks for the reply. Smile

On both RPis the command just gives me a "pilight-daemon version 7.0" but I suspect that I might have made a mess of the pilight installation on the faulty Pi since I:
- first installed it from Git (since pilight.org was down on the weekend)
- then tried to delete the folders manually
- tried to install it via apt-get from the stable repo
- tried to purge it with apt-get
- tried to install it via apt-get from the nightly repo.

Maybe you could explain to me how I can really, cleanly get rid of pilight manually and then which repo to use to install a clean, fresh, working version? Smile

Thanks a lot!! Smile
 
Reply
#4
That's why I promote to make a backup *before* installing any applications.
The is an excellent page with a 5 min backup and it's worth to go that way!

https://www.linux-tips-and-tricks.de/de/...lstart-rbk
(if you prefer EN version switch with the flag)
 
Reply
#5
The best method is to follow the steps in the manual for manually compiling pilight and to install the sources from github. In step 4 copy the complete repository using the command:
git clone https://www.github.com/pilight/pilight.git

The setup.sh script takes of all initialisation steps required
To change to the development branch you do need to do:
git checkout development

When you compile the development branch you get something like v7.0-176-fe40ae4c, depending on the actual release.
You can consider the development to be as stable as the master branch. This is due to the fact that changes are only accepted after in depth testing and code reviews.
As a matter of fact if you use newer kernels (4.9.x or higher) only the development branch, (or the latest nightly) will work.

-----

What you most probably run into is the builtin "adhoc" feature of pilight.
When you run pilight on two machines, the 1st machine is the pilight MASTER and has to be used for communication purposes.
The 2nd machine is connecting to the MASTER as a pilight SLAVE and it is using the MASTER's config.json configuration file settings for the devices.

-----

There is another issue you will run into:
You can add a receiver to the Master and to the SLAVE, but whenever you connect a 2nd transmitter, you do need to ensure that the RF signals from the 2nd transmitter do not overlap with the signals from the 1st transmitter, as that will create interferences.

This means all transmitters will start transmitting in an adhoc environment.
Currently the development branch is not supporting usage of the UUID configuration information in the settings section of config.json. Intended use of the UUID feature is to tell pilight which machine it shall use for transmitting RF data.

The new pilight version 8 is under development and will support UUID. The branch "rewrite" is the current tip of pilight's V8 development.

If you can not use the "rewrite" branch, another option is the usage of the following pilight repository wo-rasp.
The branch "test_dev_stable" is a full clone of the main pilight project's development branch, plus multiple pilight V7 extensions and patches. For you most notably this branch has the required patch to support UUID for the GPIO interface.

For the UUID feature to work you do need to add to the MASTER's config.json file the UUID for each Pi in the device settings section of config.json. Thus all pilight instances do know which Pi to use for transmitting RF signals to a particular device. Use pilight-uuid to obtain the UUID.
 
Reply
#6
Quote:What you most probably run into is the builtin "adhoc" feature of pilight.
When you run pilight on two machines, the 1st machine is the pilight MASTER and has to be used for communication purposes.
The 2nd machine is connecting to the MASTER as a pilight SLAVE and it is using the MASTER's config.json configuration file settings for the devices.

So that means that the faulty Pi fooled me when I told pilight to send things via bash because it just sent the commands through the non-faulty Pi?

That's very interesting!

How can this be disabled so that you have two independent pilight instances on two Pis on the same LAN?


(I'll try a few things and report back...!)
 
Reply
#7
Check the manual, you do need to configure the parameter:
"standalone":
in config.json.
This will disable the SSDP capability of pilight and you have to provide the ip address and the port when you use the command interface.
 
Reply
#8
Do I have to set the flag on both pilight instances because otherwise it will still find an SSDP server?
Interestingly: when I put "standalone: 1" in the config.json and reboot the attribute is gone.
 
Reply
#9
(04-06-2017, 07:32 PM)PatiB87 Wrote: Do I have to set the flag on both pilight instances because otherwise it will still find an SSDP server?
Putting it on both makes more sense, and also makes your setup more future-proof should you add more nodes in the future. Then you won't run into this again. There is no other SSDP server it will ever find, the only pilight SSDP server it can find is the one run by the first pilight-daemon to start in your network. If you disable this feature on node A, node B will not discover node A and think it is the only pilight instance running. It will then go ahead and start its own SSDP server, if you didn't apply the setting on both nodes.

(04-06-2017, 07:32 PM)PatiB87 Wrote: Interestingly: when I put "standalone: 1" in the config.json and reboot the attribute is gone.
You need to stop the pilight daemon before editing the configuration, because it always writes the configuration is was using to the file when stopping - thereby overwriting your manual changes. So, run
Code:
sudo service pilight stop
edit the config, run
Code:
sudo service pilight start
and you should be back in business.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  pilight cpu usage possibly associated with noticeable sluggishness? hepcat72 4 176 01-28-2020, 08:02 PM
Last Post: hepcat72
  apt.pilight.org stable Release' is not signed. thomasol 2 282 01-23-2020, 11:34 PM
Last Post: thomasol
  pilight and SIGNALduino cc1101 Caleus 0 167 01-19-2020, 09:13 AM
Last Post: Caleus
  filter stopped working after update to pilight 8.1.5 zlin50 19 684 01-03-2020, 02:15 PM
Last Post: curlymo
Question [Solved] Openweathermap with pilight 7.0-40 doesn't work Seebueb 2 194 01-01-2020, 06:45 PM
Last Post: Seebueb
  [Solved] Strange receive problem with 433Mhz Receiver and pilight 8.1.5 vanillaice30 15 835 12-18-2019, 11:09 AM
Last Post: vanillaice30
  pilight error after update to 8.1.5 on Odroid C2 WitchDoctor 3 395 11-29-2019, 09:56 PM
Last Post: curlymo
  pilight crashing randomly PatiB 7 651 11-16-2019, 10:50 PM
Last Post: curlymo
  [Fixed] RaspberryPi4 pilight 8.1.5 - Send isn't working DominikB1993 4 649 10-18-2019, 10:25 PM
Last Post: DominikB1993
  Real 433Mhz Remote is disturbed by pilight service henne111 2 528 10-06-2019, 06:18 PM
Last Post: wo_rasp

Forum Jump:


Browsing: 1 Guest(s)