Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use in Windows platforms #141

Open
SimoneMSR opened this issue Dec 29, 2024 · 15 comments
Open

Use in Windows platforms #141

SimoneMSR opened this issue Dec 29, 2024 · 15 comments
Labels
enhancement New feature or request

Comments

@SimoneMSR
Copy link

After modifying scripts in package.json so to execute the install shell scritps, when I run npm run setup I get this error:

msys is not a  supported platform

and I cannot install the package. Is there a way to use the module in Windows systems?

@bugsounet
Copy link
Owner

Hi, windows platforms are not supported. (i don't use it since many years now for some reason ... $$)

maybe, best way is trying with a Virtual Machine with kubuntu/ubuntu on windows OS

@sdetweil
Copy link
Collaborator

@SimoneMSR how are you attaching the sensor?? on pi this is GPIO pins.. what system, running windows, has support for them?

@bugsounet
Copy link
Owner

bugsounet commented Dec 29, 2024

By Touch or Cron (maybe)

@SimoneMSR
Copy link
Author

@bugsounet I understand. I am not willing to use the GPIO system, but just debugging the CRON system.
Would this be possible by contemplating the WIN platform in the source codes and scripts?

@SimoneMSR
Copy link
Author

@sdetweil no, I am just debugging the CRON system

@bugsounet
Copy link
Owner

I'm not sure that my Cron library have an windows compatibility

@sdetweil
Copy link
Collaborator

there is the Croner lib i added last release, used in
compliments

@bugsounet
Copy link
Owner

If you are motivated, recode it, and make it better. I just "copy past* my old code from other modules (And make all in one )

@bugsounet
Copy link
Owner

@sdetweil

with Croner lib, can we do something like this ?

Cron: {
  mode: 2,
  schedules: [
    {
      from: {
        dayOfWeek: [0,1,2,3,4,5,6,7],
        hour: 12,
        minute: 0
      },
      to: {
        dayOfWeek: [0,1,2,3,4,5,6,7],
        hour: 12,
        minute: 30
      }
    },
    {
      from: {
       <...>
      },
      to: {
       <...>
      }
    }
  ]
},

schedules will be en Array of cron

from will be Screen ON time
to will be Screen OFF time

dayOfWeek , hour, minute : same as used on actual ON/OFF config

Maybe we are able to determine if the screen should be turned on with the interval (from and to) at start of MM² ? (actually forced ON on start)

@bugsounet
Copy link
Owner

there is the Croner lib i added last release, used in compliments

sure, just change this for actual code in cronJob.js

image

@bugsounet
Copy link
Owner

bugsounet commented Jan 2, 2025

@SimoneMSR:

Use in Windows platforms

For initial question, can you try this under windows system (with fresh master repo):

npm prune && npx electron-rebuild && npm run test:minify

I think, It must works

@bugsounet
Copy link
Owner

bugsounet commented Jan 2, 2025

npm prune && npx electron-rebuild && npm run test:minify

up to date in 2s

135 packages are looking for funding
  run `npm fund` for details
✔ Rebuild Complete

> [email protected] test:minify
> cd installer && node minify.js

Found: 10 files to install and minify

Process File: MMM-Pir/node_helper.js
Process File: MMM-Pir/MMM-Pir.js
Process File: MMM-Pir/components/screenTouch.js
Process File: MMM-Pir/components/screenLib.js
Process File: MMM-Pir/components/screenDisplayer.js
Process File: MMM-Pir/components/pirLib.js
Process File: MMM-Pir/components/motionLib.js
Process File: MMM-Pir/components/motion.js
Process File: MMM-Pir/components/governorLib.js
Process File: MMM-Pir/components/cronJob.js

If works, we can add an npm run command for this

@SimoneMSR
Copy link
Author

SimoneMSR commented Jan 2, 2025

@SimoneMSR:

Use in Windows platforms

For initial question, can you try this under windows system (with fresh master repo):

npm prune && npx electron-rebuild && npm run test:minify

I think, It must works

It does not work with my node installation (20.13.1). node-gyp gives errors

npm ERR! gyp http GET https://nodejs.org/download/release/v20.13.1/node-v20.13.1-headers.tar.gz
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp verb remove using node-gyp dir: C:\Users\simon\AppData\Local\node-gyp\Cache
npm ERR! gyp verb remove removing target version: 20.13.1
npm ERR! gyp verb remove removing development files for version: 20.13.1
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v20.13.1/node-v20.13.1-headers.tar.gz failed, reason: unable to get local issuer certificate
npm ERR! gyp ERR! stack at ClientRequest.<anonymous> (D:\Progetti\apache_simulator\MagicMirror\modules\MMM-Pir\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! gyp ERR! stack at ClientRequest.emit (node:events:519:28)
npm ERR! gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:500:9)
npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:531:35)
npm ERR! gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:169:8)
npm ERR! gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:128:3)
npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Progetti\\apache_simulator\\MagicMirror\\modules\\MMM-Pir\\node_modules\\@electron\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\Progetti\apache_simulator\MagicMirror\modules\MMM-Pir\node_modules\node-libgpiod
npm ERR! gyp ERR! node -v v20.13.1
npm ERR! gyp ERR! node-gyp -v v10.2.0-electron.1
npm ERR! gyp ERR! not ok

Maybe I can install another version of node.

@bugsounet bugsounet added the enhancement New feature or request label Jan 7, 2025
@bugsounet
Copy link
Owner

Right, I have tested MMM-Pir on windows 11

Working libraries:

  • Motion (with camera)
  • Cron (Oui @sdetweil... finalement cela fonctionne)
  • Display (with mode: 0)
  • Touch
  • Sounds

Not Working libraries:

  • Pir
  • Governor

Todo:

  • Find how turn on/off screen and apply it in new Display.mode
  • make an installer for windows
  • make an updater for windows
  • make npm commands

@bugsounet
Copy link
Owner

Let's code it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants