EliasKotlyar / Xiaomi-Dafang-Hacks

4.17k stars 1k forks source link

Xiaomi Xiaofang 1S T20L support #1128

Closed Juumm closed 4 years ago

Juumm commented 5 years ago

Hi As all new Xiaomi Xiaofang 1S have T20L chip that does not work well with current dafang hack, is it planned soon to support officially new Xiaomi Xiaofang 1S T20L ?

jmtatsch commented 4 years ago

We would need someone to try the new drivers on their old xiaofangs, Dafangs wyzes etc.

denwald commented 4 years ago

I can try the drivers on my old Dafang.

What is odd about the new Xiaofang is the amount of ram.

[root@XIAOFANG:sdcard]# free -m total used free shared buffers cached Mem: 34 31 2 0 1 9 -/+ buffers/cache: 21 13 Swap: 0 0 0

It reports total 34, which seems low.

Not sure if this means anything.

denwald commented 4 years ago

My old dafang which was bough in July last year is not working with the new drivers. I tried the drivers by replacing them on my old sd-card. Then with a fresh copy of the firmware from GitHub. The camera will boot and perform the motor calibration. After that the yellow LED starts blinking with a high frequency. It won't connect to my wifi. What's odd is that a fresh install from GitHub also fails to boot into a usable state. Fortunately I kept a backup of old sd card. After restoring the sd card from backup I can use the dafang as before.

maxencep02 commented 4 years ago

The driver are for Xiaofang, not Dafang. Or I am misunderstanding your message.

My camera is working for more than two days now.

denwald commented 4 years ago

The driver are for Xiaofang, not Dafang. Or I am misunderstanding your message.

I tested the drivers on a new Xiaofeng (working) and on an old Dafang (not working).

Apparently the drivers included in the firmware_mod directory are the same for all cameras. The mod has a script which updates the camera firmware from this repo. It can be invoked using the web ui of the camera. If you want to put the new drivers in the repo you need to make sure that they won't brick old devices or rewrite the update script so that old devices don't get the new drivers.

mrdc commented 4 years ago

I have Xiaofang 1S, but it looks like it's T20 version as it works from March without issues. But in cpuinfo I have incorrect info:

[root@Xiaofang1S:~]# cat /proc/cpuinfo system type : bull machine : Unknown processor : 0 cpu model : Ingenic Xburst V0.1 FPU V0.0 BogoMIPS : 709.42 wait instruction : yes microsecond timers : no tlb_entries : 32 extra interrupt vector : yes hardware watchpoint : yes, count: 1, address/irw mask: [0x0fff] isa : mips32r1 ASEs implemented : shadow register sets : 1 kscratch registers : 7 core : 0 VCED exceptions : not available VCEI exceptions : not available

Hardware : isvp Serial : 00000000 00000000 00000000 00000000

maxencep02 commented 4 years ago

My Xiaofang T20l is running well for days. However it seems it has issues with the night mode. It is not switching to this mode or not completely. Thus in the c night the camera is warmer than in the day. I have no idea how to debug that.

jmtatsch commented 4 years ago

@maxencep02 can you post cat /proc/cpuinfo for your T20L

jmtatsch commented 4 years ago

I was hoping the new drivers for T20L Xiaofangs would be backwards compatible with old Xiaofangs and Dafangs but apparently that is not the case. So we would need ways to id the models and chipsets.

jmtatsch commented 4 years ago

@denwald Not sure how much ram the new S1 has. Could be more just not visible because of an old 64mb bootloader. Can someone check the chips for hints?

maxencep02 commented 4 years ago

@jmtatsch : Here is the result: [root@XIAOFANG:~]# cat /proc/cpuinfo system type : bull machine : Unknown processor : 0 cpu model : Ingenic Xburst V0.1 FPU V0.0 BogoMIPS : 709.42 wait instruction : yes microsecond timers : no tlb_entries : 32 extra interrupt vector : yes hardware watchpoint : yes, count: 1, address/irw mask: [0x0fff] isa : mips32r1 ASEs implemented : shadow register sets : 1 kscratch registers : 7 core : 0 VCED exceptions : not available VCEI exceptions : not available

Hardware : isvp Serial : 00000000 00000000 00000000 00000000 [root@XIAOFANG:~]#

ZipperZ commented 4 years ago

FWIW I think I found out how to properly stream 1080p video over RTSP by reverse-engineering the Xiaofang 1S binaries. They used 2 undocumented SDK functions to increase the pool size, as well as reduce the number of video buffers to 2. It's been working on my 1S for half a year now without problems. No custom U-Boot bootloader is required.

Details for developers are here: geekman/t20-rtspd@f30f0e8

Can we expect this to be added to this project?

Maybe you could provide a compiled binary that we could change on our xiaofangs to "test"?

freddycs commented 4 years ago

My Xiaofang T20l is running well for days. However it seems it has issues with the night mode. It is not switching to this mode or not completely. Thus in the c night the camera is warmer than in the day. I have no idea how to debug that.

First of all thank you guys for getting the driver for T20L, i have 2 unit of them and both are working well, just that the frame rate is very low, less than 1 fps. However, my auto night mode seems working fine. just that it's a bit delay (2 seconds) before switching mode... happy overall that i can finally get rid of the mi home app!!! I'm using TinyCam app and it worked flawlessly!

Juumm commented 4 years ago

Hello What is the update status of this topic ?

jmtatsch commented 4 years ago

I don’t see a way to determine the exact chipset model and thus cannot load the correct drivers for each model.

ankumara commented 4 years ago

Hi, newbie here. reading all the conversation up there make me lost. Currently have xiaofang T20L. I have open the hardware and find similar hardware as above photo.

I tried the T20 CFW (cfw-1.0.bin) to mod firmware and put firmware on SDcard (not sure what the name) and it works.

Now, i would like to be able to be back to original firmware and connect using Mi home app. is this possible? how do i do it? i read that i just need to remove the sd card, but it does not work.

Juumm commented 4 years ago

I understand that it is hard to have a unique hack working for Xiaofang T20 and T20L But can we have a dedicated hack for xiaofang T20L ? Can you explain what are the feature working on the new hack dedicated for T20L versus the hack working for the Xiaofang T20 classic ? Some feature ar missing ? or everyhing is the same ?

jmtatsch commented 4 years ago

@Juumm You can already, just copy those new drivers over your old ones and it works. I don't have any xiaofangs and thus not too much interest in them.

tERB00 commented 4 years ago

Got it working on my Xiaofang T20L with the replaced drivers but it have some issues. First is a mentioned above software day/night mode where it turns IR leds on when it dark but does not turn them off when it's bright again. Second is video settings - 1080p does not work (only 1600x900 and lower). Is there any way to troubleshoot this issues?

jmtatsch commented 4 years ago

You need need more memory for fhd. You Need to flash uboot and change bootline, See old Threads for info. Night mode isn’t working well on my dafangs as well, will need to look into it eventually.

tERB00 commented 4 years ago

You need need more memory for fhd. You Need to flash uboot and change bootline, See old Threads for info. Night mode isn’t working well on my dafangs as well, will need to look into it eventually.

Should I flash one from here (which one)? https://github.com/Dafang-Hacks/uboot/tree/master/compiled_bootloader Or should I hex-edit and flash my own bootloader? Mine have this string inside: mem=41700K@0x0 ispmem=8M@0x28B9000 rmem=15644K@0x30B9000

tERB00 commented 4 years ago

It looks like my cam have only 64M and wont be able to run 1080p even with patched u-boot?

mrdc commented 4 years ago

@tERB00

Second is video settings - 1080p does not work (only 1600x900 and lower). Is there any way to troubleshoot this issues? @jmtatsch You need need more memory for fhd.

Looks like it's possible to stream 1080p with 64MB memory:

I found out how to properly stream 1080p video over RTSP It's been working on my 1S for half a year now without problems. No custom U-Boot bootloader is required.

https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1128#issuecomment-531582270 https://github.com/geekman/t20-rtspd/commit/f30f0e86849a05a8d3f00608471348a8dd36e481

jmtatsch commented 4 years ago

If anyone wants to patch that into our rtspserver i would gladly accept a pull request.

tERB00 commented 4 years ago

@tERB00

Second is video settings - 1080p does not work (only 1600x900 and lower). Is there any way to troubleshoot this issues? @jmtatsch You need need more memory for fhd.

Looks like it's possible to stream 1080p with 64MB memory:

I found out how to properly stream 1080p video over RTSP It's been working on my 1S for half a year now without problems. No custom U-Boot bootloader is required.

#1128 (comment) geekman/t20-rtspd@f30f0e8

Yeah, I've tried that binary but it gives me black screen on the rtsp stream. And I don't know how to contact author of that repo because there is no issues tab there. Sure it is possible because stock fw doing 1080p no problem but we do not know exactly how... yet...

mrdc commented 4 years ago

And I don't know how to contact author of that repo because there is no issues tab there.

Let's try @geekman

geekman commented 4 years ago

You can try out a pre-compiled binary on my repo by copying it to your Xiaofang 1S. I've added an Issues tab, in case any users are having issues with the binary.

Sure it is possible because stock fw doing 1080p no problem but we do not know exactly how... yet...

My thoughts exactly when I started looking into it. I ran the rtspserver binary from this project, which failed, but yet the stock firmware worked. In the end I took a simpler server, spliced in the changes I had reverse-engineered, and had a binary that ran fine, just like the original firmware would. I assume that would work on all cameras, but I can't really be sure.

aminhusni commented 4 years ago

You can try out a pre-compiled binary on my repo by copying it to your Xiaofang 1S. I've added an Issues tab, in case any users are having issues with the binary.

I have tested the binary so far and it is far more stable than the one we have here. Stream does not drop and it stayed on for hours.

Hopefully, we can implement this lighter and more reliable binary for rtsp. Right now it is just lacking OSD and settings argument support (I think)

mrdc commented 4 years ago

and it is far more stable than the one we have here. Stream does not drop and it stayed on for hours.

I'm using default RTSP since March - no problems for me except 720p and not working stream in Homekit (not confirmed that it's RTSP related).

aminhusni commented 4 years ago

I'm using default RTSP since March - no problems for me except 720p and not working stream in Homekit (not confirmed that it's RTSP related).

I decided to try the default RTSP again with a fresh install and a different SD card. Same result for me. The RTSP server will die after a while.

2019-10-11 19_58_42-DAFANG

Here is the dmesg:

 [ 1790.589699] error: sensor_read,172 ret = -5
[ 1790.594021]  sensor_read: addr=0x31f3 value = 0x0
[ 1790.598863] err sensor read addr = 0x31f3, value = 0x0
[ 1790.664377] i2c i2c-0: i2c_jz_irq 441, I2C transfer error, ABORT interrupt
[ 1790.671468] i2c i2c-0: --I2C txabrt:
[ 1790.675172] i2c i2c-0: --I2C TXABRT[0]=I2C_TXABRT_ABRT_7B_ADDR_NOACK
[ 1790.681729] error: sensor_read,172 ret = -5
[ 1790.686054]  sensor_read: addr=0x3008 value = 0x0
[ 1790.690899] err sensor read addr = 0x3008, value = 0x0
[ 1790.696209] info: failed sensor find
[ 1790.700355] misc sinfo_release
[ 1790.713705] set sensor gpio as PA-low-10bit
[ 1790.718030] probe ok ------->jxf23
[ 1790.871293] -----jxf23_detect: 529 ret = 0, v = 0x0f
[ 1790.871718] -----jxf23_detect: 537 ret = 0, v = 0x23
[ 1790.871735] jxf23 0-0040: jxf23 chip found @ 0x40 (i2c0)
[ 1790.877233] tx_isp: Registered sensor subdevice jxf23 0-0040
[ 1790.883159] do not support ctrl->cmd ====1
[ 1790.883179] do not support ctrl->cmd ====0
[ 1790.891673] do not support ctrl->cmd ====1
[ 1791.166444] do not support ctrl->cmd ====1
[ 1791.172111] jxf23 stream on
[ 1791.214672] ###### image_tuning_v4l2_open 4219 #######
[ 1791.265499] &&& chan1  scaler.max_width = 1920 max_height = 1080  min_width = 128 min_height = 128 &&&
[ 1791.785951] codec_codec_ctl: set sample rate...
[ 1791.787355] codec_codec_ctl: set device...
[ 1792.182881] codec_set_device: set device: MIC...
[ 1989.401152] RTL871X: recv eapol packet
[ 1989.419505] RTL871X: send eapol packet
[ 1989.423568] RTL871X: set group key camid:6, addr:e8:94:f6:b8:64:0e, kid:2, type:AES
[ 2478.355594] jxf23 stream off
[ 2478.357904] do not support ctrl->cmd ====0
[ 2478.358750] codec_codec_ctl: set CODEC_TURN_OFF...
[ 2589.449606] RTL871X: recv eapol packet
[ 2589.459011] RTL871X: send eapol packet
[ 2589.462977] RTL871X: set group key camid:5, addr:e8:94:f6:b8:64:0e, kid:1, type:AES
[ 3189.493848] RTL871X: recv eapol packet
[ 3189.503169] RTL871X: send eapol packet
[ 3189.507136] RTL871X: set group key camid:6, addr:e8:94:f6:b8:64:0e, kid:2, type:AES

UPDATED:

[   19.618840] jxf23 stream on
[   19.659321] ###### image_tuning_v4l2_open 4219 #######
[   19.694688] &&& chan1  scaler.max_width = 1920 max_height = 1080  min_width = 128 min_height = 128 &&&
[   20.321144] cgu_set_rate, parent = 712704000, rate = 4096000, n = 174, reg val = 0x200020ae
[   20.321165] codec_codec_ctl: set sample rate...
[   20.322178] codec_codec_ctl: set device...
[   20.720882] codec_set_device: set device: MIC...
[  225.551376] do_page_fault() #2: sending SIGSEGV to ai-_ai_record_t for invalid read access from
[  225.551376] 776369b8 (epc == 7763f4d0, ra == 7763f990)
[  225.606782] jxf23 stream off
[  225.612020] do not support ctrl->cmd ====0
[  225.612894] codec_codec_ctl: set CODEC_TURN_OFF...
denwald commented 4 years ago

I have a question regarding the update procedure with autoupdate.sh. If I understand it correctly the autoupdate will overwrite the changed drivers I put onto the SD card.

There seems to be a possiblitly to exclude certain paths from the autoupdate. Would it be sufficient to add the names of the drivers that were swapped for the 20L model to the EXCLUDEFILTER variable like this?:

EXCLUDEFILTER="*.conf|*.user|passwd|shadow|8189fs.ko|audio.ko|exfat.ko|sample_motor.ko|sample_pwm_core.ko|sample_pwm_hal.ko|sample_speakerctl.ko|sensor_jxf22.ko|sensor_jxf23.ko|sinfo.ko|tx-isp.ko"

or maybe easier:

EXCLUDEFILTER="*.conf|*.user|passwd|shadow|*.ko"

Dopeyr commented 4 years ago

My thoughts exactly when I started looking into it. I ran the rtspserver binary from this project, which failed, but yet the stock firmware worked. In the end I took a simpler server, spliced in the changes I had reverse-engineered, and had a binary that ran fine, just like the original firmware would. I assume that would work on all cameras, but I can't really be sure.

Great work! Just for reference, I've tried t20-rtspd on an old dafang (one with a light sensor, for ref) and vlc will not display the stream.

I've tried it on a T20L and vlc displays the stream at 1080p :)

For ref, I have also run the v4l2rtspserver-master from this repo on the T20L successfully (at 1600x900) without overwriting the driver files as discussed above. Seems pretty stable, but I don't view (or stream) it all the time so I can't comment on drops.

My cpuinfo on the T20L

[root@DAFANG3:sdcard]# cat /proc/cpuinfo
system type     : bull
machine         : Unknown
processor       : 0
cpu model       : Ingenic Xburst V0.1  FPU V0.0
BogoMIPS        : 709.42
wait instruction    : yes
microsecond timers  : no
tlb_entries     : 32
extra interrupt vector  : yes
hardware watchpoint : yes, count: 1, address/irw mask: [0x0fff]
isa         : mips32r1
ASEs implemented    :
shadow register sets    : 1
kscratch registers  : 7
core            : 0
VCED exceptions     : not available
VCEI exceptions     : not available

Hardware        : isvp
Serial          : 00000000 00000000 00000000 00000000

cmdline:

console=ttyS1,115200n8 mem=41700K@0x0 ispmem=8M@0x28B9000 rmem=15644K@0x30B9000 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)

Interesting that there's only ~40M ram in total.

tERB00 commented 4 years ago

Great work! Just for reference, I've tried t20-rtspd on an old dafang (one with a light sensor, for ref) and vlc will not display the stream.

Try to disable h264-rtsp's autorun, reboot and then try t20-rtspd binary. That worked for me. But the bitrate is really low (only 2k and it's hardcoded). I don't know why - maybe just for testing purposes or maybe it cant output more at 1080p...

Dopeyr commented 4 years ago

Great work! Just for reference, I've tried t20-rtspd on an old dafang (one with a light sensor, for ref) and vlc will not display the stream.

Try to disable h264-rtsp's autorun, reboot and then try t20-rtspd binary. That worked for me. But the bitrate is really low (only 2k and it's hardcoded). I don't know why - maybe just for testing purposes or maybe it cant output more at 1080p...

Hi, I gave this a try, but still no joy on the dafang unfortunately. I'll try and do a bit more digging, VLC seems to connect, but then errors. It doesn't really give a huge amount of info in the VLC logs. Not that I understand them very well :)

aminhusni commented 4 years ago

Great work! Just for reference, I've tried t20-rtspd on an old dafang (one with a light sensor, for ref) and vlc will not display the stream.

Try to disable h264-rtsp's autorun, reboot and then try t20-rtspd binary. That worked for me. But the bitrate is really low (only 2k and it's hardcoded). I don't know why - maybe just for testing purposes or maybe it cant output more at 1080p...

The binary was meant to be just for testing and proof of concept that the camera with 64mb can indeed run at 1080p with CFW.

Now if only we could have that one replace the one we current have in this repo, that would be awesome because it is far more stable. The original one from this repo keeps killing itself without any error output.

tERB00 commented 4 years ago

Now if only we could have that one replace the one we current have in this repo, that would be awesome because it is far more stable. The original one from this repo keeps killing itself without any error output.

Why replace it? Just add new script to the autostart folder (/config/autostart/) with your t20-rtspd.

aminhusni commented 4 years ago

Why replace it? Just add new script to the autostart folder (/config/autostart/) with your t20-rtspd.

Like I said earlier,

Right now it is just lacking OSD and settings argument support (I think)

Currently, the binary is for proof of concept. It does not do OSD, it does not take arguments for settings and it is not officially supported/integrated with the frontend UI.

c58 commented 4 years ago

Can you guys share the modified version of the FW with the "right" drivers? @maxencep02

maxencep02 commented 4 years ago

I don't understand what you want from me? The drivers are the one from this message : https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/issues/1128#issuecomment-531771773 The rest is untouched from the original FW. But I haven't been using the camera for some time.

c58 commented 4 years ago

What i wanted is a CFW bin with updated drivers in it. I managed to make it, i flashed it and it worked great. demo.bin.zip

TRSx80 commented 4 years ago

I read this whole thread with great interest. I had made a thread about Hardware purchasing discussion and one of the questions I raised was about the L variant (which supposedly are the ones I received). Since this thread is dated later than mine, apparently these issues did not become known until more recently.

At any rate, reading this thread looks like you guys have everything working by now, and @c58 has even packaged up a ready to go .bin that includes the new drivers.

I suppose my reason for posting is just to ping @jmtatsch and any other interested parties to let you guys know that I have finally received (2x) of the new T20L models and I was just about to begin playing around with them. Was there anything else we needed from a virgin stock image, or wanted to test? I do have soldering station, headers, FTDI, CH341, lots of other electronics bits, as well as GNU/Linux tools available, and familiarity (even preference for) the command line...

I suppose the first thing I will try is to see if I can try to find any way to differentiate the new models from the old ones in a way that can be included into this project, in order to auto select the proper drivers. From reading this thread, it doesn't seem as there is any info available in the firmware itself, so maybe we have to go by dates and/or serial number ranges? I have no idea, just spitballing.

Anyway, I will be home on holiday for the next week or so, if anyone wants to try and work together on this. Feel free to contact me through here I suppose (I should receive notification of any posts to this or my other thread).

I was going to idle in IRC also, but couldn't seem to find any appropriate channel...

jmtatsch commented 4 years ago

The T20L should be clocked higher right? Maybe we can use that to detect them.

tERB00 commented 4 years ago

The T20L should be clocked higher right? Maybe we can use that to detect them.

Not sure... Here is my T20L's cpuinfo:

[root@XiaoFANG-1:~]# cat /proc/cpuinfo
system type             : bull
machine                 : Unknown
processor               : 0
cpu model               : Ingenic Xburst V0.1  FPU V0.0
BogoMIPS                : 709.42
wait instruction        : yes
microsecond timers      : no
tlb_entries             : 32
extra interrupt vector  : yes
hardware watchpoint     : yes, count: 1, address/irw mask: [0x0fff]
isa                     : mips32r1
ASEs implemented        :
shadow register sets    : 1
kscratch registers      : 7
core                    : 0
VCED exceptions         : not available
VCEI exceptions         : not available

Hardware                : isvp
Serial                  : 00000000 00000000 00000000 00000000
TRSx80 commented 4 years ago

BogoMIPS : 709.42

If you compare this to https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/information/hardware.md the original (note that is a Dafang however) shows:

BogoMIPS : 858.52

That's the only difference I can see so far.

Once I get some headers soldered on, I will report what mine says.

In the meantime, here are some (hopefully good enough) pics of the new boards. Here are the changes I noted so far:

1

2

3

4

I have to run out soon, but later/tomorrow I'll try and get some serial output and other info.

spattinson commented 4 years ago

I think I have a T20L but im not sure, this is firmware? I can dump if needed. It looks the same as TRSx80 pics except the date on the PCB is 2019 03:28. The date on the carton is 2019.07

[START] Cam_firmware_HTTP = 5.6.2.77
[START] CONFIG_INFO_FIRMWARE = 5.6.2.77

Boot:

[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU0 RESET ERROR PC:E4ABE076
[    0.000000] CPU0 revision is: 00d00101 (Ingenic Xburst)
[    0.000000] FPU revision is: 00b70000
[    0.000000] CCLK:712MHz L2CLK:356Mhz H0CLK:200MHz H2CLK:200Mhz PCLK:100Mhz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 0051b000 @ 00010000 (usable)
[    0.000000]  memory: 00035000 @ 0052b000 (usable after init)
[    0.000000] User-defined physical RAM map:
[    0.000000]  memory: 028b9000 @ 00000000 (usable)
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x028b8fff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x028b8fff]
[    0.000000] Primary instruction cache 32kB, 8-way, VIPT, linesize 32 bytes.
[    0.000000] Primary data cache 32kB, 8-way, VIPT, no aliases, linesize 32 bytes
[    0.000000] pls check processor_id[0x00d00101],sc_jz not support!
[    0.000000] MIPS secondary cache 128kB, 8-way, linesize 32 bytes.
[    0.000000] Built 1 zonelists in Zone order, mobility grouping off.  Total pages: 10343
[    0.000000] Kernel command line: console=ttyS1,115200n8 mem=41700K@0x0 ispmem=8M@0x28B9000 rmem=15644K@0x30B9000 init=/linuxrc rootfstype=squashfs root=/dev/mtdblock2 rw mtdparts=jz_sfc:256k(boot),2048k(kernel),3392k(root),640k(driv

cpu info

machine         : Unknown
processor       : 0
cpu model       : Ingenic Xburst V0.1  FPU V0.0
BogoMIPS        : 709.42
wait instruction    : yes
microsecond timers  : no
tlb_entries     : 32
extra interrupt vector  : yes
hardware watchpoint : yes, count: 1, address/irw mask: [0x0fff]
isa         : mips32r1
ASEs implemented    :
shadow register sets    : 1
kscratch registers  : 7
core            : 0
VCED exceptions     : not available
VCEI exceptions     : not available

Hardware        : isvp
Serial          : 00000000 00000000 00000000 00000000

memory :-(

MemTotal:          35404 kB
MemFree:            1896 kB
Buffers:             476 kB
Cached:             5784 kB
SwapCached:            0 kB
Active:            16988 kB
Inactive:           5456 kB
Active(anon):      16188 kB
Inactive(anon):        8 kB
Active(file):        800 kB
Inactive(file):     5448 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:         16380 kB
SwapFree:          16380 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         16196 kB
Mapped:             4448 kB
Shmem:                12 kB
Slab:               5168 kB
SReclaimable:       1452 kB
SUnreclaim:         3716 kB
KernelStack:         792 kB
PageTables:          284 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:       34080 kB
Committed_AS:     311868 kB
VmallocTotal:    1048372 kB
VmallocUsed:        2628 kB
VmallocChunk:    1043376 kB

Im new to all this. I let it get is IP via the xiaomi home app, but killed the app before it finished setup. I want to work with home assistant. it would not flash demo.bin:

jiabo_do_auto_update!!!!!!!!!!!!!!!!!!!!!!!!
gpio_request lable = sdupgrade gpio = 46
setup_button set long!!!!!!!!!!!!!!!!!!!
the manufacturer c8
SF: Detected GD25Q128

reading demo.bin
the manufacturer c8
SF: Detected GD25Q128

--->probe spend 4 ms
SF: 2621440 bytes @ 0x40000 Read: OK
--->read spend 339 ms
## Booting kernel from Legacy Image at 80600000 ...

that message then kernel loads immediately. what next?

aminhusni commented 4 years ago

If anyone wants to patch that into our rtspserver i would gladly accept a pull request.

Do you have the source code for the rtspserver? Can't seem to find it anywhere in the repo so I can recompile it with the new code.

TRSx80 commented 4 years ago

OK, here is what I have learned so far:

The serial pins are in the same order as shown here, namely, starting from corner: 1 RX 2 TX 3 GND They also connect at the same baud rate as shown in that link.

I have a boot log now, starting from serial. Do we still need that? I can paste it here if so. It looks like I am also on firmware 5.6.2.77, judging from the boot log.

I could get into root shell (I think?) by following these instructions, but I could not seem to do a firmware dump because there was nothing under /proc/ at all.

I did some more poking around, but didn't come up with anything else. And because nothing mounted at /proc/ I couldn't get cpuinfo, either.

Not sure what to do next (besides grab a beer ;) )?

TRSx80 commented 4 years ago

I just had a closer look at the teardown video I posted above. I don't even think it's a T20 chip. It says Ronin(?) I think on it? And with a date stamp of 17-02-20. Is that perhaps one of the original ARM based devices, as supported in the dafang-hacks project?

Also, in case it matters (I don't think it does): I purchased mine on Aliexpress, it said for mainland China only, and the box, manual, etc. are all in Chinese. I didn't think that mattered, if we are going to be changing software, anyway (I am buying hardware is the way I look at it).

jmtatsch commented 4 years ago

Can users with T20 and T20L grep their dmesg for the clock speeds please? dmesg | grep "Mhz" Ideally before uploading a custom firmware :)

This is the clock profile of one of my dafangs:

[ 0.000000] CCLK:860MHz L2CLK:430Mhz H0CLK:200MHz H2CLK:200Mhz PCLK:100Mhz

jmtatsch commented 4 years ago

@aminhusni https://github.com/Dafang-Hacks/Main/tree/master/v4l2rtspserver-master