Read the statement by Michael Teeuw here.
Logging issues
-
I’m having trouble with logging issues again - and want to get some feedback on why and how it’s not working -
Trying to get a module (MMM-pages) to work the way I want it to - and notice in the code that it’s using
Log.warnto try and log errors and whatnot.I’m launching MM with pm2, in a server/client enviroment.
PM2 logs show nothing from this module, either on the server or the client.
my config.js has log level set at
logLevel: ["INFO", "LOG", "WARN", "ERROR", "DEBUG"],where is this actually logging to?
-
@BKeyport browser side goes to the browser console , which you can see in the developers window, console tab (how i debugged your recent problem)
pm2 only sees the stdout/stderr consoles (so only from node_helpers log. or console.)so to merge them together you would use
MMM-Logging or MMM-LogExt
then all the messages are logged in the stdout/err consolei extended logging, MMRIZE did LogExt
logLevel decides which messages print
-
Ended up loading it up on my PC to get the console.
So, here’s what I got…
- Apparently, MMM-pages will resume the rotation if you tell it to pause, but it’s already paused.
- It should be documented that MMM-pages will pause as part of the hidden pages routine.
While I was looking and debugging
Out of curiosity, why would calendar try to update the DOM without being given a location to display
-
@BKeyport module doesn’t know its position (or lack thereof)
it signals updateDom() which calls getDom()
oops no place to put it. oh wellhidden pages stop rotation
.i think it says that ‘not in the normal rotation’
pause while paused restarts is a bug i think, will review
as i just fixed that area too -
@BKeyport i looked thru the code and dont SEE a path where pause while paused restarts, but i will test later tonight
can you show any part of what you logged?
-
@sdetweil While this is broken up to explain what is sent where, there’s no lines in between other than the diagnostics on the error for “already paused”
Sent: curl -X GET http://mirrorserv:8080/api/notification/PAGE_CHANGED/0
[MMM-pages] received a notification to change to page 0 of type string. module.js:189 MMM-pages is suspended. module.js:189 MMM-CalendarExt3Agenda is suspended. module.js:189 MMM-OpenWeatherForecast is suspended. module.js:189 MMM-CalendarExt3 is suspended. module.js:196 alert is resumed. module.js:196 calendar is resumed. module.js:196 MMM-Remote-Control is resumed. module.js:196 clock is resumed. module.js:196 MMM-Worldclock is resumed. module.js:196 MMM-Wallpaper is resumed. module.js:196 MMM-CalendarExt3 is resumed. module.js:196 MMM-CalendarExt3Agenda is resumed. module.js:196 MMM-Multimonth is resumed.Sent: curl -X GET http://mirrorserv:8080/api/notification/PAUSE_ROTATION/
MMM-pages.js:311 [MMM-pages] pausing rotationSent: curl -X GET http://mirrorserv:8080/api/notification/PAGE_CHANGED/2
[MMM-pages] received a notification to change to page 2 of type string. module.js:189 MMM-pages is suspended. module.js:189 MMM-CalendarExt3Agenda is suspended. 3module.js:189 MMM-Multimonth is suspended. module.js:189 MMM-CalendarExt3Agenda is suspended. module.js:189 MMM-CalendarExt3 is suspended. module.js:196 alert is resumed. module.js:196 calendar is resumed. module.js:196 MMM-Remote-Control is resumed. module.js:196 clock is resumed. module.js:196 MMM-Worldclock is resumed. module.js:196 MMM-Wallpaper is resumed. module.js:196 MMM-CalendarExt3 is resumed. module.js:196 MMM-OpenWeatherForecast is resumed.Sent: curl -X GET http://mirrorserv:8080/api/notification/PAUSE_ROTATION/
MMM-pages.js:309 [MMM-pages] was asked to pause but rotation is already paused! MMM-pages.js:100 [MMM-pages] received a notification to increment pages! module.js:189 MMM-pages is suspended.etc.
The diagnostics:
MMM-pages.js:309 [MMM-pages] was asked to pause but rotation is already paused! setRotation @ MMM-pages.js:309 notificationReceived @ MMM-pages.js:123 sendNotification @ main.js:99 sendNotification @ main.js:649 sendNotification @ module.js:350 socketNotificationReceived @ MMM-Remote-Control.js:159 (anonymous) @ module.js:240 (anonymous) @ socketclient.js:32 Emitter.emit @ index.js:136 emitEvent @ socket.js:553 onevent @ socket.js:540 MMSocket.socket.onevent @ socketclient.js:26 onpacket @ socket.js:508 Emitter.emit @ index.js:136 (anonymous) @ manager.js:217 Promise.then (anonymous) @ globals.js:4 ondecoded @ manager.js:216 Emitter.emit @ index.js:136 add @ index.js:142 ondata @ manager.js:203 Emitter.emit @ index.js:136 _onPacket @ socket.js:259 Emitter.emit @ index.js:136 onPacket @ transport.js:99 onData @ transport.js:91 ws.onmessage @ websocket.js:48 -
@BKeyport sent message
-
@sdetweil Got message - nothing critical, as usual. and if you have a better way to set page & pause (stop), then later resuming (start) the rotation, I’m all ears.
For reference, same configuration as before.
-
@BKeyport git pull for update
I think you can set page (will resume rotation)
then immediately (or before rotationTime) pauseRotation -
@sdetweil – Pausing is working perfectly, but we moved the bug elsewhere.
[MMM-pages] received a notification to change to page 0 of type string. MMM-pages.js:192 [MMM-pages] cannot change to a named page 0' updatePages @ MMM-pages.js:192 notificationReceived @ MMM-pages.js:102 sendNotification @ main.js:99 sendNotification @ main.js:649 sendNotification @ module.js:350 socketNotificationReceived @ MMM-Remote-Control.js:159 (anonymous) @ module.js:240 (anonymous) @ socketclient.js:32 Emitter.emit @ index.js:136 emitEvent @ socket.js:553 onevent @ socket.js:540 MMSocket.socket.onevent @ socketclient.js:26 onpacket @ socket.js:508 Emitter.emit @ index.js:136 (anonymous) @ manager.js:217 Promise.then (anonymous) @ globals.js:4 ondecoded @ manager.js:216 Emitter.emit @ index.js:136 add @ index.js:142 ondata @ manager.js:203 Emitter.emit @ index.js:136 _onPacket @ socket.js:259 Emitter.emit @ index.js:136 onPacket @ transport.js:99 onData @ transport.js:91curl -X GET http://mirrorserv:8080/api/notification/PAGE_CHANGED/0 curl -X GET http://mirrorserv:8080/api/notification/PAUSE_ROTATION/ -
@BKeyport can you show me the actual request for page 0
its a number, 0 , not a string “0” or ‘0’
-
@sdetweil it’s through MMM-Remote-Control - the curl statements above is what is sent to trigger.
-
@BKeyport ok, will look at what to do
-
@sdetweil FWIW, it worked before the latest changes, just didn’t pause as requested.
-
@BKeyport yes, i know, i sent a notification with a string and it crashed. so i added a check, its NOT supposed to be a string
but ive got to figure out how to deal with that -
@sdetweil Yeah, I was looking into the code myself.
Maybe a re-write to see if it’s a string, then parseint(this.curPage) - and if it’s not NaN, run it?
-
@BKeyport yeh, but parseInt stops if it sees a non numeric, but doesn’t fail
so 1234test returns 1234
which is incomplete
such was my comment about what to do
-
@BKeyport git pull when you have time
-
@sdetweil OK. It’s now changing pages correctly, but it will resume rotation if pause is already set and you request it again.
-
@BKeyport did you log that?
doing pause-rotation?
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login