Domoticz crashes with P1 Wifi gateway

Please use template to report bugs and problems. Post here your questions when not sure where else to post
Only for bugs in the Domoticz application! other problems go in different subforums!
Forum rules
Before posting here, make sure you are on the latest Beta or Stable version.
If you have problems related to the web gui, clear your browser cache + appcache first.

Use the following template when posting here:

Version: xxxx
Platform: xxxx
Plugin/Hardware: xxxx
Description:
.....

If you are having problems with scripts/blockly, always post the script (in a spoiler or code tag) or screenshots of your blockly

If you are replying, please do not quote images/code from the first post

Please mark your topic as Solved when the problem is solved.
Post Reply
Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 11:20

Hi,

I have an issue with my P1 Wifi gateway. Domoticz crashes and the problem got worse with the latest betas. With the last stable it also crashed, but that happened "only" once a day and Minot was able to restart Domoticz. With the latest betas, it crashes continuously and Monit is not able to get everything up-and-running again, so a reboot was needed.

At first I thought it was my system (I experiment a lot on my system), so I did a complete clean re-install yesterday. but the issue was the same. I disabled the hardware in Domoticz and everything now runs fine.

The log shows:

Code: Select all

Aug 19 21:50:13 domoticz domoticz: P1 Wifi Gateway hardware (12) thread seems to have ended unexpectedly
Aug 19 21:50:13 domoticz domoticz: P1 Wifi Gateway hardware (12) nothing received for more than 1 Minute!....
Aug 19 21:50:14 domoticz domoticz: Restarting: P1 Wifi Gateway
Aug 19 21:50:14 domoticz domoticz: Domoticz(pid:464, tid:478('MainWorker')) received fatal signal 6 (Aborted)
Aug 19 21:50:14 domoticz domoticz: siginfo address=0x1d0, address=0xffffffff
Aug 19 21:50:18 domoticz domoticz: P1 Smart Meter: TCP/IP Worker stopped...
Aug 19 21:50:19 domoticz domoticz: Thread 11 (Thread 0x708ff430 (LWP 478)):
Aug 19 21:50:19 domoticz domoticz: #0  0x76eda4cc in __waitpid (pid=24023, stat_loc=0x708fe130, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:29
Aug 19 21:50:19 domoticz domoticz: #1  0x002bddd8 in dumpstack_gdb(bool) ()
Aug 19 21:50:19 domoticz domoticz: #2  0x002be3c8 in signal_handler(int, siginfo_t*, void*) ()
Aug 19 21:50:19 domoticz domoticz: #3  <signal handler called>
Aug 19 21:50:19 domoticz domoticz: #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
Aug 19 21:50:19 domoticz domoticz: #5  0x76c83824 in __GI_abort () at abort.c:89
Aug 19 21:50:19 domoticz domoticz: #6  0x009b9240 in __gnu_cxx::__verbose_terminate_handler() ()
Aug 19 21:50:19 domoticz domoticz: #7  0x00919ae4 in __cxxabiv1::__terminate(void (*)()) ()
Aug 19 21:50:19 domoticz domoticz: #8  0x00919b58 in std::terminate() ()
Aug 19 21:50:19 domoticz domoticz: #9  0x00254e18 in std::_Sp_counted_ptr_inplace<std::thread, std::allocator<std::thread>, (__gnu_cxx::_Lock_policy)1>::_M_dispose() ()
There P1 Wifi Gateway has been running fine before the issues started, but I'm not sure when the issues started. Nothing has been changed with the P1 Wifi Gatway since I installed it, no new firmware, nothing. I use this P1 Wifi gateway: http://www.esp8266thingies.nl/wp/

I hope someone can help me solve this.

Regards,

Martijn

JimmyH1969
Posts: 103
Joined: Tuesday 28 June 2016 16:38
Target OS: Windows
Domoticz version: Beta
Location: Amersfoort NL
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by JimmyH1969 » Monday 20 August 2018 13:20

Just downloaded the latest beta on a Windows system and added my P1-Wifi Gateway ( i have the same as you do)
No errors in my log....

2018-08-20 13:15:50.248 Status: P1 Smart Meter: connected to: 192.168.1.1:8088
2018-08-20 13:15:58.200 (test) P1 Smart Meter (Power)
2018-08-20 13:15:58.235 (test) P1 Smart Meter (Gas)
2018-08-20 13:15:58.138 Status: P1 Smart Meter: Meter reports as DSMR 4.2
2018-08-20 13:15:58.145 Status: P1 Smart Meter: Found gas meter on M-Bus channel 1
2018-08-20 13:16:08.171 (test) P1 Smart Meter (Power)
2018-08-20 13:16:18.201 (test) P1 Smart Meter (Power)
2018-08-20 13:16:28.222 (test) P1 Smart Meter (Power)
2018-08-20 13:16:38.234 (test) P1 Smart Meter (Power)

Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 14:20

JimmyH1969 wrote:
Monday 20 August 2018 13:20
Just downloaded the latest beta on a Windows system and added my P1-Wifi Gateway ( i have the same as you do)
No errors in my log....
Hmmm... Interesting. Maybe it is a hardware glitch, but I hardly can imagine, as all seems to be working just fine with the P1 gateway and when manually accessing the data.

gordonb3
Posts: 175
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by gordonb3 » Monday 20 August 2018 15:36

You appear to have enabled a one minute data timeout on the hardware. This should normally not cause any issues as the P1 is supposed to communicate at least every 10 seconds, but that ESP device of yours features a CRC check similar to the one used in Domoticz itself. If that check fails then the ESP will not pass on the message and thus Domoticz will see no communication.

Which is where the second problem starts. Just before the new stable thread handling was switched from Boost to C++11 and an issue has been raised that with several hardware types Domoticz crashes when you disable that hardware (including stopping Domoticz). Apparently the P1 via TCP hardware is one of those hardware types.

Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 16:32

gordonb3 wrote:
Monday 20 August 2018 15:36
You appear to have enabled a one minute data timeout on the hardware. This should normally not cause any issues as the P1 is supposed to communicate at least every 10 seconds, but that ESP device of yours features a CRC check similar to the one used in Domoticz itself. If that check fails then the ESP will not pass on the message and thus Domoticz will see no communication.

Which is where the second problem starts. Just before the new stable thread handling was switched from Boost to C++11 and an issue has been raised that with several hardware types Domoticz crashes when you disable that hardware (including stopping Domoticz). Apparently the P1 via TCP hardware is one of those hardware types.
Hi Gordon,

Thanks for your explanation. And it actually does crash Domoticz when I disable it. But when restarted, the device is disabled fortunately.

But is there anything I can do to (temporarily) solve this? Should I decrease the timeout on the device? Or disable the CRC check? Or just wait for a new build of Domoticz that fixes this issue? Or is it an issue that is not t be fixed by Domoticz and should the P1 Gateway guy fix this?

JimmyH1969
Posts: 103
Joined: Tuesday 28 June 2016 16:38
Target OS: Windows
Domoticz version: Beta
Location: Amersfoort NL
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by JimmyH1969 » Monday 20 August 2018 16:46

Is enabeling the CRC check not the solution then. In my setup it's always enabled.

Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 17:10

JimmyH1969 wrote:
Monday 20 August 2018 16:46
Is enabeling the CRC check not the solution then. In my setup it's always enabled.
I've been reading up on the P1 Wifi documentation and with my smart meter, it does not matter if I enable or disable the CRC check. As the P1 gateway does a CRC check itself when reading data from the smart meter.

gordonb3
Posts: 175
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by gordonb3 » Monday 20 August 2018 17:32

I think the P1 gateway also allows disabling the CRC check for debug purposes, which might help you identify the source of the problem or at least allow Domoticz to receive something. Of course at that point it will be Domoticz that discards the message on account of the CRC validation failing, unless you disable that there as well. There is no telling how much misinformation you'll get from doing so though, so unless for testing please don't.

Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 17:40

gordonb3 wrote:
Monday 20 August 2018 17:32
I think the P1 gateway also allows disabling the CRC check for debug purposes, which might help you identify the source of the problem or at least allow Domoticz to receive something. Of course at that point it will be Domoticz that discards the message on account of the CRC validation failing, unless you disable that there as well. There is no telling how much misinformation you'll get from doing so though, so unless for testing please don't.
It is not in the standard settings of the P1 Gateway to disable the CRC.

I also enabled the device again in Domoticz with a new static IP-address and a new port number and, as long as I don't disable it in Domoticz, it has been running fine for a couple of hours. But let's wait and see what happens when time passes.

But I still don't understand where this issue should be fixed. Can you elaborate on that? I did read abut similar issues on the forum, so I think it is an issue in Domoticz, but I could be wrong.

gordonb3
Posts: 175
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by gordonb3 » Monday 20 August 2018 18:23

It's not in Domoticz. The most common issue with P1 is in the interlink between the meter and your machine: bad contacts or wiring, incorrect drop down resistor (different for ESMR 5+), unstable power supply etc. The ESP module adds possible (wifi) networking errors to that and apparently the impossibility to monitor the (P1) input or view its raw data when it contains errors.

You say it has worked correctly since you changed the IP address and communication port number on the ESP module. This will have caused a restart of the module and from this I'd say the most likely cause for the issue will have been a memory allocation problem inside the module.

Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 18:35

gordonb3 wrote:
You say it has worked correctly since you changed the IP address and communication port number on the ESP module. This will have caused a restart of the module and from this I'd say the most likely cause for the issue will have been a memory allocation problem inside the module.
I restarted the device multiple times before today, and hoped that would solve the issue. But Domoticz still crashes, even today after the reconfiguration of the IP and port, when I disable the hardware in Domoticz. That is something in Domoticz I presume, or not? I can't imagine that has something to do with the connection or the device.

Quite some time ago, the device worked just fine and there where no Domoticz crashes. Nothing changed on the P1 gateway or with my wifi, but I understand that can create issues.

I did find an option to display the values read by the device by flashing a firmware that has an extra menu, but there is no history, only current values.

P.S. I did notice some VERY high values in the graph in Domoticz
Image

gordonb3
Posts: 175
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by gordonb3 » Monday 20 August 2018 22:17

Yes, like I explained earlier the crash when disabling the hardware is a Domoticz issue. In your case the cause for that crash to occur regularly is that you set a data timeout for restarting the hardware (i.e disable and enable in sequence) and your data source was in fact not sending any data for whatever reason. Obviously, the same applies if you disable the hardware manually: it will still trigger the crash.

Thelion
Posts: 46
Joined: Saturday 08 October 2016 12:15
Target OS: Raspberry Pi
Domoticz version: Beta
Location: The Netherlands
Contact:

Re: Domoticz crashes with P1 Wifi gateway

Post by Thelion » Monday 20 August 2018 22:19

gordonb3 wrote:Yes, like I explained earlier the crash when disabling the hardware is a Domoticz issue. In your case the cause for that crash to occur regularly is that you set a data timeout for restarting the hardware (i.e disable and enable in sequence) and your data source was in fact not sending any data for whatever reason. Obviously, the same applies if you disable the hardware manually: it will still trigger the crash.
Ah. I understand now. Got it.

Post Reply

Who is online

Users browsing this forum: Google [Bot], ShaunJ and 3 guests