YooSee SD-M5 doorbell: 1080p, PoE, RTSP, Onvif, only $66

fennec62

n3wb
Joined
Jul 10, 2021
Messages
6
Reaction score
1
Location
france
Great progress @petervk!
At the moment I am struggling to get the gmwf tool to work (something about No module Crypto.Cipher). So I haven't actually installed anything new on the doorbell yet. Also, I am new to MQTT but it seems to be something I want to implement :p

The decompiler I'm comfortable with is Ghidra. Here is where I am thinking to patch the reboot issue (stop the increment of the DayCounter by setting it to 0x0):
View attachment 85694

Other than the challenges mentioned, how would I be able to use the doorbell with two-way audio in conjunction with my Synology NAS?
Hi

Do you find a solution for Two-Way audio ?

Very interesting for homebridge ffmpeg to send audio

Thanks
 

flynreelow

Known around here
Joined
Dec 12, 2016
Messages
1,198
Reaction score
1,086
any other users happy with the quality and reliability of this doorbell? or should just pass.

ran new wires to the doorbell, so POE is now an option.
 

vandyman

Getting comfortable
Joined
Jul 24, 2018
Messages
555
Reaction score
1,620
Location
US
any other users happy with the quality and reliability of this doorbell? or should just pass.

ran new wires to the doorbell, so POE is now an option.
Had mine installed for about two years now, with no complaints.
any other users happy with the quality and reliability of this doorbell? or should just pass.

ran new wires to the doorbell, so POE is now an option.
I had mine installed for about two years now. Working great with vlan and BI.
 

flynreelow

Known around here
Joined
Dec 12, 2016
Messages
1,198
Reaction score
1,086
Had mine installed for about two years now, with no complaints.

I had mine installed for about two years now. Working great with vlan and BI.

did you have to put on the custom firmare to fix the frames per second?
 

whoami ™

Pulling my weight
Joined
Aug 4, 2019
Messages
230
Reaction score
224
Location
South Florida
I'm having a hard time figuring out what HiLinux is using to set the timezone... And it sounds like I'm not the only one. I found these strings that might give an idea
local_time
dwSettingValue = %d,dwTimeZone = %d

But at this time I don't know how to use ghidra to track it down
Im able to set the system time zone though using echo EST5EDT,M3.2.0,M11.1.0 > /etc/TZ then checking it with date but it doesn't change the time stamp displayed on the video. This thing has to set TZ somehow. With hardware clock or TZ or something.
 

flynreelow

Known around here
Joined
Dec 12, 2016
Messages
1,198
Reaction score
1,086
ive been following this thread, and have read everything since 2019. Since this is not a dahua or hik which i am used to, how are you able to adjust settings. is there a web gui for contrast, brightness, iFrame, etc?
or, does the yoosee phone app give me these options?
 
Last edited:

sp00025

n3wb
Joined
Jul 26, 2020
Messages
27
Reaction score
13
Location
Madrid
Im able to set the system time zone though using echo EST5EDT,M3.2.0,M11.1.0 > /etc/TZ then checking it with date but it doesn't change the time stamp displayed on the video. This thing has to set TZ somehow. With hardware clock or TZ or something.
I was able to update the system time from the login shell in such a way that it changes the timestamp on the video. I mentioned that in the post #556 of this thread.
Experimentally I found that the command date -s 'xxxx' can change the value shown on the video timestamp. But I cannot explain weird behaviour of TZ settings. As an example the following script run from the login shell, can set the correct value on the video:


#!/bin/sh

# Sync with local ntp server
export TZ=UTC-6
ntpd -q -p 192.168.x.x
T=$(date +"%Y-%m-%d %H:%M:%S")
export TZ=UTC-5
date -s "$T"


If your embedded system has WAN access, use pool.ntp.org as NTP server. I cannot explain why such magic passes with TZ variable are needed to get the correct time read. Also, most important is that doing something similar in a "startup script" (or whatever we can use as a startup script) does not work. Maybe this info gives some push towards the root of the problem...
 

mrxyz

Getting the hang of it
Joined
May 4, 2020
Messages
72
Reaction score
79
Location
Island
At first glance it seems to use standard mechanisms to get the time:

1628191193791.png

Better to find out how Linux sets the time as Sp00025 pointed out.
 

whoami ™

Pulling my weight
Joined
Aug 4, 2019
Messages
230
Reaction score
224
Location
South Florida
Since HiLinux is booting into a ramdisk how are you guys able to maintain your scripts through a reboot? A startup script should go in /etc/init.d/ but it won't persist through reboot.

LMAO... Hard to believe how far this lil' $60 doorbell cam has come since this thread first started & I'm looking forward to seeing what else we'll be able to make it do.

EDIT: I see if the script is placed in /mnt/disc1 it will persist through reboot... So how to run a startup script in /mnt/disc1 ?
 
Last edited:

flynreelow

Known around here
Joined
Dec 12, 2016
Messages
1,198
Reaction score
1,086
Since HiLinux is booting into a ramdisk how are you guys able to maintain your scripts through a reboot? A startup script should go in /etc/init.d/ but it won't persist through reboot.

LMAO... Hard to believe how far this lil' $60 doorbell cam has come since this thread first started & I'm looking forward to seeing what else we'll be able to make it do.
haha, im with ya.

before you know it, it will be 4K, 60fps, h265, with a varifocal lens.
 

mrxyz

Getting the hang of it
Joined
May 4, 2020
Messages
72
Reaction score
79
Location
Island
Since HiLinux is booting into a ramdisk how are you guys able to maintain your scripts through a reboot? A startup script should go in /etc/init.d/ but it won't persist through reboot.

LMAO... Hard to believe how far this lil' $60 doorbell cam has come since this thread first started & I'm looking forward to seeing what else we'll be able to make it do.

EDIT: I see if the script is placed in /mnt/disc1 it will persist through reboot... So how to run a startup script in /mnt/disc1 ?
Running mount on the terminal shows location you can write to. The trick I did was replacing the npc binary with a shell script and putting the npc binary on the flash card. There are some people that made there own firmware with the patched binary and simply flashed the image. This trick would also do.
 

whoami ™

Pulling my weight
Joined
Aug 4, 2019
Messages
230
Reaction score
224
Location
South Florida
I haven't gotten very far yet, but I have found the working syntax for the TZ format with DST.
Code:
#!/bin/sh

# Sync with local ntp server
ntpd -q -p 192.168.10.1
T=$(date +"%Y-%m-%d %H:%M:%S")
TZ='EST-5EDT-4,M3.2.0/02:00:00,M11.1.0/02:00:00'
export TZ
date -s "$T"

exit 0
Since there is no sleep(1) included in this implementation of busybox, I have to run ntpd -q -p 192.168.10.1 every time before running this bash script to start from UTC0 in order to set the desired TZ. Other wise it will just keep subtracting 5 or 4 hrs. Without having sleep(1) i don't see how it would be possible to use this in a startup script since network has to be up.
Maybe if someone with more skills than me would add a file to /etc/init.d/ named S99set_time.sh... with a symlink to a example file in /mnt/disc1 in the custom FW so that the file in /mnt/disc1 could be edited with the user specified ntp and tz info. The S99 should make it start after the network file which has a runlevel of S80.

Or we need sleep(1) added to busybox somehow.

or if someone who has already figured out how to edit and repackage the FW would give me the links to the exact info I'd need to be able to roll my own FW I can give it a shot.

Code:
TZ=EST-5EDT-4,M3.2.0/02:00:00,M11.1.0/02:00:00
This is the full specification for the default when the TZ variable isn't set.
Eastern Standard Time is 5 hours earlier than Coordinated Universal Time (UTC).
Standard time and daylight saving time both apply to this locale.
Eastern Daylight Time (EDT) is one hour ahead of standard time.
Daylight saving time starts on the second (2) Sunday (0) of March (3) at 2:00 A.M., and ends on the first (1) Sunday (0) of November (11) at 2:00 A.M.
 
Last edited:

sp00025

n3wb
Joined
Jul 26, 2020
Messages
27
Reaction score
13
Location
Madrid
If you place a more complete busybox file to /mnt/disc1 and refer to it with full path you may get not only sleep but plenty of other useful stuff.

As for the custom FW, isn't it so that all "custom" and even official vendor's FW modify only the /npc partition?? The rest (with exception of one /rom partition) exists in the ROM and cannot be modified by standard flashing...
Also, are you sure that syncing time only once on boot is enough?
 

whoami ™

Pulling my weight
Joined
Aug 4, 2019
Messages
230
Reaction score
224
Location
South Florida
Also, are you sure that syncing time only once on boot is enough?
I don't know much of anything about busybox or how editing FW works, but with sleep, you could run ntpd to get utc time, then sleep 1 and run the script posted above giving you the desired time. then run another sleep 900 and loop it. it would sync time every 15mins. with trial and error you could get the first sleep timed perfectly where you wouldn't see the time display the UTC time. You could use while to create the loop. I'm guessing there are probably multiple ways to create the loop with what is in here already. I added the script I posted above to the bottom of the dhcp.script and it kept looping and changing the time by -4 hrs. Not sure why tho... It might have had to do with throwing an error because I had added sleep to the script.

Below is an example of a while loop

Code:
#!/bin/sh
while true
do
    echo "Press CTRL+C to stop the script execution"
done
 
Last edited:

sp00025

n3wb
Joined
Jul 26, 2020
Messages
27
Reaction score
13
Location
Madrid
A suitable busybox binary could be found for example here, as well as a hint to use cron which may better suit the purpose. So far, such trick as you describe worked for me only when login as root from the terminal. But any attempt to run it from the faked /npc/npc script not affected the system time... I will try dhcp.script if you confirm it working.
 

whoami ™

Pulling my weight
Joined
Aug 4, 2019
Messages
230
Reaction score
224
Location
South Florida
A suitable busybox binary could be found for example here, as well as a hint to use cron which may better suit the purpose. So far, such trick as you describe worked for me only when login as root from the terminal. But any attempt to run it from the faked /npc/npc script not affected the system time... I will try dhcp.script if you confirm it working.
Thanks @sp00025, I didn't realize it was that easy. I copy all the files in SDcard to my SD card root like your github README.md instructs. Then I added executable permissions to the scripts and binaries.
Then I added this script I named set_time.sh to /mnt/disc1
Bash:
#!/bin/sh

# Sync with local ntp server
        /mnt/disc1/busybox sleep 5
    while true;
    do
        ntpd -q -p 192.168.10.1
        /mnt/disc1/busybox sleep 10
        ntpd -q -p 192.168.10.1
        T=$(date +"%Y-%m-%d %H:%M:%S")
        TZ='EST-5EDT-4,M3.2.0/02:00:00,M11.1.0/02:00:00'
        export TZ
        date -s "$T"
        /mnt/disc1/busybox sleep 21600
    unset TZ
    done
Then I edited the dhcp.script in /npc like this.
Bash:
#!/bin/sh

# udhcpc script edited by Tim Riker <Tim@Rikers.org>

[ -z "$1" ] && echo "Error: should be called from udhcpc" && exit 1

RESOLV_CONF="/mnt/ramdisk/resolv.conf"
[ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
[ -n "$subnet" ] && NETMASK="netmask $subnet"

case "$1" in
    deconfig)
        /sbin/ifconfig $interface 0.0.0.0
        killall telnetd
        ;;

    renew|bound)
        /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

        if [ -n "$router" ] ; then
            echo "deleting routers"
            while route del default gw 0.0.0.0 dev $interface ; do
                :
            done

            metric=0
            for i in $router ; do
                route add default gw $i dev $interface metric $((metric++))
            done
        fi

        echo -n > $RESOLV_CONF
        [ -n "$domain" ] && echo search $domain >> $RESOLV_CONF
        for i in $dns ; do
            echo adding dns $i
            echo nameserver $i >> $RESOLV_CONF
        done

#       echo "** Start telnetd"
#       /usr/sbin/telnetd
        echo "** Disable WLAN"
        /sbin/ifconfig wlan0 down
#       echo "** Start ftpd"
#       /mnt/disc1/busybox tcpsvd -vE 0.0.0.0 21 ftpd -w /
#       echo "** Start monitoring"
#       /mnt/disc1/MONITORING/parse_push &
#       echo "** Start Cron"
#       /mnt/disc1/busybox crond -L /mnt/disc1/CRON/cron.log -l 0 -c /mnt/disc1/CRON/
        echo "** Setting time"
        /bin/sh /mnt/disc1/set_time.sh
        ;;
esac

exit 0
The line
Code:
echo "** Setting time"
bin/sh /mnt/disc1/set_time.sh
kicks off my script and syncs time every 6hrs to my local ntp server.
I was wrong about being able to use trial and error to set sleep(1) just right so UTC0 time would never be displayed and time sync would be seamless. Unfortunately ntp isn't able to sync in the same amount of time every time so I actually had to add extra time to sleep just to make sure ntpd had enough time to set UTC0 before running the rest of the script. This is why I chose to run the script every 6 hrs instead of every 15 mins, I don't think there is anyway to make the time sync seamless where UTC0 time is never displayed. UTC time is only displayed for a second or two every 6 hrs, no way around it I guess. ¯\_(ツ)_/¯

Maybe if I have more time I'll figure out Cron and use that instead of a while loop. Using while isn't the most efficient why of creating a loop.
 
Last edited:

Ryco

n3wb
Joined
Nov 9, 2019
Messages
9
Reaction score
0
Location
Bc canada
Thanks for all your work on this everyone. I have had this doorcam for a couple years, but have never used it. I have installed the modified FW and telnet is working, what is the username and password you use on telnet? Sorry haven't found this anywhere in the thread.
 
Top