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

Support for Revotech I6032 #13

Closed
tssk opened this issue Jul 9, 2019 · 6 comments
Closed

Support for Revotech I6032 #13

tssk opened this issue Jul 9, 2019 · 6 comments

Comments

@tssk
Copy link

tssk commented Jul 9, 2019

Hello,

I was amazed when I found this Mozilla IOT Gateway Add-on for cameras! Please consider this as a feature request/request for help/sharing of experience.

I am trying to get this working with "cheap chinese HD IP camera". Based on this https://www.jpavlik.cz/aliexpress-ip-cameras-review/ blog post I decided to try Revotech I6032, specifically I6032W-V200-POE (white, non-sony chip, PoE).

I am using Mozilla IOT Gateway 0.8.1 installed on Debian 9 in virtualbox according to official procedure on github. Then I installed ffmpeg from debian package. And added ONVIF Add-on and it correctly autodetected camera IP (192.168.1.206). I had to set password for the default admin user because the Add-on does not seem to allow empty password. After setting the password Gateway was able to detect and add Video Camera Thing.

Screenshot works ok. Stream does not work.

2019-07-09 09:13:40.149 INFO   : Successfully created new thing kamera
2019-07-09 09:13:42.991 ERROR  : Thing was not added
2019-07-09 09:13:42.992 ERROR  : addNewThing cancelled
2019-07-09 09:13:42.996 INFO   : thing-url: Adapter: ThingURLAdapter id thing-url-adapter pairing cancelled
2019-07-09 09:14:21.859 INFO   : onvif: Unhandled Rejection
2019-07-09 09:14:21.862 ERROR  : onvif: { Error: socket hang up
2019-07-09 09:14:21.863 ERROR  : onvif:     at createHangUpError (_http_client.js:342:15)
2019-07-09 09:14:21.864 ERROR  : onvif:     at Socket.socketOnEnd (_http_client.js:437:23)
2019-07-09 09:14:21.865 ERROR  : onvif:     at emitNone (events.js:111:20)
2019-07-09 09:14:21.884 ERROR  : onvif:     at Socket.emit (events.js:208:7)
2019-07-09 09:14:21.885 ERROR  : onvif:     at endReadableNT (_stream_readable.js:1064:12)
2019-07-09 09:14:21.887 ERROR  : onvif:     at _combinedTickCallback (internal/process/next_tick.js:139:11)
2019-07-09 09:14:21.889 ERROR  : onvif:     at process._tickCallback (internal/process/next_tick.js:181:9) code: 'ECONNRESET' }
2019-07-09 09:16:11.535 INFO   : onvif: Unhandled Rejection
2019-07-09 09:16:11.537 ERROR  : onvif: { Error: connect ECONNREFUSED 192.168.1.206:80
2019-07-09 09:16:11.541 ERROR  : onvif:     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
2019-07-09 09:16:11.547 ERROR  : onvif:   errno: 'ECONNREFUSED',
2019-07-09 09:16:11.548 ERROR  : onvif:   code: 'ECONNREFUSED',
2019-07-09 09:16:11.549 ERROR  : onvif:   syscall: 'connect',
2019-07-09 09:16:11.555 ERROR  : onvif:   address: '192.168.1.206',
2019-07-09 09:16:11.556 ERROR  : onvif:   port: 80 }

I can view the lowres stream manually using $ ffplay rtsp://admin:12345@192.168.1.206:5544/live1.264 (hires should be /live0.264 ) so I guess adding some correct parameters in lib/onvif-device.js should do the trick?

Maybe more generally allow manual configuration for stream url to support more cameras?

I would like to try to add support myself but I will sure need some help/advice where to start.

Thanks,

Tomas

@tssk
Copy link
Author

tssk commented Jul 9, 2019

Hardcoding camera live stream URL in lib/onvif-device.js by changing line 244

from:
'-i', this.streamUrl.toString(),
to:
'-i', 'rtsp://admin:12345@192.168.1.206:5544/live1.264',

(and updating SHA256 cheksum for the lib/onvif-device.js file )

makes it work like a charm.

So where does profile.StreamUri.Uri come from? (I am sorry I am JavaScript illiterate.)

@mrstegeman
Copy link
Contributor

In lib/onvif-device.js, can you change the DEBUG flag at the top to be true? After doing so, it will dump the streaming profile to the log. The URI is part of that profile.

@tssk
Copy link
Author

tssk commented Jul 9, 2019

Oh, thanks!

2019-07-09 18:47:20.789 INFO   : onvif:   "StreamUri": {
2019-07-09 18:47:20.790 INFO   : onvif:     "Uri": "rtsp://192.168.1.206:5544/live0.264",
2019-07-09 18:47:20.791 INFO   : onvif:     "InvalidAfterConnect": "false",
2019-07-09 18:47:20.792 INFO   : onvif:     "InvalidAfterReboot": "false",
2019-07-09 18:47:20.793 INFO   : onvif:     "Timeout": "PT10S"
2019-07-09 18:47:20.794 INFO   : onvif:   },

It looks correct... So the problem must be somewhere in the ffmpeg processing I guess. I will investigate that thanks!

@mrstegeman
Copy link
Contributor

If you reset the URL back to the original this.streamUrl.toString(), you can check the output of ps -ef to see the full ffmpeg command that's running.

@tssk
Copy link
Author

tssk commented Jul 9, 2019

So it seems the problem is that the camera default settings of hi-resolution/definition stream is producing "invalid VUI" ( source https://superuser.com/a/1421470 ). Changing the hires stream resolution setting from 1920x1080 to 1280x720 makes it work ok. ( Other option is to patch ffmpeg. )

So much for "cheap chinese camera"... :)

To sum up - to get the camera working:

  • set password
  • set hires stream to 720p
  • follow official onvif-adapter readme (as of v0.1.2)

Thanks for your time @mrstegeman !

Tomas

@tssk tssk closed this as completed Jul 9, 2019
@mrstegeman
Copy link
Contributor

Great! Glad it's working for you.

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

2 participants