Coder Social home page Coder Social logo

Comments (23)

werthdavid avatar werthdavid commented on August 28, 2024 1

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!?!

from homebridge-website-to-camera.

DJay-X avatar DJay-X commented on August 28, 2024 1

@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

> [email protected] 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! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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 | [email protected] | [email protected] | [email protected]
Raspberry Pi 3 B+ (Raspbian stretch)

Thanks again for the time you are investing.

2018-07-02T15_18_15_508Z-debug.log

from homebridge-website-to-camera.

pottersfield avatar pottersfield commented on August 28, 2024 1

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

Thanks in advance!

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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

from homebridge-website-to-camera.

paqpaqpaq avatar paqpaqpaq commented on August 28, 2024

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

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

Okay can you please try

  • sudo npm install -g phantomjs

from homebridge-website-to-camera.

paqpaqpaq avatar paqpaqpaq commented on August 28, 2024

exact same result

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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

from homebridge-website-to-camera.

paqpaqpaq avatar paqpaqpaq commented on August 28, 2024

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 [email protected]: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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

from homebridge-website-to-camera.

paqpaqpaq avatar paqpaqpaq commented on August 28, 2024

The github work around works!

from homebridge-website-to-camera.

DJay-X avatar DJay-X commented on August 28, 2024

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 [email protected]: Package renamed to phantomjs-prebuilt. Please update 'phantomjs' package references to 'phantomjs-prebuilt'
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130

> [email protected] 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! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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

from homebridge-website-to-camera.

pottersfield avatar pottersfield commented on August 28, 2024

I have the same issue as other mentioned above.

Could the issue be, that your your package-lock.json always refers to [email protected] and not [email protected].

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! [email protected] install: node install.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the [email protected] 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`

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

@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..

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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

from homebridge-website-to-camera.

pottersfield avatar pottersfield commented on August 28, 2024

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...?

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

Definitely!

from homebridge-website-to-camera.

pottersfield avatar pottersfield commented on August 28, 2024

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 :)

from homebridge-website-to-camera.

pottersfield avatar pottersfield commented on August 28, 2024

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?

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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...)

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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

from homebridge-website-to-camera.

pottersfield avatar pottersfield commented on August 28, 2024

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)

from homebridge-website-to-camera.

werthdavid avatar werthdavid commented on August 28, 2024

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?

from homebridge-website-to-camera.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.