• 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
No UUID assigned
#1
Hey Folks,

Let me note first: Great piece of software I am using in My “smart“ flat a lot. Thanks!

However, I am having an issue for which I cannot find an explanation on the web. Sometimes, my (single = no plight network) I.instance does not deliver its uuid with pilight-receive. This breaks some of my home assistant components, which seem to expect an uuid as a mandatory. Restarting the daemon usually fixes this.


Is there a way to force reporting an Uuid? Or is this even even optional?

Thanks!

Andreas
 
Reply
#2
Can you post an example when this happens?
 
Reply
#3
What would you like me to post? Logs? pilight-receive's outputs?

As this happens sporadically only, it might take some time til I come back with this...
 
Reply
#4
Yes, the actual output of the issue that you're describing.
 
Reply
#5
(11-20-2018, 10:56 PM)curlymo Wrote: Yes, the actual output of the issue that you're describing.

Alright I just restarted my pi this evening and already suspected, things might go wrong. I think I did a reboot from command line, no plug-out-plug-in-procedure. So here we go with the outputs...

1. There are no errors in /var/log/pilight.err, last entry is from April 
2. Here is the /var/log/pilight.log (the IP XXXX.114 is the local wifi address):
Code:
   [Nov 28 18:14:40:169069] pilight-daemon: INFO: Interrupt signal received. Please wait while pilight is shutting down
   [Nov 28 18:14:40:257330] pilight-daemon: INFO: removed stale pid_file /var/run/pilight.pid
   [ Nov 28 18:14:46:65735] pilight-daemon: INFO: version v8.1.3
   [Nov 28 18:14:46:167918] pilight-daemon: INFO: no pilight daemon found, daemonizing
   [Nov 28 18:14:57:752820] pilight-daemon: INFO: daemon listening to port: 5000
   [Nov 28 18:14:57:756369] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 37470
   [Nov 28 18:14:57:762026] pilight-daemon: INFO: secured webserver started on port: 5002 (fd 16)
   [Nov 28 18:14:57:768983] pilight-daemon: INFO: regular webserver started on port: 5001 (fd 13)
   [Nov 28 18:14:57:888384] pilight-daemon: INFO: new client, ip: XXXX.114, port: 57368
   [Nov 28 18:15:00:229404] pilight-daemon: WARNING: could not sync FW values
   [Nov 28 18:15:00:229504] pilight-daemon: INFO: pilight-usb-nano version: 1, lpf: 8, hpf: 1600
   [Nov 28 18:15:12:134215] pilight-daemon: INFO: new client, ip: XXXX.114, port: 57370
   [Nov 28 18:15:12:135166] pilight-daemon: INFO: new client, ip: XXXX.114, port: 57372
   [Nov 28 20:55:53:870883] pilight-daemon: INFO: new client, ip: XXXX.114, port: 37294
3. And this is the output of pilight-receive:
Code:
   {
           "message": {
                   "systemcode": 15,
                   "unitcode": 2,
                   "state": "on"
           },
           "origin": "receiver",
           "protocol": "pollin",
           "repeats": 1
   }
   {
           "message": {
                   "unitcode": 178943,
                   "state": "opened"
           },
           "origin": "receiver",
           "protocol": "ev1527",
           "repeats": 1
   }
   {
           "message": {
                   "systemcode": 15,
                   "unitcode": 2,
                   "state": "opened"
           },
           "origin": "receiver",
           "protocol": "elro_800_contact",
           "repeats": 1
   }

As you may notice, there is no UUID assigned to my nano receiver. 

I then restarted pilight via systemctl. Here's the output...


1. Still no errors
2. Output of log file:
Code:
   [Nov 28 21:06:56:556608] pilight-daemon: INFO: Interrupt signal received. Please wait while pilight is shutting down
   [Nov 28 21:06:56:559860] pilight-daemon: INFO: removed stale pid_file /var/run/pilight.pid
   [Nov 28 21:06:56:689382] pilight-daemon: INFO: version v8.1.3
   [Nov 28 21:06:56:789925] pilight-daemon: INFO: no pilight daemon found, daemonizing
   [Nov 28 21:06:56:800723] pilight-daemon: INFO: daemon listening to port: 5000
   [Nov 28 21:06:56:804902] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 46680
   [Nov 28 21:06:56:805894] pilight-daemon: INFO: secured webserver started on port: 5002 (fd 13)
   [Nov 28 21:06:56:808003] pilight-daemon: INFO: regular webserver started on port: 5001 (fd 15)
   [Nov 28 21:06:56:920605] pilight-daemon: INFO: new client, ip: XXXX.114, port: 38346
   [Nov 28 21:06:59:277979] pilight-daemon: WARNING: could not sync FW values
   [Nov 28 21:06:59:278118] pilight-daemon: INFO: pilight-usb-nano version: 1, lpf: 8, hpf: 1600


3. Output of pilight-receive:
Code:
   {
           "message": {
                   "systemcode": 15,
                   "unitcode": 2,
                   "state": "on"
           },
           "origin": "receiver",
           "protocol": "pollin",
           "uuid": "0000-b8-27-eb-a8767d",
           "repeats": 1
   }
   {
           "message": {
                   "unitcode": 703231,
                   "state": "opened"
           },
           "origin": "receiver",
           "protocol": "ev1527",
           "uuid": "0000-b8-27-eb-a8767d",
           "repeats": 1
   }
   {
           "message": {
                   "systemcode": 15,
                   "unitcode": 2,
                   "state": "opened"
           },
           "origin": "receiver",
           "protocol": "elro_800_contact",
           "uuid": "0000-b8-27-eb-a8767d",
           "repeats": 1
   }

Et voilá. There is a UUID.

So... I was curious and restarted my pi again with a reboot from the command line. The error is there again, no UUID. And a "sudo systemctl restart pilight" does the job in returning my UUID.

So... I was still curious and restarted my pi with the plug-procedure. Interestingly, now I have different things in my outputs:

1. pilight.log:
Code:
   [ Nov 28 21:18:37:35903] pilight-daemon: INFO: version v8.1.3
   [Nov 28 21:18:37:155787] pilight-daemon: INFO: no pilight daemon found, daemonizing
   [Nov 28 21:18:37:166749] pilight-daemon: INFO: daemon listening to port: 5000
   [Nov 28 21:18:37:166821] pilight-daemon: ERROR: cannot bind to the ssdp multicast network


2. pilight-receive:
Code:
[Nov 28 21:25:42:169105] pilight-receive: NOTICE: no pilight ssdp connections found


Restarting the pilight service fixes the multicast part of the problem. But my nano is still not found...


1. pilight.log:
Code:
   [Nov 28 21:26:27:485870] pilight-daemon: INFO: version v8.1.3
   [Nov 28 21:26:27:588978] pilight-daemon: INFO: no pilight daemon found, daemonizing
   [Nov 28 21:26:27:599789] pilight-daemon: INFO: daemon listening to port: 5000
   [Nov 28 21:26:27:604071] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 53272
   [Nov 28 21:26:27:604677] pilight-daemon: INFO: secured webserver started on port: 5002 (fd 14)
   [Nov 28 21:26:27:604746] pilight-daemon: INFO: regular webserver started on port: 5001 (fd 15)
   [Nov 28 21:26:27:719340] pilight-daemon: INFO: new client, ip: XXXXX.114, port: 54594
2. pilight-receive is empty

Interestingly, a second restart of the pilight service also brings my nano to life...

1. pilight.log:
Code:
   [Nov 28 21:29:06:755641] pilight-daemon: INFO: Interrupt signal received. Please wait while pilight is shutting down
   [Nov 28 21:29:06:760566] pilight-daemon: INFO: removed stale pid_file /var/run/pilight.pid
   [Nov 28 21:29:06:922791] pilight-daemon: INFO: version v8.1.3
   [ Nov 28 21:29:07:28969] pilight-daemon: INFO: no pilight daemon found, daemonizing
   [ Nov 28 21:29:07:39687] pilight-daemon: INFO: daemon listening to port: 5000
   [ Nov 28 21:29:07:42902] pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 53376
   [ Nov 28 21:29:07:45044] pilight-daemon: INFO: secured webserver started on port: 5002 (fd 15)
   [ Nov 28 21:29:07:45129] pilight-daemon: INFO: regular webserver started on port: 5001 (fd 14)
   [Nov 28 21:29:07:149370] pilight-daemon: INFO: new client, ip: XXXX.114, port: 54698
   [Nov 28 21:29:09:516602] pilight-daemon: WARNING: could not sync FW values
   [Nov 28 21:29:09:516681] pilight-daemon: INFO: pilight-usb-nano version: 1, lpf: 8, hpf: 1600
2. pilight-receive has a UUID
3. There is nothing interesting in the journalctl (in reverse order!) nor the dmesg in between 21:26:27 and 21:29:06...
Code:
   Nov 28 22:29:07 ak-test sudo[1451]: pam_unix(sudo:session): session closed for user root
   Nov 28 22:29:07 ak-test systemd[1]: Started pilight.
   Nov 28 22:29:06 ak-test systemd[1]: Starting pilight...
   Nov 28 22:29:06 ak-test systemd[1]: Stopped pilight.
   Nov 28 22:29:06 ak-test systemd[1]: Stopping pilight...
   Nov 28 22:29:06 ak-test sudo[1451]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
   Nov 28 22:29:06 ak-test sudo[1451]:     osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/systemctl restart pilight
   Nov 28 22:27:07 ak-test systemd[1]: Started Report anonymous OSMC install statistics.
   Nov 28 22:27:07 ak-test systemd[1]: Starting Report anonymous OSMC install statistics...
   Nov 28 22:26:27 ak-test sudo[1335]: pam_unix(sudo:session): session closed for user root
   Nov 28 22:26:27 ak-test systemd[1]: Started pilight.
   Nov 28 22:26:27 ak-test systemd[1]: Starting pilight...
   Nov 28 22:26:27 ak-test sudo[1335]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
   Nov 28 22:26:27 ak-test sudo[1335]:     osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/systemctl restart pilight


I hope you can find some cause in this massive log spam. Sorry for that, I just didn't want to miss anything... I also was a bit reluctant to post all my journalctl and dmesg outputs for the reboots. If that could help, I'll go about  and see, what I can anonymize!

Thanks already for your help!
 
Reply
#6
The uuid generator requires your network devices to be initiated. It seems like they are not visible when pilight automatically starts, but they are when pilight is started from the command line. Can you try starting pilight after the network devices have been initiated?
 
Reply
#7
Thanks for the hint! So, I guess, this can be done by changing the /etc/systemd/system/pilight.service file, right? It was installed as the following:

Code:
[Unit]
Description=pilight
After=network-online.target

[Service]
ExecStart=/usr/local/sbin/pilight-daemon
Type=forking

[Install]
WantedBy=multi-user.target


I searched the web and found this: http://www.freedesktop.org/wiki/Software...orkTarget/

Summary: The network-online.target appears to be the correct target to wait for. Also I might need a Wants directive in the service file. Also, I should make sure, my "wait" service is enabled.

So, I added the Wants directive to the service file as follows:

Code:
[Unit]
Description=pilight
After=network-online.target
Wants=network-online.target

[Service]
ExecStart=/usr/local/sbin/pilight-daemon
Type=forking

[Install]
WantedBy=multi-user.target

I also checked and enabled the "wait" services:

Code:
osmc@ak-test:~$ systemctl is-enabled NetworkManager-wait-online.service systemd-networkd-wait-online.service
Failed to get unit file state for NetworkManager-wait-online.service: No such file or directory
osmc@ak-test:~$ systemctl is-enabled systemd-networkd-wait-online.service
disabled
osmc@ak-test:~$ sudo systemctl enable systemd-networkd-wait-online.service
Created symlink /etc/systemd/system/network-online.target.wants/systemd-networkd-wait-online.service -> /lib/systemd/system/systemd-networkd-wait-online.service.

Judging from journalctl, it seems this waiting works. See the following entries:

Code:
Nov 28 23:57:40 ak-test systemd[1]: Reached target Network.
Nov 28 23:57:40 ak-test systemd[1]: Starting OpenVPN service...
Nov 28 23:57:40 ak-test systemd[1]: Reached target Network is Online.
Nov 28 23:57:40 ak-test systemd[1]: Starting Snapcast server...
Nov 28 23:57:40 ak-test systemd[1]: Starting /etc/rc.local Compatibility...
Nov 28 23:57:40 ak-test systemd[1]: Starting pilight...


However, after rebooting, I still don't have UUIDs. Restarting the pilight service still solves the issue.

Did I do something wrong with the services? I must admit, I am not very firm with this and I'm mostly trailing (and erring)...

Also, I have a pi3 with a LAN port. But I use WiFi. Maybe that affects my problem?
 
Reply
#8
It should just pick an available network device. What i'm going to do is just letting pilight retry the UUID generation if it fails in an certain interval.
 
Reply
#9
Thanks! That sounds like a practical circumvention of the problem. If need me to test the change, let me know!
 
Reply
#10
Can you try the latest nightly of tonight?
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
Exclamation How to change the uuid berl2n 1 1,116 03-13-2016, 10:44 PM
Last Post: curlymo

Forum Jump:


Browsing: 1 Guest(s)