Dafang-Hacks / uboot

Other
23 stars 16 forks source link

Neos SmartCam #10

Open jgrob1 opened 5 years ago

jgrob1 commented 5 years ago

Hi,

I think this is a Xiaomi clone too, very similar to Wyze... Would the boot loader for Wyzecam V2 128Mb work?

The technical sheet says 128MB.

Just don't want to brick a brand new toy!

susadmin commented 5 years ago

+1 for an answer to this. Not too sure what the difference is. The Wyzecams and the 128Mb Dafang all seem to want the same bootloader but it would good to get some reassurance that dafang_128mb_v2.bin is the right file. I have checked the memory from the cmdline and it is 128M.

My command line reads:

console=ttyS1,115200n8 mem=104M@0x0 ispmem=8M@0x6800000 rmem=16M@0x7000000 init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2048k(kernel),3392k(root),640k(driver),4736k(appfs),2048k(backupk),640k(backupd),2048k(backupa),256k(config),256k(para),-(flag)

Thanks for the great project!

daaaaan commented 5 years ago

I took the plunge. Figured if I bricked it I'd return it.

dafang_128mb_v2.bin works with the Neos. :) Also the other one does too which I found out accidentally. I'm in "glorious" hd now :)

matbrewer396 commented 3 years ago

do you guys use RSTP, just wondering what video settings you found best with HD vid? Mine seems to have quite a delay and fps is really low, like 0.3fps if that

jontybrook commented 2 years ago

For the benefit of anyone also doing this on a NeosCam, and for my own notes; I am going to document the process for flashing U-Book on a "Neos SmartCam"

My particular device labelled on the bottom with Model: NS-CAM-02 and was purchased from Amazon in the UK. I've set up Dafang on it and am now looking to enable full HD streaming from it by flaing U-Boot bootloader...

Flashing U-Boot

As per the instructions here the below screenshots show the process after SSHing into the device.

First I check the device RAM, then WGET the dafang_128mb_v2.bin file from:

https://github.com/Dafang-Hacks/uboot/raw/master/compiled_bootloader/dafang_128mb_v2.bin

Note that the link GitHub gives you if you use the "view raw" link is slightly different to the above (it uses query params to return the raw bin, whereas the above address contains "raw" in the path... it's important that you use the above link which will return the raw bin via wget

I then validate the MD5 hash, erase the the flash memory, copy in the new bootloader, copy the uEnv.txt file and finally reboot the device...

image

Enabling FullHD

Following reboot, the LED on the rear of the device is solid blue, indicating it successfully found the custom uEnv.txt boot configuration.

I SSH back into the camera and edit the uEnv.txt bootargs line. Below shows the contents of uEnv.txt following the changes. Note that in the instructions it mentions change the boot-line - I found this line to actually be called bootargs

Do not copy this config.. read below first! image

I then ran reboot now and the device appeared to reboot (lost ping, heard the IR shutter click)... but it didn't boot. The blue LED was on solid. I power-cycled the device... and the same... just a solid blue light. Uh-oh...

Putting the SD card into my laptop and inspecting the uEnv.txt file revealed the issue... I had missed the "M" after the 87 on the mem boot argument. I fixed this. The valid bootargs line in uEnv.txt now reads:

bootargs=console=ttyS1,115200n8 mem=87M@0x0 ispmem=9M@0x5700000 rmem=32M@0x6000000 init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2048k(kernel),3392k(root),640k(driver),4736k(appfs),2048k(backupk),640k(backupd),2048k(backupa),256k(config),256k(para),-(flag)

Put the SD card back in the device and now it boots! cat /proc/cmdline indicates the change worked..

image

After some experimentation, I've found for my use case H264 VBR provides the most consistent frame rate at the cost of some artefacting in complex scenes..

image

jontybrook commented 2 years ago

do you guys use RSTP, just wondering what video settings you found best with HD vid? Mine seems to have quite a delay and fps is really low, like 0.3fps if that

Depends on your use case...

If artifacting is a problem for you then try MJPEG codec with CBR at 12000Kbps - this should provide accurate images but frame rate may be low.

If you want higher frame rate at the expense of potential artifacting, then H264 may be the best choice for you although due to the limited computing resources available on the Neos cam, complex scenes do lead to considerable artifacting.

To help you choose between codecs, consider the following: