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

can't get plugin installed #1

Closed
paqpaqpaq opened this issue Jul 2, 2018 · 23 comments
Closed

can't get plugin installed #1

paqpaqpaq opened this issue Jul 2, 2018 · 23 comments
Assignees

Comments

@paqpaqpaq
Copy link

on debian stretch:

[code]Unexpected platform or architecture: linux/arm
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs@2.1.7 install: node install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@2.1.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-07-02T08_39_43_685Z-debug.log
[/code]

I've tried several ways of installing PhantomJS, but it keeps on returning the same error.
Any ideas here?

@werthdavid werthdavid self-assigned this Jul 2, 2018
@werthdavid
Copy link
Owner

Sorry, the README is missing something here...
Please try

  • wget https://github.com/fg2it/phantomjs-on-raspberry/releases/download/v2.1.1-wheezy-jessie-armv6/phantomjs_2.1.1_armhf.deb
  • sudo dpkg -i phantomjs_2.1.1_armhf.deb

werthdavid added a commit that referenced this issue Jul 2, 2018
@paqpaqpaq
Copy link
Author

No that was actually already in the readme.
However, the problem/error remains.

@werthdavid
Copy link
Owner

Okay can you please try

  • sudo npm install -g phantomjs

@paqpaqpaq
Copy link
Author

exact same result

@werthdavid
Copy link
Owner

Sorry for the inconvenience... I'll try to find out what I did differently on my RPi

@paqpaqpaq
Copy link
Author

paqpaqpaq commented Jul 2, 2018

Could it have something to do with the install file of the plugin pointing to version 2.1.7 instead of 2.1.1

pi@raspberrypi:~ $ phantomjs -v
2.1.1

pi@raspberrypi:~ $ npm install -g homebridge-website-to-camera
npm WARN deprecated phantomjs@2.1.7: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

@werthdavid
Copy link
Owner

Thanks for the hint, I tried an dev-version with 2.1.1 as dependency but that didn't help. What I found out is that

npm install -g homebridge-website-to-camera

doesn't work. But doing

cd /usr/lib/node_modules     (<-- can be found with 'npm root -g')
git clone https://github.com/werthdavid/homebridge-website-to-camera.git
cd homebridge-website-to-camera
npm install

does work!?!

@werthdavid
Copy link
Owner

I'm updating the README accordingly until I've found a better way or migrated to puppeteer

werthdavid added a commit that referenced this issue Jul 2, 2018
werthdavid added a commit that referenced this issue Jul 2, 2018
@paqpaqpaq
Copy link
Author

The github work around works!

@DJay-X
Copy link

DJay-X commented Jul 2, 2018

@werthdavid First of all thanks for your work and sharing.

I tried the above workaround, but unfortunately that didn't work for me.

pi@raspberrypi-3BPlus:~ $ cd /usr/lib/node_modules
pi@raspberrypi-3BPlus:/usr/lib/node_modules $ git clone https://github.com/werthdavid/homebridge-website-to-camera.git
fatal: Konnte Arbeitsverzeichnis 'homebridge-website-to-camera' nicht erstellen: Keine Berechtigung
pi@raspberrypi-3BPlus:/usr/lib/node_modules $ sudo git clone https://github.com/werthdavid/homebridge-website-to-camera.git
Klone nach 'homebridge-website-to-camera' ...
remote: Counting objects: 38, done.
remote: Compressing objects: 100% (23/23), done.
remote: Total 38 (delta 18), reused 29 (delta 12), pack-reused 0
Entpacke Objekte: 100% (38/38), Fertig.
pi@raspberrypi-3BPlus:/usr/lib/node_modules $ cd homebridge-website-to-camera
pi@raspberrypi-3BPlus:/usr/lib/node_modules/homebridge-website-to-camera $ sudo npm install

> phantomjs@2.1.7 install /usr/lib/node_modules/homebridge-website-to-camera/node_modules/capture-phantomjs/node_modules/phantomjs
> node install.js

(node:4319) ExperimentalWarning: The fs.promises API is experimental
PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs@2.1.7 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@2.1.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-07-02T15_18_15_508Z-debug.log

Log enclosed. Hope this helps to investigate.

Could it be that in my case the folder for the modules is not /usr/lib/node_modules instead it is /usr/local/lib/node_modules

Running Homebridge (system.d) @0.4.44 | n@2.1.12 | node@10.1.0 | npm@6.1.0
Raspberry Pi 3 B+ (Raspbian stretch)

Thanks again for the time you are investing.

2018-07-02T15_18_15_508Z-debug.log

@DJay-X
Copy link

DJay-X commented Jul 2, 2018

By the way with the usually common command sudo npm install -g homebridge-website-to-camera I get this error.

pi@raspberrypi-3BPlus:~ $ sudo npm install -g homebridge-website-to-camera
npm WARN deprecated phantomjs@2.1.7: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated tough-cookie@2.2.2: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

> phantomjs@2.1.7 install /usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/phantomjs
> node install.js

(node:1596) ExperimentalWarning: The fs.promises API is experimental
PhantomJS not found on PATH
Unexpected platform or architecture: linux/arm
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs@2.1.7 install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the phantomjs@2.1.7 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2018-07-02T15_35_38_077Z-debug.log

@ghost
Copy link

ghost commented Jul 2, 2018

I have the same issue as other mentioned above.

Could the issue be, that your your package-lock.json always refers to phantomjs@2.1.7 and not phantomjs@2.1.1.

Even if I try to change the information in your file I get the same error code:

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory Aborted npm ERR! code ELIFECYCLE npm ERR! errno 134 npm ERR! phantomjs@2.1.1 install: node install.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the phantomjs@2.1.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-07-02T16_29_05_129Z-debug.log`

@werthdavid
Copy link
Owner

@DJay-X
For the workaround you have to install phantomjs as well (first step of the "Raspberry Pi and any other ARM" section in the readme --> dkpg -i)

@misanthrophy
I tried that and it didn't help unfortunately..

@werthdavid
Copy link
Owner

I updated to plugin to use Puppeteer/Chrome instead of Phantomjs. Please try with v1.1.0, take a look at the README first!

@ghost
Copy link

ghost commented Jul 3, 2018

Thanks for the update.

Will install it later today to verify if it is working now.

While I checked the config.json, is it possible to add more websites as cameras with different websites?

For example:

"platforms": [
{
"platform": "website-camera",
"cameras": [
{
"name": "Website 1",
"url": "http://github.com/1",
"width": 800,
"height": 400,
"chromiumPath": "/usr/bin/chromium-browser"
},
{
"name": "Website 2",
"url": "http://github.com/2",
"width": 800,
"height": 400,
"chromiumPath": "/usr/bin/chromium-browser"
}
]
}
]

And so on...?

@werthdavid
Copy link
Owner

Definitely!

@ghost
Copy link

ghost commented Jul 3, 2018

Okay, the plugin works now for installation, but I do not see a picture...

What I am trying to do is: I have an old iPhone 3GS on which I open a camera app which creates a livestream over a local IP Adress: 10.0.4.XX.
When I open this website on my Mac or other iPhone I see the video and everything is fine.
But when I use this link/IP address in the config.json it says that the "camera" does not respond when I try to open it on my Mac, iPhone or iPad.

I then thought it could be a problem with the address itself, so I just used https://apple.com/de/ to verify that I can even get a picture. But still the same issue. Even after removing the camera from HomeKit adding it again, still the same issue.

How could I troubleshoot further to see whats the problem here?

Thanks in advance for your help :)

@ghost
Copy link

ghost commented Jul 3, 2018

Ps: I never had a HK enabled camera added to my home, so I don‘t know if thats normal, but when I add this plugin to HomeKit it shows me two devives:

  1. the bridge homebridge-website-to-camera

  2. my camera with my set name.

I have to add both of them and when I delete the bridge from HK, the cam itself remains. Is that normal?

@werthdavid
Copy link
Owner

werthdavid commented Jul 4, 2018

So you see a camera but the camera itself shows a white screen?

  • Try to start chromium-browser from console and make sure it would start (it won't since you don't have a screen but there shouldn't be any other errors)
  • Could you send me your (log-files)[https://github.com/nfarina/homebridge/wiki/Basic-Troubleshooting] please?
  • Also it is probably the case but please make sure as well that your RPi/Homebridge server can access the internet (ping...)

@werthdavid
Copy link
Owner

I made a new version that should log more to the log-file

@ghost
Copy link

ghost commented Jul 4, 2018

hi,

no the camera window is black with a camera symbol crossed out. Both on the overview section and when I tap on it.

I also updated the config.json according to your read.me file.

When I start the chromium browser I got that message:

`[21550:21550:0704/121219.617505:ERROR:browser_main_loop.cc(670)] Failed to put Xlib into threaded mode.

(chromium-browser:21550): Gtk-WARNING **: cannot open display:`

It looks very similar to your message.

I ping'd google.com with that output:

ping google.com PING google.com (216.58.210.14) 56(84) bytes of data. 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=1 ttl=51 time=29.6 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=2 ttl=51 time=33.8 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=3 ttl=51 time=36.3 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=4 ttl=51 time=32.8 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=5 ttl=51 time=34.2 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=6 ttl=51 time=40.4 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=7 ttl=51 time=38.3 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=8 ttl=51 time=33.2 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=9 ttl=51 time=52.5 ms 64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=10 ttl=51 time=91.3 ms ^X64 bytes from fra16s07-in-f14.1e100.net (216.58.210.14): icmp_seq=11 ttl=51 time=38.6 ms ^C --- google.com ping statistics --- 11 packets transmitted, 11 received, 0% packet loss, time 10013ms rtt min/avg/max/mdev = 29.619/41.949/91.347/16.639 ms

Livelog tells me:

Jul 04 12:29:32 raspi homebridge[3388]: [2018-7-4 12:29:32] iPhone 3GS is running on port 40779.
Jul 04 12:29:41 raspi homebridge[3388]: [2018-7-4 12:29:41] [website-camera] Starting new instance of Chromium: /usr/bin/chromium-browser
Jul 04 12:29:42 raspi homebridge[3388]: [2018-7-4 12:29:42] [website-camera] Error: Failed to launch chrome!
Jul 04 12:29:42 raspi homebridge[3388]: [0704/122942.296979:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Jul 04 12:29:42 raspi homebridge[3388]: TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
Jul 04 12:29:42 raspi homebridge[3388]:     at onClose (/usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer/lib/Launcher.js:285:14)
Jul 04 12:29:42 raspi homebridge[3388]:     at Interface.helper.addEventListener (/usr/local/lib/node_modules/homebridge-website-to-camera/node_modules/puppeteer/lib/Launcher.js:274:50)
Jul 04 12:29:42 raspi homebridge[3388]:     at emitNone (events.js:111:20)
Jul 04 12:29:42 raspi homebridge[3388]:     at Interface.emit (events.js:208:7)
Jul 04 12:29:42 raspi homebridge[3388]:     at Interface.close (readline.js:368:8)
Jul 04 12:29:42 raspi homebridge[3388]:     at Socket.onend (readline.js:147:10)
Jul 04 12:29:42 raspi homebridge[3388]:     at emitNone (events.js:111:20)
Jul 04 12:29:42 raspi homebridge[3388]:     at Socket.emit (events.js:208:7)
Jul 04 12:29:42 raspi homebridge[3388]:     at endReadableNT (_stream_readable.js:1064:12)
Jul 04 12:29:42 raspi homebridge[3388]:     at _combinedTickCallback (internal/process/next_tick.js:138:11)

@werthdavid
Copy link
Owner

Okay so you're running homebridge as root... In general I'd recommend to not do that but of course it should work anyway. I published a new version, can you please try with that?

@ghost
Copy link

ghost commented Jul 4, 2018

Now it is working with a general website, will test it later with the internal IP adress of my iPhone Livestream

Thanks in advance!

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

No branches or pull requests

3 participants