ottopaulsen / MMM-Tibber

Show data from Tibber in MagicMirror
MIT License
33 stars 11 forks source link

Module freezes #41

Open andzie82 opened 1 year ago

andzie82 commented 1 year ago

Anyone else with the same problem? A reboot make it work again.

Can this be related to the issue?

[05.11.2022 20:03.04.385] [LOG] MMM-Tibber: Consumption parts: 0|MagicMirror | [05.11.2022 20:03.04.386] [LOG] MMM-Tibber: [] 0|MagicMirror | [05.11.2022 20:03.21.588] [LOG]
0|MagicMirror | Unhandled http GET request /setupservice.xml 0|MagicMirror | [05.11.2022 20:03.21.624] [LOG]
0|MagicMirror | Unhandled http GET request /setupservice.xml 0|MagicMirror | [05.11.2022 20:03.21.645] [LOG]
0|MagicMirror | Unhandled http GET request /setupservice.xml 0|MagicMirror | [05.11.2022 20:03.21.669] [LOG]
0|MagicMirror | Unhandled http GET request /setupservice.xml 0|MagicMirror | [05.11.2022 20:04.04.435] [LOG]
0|MagicMirror | MMM-Tibber: Tibber data: 0|MagicMirror | [05.11.2022 20:04.04.439] [LOG]

avolaid commented 1 year ago

i have the same problem...

TheGizmo2022 commented 1 year ago

Same here. The rest of the mirror is working, time is ticking and the Tibber module appears normal, but does not register actual usage or show cost.

Restart of MagicMirror app does not work, but restart of Pi solves the problem.. Appears to happen 1-3 times per week, and has been going on for a couple of months in my case.

mrhawkin commented 1 year ago

I have the same experience as @TheGizmo2022 except I am running magicmirrorOS (dockerized) where a restart of mm (docker) makes it work again. Its mostly visible on the gauges display. I thought it was related to memory (rpi zero2), but upgrading to rpi3 did not make a difference.

mrhawkin commented 1 year ago

After this error, the Watts gauge and price calculation stops:

[02.01.2023 00:02.32.158] [LOG] Terminating Tibber socket after timeout [02.01.2023 00:02.32.173] [LOG] Tibber socket disconnected unexpectingly. Reconnecting in 45 seconds. [02.01.2023 00:03.17.192] [LOG] Reconnecting Tibber subscription [02.01.2023 00:03.17.194] [LOG] Opening Tibber socket [02.01.2023 00:03.17.532] [LOG] Tibber socket connected: 1 [02.01.2023 00:03.17.533] [LOG] Initiating Tibber subscription [02.01.2023 00:03.17.543] [LOG] Subscription request:
[02.01.2023 00:03.17.846] [ERROR] Whoops! There was an uncaught exception... [02.01.2023 00:03.17.868] [ERROR] TypeError: Cannot read properties of undefined (reading 'liveMeasurement') at Class.receiveTibberSubscriptionData (/opt/magic_mirror/modules/MMM-Tibber/node_helper.js:186:30) at WebSocket.incoming (/opt/magic_mirror/modules/MMM-Tibber/tibber.js:221:7) at WebSocket.emit (node:events:526:28) at Receiver.receiverOnMessage (/opt/magic_mirror/modules/MMM-Tibber/node_modules/ws/lib/websocket.js:1178:20) at Receiver.emit (node:events:526:28) at Receiver.dataMessage (/opt/magic_mirror/modules/MMM-Tibber/node_modules/ws/lib/receiver.js:528:14) at Receiver.getData (/opt/magic_mirror/modules/MMM-Tibber/node_modules/ws/lib/receiver.js:446:17) at Receiver.startLoop (/opt/magic_mirror/modules/MMM-Tibber/node_modules/ws/lib/receiver.js:148:22) at Receiver._write (/opt/magic_mirror/modules/MMM-Tibber/node_modules/ws/lib/receiver.js:83:10) at writeOrBuffer (node:internal/streams/writable:389:12) at _write (node:internal/streams/writable:330:10) at Writable.write (node:internal/streams/writable:334:10) at TLSSocket.socketOnData (/opt/magic_mirror/modules/MMM-Tibber/node_modules/ws/lib/websocket.js:1272:35) at TLSSocket.emit (node:events:526:28) at addChunk (node:internal/streams/readable:315:12) at readableAddChunk (node:internal/streams/readable:289:9) at Readable.push (node:internal/streams/readable:228:10) at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)

I also get these errors from time to time, but it continue to work. I wonder if these issues has something with Tibber API breaking-change: https://developer.tibber.com/docs/overview#breaking-websocket-change

[01.01.2023 20:16.03.634] [LOG] Error: StatusCodeError: 504 - "\r\n504 Gateway Time-out\r\n\r\n

504 Gateway Time-out

\r\n\r\n\r\n" at new StatusCodeError (/opt/magic_mirror/modules/MMM-Tibber/node_modules/request-promise-core/lib/errors.js:32:15) at plumbing.callback (/opt/magic_mirror/modules/MMM-Tibber/node_modules/request-promise-core/lib/plumbing.js:104:33) at Request.RP$callback [as _callback] (/opt/magic_mirror/modules/MMM-Tibber/node_modules/request-promise-core/lib/plumbing.js:46:31) at self.callback (/opt/magic_mirror/modules/MMM-Tibber/node_modules/request/request.js:185:22) at Request.emit (node:events:526:28) at Request. (/opt/magic_mirror/modules/MMM-Tibber/node_modules/request/request.js:1154:10) at Request.emit (node:events:526:28) at IncomingMessage. (/opt/magic_mirror/modules/MMM-Tibber/node_modules/request/request.js:1076:12) at Object.onceWrapper (node:events:645:28) at IncomingMessage.emit (node:events:538:35) at endReadableNT (node:internal/streams/readable:1345:12) at process.processTicksAndRejections (node:internal/process/task_queues:83:21) { statusCode: 504, error: '\r\n' + '504 Gateway Time-out\r\n' + '\r\n' + '

504 Gateway Time-out

\r\n' + '\r\n' + '\r\n',

ottopaulsen commented 1 year ago

I am working on an update.

mrhawkin commented 1 year ago

The v3.0 update helped abit, but I still experience the realtime data stops.

The log output when it happens: [24.01.2023 13:33.30.095] [LOG] Error: FetchError: request to https://api.tibber.com/v1-beta/gql failed, reason: connect ETIMEDOUT 52.213.51.139:443 at ClientRequest.<anonymous> (/opt/magic_mirror/modules/MMM-Tibber/node_modules/node-fetch/lib/index.js:1491:11) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:481:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at process.processTicksAndRejections (node:internal/process/task_queues:83:21) { type: 'system', errno: 'ETIMEDOUT', code: 'ETIMEDOUT' }

andzie82 commented 1 year ago

And i get this as well now,

[26.01.2023 04:58.10.833] [LOG] MMM-Tibber: Consumption parts: [26.01.2023 04:58.10.834] [LOG] MMM-Tibber: [] [26.01.2023 04:58.24.231] [INFO] Calendar-Fetcher: Broadcasting 421 events. [26.01.2023 04:59.11.057] [LOG] Reconnecting (retry no 6) [26.01.2023 04:59.11.057] [LOG] Initializing WebSocket [26.01.2023 04:59.11.331] [LOG] Tibber WebSocket closed [26.01.2023 04:59.21.061] [LOG] Reconnecting in 146 seconds [26.01.2023 05:01.16.431] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.450] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.465] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.479] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.522] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.564] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.580] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.16.608] [LOG] Unhandled http GET request /setupservice.xml [26.01.2023 05:01.47.065] [LOG] Reconnecting (retry no 7) [26.01.2023 05:01.47.065] [LOG] Initializing WebSocket [26.01.2023 05:01.47.340] [LOG] Tibber WebSocket closed [26.01.2023 05:01.57.072] [LOG] Reconnecting in 302 seconds

ottopaulsen commented 1 year ago

I think this is resolved in version 3.0.1. Please confirm.

mrhawkin commented 1 year ago

I did upgrade to 3.0.1 the 19th Feb, but I still experiencing the real-time data stops after some time. To get it working again, I have to restart the docker container (MagicMirrorOS). I wonder if its related to what has been discussed in #48

ottopaulsen commented 8 months ago

I still experience that the gauges are freezing from time to time. My current workaround is to restart MM every night using crontab. Sorry I have no better solution, but if anyone can supply logs from around when freezing, it could be interesting.

DanielHabenicht commented 7 months ago

I also got a "freeze", but for me, the price chart stays working. The consumption data however is not displayed anymore (I don't use any gauges but, they use the same data). After changing the token it started working again. I debugged a little and found out that before changing the token my websocket connection was just closed directly after connecting to it. I now changed my refresh interval to 10 (as reported in #48) and will report back if it still works in a few days. Last time it did take some time till the problem manifested itself.