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

Waveshare pan-tilt-hat on pi4 communication through onvif in frigate (hassio) #172

Open
berndklug1107 opened this issue Jun 8, 2024 · 3 comments

Comments

@berndklug1107
Copy link

berndklug1107 commented Jun 8, 2024

Hi everybody!

my objective: detection and autotracking with ov5647 picam on waveshare pt-hat on pi4 / 4GB or pi zero2 using rpos onvif

this is a user-specified issue, so afaik no bug or similar because regarding the guides and docs it should work, but I'm not 100% sure.

symptom:
the pt-hat (servos) works with the common waveshare or other py library when calling the scripts on pi4 or zero, so everything works locally. during installation (buster and bullseye) with the mounted pt-equipment apart from warnings everything runs ok and finally the rpos-onvif interface works, getting rtsp-stream form mediamtx (instead of the rpos rtsp streamer) and serves the streams in frigate(hassio) hacs integration, installed on another pi5, so the cams work in frigate with onvif protocol except the pt-control :-(
I'm not sure what the rpos ptz-driver needs to address the pt-servos, if some kind of (waveshare) py-script, controlling the servos, needs to run in order to handle communication with rpos ptz-driver (like that: https://github.com/RogerHardiman/node-pan-tilt-hat ) or if the rpos ptz driver itself communicates with the pt-hat, this I also found somewhere, but can't find anymore :-)

Running hawkeye217/fovtest.py script gives this:

YES - GetServiceCapabilities shows that the camera supports MoveStatus.
NO - MoveStatus not reporting IDLE or MOVING.
NO - RelativeMove Pan/Tilt is unsupported.
NO - RelativeMove Zoom is unsupported.

maybe someone has a similar configuration (must be :-) and give me a hint 🙏🙏🙏

.... meanwhile I think the issue is the camera itself, it's a china device 🙄
according to arducam wiki these raspi-cams support onvif-compliant ptz support (I think ONVIF Profile S and T):
5MP OV5647 -> my model
8MP IMX219
12MP IMX477
and Hawkeye

so my question also is: does the rpos interface turn any rtsp cam (also those which are officially not onvif Profile S/T capable) into an onvif-ptz compliant device OR is a officially onvif compliant device necessary?

in my case the ONVIF compliant arducam product SKU for the ov5647 cam would be: B01675MP and from my cam I only know that it's an OV5647.

attached config & log-files and v4l2-ctl --all output:
rposCOnifg.json
rpos-install.txt
frigate-log.txt
frigate-yml.txt
v4l2-ctl-all.txt

@RogerHardiman
Copy link
Collaborator

I have a Waveshare PT HAT and it was on my TODO list to add support alongside the Pymoroni Pan/Tilt HAT but I never had time to do the work.

To answer your question, RPOS will turn any RTSP stream into an ONVIF camera with PTZ support.
RPOS receives the PTZ commands and sends them on to whatever motors are supported.
In the RPOS source is a typescript file that handles the ONVIF PTZ messages and supports a wide range of motor controls - Pymoroni Pan/Tilt HAT, or output in classic Pelco D format for old CCTV hardware, or an ASCII protocol etc.
So you will need to dig into that source code and work out how to forward the motor controls on to the Waveshare Pan/Tilt HAT

@RogerHardiman
Copy link
Collaborator

Oh, turns out I did implement Waveshare support and it is in this alternative project...
https://github.com/RogerHardiman/node-pan-tilt-driver

It was 6 years ago, I'd forgotten.

So take a look at this project. It probably helps.

@berndklug1107
Copy link
Author

Thank you!
Yes, I already discovered the waveshare node-pan-tilt-driver link, so I easily replaced the existing /home/pi/rpos/node_modules/pan-tilt-hat folder and it works perfectly 😍 ... of course after modifying the hat hardware itself, this is a complete mess 🙄
I was little confused because of all the different statements and opinions regarding the cams itself, but meanwhile I know what it's all about

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