-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Failed to connect to camera #12
Comments
Sounds like the Camera doesn't have profiles. Are you sure the camera is ONVIF compliant? If so, does it just have one profile that is not kept in an array? |
I've added some extra logging, this is what your parseProfiles gets as argument: VideoEncoderConfiguration: PTZConfiguration: |
I have similar error using the Mozilla IoT Gateway and the camera I'm using is Android phone camera made ONVIF compatible using IP Webcam https://play.google.com/store/apps/details?id=com.pas.webcam ERROR : onvif: TypeError: Cannot read property 'forEach' of undefined |
Thanks for the info. I have an Android I can use to replicate this and get it fixed (hopefully). |
Any update on this? I'm no js expert, but to me this looks like a type mismatch: rpos provides an object, nvt expects an array. |
@atirage Sorry, have not had time. I apologize that this project is low on my list. We use it at work, but all of our cameras work with it. PRs are very welcomed if you feel you can help out. The problem with working with hardware is if you don't have the specific hardware, then you can only hope something works. This can cause several iterations with those that do have the hardware. Therefore, it's easier for those with the hardware do the specific work needed. Again, my apologies. Please feel free to work through it and make adjustments as needed. I also just want to point out, that having done this project, I have found the ONVIF specs to be lenient on design and different camera manufacturers implement in different ways, unfortunately. If you make changes, be sure to keep compatibility with those cameras that currently do work. ie: test returned object as js array or js object.. Thanks. |
@hawkeye64, no worries, I was just wondering if it was still on your radar or not. :)
I'm not sure if this is generic enough, but it seems that the issue will happen only if there's just one profile. |
@atirage Yes, it should probably detect if it is an object or an array. Can you PR the code? |
Fix an issues caused when a single profile is given for a camera. It fixes the issue: hawkeye64#12
Will release soon |
Forgot to close after releasing, so closing now |
I'm getting the following error while connecting to a camera:
ERROR : onvif: TypeError: profiles.forEach is not a function
ERROR : onvif: at Camera.parseProfiles (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:645:14)
ERROR : onvif: at media.getProfiles.then.results (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:631:34)
ERROR : onvif: at
ERROR : onvif: at process._tickCallback (internal/process/next_tick.js:189:7)
ERROR : onvif: TypeError: profiles.forEach is not a function
ERROR : onvif: at Camera.parseProfiles (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:645:14)
ERROR : onvif: at media.getProfiles.then.results (/home/pi/.mozilla-iot/addons/onvif-adapter/node_modules/onvif-nvt/lib/camera.js:631:34)
ERROR : onvif: at
ERROR : onvif: at process._tickCallback (internal/process/next_tick.js:189:7)
As sou can see from the log I'm using the Mozilla IoT Gateway and the camera I'm using is a Raspberry Pi camera made ONVIF compatible using https://github.com/BreeeZe/rpos.
The text was updated successfully, but these errors were encountered: