foxriver76 / ioBroker.puppeteer

Adapter to control a headless browser to take screenshots of web pages.
MIT License
1 stars 2 forks source link

Installation/Usage not possible on ARM64 platforms (RPi, etc.) #13

Open kopierschnitte opened 7 months ago

kopierschnitte commented 7 months ago

Describe the bug
The Puppeteer NPM-Package seems to download and install the x86 build of Chrome. This refuses to work on non-x86 CPUs.

To Reproduce
Install the adapter on ARM64 platforms.

Expected behavior
Use either the package manager of the distribution to install a correct build of Chrome/Chromium or download it during install.

Additional context
I've fixed the problem by first installing chromium (Debian 12 / ARM64 in my case): sudo apt install chromium

Change the adapter's main.js onReady() function to load the correct binary (chromium in my case):

async onReady() {
    this.browser = await import_puppeteer.default.launch({ headless: "new", defaultViewport: null, executablePath: '/usr/bin/chromium', args: ['--no-sandbox', '--disable-setuid-sandbox'] });
    this.subscribeStates("url");
    this.log.info("Ready to take screenshots");
  }

Now everything works as expected.

foxriver76 commented 7 months ago

Duplicate of https://github.com/foxriver76/ioBroker.puppeteer/issues/7

grumbein commented 23 hours ago

@kopierschnitte I am using the buanet/iobroker docker container. Any hints on how to get it working there? I tried to manually install chromium in the container, and changed the main.js according to you. However, iobroker will not install "my" adapter. Exit Code 25.