samtap / fang-hacks

Collection of modifications for the XiaoFang WiFi Camera
1.67k stars 340 forks source link

SDCard during boot. blocks booting with 3.0.3.56 #102

Closed GrumpyMeow closed 7 years ago

GrumpyMeow commented 7 years ago

Hi.,

I've just recently bought two Xiaofang camera's. I really like them, especially because of it's low price. I think more tweaking can be done to make the device even more powerfull.

I've read that one should should not boot with the sdcard in it. It indeed blocks the booting of the camera. Booting without SDCard and afterwards placing the SDCard does work.

But i don't want to eject the SDCard everytime the device boots. Especially i will mount the device somewhere out of my reach. I started this thread to eventually resolve this issue with the sdcard blocking the boot.

I suspect that the following reasons can might be blocking the booting with an SDCard:

I've created dump files of the mtdblocks 0 through 5 with: dd if=/dev/mtdblock0 of=/media/mmcblk0p2/backup/dev_mtdblock0.img bs=4096 Using "cat /proc/mtd" i could resolve which mtd what is: cat /proc/mtd dev: size erasesize name mtd0: 000c0000 00001000 "uboot" mtd1: 00300000 00001000 "kernel" mtd2: 00700000 00001000 "rootfs" mtd3: 00400000 00001000 "rescue" mtd4: 00100000 00001000 "etc" mtd5: 00040000 00001000 "userconfig"

I'll be looking more into uboot and mtd.. I'll be updating this thread to hopefully resolve this boot issue quick.

Questions for now:

bbbenji commented 7 years ago

You only need to boot without SD the first time, before enabling hacks. After which it will boot and use the SD just fine without having to remove and reinsert it.

Edit: I am on the same FW as you and not having any problems booting with SD inside.

GrumpyMeow commented 7 years ago

Thank you for your reply.. That's strange that with my sdcard and camera combination it doesn't work like that. Everytime when booting with the SDCard in it, it halts with:

I've used the SDCard image v0.2.0 from this repository with a 16GB SDcard. I didn't enlarge the partion yet. Did you enlarge the partion? Are you also using the image v0.2.0 ?

bbbenji commented 7 years ago

Yes I expanded the partition. I am using v0.2.0 with the latest commits since that release, but that should not make a difference. Are you sure you enabled the hacks?

GrumpyMeow commented 7 years ago

I've just now expanded the partition also and did a reboot. I think that was causing the issue. It did reboot with the SDCard in it... Yay!

I do get a message: Error: Nothing is mounted on /media/mmcblk0p2

If i click the button "manual mount" i get messages: Mounting /dev/mmcblk0p2 to /media/mmcblk0p2... Device is present (filesystem: ext2) mount: mounting /dev/mmcblk0p2 on /media/mmcblk0p2 failed: Device or resource busy Failed to mount!

These last messages might have caused by myself, because i've been fiddling with the snx_autorun.sh script.

Thank you for giving the confirmation that it should've worked. I didn't expect it to be caused by not expanding the SDCard partition.

thanks!

GrumpyMeow commented 7 years ago

Btw... I'm trying to create a nice admin web interface for this device. I'll present my files as soon as possible for every to use.

bbbenji commented 7 years ago

You are getting that warning because you need to wait for the resize to complete. It might take a long time so be sure not to reboot during this process or it may fail!

I started work on a nice admin page myself, maybe we can work together:) Looking forward to a pull request from you.

GrumpyMeow commented 7 years ago

uh oh.. :-D Ejecting the SDCard from the device probably is not a good idea :-S

bbbenji commented 7 years ago

You don't want to touch anything until that message goes away. Also if your issue is resolved, please close it.

GrumpyMeow commented 7 years ago

I'll be closing this issue and will get in touch with you about working together on an admin interface. thx!