roleoroleo / yi-hack-MStar

Custom firmware for Yi 1080p camera based on MStar platform
GNU General Public License v3.0
830 stars 110 forks source link

Onvif stopped working after update to 0.5.0 - Yi 1080 Home 6FUS (4.5.0) #509

Closed cklimowicz closed 2 months ago

cklimowicz commented 1 year ago

Hi, I have several Yi 1080 Home 6FUS (4.5.0) cameras connected to HA via Onvif. Everything was fine until update 0.5.0. Updated 2 cameras 0.4.9 to 0.5.0 and onvif stopped working, stream via Rstp works ok. Cameras with version 0.4.9 work properly via onvif.

roleoroleo commented 1 year ago

I noticed that HA is not so standard with onvif. It doesn't understand spaces inside the xml. I need to change some code.

Does Onvif Device Manager works?

cklimowicz commented 1 year ago

Onvif Manager works ok. I have connected 2 more cameras with 0.4.9 version

roleoroleo commented 1 year ago

There was several problems, I think HA is not completely compliant with the standard specification. But no problem, I fixed it. I will send a new beta hack to test.

roleoroleo commented 1 year ago

Here it is: y203c_0.5.0.tgz

Please try it and let me know if it's ok.

cklimowicz commented 1 year ago

Thank you very much. I don't know if I can test it now because I only have remote access to the cameras. Unless I can upload via ssh. I'll let you know

roleoroleo commented 1 year ago

I can send you just the differences... update_1.tar.gz

wsd_simple_server.gz

And finally reboot the cam. Pay attention to the permissions. Don't miss them.

cklimowicz commented 1 year ago

Ok, I checked both variants. First, I uploaded the files (home../sys..) to the sd card via ssh and did a reboot. In HA through the onvif manager, the camera was not visible. Second, I replaced the Onvif directory and wsd_simple_server and rebooted. Unfortunately the same, the camera cannot be seen through Onvif.

Finally, I uploaded the files with version 0.4.9 and restarted. Onvif started working again.

cklimowicz commented 1 year ago

I noticed that version 0.5.0 lacks Onvif port configuration. I don't know if that has anything to do with it.

obraz

roleoroleo commented 1 year ago

With the last hack version, the old onvif_srvd daemon is deprecated and not used anymore. The new binary is onvif_simple_server and it's not a daemon but a cgi. So it shares the port 80 with httpd (no need to configure it).

wsdd is also deprecated, the new binary is wsd_simple_server (this is a daemon).

Extreme79 commented 1 year ago

I'm in this issue too. Is the Xml formatting or the httpd port sharing that doesn't like to HA?

roleoroleo commented 1 year ago

No, the problem is that the xml produced by HA uses explicit namespace. Something like:

<SOAP-ENV:Envelope>
...
<ns0:GetCapabilities xmlns:ns0="http://www.onvif.org/ver10/device/wsdl">
...

instead of:

<SOAP-ENV:Envelope xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
...
<GetCapabilities>
...

Since there is no soap/xml engine behind onvif_simple_server, it didn't work. There is just a simple parse.

And another problem. If GetCapabilitiesResponse from the cam contains the Event section:

                <tt:Events>
                    <tt:XAddr>%EVENTS_SERVICE_ADDRESS%</tt:XAddr>
                    <tt:WSSubscriptionPolicySupport>false</tt:WSSubscriptionPolicySupport>
                    <tt:WSPullPointSupport>false</tt:WSPullPointSupport>
                    <tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport>
                </tt:Events>

HA asks for an event subscription although the support is false as in the example above.

I improved the parsing of the XML request and I removed the event section.

The previous release was tested with the official tools from ONVIF Project, so I'm pretty sure that was correct.

papagdog commented 1 year ago

Same problem here. I have the y30 and h201c flavor.... No ONVIF access... I've only upgraded the y30 to this point..... I started to follow the same instructions posted earlier, but decided against it since that version may be different..... I was on version 0.4.9 before upgrading. I may revert back for now.. Thanks in advance.

roleoroleo commented 1 year ago

The problem is already fixed. There are no difference between h201c and y203c about onvif daemons. You can try them if you want.

Extreme79 commented 1 year ago

When new release will be available? Just to evaluate to downgrade all cameras or wait

roleoroleo commented 1 year ago

I don't know at the moment. If you want, I can make a beta version.

Extreme79 commented 1 year ago

If you can, I'll (we'll) appreciate it! 💚

roleoroleo commented 1 year ago

Here it is: h201c_0.5.0.tar.gz h305r_0.5.0.tar.gz h307_0.5.0.tar.gz y23_0.5.0.tar.gz y25_0.5.0.tar.gz y30_0.5.0.tar.gz y203c_0.5.0.tar.gz

TheBandit001 commented 8 months ago

Was this confirmed working ? I have [ Installed: 0.5.2 - Available: 0.5.2 ] and it does same thing. onvif doesn't work, stream via Rstp works ok. and also in the app it works. I was on 0.4.2 or something like that. Just decided to update..

roleoroleo commented 8 months ago

Yes, onvif is working. If it doesn't work with you client, please take a network capture and share it with me.

github-actions[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.