bugsounet / MMM-Pir

Manage your screen with a pir sensor
MIT License
28 stars 7 forks source link

v1.2.0 #31

Closed bugsounet closed 6 months ago

bugsounet commented 7 months ago

Add:

Update dependencies (all sub-deps for MM² rebuild)

Update:

Fix: Typo in readme (@JHWelch)

Remove features:

Todo:

bugsounet commented 7 months ago

@giovamec : can you to add this feature on your MMM-Pirconfig and try this on develop branch:

and restart your MM²

Tell me if ok for you, Thanks for you help

@bugsounet

giovamec commented 7 months ago

Dear @bugsounet I ran the new configuration and did some tests. now when you wakeup, the screen configuration restores correctly :-)

MMM-PIR WakeUP However, VNC configuration has become disabled. VNC disable

I can always check via ssh or xrdp but it seems very strange to me. In the old configuration of the MMM-NewPir module it didn't happen, but it could also be a waylan problem with turning off the screen :-).

thanks for the implementations. Giovamec

bugsounet commented 7 months ago

I ran the new configuration and did some tests. now when you wakeup, the screen configuration restores correctly :-)

Perfect so ! I will code TouchScreen feature tomorrow :-)

I can always check via ssh or xrdp but it seems very strange to me. In the old configuration of the MMM-NewPir module it didn't happen, but it could also be a waylan problem with turning off the screen :-).

Yes maybe because I have some problem with VNC too (not the same... disconnect/connect problem) with wayland Note: Under bulleyes, It works...

sdetweil commented 7 months ago

VNC under Wayland is still broken

bugsounet commented 7 months ago

not really. I just try a fresh install of bookworm (with Release date: December 5th 2023) and it's works but it's not stable, there is some disconnect

Note: In first version of bookworn, i'm agree with you.. it's not works

bugsounet commented 7 months ago

image

VNC under bookworm

bugsounet commented 7 months ago

@giovamec :

touchScreen functionality is now added. You can update it with npm run update inside MMM-Pir Folder

Please consult new Readme and tell me if it's ok for you before releasing :)

bugsounet commented 7 months ago

@sdetweil :

Are you able to review this part ?

I just make an fresh install of bookwarn yesterday I see this dpms_timeout = 0 is not writed why because this is no dpms_timeout = on this file

So I search this result Rules

...
[Idle]
dpms_timeout = 0
....

So maybe we have to check dpms_timeout = and [idle] if dpms_timeout = --> modify to dpms_timeout = 0 if there is [idle] -> write dpms_timeout = 0 on this section if no [idle] and no dpms_timeout = 0 --> create an [idle] section and add dpms_timeout = 0 inside

I know you are stronger than me in bash ;) a little help would be welcome :)

sdetweil commented 7 months ago

will do in the morning...

bugsounet commented 7 months ago

@giovamec : I confirm, vnc server will be close when screen turn off (when using wlr-randr command) I will see if there is a param somewhere for this...

sdetweil commented 7 months ago

I posted a review.. my pi5 doesn't have anything to do with DPMS in wayfire.ini

I don't find any reference

my screensaveroff reports

gsettings screen saver already disabled
screensaver via lightdm already disabled
lxsession screen saver already disabled
disable screensaver via wayfire.ini

altho the wayfire code doesn't work..

giovamec commented 7 months ago

Dear @bugsounet, sorry for the delay in checking but I tried to do more tests with 2 touch monitors, a "Wimaxit full hd touch" and "AcerT231H". screenTouch and touchMode feature:

- touchMode: 0 disabled

- touchMode: 1 One click on the screen will restart the timer (or Wake up the screen if needed)

- touchMode: 2 One Click on the EXT-Screen area will restart the timer

- touchMode: 3 One Click on the EXT-Screen area will restart the timer

MMM LOG: 0|MagicMirror | [14.01.2024 16:30.32.561] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 4000 0|MagicMirror | [14.01.2024 16:30.33.561] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 01:55 0|MagicMirror | [14.01.2024 16:30.33.563] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 5000 0|MagicMirror | [14.01.2024 16:30.34.562] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 01:54 0|MagicMirror | [14.01.2024 16:30.34.563] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 6000 0|MagicMirror | [14.01.2024 16:30.35.565] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 01:53 0|MagicMirror | [14.01.2024 16:30.35.571] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 7000 0|MagicMirror | [14.01.2024 16:30.36.564] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 00:00 0|MagicMirror | [14.01.2024 16:30.36.567] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 120000 0|MagicMirror | [14.01.2024 16:30.36.616] [LOG] [MMM-Pir] Screen Callback: SCREEN_PRESENCE false 0|MagicMirror | [14.01.2024 16:30.36.739] [LOG] [MMM-Pir] Screen Callback: SCREEN_POWER false Auto wake up without any touch action and the last time presence is 0:00, if I click after several seconds on EXT area it restart time as you can see in the following log 0|MagicMirror | [14.01.2024 16:31.19.770] [LOG] [MMM-Pir] Screen Callback: SCREEN_PRESENCE true 0|MagicMirror | [14.01.2024 16:31.20.808] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 02:00 0|MagicMirror | [14.01.2024 16:31.20.821] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 0 0|MagicMirror | [14.01.2024 16:31.21.810] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 01:59 0|MagicMirror | [14.01.2024 16:31.21.812] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 1000 0|MagicMirror | [14.01.2024 16:31.22.811] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 01:58 0|MagicMirror | [14.01.2024 16:31.22.812] [LOG] [MMM-Pir] Screen Callback: SCREEN_BAR 2000 0|MagicMirror | [14.01.2024 16:31.23.812] [LOG] [MMM-Pir] Screen Callback: SCREEN_TIMER 01:57

Module configuration: { module: 'MMM-Pir', position: 'top_center', config: { debug: true, delay: 2 60 1000, turnOffDisplay: true, mode: 10, ecoMode: false, displayCounter: true, displayBar: true, displayStyle: "SemiCircle", displayLastPresence: true, lastPresenceTimeFormat: "LL H:mm", mode6_gpio: 20, mode6_clearGpioValue: true, pir_gpio: 21, pir_reverseValue: false, //xrandrForceRotation: "270", wrandrForceRotation: "270", touchMode: 3 } },

I hope it is clear :-) Giovamec

bugsounet commented 7 months ago

Thanks for this report. I will see what "can" i do for this ;)

giovamec commented 7 months ago

dear @bugsounet , yesterday I put some notes for further tests but I can't find it in this pull, I'll rewrite it:

  1. I switched to X11 mode and did all the tests in all modes and the monitor turns off and wake up correctly based on the different modes. So X11 is OK.
  2. I went back to wayland and with "ecoMode: true", the mode touch work correctly but the monitor hides all the modules but it doesn't turn off, obviously it wake up correctly.
  3. In wayland and with "ecoMode: false", the mode touch work correctly but the monitor turn off, but few seconds (abaut 2s) it wake up itself without any touch either on the touch or on the pir and SCREEN_TIMER is 00:00.

I hope this info reduces your debugging time Giovamec

sdetweil commented 7 months ago

here is the test script for checking and modifying wayfire.ini for idle and dpms_timeout testit.sh.txt

giovamec commented 6 months ago

dear @sdetweil tnks for the script, I'll try it as soon as possible. Giovamec

bugsounet commented 6 months ago

@sdetweil, thx. I will try it soon. Sorry I'm working around another module :/

bugsounet commented 6 months ago

@sdetweil : I have added this missing part: if an DPMS_VALUE is already set in [idle] section, see there

sdetweil commented 6 months ago

cool, thx for feedback

bugsounet commented 6 months ago

cool, thx for feedback

and added -i option in sed there

bugsounet commented 6 months ago

(not finish just begin coding new rules for touch)

bugsounet commented 6 months ago

@giovamec : tell me if better with touch?

with touch, if you shutdown screen:

I make this rule because I think "other" module send noti with USER_PRESENCE for wake up (and restart timer)

Remove features:

giovamec commented 6 months ago

dear @bugsounet, thanks for the updates, I can't currently test because I'm away from home for work for 2 weeks. As soon as I get back it's the first thing I'll do. Thank you. Giovamec

giovamec commented 5 months ago

dear @bugsounet , sorry for the huge delay in carrying out the tests after your precious updates. However, I'm missing something that works perfectly in MODE 9, but in MODE 10 the monitor doesn't turn off completely, meaning it gets dark but stays on. I noticed something in the log that I don't know if it can help, there is a reference to the second HDMI-A-2 in MODE 10 while in MODE 9 the reference is correct to HDMI-A-1. Could it be that the shutdown is being sent to the wrong HDMI? These are the logs in X11 MODE 9 and Wayland MODE10:

--------------> MODE 9 -> touchMode: 3 0|MagicMirror | [01.03.2024 20:00.13.037] [LOG] [MMM-Pir] [LIB] [PIR] Start 0|MagicMirror | [01.03.2024 20:00.13.048] [LOG] [MMM-Pir] [CALLBACK] Pir: PIR_STARTED 0|MagicMirror | [01.03.2024 20:00.13.061] [LOG] [MMM-Pir] [LIB] [PIR] Started! 0|MagicMirror | [01.03.2024 20:00.13.081] [LOG] [MMM-Pir] [LIB] [SCREEN] Mode 9: xrandr (primary display) -- Rotation: normal 0|MagicMirror | [01.03.2024 20:00.13.089] [LOG] [MMM-Pir] [LIB] [SCREEN] Start. 0|MagicMirror | [01.03.2024 20:00.13.092] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_PRESENCE true 0|MagicMirror | [01.03.2024 20:00.13.131] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_SHOWING 0|MagicMirror | [01.03.2024 20:00.13.148] [LOG] [MMM-Pir] Started! 0|MagicMirror | [01.03.2024 20:00.13.299] [LOG] [MMM-Pir] [LIB] [SCREEN] [MODE 9] Monitor on HDMI-1 is on 0|MagicMirror | [01.03.2024 20:00.13.309] [LOG] [MMM-Pir] [LIB] [SCREEN] Display: Force On Start 0|MagicMirror | [01.03.2024 20:00.13.319] [LOG] [MMM-Pir] [LIB] [SCREEN] Display ON. 0|MagicMirror | [01.03.2024 20:00.14.704] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_POWERSTATUS true 0|MagicMirror | [01.03.2024 20:00.14.706] [LOG] [MMM-Pir] [LIB] [SCREEN] [POWER] Display from false ---> true 0|MagicMirror | [01.03.2024 20:00.14.746] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '01:00', bar: 0 } 0|MagicMirror | [01.03.2024 20:00.16.161] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:59', bar: 1000 } ... ... 0|MagicMirror | [01.03.2024 19:57.14.291] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:03', bar: 57000 } 0|MagicMirror | [01.03.2024 19:57.15.292] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:02', bar: 58000 } 0|MagicMirror | [01.03.2024 19:57.16.293] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:01', bar: 59000 } 0|MagicMirror | [01.03.2024 19:57.17.293] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:00', bar: 60000 } 0|MagicMirror | [01.03.2024 19:57.17.296] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_HIDING 0|MagicMirror | [01.03.2024 19:57.17.328] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_PRESENCE 0|MagicMirror | [01.03.2024 19:57.17.329] [LOG] [MMM-Pir] [LIB] [SCREEN] Stops by counter. 0|MagicMirror | [01.03.2024 19:57.17.416] [LOG] [MMM-Pir] [LIB] [SCREEN] [MODE 9] Monitor on HDMI-1 is on 0|MagicMirror | [01.03.2024 19:57.17.417] [LOG] [MMM-Pir] [LIB] [SCREEN] Display -- Actual: true - Wanted: false 0|MagicMirror | [01.03.2024 19:57.17.417] [LOG] [MMM-Pir] [LIB] [SCREEN] Display OFF. 0|MagicMirror | [01.03.2024 19:57.18.044] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_POWERSTATUS 0|MagicMirror | [01.03.2024 19:57.18.046] [LOG] [MMM-Pir] [LIB] [SCREEN] [POWER] Display from true ---> false ... ... 0|MagicMirror | [01.03.2024 20:02.55.678] [LOG] [MMM-Pir] [LIB] [SCREEN] Restart. 0|MagicMirror | [01.03.2024 20:02.55.679] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_PRESENCE true 0|MagicMirror | [01.03.2024 20:02.55.705] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_SHOWING 0|MagicMirror | [01.03.2024 20:02.55.712] [LOG] [MMM-Pir] [LIB] [SCREEN] [Force ON] Turn ON Display 0|MagicMirror | [01.03.2024 20:02.55.800] [LOG] [MMM-Pir] [LIB] [SCREEN] [MODE 9] Monitor on HDMI-1 is off 0|MagicMirror | [01.03.2024 20:02.55.800] [LOG] [MMM-Pir] [LIB] [SCREEN] Display -- Actual: false - Wanted: true 0|MagicMirror | [01.03.2024 20:02.55.801] [LOG] [MMM-Pir] [LIB] [SCREEN] Display ON. 0|MagicMirror | [01.03.2024 20:02.56.462] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_POWERSTATUS true 0|MagicMirror | [01.03.2024 20:02.56.464] [LOG] [MMM-Pir] [LIB] [SCREEN] [POWER] Display from false ---> true 0|MagicMirror | [01.03.2024 20:02.56.712] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '01:00', bar: 0 } 0|MagicMirror | [01.03.2024 20:02.57.713] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:59', bar: 1000 } 0|MagicMirror | [01.03.2024 20:02.58.714] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:58', bar: 2000 } 0|MagicMirror | [01.03.2024 20:02.59.714] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:57', bar: 3000 } 0|MagicMirror | [01.03.2024 20:03.00.715] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:56', bar: 4000 } 0|MagicMirror | [01.03.2024 20:03.01.716] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:55', bar: 5000 } 0|MagicMirror | [01.03.2024 20:03.02.716] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:54', bar: 6000 } 0|MagicMirror | [01.03.2024 20:03.03.717] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:53', bar: 7000 } 0|MagicMirror | [01.03.2024 20:03.04.717] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:52', bar: 8000 } 0|MagicMirror | [01.03.2024 20:03.05.718] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:51', bar: 9000 }

---------------> In MODE 10 -> touchMode: 3 0|MagicMirror | [02.03.2024 12:20.46.049] [LOG] [MMM-Pir] [LIB] [SCREEN] Restart. 0|MagicMirror | [02.03.2024 12:20.46.050] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_PRESENCE true 0|MagicMirror | [02.03.2024 12:20.46.103] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_SHOWING 0|MagicMirror | [02.03.2024 12:20.46.106] [LOG] [MMM-Pir] [LIB] [SCREEN] [Force ON] Turn ON Display 0|MagicMirror | [02.03.2024 12:20.46.185] [LOG] [MMM-Pir] [LIB] [SCREEN] [MODE 10] Monitor on HDMI-A-2 is false 0|MagicMirror | [02.03.2024 12:20.46.186] [LOG] [MMM-Pir] [LIB] [SCREEN] Display -- Actual: false - Wanted: true 0|MagicMirror | [02.03.2024 12:20.46.186] [LOG] [MMM-Pir] [LIB] [SCREEN] Display ON. 0|MagicMirror | [02.03.2024 12:20.47.040] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_POWERSTATUS true 0|MagicMirror | [02.03.2024 12:20.47.041] [LOG] [MMM-Pir] [LIB] [SCREEN] [POWER] Display from false ---> true 0|MagicMirror | [02.03.2024 12:20.47.128] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '01:00', bar: 0 } 0|MagicMirror | [02.03.2024 12:20.48.127] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:59', bar: 1000 } 0|MagicMirror | [02.03.2024 12:20.49.127] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:58', bar: 2000 } ... ... 0|MagicMirror | [02.03.2024 12:21.45.222] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:02', bar: 58000 } 0|MagicMirror | [02.03.2024 12:21.46.223] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:01', bar: 59000 } 0|MagicMirror | [02.03.2024 12:21.47.226] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_OUTPUT { timer: '00:00', bar: 60000 } 0|MagicMirror | [02.03.2024 12:21.47.232] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_HIDING 0|MagicMirror | [02.03.2024 12:21.47.288] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_PRESENCE 0|MagicMirror | [02.03.2024 12:21.47.311] [LOG] [MMM-Pir] [LIB] [SCREEN] Stops by counter. 0|MagicMirror | [02.03.2024 12:21.47.422] [LOG] [MMM-Pir] [LIB] [SCREEN] [MODE 10] Monitor on HDMI-A-2 is false 0|MagicMirror | [02.03.2024 12:21.47.423] [LOG] [MMM-Pir] [LIB] [SCREEN] Display -- Actual: false - Wanted: false 0|MagicMirror | [02.03.2024 12:21.48.174] [LOG] [MMM-Pir] [CALLBACK] Screen: SCREEN_POWERSTATUS 0|MagicMirror | [02.03.2024 12:21.48.175] [LOG] [MMM-Pir] [LIB] [SCREEN] [POWER] Display from true ---> false

Greetings @giovamec