• 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
Connection lost, trying to reconnect — loop
#1
Latest nightly does not switch my sockets and dimmers anymore (tested with intertechno sockets).
Debug message tells that connection to main pilight-daemon lost and goes into an infinite reconnection loop.
Switching does nothing neither via Web GUI nore pilight-control 

E.g.
Code:
pilight-control -S 127.0.0.1 -P 5000 -d light_ceiling_corridor -s on
does nothing (of course the device exists).

Version:
Code:
pilight-daemon version v8.1.4-nightly-6bc8511a

Debug message says:
Code:
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":13,"weekday":4,"hour":22,"minute":45,"second":55,"dst":0},"uuid":"0000-b8-27-eb-0f8ee3"}
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
Could any code change in the latest nightly causes this?
 
Reply
#2
What was the latest nightly version that did work?
 
Reply
#3
Unfortunately I missed some nightly's.
But I can tell that my last working version was 8.1.4-8-gd702224c (installed on 2019-02-08)

Installed on 2019-03-12: 8.1.4-24-g7202a438 (not working, lost connection to daemon, reconnection loop)
Installed on 2019-03-13: 8.1.4-25-g6bc8511a (not working, lost connection to daemon, reconnection loop)

Today I installed 8.1.4-31-gef298946.
During installation my config got overwritten with the default one.
I replaced it with a backup with no hardware modules configured.

pilight.log shows:

Code:
pilight-daemon: INFO: rule #2 sunrise-decolight was parsed in 0.007860 seconds
pilight-daemon: INFO: rule #3 sunset-decolight was parsed in 0.007783 seconds
pilight-daemon: INFO: version v8.1.4-nightly-ef298946
pilight-daemon: INFO: daemon listening to port: 5000
pilight-daemon: NOTICE: there are no hardware modules configured
pilight-daemon: INFO: secured webserver started on port: 5002 (fd 12)
pilight-daemon: INFO: regular webserver started on port: 5001 (fd 13)
pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 40500
pilight-daemon: NOTICE: no pilight ssdp connections found
pilight-daemon: INFO: new client, ip: 127.0.0.1, port: 40502

Debug messages:

Code:
sudo pilight-daemon -S 127.0.0.1 -P 5000 -D
pilight-daemon: DEBUG: loaded storage /usr/local/lib/pilight/storage/json/settings.lua v1.0
pilight-daemon: DEBUG: loaded storage /usr/local/lib/pilight/storage/json/hardware.lua v1.0
pilight-daemon: DEBUG: loaded storage /usr/local/lib/pilight/storage/json/registry.lua v1.0
pilight-daemon: INFO: datetime datetimedev xx.xxxxxx:xx.xxxxxx seems to be in timezone: Europe/Berlin
pilight-daemon: INFO: sunriseset sunrisesetdev xx.xxxxxx:xx.xxxxxx seems to be in timezone: Europe/Berlin
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/min.lua v2.1
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/max.lua v2.1
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/date_format.lua v1.0
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/date_add.lua v2.0
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/random.lua v2.1
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/plus.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/ge.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/minus.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/le.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/or.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/ne.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/divide.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/modulus.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/eq.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/multiply.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/lt.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/and.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/gt.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/intdivide.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/concat.lua v1.0
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/sendmail.lua v4.1
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/switch.lua v4.2
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/label.lua v4.1
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/pushbullet.lua v1.0
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/pushover.lua v1.0
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/toggle.lua v4.1
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/dim.lua v4.1
pilight-daemon: INFO: rule #1 group-decolight was parsed in 0.006206 seconds
pilight-daemon: INFO: rule #2 sunrise-decolight was parsed in 0.007869 seconds
pilight-daemon: INFO: rule #3 sunset-decolight was parsed in 0.007734 seconds
pilight-daemon: DEBUG: loaded hardware /usr/local/lib/pilight/hardware/433gpio.lua v4.1
pilight-daemon: DEBUG: loaded hardware /usr/local/lib/pilight/hardware/none.lua v4.1
pilight-daemon: DEBUG: loaded hardware /usr/local/lib/pilight/hardware/433nano.lua v4.1
pilight-daemon: INFO: version v8.1.4-nightly-ef298946
pilight-daemon: NOTICE: pilight daemon not found @127.0.0.1, waiting for it to come online
pilight-daemon: NOTICE: there are no hardware modules configured
pilight-daemon: DEBUG: new thread node, 1 thread running
pilight-daemon: DEBUG: new thread sender, 2 threads running
pilight-daemon: DEBUG: new thread broadcaster, 3 threads running
pilight-daemon: DEBUG: new thread receive parser, 4 threads running
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"sunriseset","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"sun":"rise","sunrise":6.22,"sunset":18.12},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: DEBUG: cpu: 0.000000%
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":15,"weekday":6,"hour":10,"minute":55,"second":34,"dst":0},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":15,"weekday":6,"hour":10,"minute":55,"second":35,"dst":0},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":15,"weekday":6,"hour":10,"minute":55,"second":36,"dst":0},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: cpu: 0.197296%
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":15,"weekday":6,"hour":10,"minute":55,"second":37,"dst":0},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":15,"weekday":6,"hour":10,"minute":55,"second":38,"dst":0},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
^C
pilight-daemon: INFO: Interrupt signal received. Please wait while pilight is shutting down

Version 8.1.4-31-gef298946 with configured hardware module does not start:

Code:
sudo pilight-daemon -S 127.0.0.1 -P 5000 -D
pilight-daemon: DEBUG: loaded storage /usr/local/lib/pilight/storage/json/settings.lua v1.0
pilight-daemon: DEBUG: loaded storage /usr/local/lib/pilight/storage/json/hardware.lua v1.0
pilight-daemon: DEBUG: loaded storage /usr/local/lib/pilight/storage/json/registry.lua v1.0
pilight-daemon: INFO: datetime datetimedev xx.xxxxxx:xx.xxxxxx seems to be in timezone: Europe/Berlin
pilight-daemon: INFO: sunriseset sunrisesetdev xx.xxxxxx:xx.xxxxxx seems to be in timezone: Europe/Berlin
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/min.lua v2.1
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/max.lua v2.1
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/date_format.lua v1.0
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/date_add.lua v2.0
pilight-daemon: DEBUG: loaded event function /usr/local/lib/pilight/functions/random.lua v2.1
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/plus.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/ge.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/minus.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/le.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/or.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/ne.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/divide.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/modulus.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/eq.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/multiply.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/lt.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/and.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/gt.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/intdivide.lua v1.0
pilight-daemon: DEBUG: loaded event operator /usr/local/lib/pilight/operators/concat.lua v1.0
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/sendmail.lua v4.1
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/switch.lua v4.2
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/label.lua v4.1
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/pushbullet.lua v1.0
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/pushover.lua v1.0
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/toggle.lua v4.1
pilight-daemon: DEBUG: loaded event action /usr/local/lib/pilight/actions/dim.lua v4.1
pilight-daemon: INFO: rule #1 group-decolight was parsed in 0.006213 seconds
pilight-daemon: INFO: rule #2 sunrise-decolight was parsed in 0.007898 seconds
pilight-daemon: INFO: rule #3 sunset-decolight was parsed in 0.007991 seconds
pilight-daemon: DEBUG: loaded hardware /usr/local/lib/pilight/hardware/433gpio.lua v4.1
pilight-daemon: DEBUG: loaded hardware /usr/local/lib/pilight/hardware/none.lua v4.1
pilight-daemon: DEBUG: loaded hardware /usr/local/lib/pilight/hardware/433nano.lua v4.1
pilight-daemon: INFO: version v8.1.4-nightly-ef298946
pilight-daemon: NOTICE: pilight daemon not found @127.0.0.1, waiting for it to come online
pilight-daemon: DEBUG: new thread node, 1 thread running
pilight-daemon: DEBUG: new thread sender, 2 threads running
pilight-daemon: DEBUG: new thread broadcaster, 3 threads running
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: new thread receive parser, 4 threads running
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"sunriseset","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"sun":"rise","sunrise":6.22,"sunset":18.12},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: DEBUG: lua wiringx on state #0
pilight-daemon: DEBUG: lua wiringx on state #0
pilight-daemon: DEBUG: lua wiringx on state #0
pilight-daemon: DEBUG: broadcasted: {"origin":"receiver","protocol":"datetime","message":{"longitude":xx.xxxxxx,"latitude":xx.xxxxxx,"year":2019,"month":3,"day":15,"weekday":6,"hour":10,"minute":59,"second":43,"dst":0},"uuid":"xxxx-xx-xx-xx-xxxxxx"}
pilight-daemon: DEBUG: cpu: 0.000000%
pilight-daemon: DEBUG: lua wiringx on state #0
pilight-daemon: ERROR: could not connect to pilight-daemon
pilight-daemon: NOTICE: connection to main pilight daemon lost
pilight-daemon: NOTICE: trying to reconnect...
pilight-daemon: DEBUG: lua wiringx on state #0
pilight-daemon: DEBUG: lua wiringx on state #0
pilight-daemon: DEBUG: lua wiringx on state #0
*** Error in `pilight-daemon': double free or corruption (fasttop): 0x01b3d3a0 ***

May be this is a totally different problem.

Current config settings:

Code:
        "settings": {
                "standalone": 1,
                "port": 5000,
                "log-level": 6,
                "pid-file": "/var/run/pilight.pid",
                "log-file": "/var/log/pilight.log",
                "webserver-enable": 1,
                "webserver-root": "/usr/local/share/pilight/webgui",
                "webserver-http-port": 5001,
                "webserver-cache": 1,
                "gpio-platform": "raspberrypi3",
                "ntp-servers": [ "0.debian.pool.ntp.org", "1.debian.pool.ntp.org", "2.debian.pool.ntp.org", "3.debian.pool.ntp.org" ]
        },
        "hardware": {
                "433gpio": {
                        "sender": 0,
                        "receiver": 1
                }
        },
        "registry": {
                "webserver": {
                        "ssl": {
                                "certificate": {
                                        "secure": 0,
                                        "location": "/etc/pilight/pilight.pem"
                                }
                        }
                },
                "pilight": {
                        "version": {
                                "current": "8.1.1"
                        }
                }
        }
 
Reply
#4
There are two issues here.
1: Adhoc not working anymore. We can discuss that one here. Can you revert pilight each nightly version step by step and tell which is the last one working.
2: Can you open a new topic for debugging the:

Code:
*** Error in `pilight-daemon': double free or corruption (fasttop): 0x01b3d3a0 ***
 
Reply
#5
I tried every nightly and reinstalled each version.
Right now the last version I got to work is 8.1.4-25-g6bc8511a
Latest nightly 8.1.4-31-gef298946 is unable to start but for this I started a new thread as you suggested.

This is a bit crazy as 8.1.4-25-g6bc8511a didn't work at my last test.
Anyway it seems to be the last working version.

One question:
My config settings are standalone: 1 and port: 5000
With this I should manually start the daemon in debug mode with the following command, right?
Code:
sudo pilight-daemon -S 127.0.0.1 -P 5000 -D

But with this command I get the "lost connection, trying to reconnect" messages.
I can only successfully start with
Code:
sudo pilight-daemon -D

May be I don't understand the standalone mode correctly.

Starting the daemon as a service is also working

Code:
sudo systemctl start pilight.service
 
Reply
#6
Can you post minimal configs for both machines to trigger the error. The setup i've tried just works.
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Infinite loop on sunrise rule caused by currentdatetime Trashware 18 1,921 10-14-2018, 03:41 PM
Last Post: kylex
  [Solved] No ssdp connection found Hexcode 145 146,800 12-23-2017, 02:10 PM
Last Post: HuberDe
  pilight without internet connection terrar 5 3,280 08-12-2016, 09:47 PM
Last Post: terrar
  [split] pilight Error : pilight hangs in a loop Tommybear1979 5 2,109 07-01-2016, 08:27 AM
Last Post: Tommybear1979

Forum Jump:


Browsing: 1 Guest(s)