sonoff-hack icon indicating copy to clipboard operation
sonoff-hack copied to clipboard

preset call not working

Open dCypherNx opened this issue 1 year ago • 23 comments

I just updated to 0.1.7, but I can't call presets from either HA or ODM. In HA I can't even call pan tilt commands

dCypherNx avatar Feb 11 '24 18:02 dCypherNx

It could be a problem with the ptz binary. Open a ssh session and try to move the cam manually: /mnt/mmc/sonoff-hack/bin/ptz -a left -t 500

If it doesn't work, try ptz_h and ptz_p binaries.

roleoroleo avatar Feb 11 '24 19:02 roleoroleo

the original ptz bin works through ssh but not for presets, I tried resetting them to the default hack and the same behavior persists, ODM is able to pan/tilt but not call or set presets, HA can't control any ptz aspect. When I try to set presets in ODM it returns "Too many presets"

dCypherNx avatar Feb 11 '24 23:02 dCypherNx

Can confirm the issue. On 0.1.6 ptz from HA works well. But on 0.1.7 i get error calling procedure error. From ssh and web interface - works well

DeadlySin2 avatar Feb 12 '24 02:02 DeadlySin2

In the last release (0.1.7) I completely changed the onvif server.

There is a problem with the configuration file onvif_simple_server.conf Please use the files from this archive: sonoff-hack.tar.gz Let me know if it works.

roleoroleo avatar Feb 12 '24 16:02 roleoroleo

Seems that nothing changed

dCypherNx avatar Feb 12 '24 19:02 dCypherNx

Too many preset is a strange message. Please, post your /mnt/mmc/sonoff-hack/etc/ptz_presets.conf

roleoroleo avatar Feb 12 '24 20:02 roleoroleo

there are few pretest, seems that onvif command is unable to access this file, at ODM the presets aren't lieted either

my ptz_presets.conf

image

0=0|969|956 1=1|2362|424 2=2|433|344 3=empty|-1|-1 4=empty|-1|-1 5=empty|-1|-1 6=empty|-1|-1 7=empty|-1|-1 8=empty|-1|-1 9=empty|-1|-1 ~

dCypherNx avatar Feb 12 '24 23:02 dCypherNx

Could you post the output of the list command? /mnt/mmc/sonoff-hack/bin/ptz -f /mnt/mmc/sonoff-hack/etc/ptz_presets.conf -a get_presets

roleoroleo avatar Feb 13 '24 07:02 roleoroleo

This command just returned the usage guide, I tried ptz_h and it returned all presets, the ptz_p " can't load library 'libptz.so'" I renamed the ptz_h to ptz, it solved the problem at ODM, BUT at HA the behavior persists. Can I control PTZ through mqtt?

dCypherNx avatar Feb 13 '24 11:02 dCypherNx

How did you add the cam to ha? Are you using onvif standard or my integration?

roleoroleo avatar Feb 13 '24 11:02 roleoroleo

Litle update about HA Previously the presets are 0, 1, etc. Now, the presets are PresetToken_0, PresetToken_1, etc. I'm using onvif standard, I didn't know you had your own integration LOL

dCypherNx avatar Feb 13 '24 11:02 dCypherNx

Are presets working now?

This is my integration: https://github.com/roleoroleo/yi-hack_ha_integration

EDIT

Can I control PTZ through mqtt?

No, at the moment.

roleoroleo avatar Feb 13 '24 11:02 roleoroleo

Now the presets are working, but the single PTZ is not, just like in the h60ga, maybe the commands are also different, previously I was using UP, DOWN, LEFT, RIGHT of the HA, I will try some variations. In mean time I'll try your integration either

dCypherNx avatar Feb 13 '24 11:02 dCypherNx

So pan and tilt in ODM work and in ha don't work. Correct? Did you test all available pan and tilt in ODM? I mean continuous, absolute and relative?

But... I'm able to test it. I will let you know.

roleoroleo avatar Feb 13 '24 11:02 roleoroleo

Presets are fine in both HA and ODM. I'll check variation of relative, absolute and continuous, never had to worry about it before LOL

dCypherNx avatar Feb 13 '24 11:02 dCypherNx

I got ONVIF integration error after the update, so i removed ONVIF integration and tried to install default onvif integration and it can't connect to the camera - ONVIF: All connection attempts failed.

DeadlySin2 avatar Feb 13 '24 11:02 DeadlySin2

That's it! Previously we didn't need to set move_mode for single moves, now we need to. Presets solved, single moves solved.

dCypherNx avatar Feb 13 '24 11:02 dCypherNx

Another little fix: onvif_simple_server.gz

But I noticed a problem with ptz service in ha. Ha doesn't ask to the cam the range of the pan and tilt movements. When ha sends the command uses the range 0.0 - 1.0, but the cam works in degrees (0 - 360 and 0 - 180). So the cam doesn't move properly. I think ha is not compliant.

roleoroleo avatar Feb 13 '24 15:02 roleoroleo

Another little fix: onvif_simple_server.gz

But I noticed a problem with ptz service in ha. Ha doesn't ask to the cam the range of the pan and tilt movements. When ha sends the command uses the range 0.0 - 1.0, but the cam works in degrees (0 - 360 and 0 - 180). So the cam doesn't move properly. I think ha is not compliant.

They probably did it like this cause not all camera can pan 0-360 or tilt 0-180, so they implement as percentage. I don't know how onvif tells to implement

dCypherNx avatar Feb 19 '24 20:02 dCypherNx

In the onvif ptz specification there are 5 methods:

  • GetConfiguration(s)
  • GetConfigurationOptions
  • GetNode(s) that return the configuration of the cam. The client should call these methods and get the values of all parameters: pan, tilt, zoom, etc... Then shoud call other methods using these values.

If you try ODM, you will see this sequence.

roleoroleo avatar Feb 21 '24 16:02 roleoroleo

I can't make ONVIF work on firmware 0.1.7. HA standart integration can't connect after update. YI-hack integration can't connect too. I roled back to 0.1.6 and HA standart integration connected, but YI-hack is not working.

DeadlySin2 avatar Feb 22 '24 07:02 DeadlySin2

Please, restart from scratch. Clean your sd card and install again the hack.

roleoroleo avatar Feb 22 '24 08:02 roleoroleo

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.

github-actions[bot] avatar May 23 '24 02:05 github-actions[bot]