mcchas / g2h-camera-mods

Modifying the G2H camera with rtsp, security and not to call home
MIT License
105 stars 14 forks source link

Image flip in Homekit #23

Open Kronos-117 opened 2 years ago

Kronos-117 commented 2 years ago

I followed the steps outlined in #5 to do the image flip via Telnet, but the value doesn't seem to stay at 3. Just changes back to 0. Can anyone help?

mcchas commented 2 years ago

@Kronos-117 If there are any mistakes in the file (or md5 is wrong) the camera restores it to a working version. Make sure you update the md5 value on the last line of the file.

foot-gloves commented 2 years ago

I was having issues and found out that you need to delete the empty lines above the checksum line also. this is how the final lines should look like after making the mod:

[homekit] paird_status = 1 mfi_address = 0x10 camera_active = 1 iseverpaired = 1 checksum = 08222ef07c26733d8c900106379b88d5

Kronos-117 commented 2 years ago

Thanks for the help! I tried both suggestions but still doesn't work. Won't the checksum of the file change after you paste the new one into the file?

ads1230 commented 2 years ago

Delete the md5 checksum, make sure you’re not streaming the camera at the same time as it resets the config. Generate a new md5 and add it in.

averagenormalguy commented 1 year ago

What are possible values? Is there a way to rotate by 90 degree for vertical video (door bell scenario)?

pedroxns commented 1 year ago

I'm having tha same issue here, the file looks like its correctly edited but after a reboot the image stays upside down.

vordenken commented 2 months ago

I don't get how to do this... Changing the 0 to something else and replacing the checksum doesn't work. After a reboot its the original file again. What I don't understand is the checksum part - what should I put there? the output of md5sum /mnt/config/flash_config.ini ? But it's already a different checksum inside the file then if I run the command without modifying the file.

mcchas commented 2 months ago

I don't get how to do this... Changing the 0 to something else and replacing the checksum doesn't work. After a reboot its the original file again.

What I don't understand is the checksum part - what should I put there? the output of md5sum /mnt/config/flash_config.ini ? But it's already a different checksum inside the file then if I run the command without modifying the file.

Try this on the camera itself, some windows text editors add extra new line characters which could corrupt the config.

Step 1. Change the config (e.g 0 to something else) Step 2. Delete the last line of the file that has the checksum (note the format before you do this.. or back it up) Step 3. Save the file Step 4. Run md5 on the above file Step 5. Edit the file again and add the new checksum as the last line of the file, in the same format it was originally Step 6. Save the file and reboot

vordenken commented 2 months ago

Thank you so much! This worked instantly :) Now I need to find out why your "hostname" file doesn't work on my camera. I got root access with a simple script regarding the password but your file with all the other stuff doesn't work :(

mcchas commented 2 months ago

Now I need to find out why your "hostname" file doesn't work on my camera.

The script only patches a few versions of the camera binary (from around the time this repo was created) and probably won't work with newer versions.

To update it one would need to find the new patterns to patch.

I never found a need to update mine as they work fine. You could always downgrade the camera binary if you want rtsp and HomeKit. The harder way would be using Ghidra to find the locations to patch the newer binaries.

vordenken commented 2 months ago

I'm running firmware version 2.2.1 - what's yours running on? I've never updated the device because I only use it in homekit.

mcchas commented 2 months ago

I'm running firmware version 2.2.1 - what's yours running on? I've never updated the device because I only use it in homekit.

I'm running a few on v2.0.9 and v2.0.6. But the script was updated at one point to support 2.2.1