roleoroleo / sonoff-hack

Custom firmware for Sonoff GK-200MP2B camera
GNU General Public License v3.0
200 stars 45 forks source link

GK-200MP2-B hack reports as GK-200MP2C #123

Closed ggggh closed 1 month ago

ggggh commented 1 year ago

Loaded GK-200MP2-B on SD card (as that is what my camera seems to be), confirmed the sonoff-hack/model file states the same, but on the sonoff hack web portal, once camera is up, it says GK-200MP2C. Is that a bug on the portal, is it actually detecting it is a model C (regardless of what the packaging says, and therefore I loaded the wrong firmware)?

I'm having a lot of trouble getting some things to work (motion alerts are triggered but files are only saved in /tmp, not in /mnt/mmc/alarm_record/, and I can't seem to get the "motion event location" setting to actually work)

roleoroleo commented 1 year ago

Where do you see the model GK-200MP2C?

ggggh commented 1 year ago

On the sonoff hack status page (first tab):

Firmware Version 0.1.4 Base Version V0525.1.276build20201103 Model GK-200MP2C

roleoroleo commented 1 year ago

The status page reads this value from a file of the original fw, so it can't be wrong. From https://github.com/roleoroleo/sonoff-hack/blob/master/src/www/httpd/cgi-bin/status.json:

MODEL_CFG_FILE=/mnt/mtd/ipc/cfg/config_cst.cfg
[ -f /mnt/mtd/db/conf/config_cst.ini ] && MODEL_CFG_FILE=/mnt/mtd/db/conf/config_cst.ini
...
MODEL=$(cat $MODEL_CFG_FILE | grep model | cut -d'=' -f2 | cut -d'"' -f2)

Are you sure that you used the correct hack file?

ggggh commented 1 year ago

Yes, downloaded it twice to two different SD cards, and file name looks like the right one. Also, on live system now:

more /mnt/mmc/sonoff-hack/model GK-200MP2-B

more /mnt/mtd/ipc/cfg/config_cst.cfg [customsystem] stop_ptz_slef = "1" IrSampling = "500" IrThresholdDay = "140" IrThresholdNight = "240" model = "GK-200MP2C" vendor = "GK-200MP2C"

roleoroleo commented 1 year ago

The model you find in /mnt/mmc/sonoff-hack/model comes from the hack, so it depends on the hack file you downloaded. /mnt/mtd/ipc/cfg/config_cst.cfg is a sonoff file.

Probably your cam is a GK-200MP2C.

ggggh commented 1 year ago

Ok! Is there a way to tell from the camera itself? Any outside differences? The box it came in clearly says MP2-B

roleoroleo commented 1 year ago

The truth is the file config_cst.cfg.. I don't know if there are exterior differences, I only own the old model GK-200MP2B. What's the sonoff fw version?

But don't worry. The differences between the hacks (in terms of model) are really very small. For example, does ptz work?

ggggh commented 1 year ago

Do I need to check on the ewelink app for the original sonoff fw version? PTZ was working but extremely slow. What wasn't working was motion events. They're triggered, but files are only saved in /tmp, not in /mnt/mmc/alarm_record/, and I can't seem to get the "motion event location" setting to actually work. I'll load the C hack and try it out.

ggggh commented 1 year ago

Changed to C version of the hack, but still the same issue on /mnt/mmc/alarm_record/ being empty and consequently no FTP uploads, although video files for the events do pile up in /tmp. Any ideas?

roleoroleo commented 1 year ago

Your fw version is V0525.1.276build20201103 if I'm not wrong.

What wasn't working was motion events. They're triggered, but files are only saved in /tmp, not in /mnt/mmc/alarm_record/

This is strange: /tmp is a temporary filesystem. What happens when you restart the cam? Is your sd card properly formatted?

ggggh commented 1 year ago

Files appear with a "/tmp/file****" format, with the being random alphanumeric. They do disappear after a reset, as do the log files in /tmp. Interestingly, the video files used to pile up on /tmp, but right now they're disappearing in seconds from /tmp, although they still don't make it to /mnt/mmc/alarm_record. Not sure where they're going. Neither ftppush nor thumb scripts are doing that, as they only look in alarm_record.

MQTT messages are being sent on each motion event, but the hack portal is not listing the events in the motion events table. Sqlite shows them on t_alarm_log, but there is nothing on T_RecordFile. Motion Event setting is on 1; changing it to 0 only seems to cause the mqtt messages to not be sent, but otherwise stays the same (/tmp/file is still created and deleted quickly).

roleoroleo commented 1 year ago

Files appear with a "/tmp/file****" format, with the being random alphanumeric. They do disappear after a reset, as do the log files in /tmp.

They are temporary files, you shouldn't pay attention to these. The problemi is: why aren't they moved to the alarm directory? Sonoff firmware is responsible fot this action (save mp4 files). If you remove the sd card and disable the hack, are the files saved? Have you already tried using another sd card?

MQTT messages are being sent on each motion event, but the hack portal is not listing the events in the motion events table. Sqlite shows them on t_alarm_log, but there is nothing on T_RecordFile.

It depends on the Sonoff fw version: the old firmware reads events from /mnt/mtd/db/ipcsys.db (table t_alarm_log), the new one from /mnt/mmc/AVRecordFile.db (table T_RecordFile). If your T_RecordFile is empty and mqtt messages are sent, "Motion Event" setting must be 1.

korskantevin commented 1 year ago

I've got GK-200MP2-B written on the box, but GK-200MP2С model written in Ewelink app.

darkxst commented 1 year ago

I've got GK-200MP2-B written on the box

Whats written on the base of the actual camera?

However I would believe what is reported by eWeLink and sonoff-hack over what is on the box!

It may be that some sellers are trying to clear out old stock, as I believe only the GK-200MP2-B supports the new ewelink cloud features. However for use with sonoff-hack it makes almost no difference which version you have, they are all very similar.

korskantevin commented 1 year ago

GK-200MP2-B is on the bottom of camera and on box, but GK-200MP2С model written in Ewelink app. what file should I use? I've install hack for GK-200MP2С model yesterday, but PTZ is not working at all from web interface. "ptz -a right" or "ptz_h -a right " - nothing. "ptz_p -a right" - error. So today i install GK-200MP2-B hack file. PTZ is not working from web interface, but all three commands rotate the camera. "ptz_p -a right" - moves it on much big angle. what should I do?

roleoroleo commented 1 year ago

What's the firmware version reported by the app?

korskantevin commented 1 year ago
Base Version | V0525.1.412build20220712 -- | --
roleoroleo commented 1 year ago

I didn't test this version. Please, send me a backup and I will check if it's possible to support it.

korskantevin commented 1 year ago

backup

what do you mean by backup? be more specific please :)

roleoroleo commented 1 year ago

Check the wiki: https://github.com/roleoroleo/sonoff-hack/wiki/Dump-your-backup-firmware-(SD-card)

korskantevin commented 1 year ago

Check the wiki: https://github.com/roleoroleo/sonoff-hack/wiki/Dump-your-backup-firmware-(SD-card)

I didn't test this version. Please, send me a backup and I will check if it's possible to support it.

LINK REMOVED

jekkel commented 1 year ago

FTR Same story here:

Running hack v0.1.4 with working PTZ (albeit slow), not sure about motion detection as I don't really use it (I'd say it doesn't work properly).

Worth noting: upgrading to hack v0.1.5 makes it crash loop after about 5 minutes uptime, had to downgrade.

Anything I can help with?

rlarranaga commented 1 year ago

Same with me. Trying to figure out which firmware to use? GK-200MP2-B on the box, GK-200MP2C on ewelink Thanks

korskantevin commented 1 year ago

Same with me. Trying to figure out which firmware to use? GK-200MP2-B on the box, GK-200MP2C on ewelink Thanks

I've try both of firmwares and finally chose GK-200MP2-B because PTZ was not working on GK-200MP2C.

rlarranaga commented 1 year ago

Thanks for sharing your experience! I am currently on that fw too.

On Mon, Apr 24, 2023, 3:50 PM korskantevin @.***> wrote:

Same with me. Trying to figure out which firmware to use? GK-200MP2-B on the box, GK-200MP2C on ewelink Thanks

I've try both of firmwares and finally chose GK-200MP2-B because PTZ was not working on GK-200MP2C.

— Reply to this email directly, view it on GitHub https://github.com/roleoroleo/sonoff-hack/issues/123#issuecomment-1520660738, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABW5CXZC323GW64BFJAHNOTXC3DPHANCNFSM6AAAAAATQ4ZW3A . You are receiving this because you commented.Message ID: @.***>

roleoroleo commented 1 year ago

Please, let me know if motion detection works and what "Motion event location" configuration.

korskantevin commented 1 year ago

Please, let me know if motion detection works and what "Motion event location" configuration.

Yes it works. image "Motion event location" where can i find this?

Buy the way. I set up MQTT and it works fine, but how can I stop motion records, and get only motion event by MQTT?

roleoroleo commented 1 year ago

"Motion event location" where can i find this?

I mean this option: immagine

Buy the way. I set up MQTT and it works fine, but how can I stop motion records, and get only motion event by MQTT?

I think it's not possible.

korskantevin commented 1 year ago

I mean this option:

I do not change it, so it's 1 by default

I think it's not possible.

It's very unfortunate. because I use this camera only for baby monitor so I don't nead records at all

darkxst commented 1 year ago

The recordings are made by the Sonoff software. If you dont want to keep them you could setup a cron job to delete them regularly.

korskantevin commented 1 year ago

The recordings are made by the Sonoff software. If you dont want to keep them you could setup a cron job to delete them regularly.

yes, I know that. but I'm worried about SD card, which I think will be corrupter after approximately one year

roleoroleo commented 1 year ago

yes, I know that. but I'm worried about SD card, which I think will be corrupter after approximately one year

Maybe 2 years, but you are right. It depends on the model, but you could try to kill the process AVRecorder and check what happens.

korskantevin commented 1 year ago

try to kill the process AVRecorder and check what happens

records are still being saved. but MQTT stops send me alarms

github-actions[bot] commented 2 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.