yi-hack-Allwinner-v2 icon indicating copy to clipboard operation
yi-hack-Allwinner-v2 copied to clipboard

Status of the camera is not correct

Open ttarzan01 opened this issue 1 year ago • 78 comments

I use firmware 0.2.7 with model y291ga. Unfortunately, I can no longer read the status with IP:8080/cgi-bin/get_configs.sh?conf=camera. It always says "SWITCH_ON": "yes" even if the camera is turned off. What is the reason, what can I do?

ttarzan01 avatar Jul 08 '23 10:07 ttarzan01

This is not the correct behavior. If you switch off the cam from camera_settings web page and click "Save Configuration", the cam should reply "SWITCH_ON":"no" Please clean the cache of the browser and check again.

roleoroleo avatar Jul 10 '23 11:07 roleoroleo

Sorry, this approach shows no effect. Everytime ist "SWITCH_ON":"yes".

ttarzan01 avatar Jul 10 '23 20:07 ttarzan01

Please, use the debug of the browser and try to capture the network request. F12 with Chrome, network tab.

roleoroleo avatar Jul 10 '23 21:07 roleoroleo

Ok. Camera is off, but camera-setting-page show "on".

image

This ist the network request:

image

ttarzan01 avatar Jul 12 '23 18:07 ttarzan01

Ok. Now press Save button and capture the request and the response:

immagine

immagine

roleoroleo avatar Jul 13 '23 06:07 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.

stale[bot] avatar Oct 11 '23 07:10 stale[bot]

I face the same issue. Looks like after some time 1/2 day camera switched off, it is not longer possible to turn on/off the camera via the hack web interface or the applicable request.

Workaround is to use the yi app to get it again turned on.

thoemmes86 avatar Oct 15 '23 13:10 thoemmes86

could someone figure out whats the problem? I have the same issue...

Few times ago i got the correct values within the response of
"... cgi-bin/get_configs.sh?conf=camera"

but now theres nothing changing after switch something neither from the app, nor from Webpage

i used to resolve the json file for a state sensor in Mediola AIO Remote and wanted to use these at Home Assistant now.

Maybe this is also the Reason why the HASS Integration does not work for me...?!

Thx to All

captaincanada avatar Nov 10 '23 21:11 captaincanada

Please explain me better. The issue refers to an old version of the hack.

roleoroleo avatar Nov 11 '23 15:11 roleoroleo

Hi, thank you for taking care!

the states of the camera are not correct when I check them with the "conf=camera" request.

this is always the answer, no matter what I use to change:

{ "SWITCH_ON":"yes", "SAVE_VIDEO_ON_MOTION":"yes", "SENSITIVITY":"low", "AI_HUMAN_DETECTION":"no", "SOUND_DETECTION":"no", "SOUND_SENSITIVITY":"80", "LED":"no", "ROTATE":"no", "IR":"yes", "HOMEVER":"9.0.19.02_202007141512", "NULL":"NULL" }

captaincanada avatar Nov 11 '23 18:11 captaincanada

Maybe you need a refresh of the cache. If the js script is not synchronized the "Save" function doesn't work. Please clean the cache and try again.

roleoroleo avatar Nov 12 '23 08:11 roleoroleo

cache is empty. when I save changed settings and refresh the page, it doesn't keep the changes...

https://github.com/roleoroleo/yi-hack-Allwinner-v2/assets/2896314/328fa169-22e2-4df1-8693-5e37bd921a54

captaincanada avatar Nov 13 '23 10:11 captaincanada

cache is empty. when I save changed settings and refresh the page, it doesn't keep the changes...

Screen_Recording_20231113_112526_Samsung.Internet.mp4

Same here.

ttarzan01 avatar Nov 13 '23 10:11 ttarzan01

Please, open the debug console in the browser and click "Save configuration". Then check the response: immagine

roleoroleo avatar Nov 13 '23 12:11 roleoroleo

Please, open the debug console in the browser and click "Save configuration". Then check the response:

I do not receive such a response.

It does not matter whether the camera is on or off, it is always displayed as on. It doesn't matter whether I call 'cgi-bin/get_configs.sh?conf=camera' or 'index.html?page=camera_settings'.

I noticed another point: If I set the rotation to 'on' under 'index.html?page=camera_settings' so that the image is rotated, this setting is not displayed either. It always shows 'off' when I have saved the settings. Same with 'Status led'.

image

ttarzan01 avatar Nov 13 '23 17:11 ttarzan01

I do not receive such a response.

Please share the request.

roleoroleo avatar Nov 13 '23 17:11 roleoroleo

Ok, I cleared the browser cache, then called 'index.html?page=camera_settings'. The camera is displayed as 'on' even though it is off. image In the console I only see the following error:

image Nothing more.

ttarzan01 avatar Nov 13 '23 17:11 ttarzan01

request: camera request

refreshed page: refreshed page

captaincanada avatar Nov 13 '23 18:11 captaincanada

After refresh:

image

But camera is off.

ttarzan01 avatar Nov 13 '23 18:11 ttarzan01

it sends switch_on= on and switch_on=yes and the camera is switching on and of too, but eyerytime i ask for the state it says

"SWITCH_ON":"yes"

same for browser and postman

it seems as something would trigger the state to "on/yes", because the state turns always back to "on" after refreshing the page. The Cam itself keeps on beeing on or off.

I have the App installed too, but this shouldn't be the reason. It is running in this setup for years

captaincanada avatar Nov 13 '23 19:11 captaincanada

Check if the file /tmp/sd/yi-hack/etc/camera.conf changes when you switch on/off.

roleoroleo avatar Nov 14 '23 08:11 roleoroleo

Check if the file /tmp/sd/yi-hack/etc/camera.conf changes when you switch on/off.

Do I have to take the SD out of the camera? Or can I access it in another way? Via ssh perhaps?

ttarzan01 avatar Nov 14 '23 10:11 ttarzan01

Use ssh.

roleoroleo avatar Nov 14 '23 10:11 roleoroleo

I did it with ftp and the files show exactly the same...

captaincanada avatar Nov 14 '23 11:11 captaincanada

when I manually edit the camera.conf file to switch_on=no... it shows the right state on the web server.

But the effect is the same... it doesn't change the settings set from the web server... it's falling back to state "no"

captaincanada avatar Nov 14 '23 13:11 captaincanada

I don't understand. Probably 2 different problems. The status it's not correct but the question is: does the cam change the internal setting when you click "Save"? Does the file camera.conf change? So, the problem is the save method or just the get method?

roleoroleo avatar Nov 14 '23 14:11 roleoroleo

the camera.conf does not change.

1.switch web server to "on"

camera turns on

-web server button changes to on -camera.conf doesn't change -http request doesn't change (thought this would get the data from the camera.conf file)

2.switch web server to "off" (whiteout refreshing the web page, cause the button would change by it self after a refresh...)

camera turns off

-web server button changes to off -camera.conf doesn't change -http request doesn't change

the web server button keeps its state and the camera.conf doesn't change. whatever I do so I guess the problem is the save method of the camera.conf

captaincanada avatar Nov 14 '23 16:11 captaincanada

I have the same behavior of camera.conf on the SD like @captaincanada . No matter what I do, camera.conf doesn't change. Although the camera goes on or off as desired.

ttarzan01 avatar Nov 16 '23 20:11 ttarzan01

If the camera switch on/off but doesn't save, it's probably a problem related to mqttv4.

So, please, check if it's running: # ps | grep mqttv4

roleoroleo avatar Nov 18 '23 16:11 roleoroleo

It says

root@xxx:~# ps | grep mqttv4
 1403 root       792 S    mqttv4
11639 root       980 S    grep mqttv4

ttarzan01 avatar Nov 18 '23 19:11 ttarzan01