Dafang-Hacks / rootfs

13 stars 18 forks source link

What is next ? #2

Open nik0 opened 6 years ago

nik0 commented 6 years ago

Hi @EliasKotlyar, @jmtatsch,

I succeeded installing my other Dafang with the new bootloader (thanks for your hard work on it) I am currently trying to install the rootfs on the sdcard. So my question now is: what shall we do about the path, for example /system/sdcard/ ?

I am just guessing, I am not sure all the implication of the new rootfs ...

Nik0

jmtatsch commented 6 years ago

I would vote for the last option. With this writable rootfs we can also drop a lot of workarounds in run.sh bindmounting stuff and trying to recreate a normal Linux environment. A package manager would also be swell

nik0 commented 6 years ago

That’s also my opinion. But I have myself some troubles having this working 😜so there should be a packaging effort to do here ...

EliasKotlyar commented 6 years ago

I also prefer option 3, but it may take some time to migrate everything to the new system.

jmtatsch commented 6 years ago

Where do we want to store our configuration files? /config? Do we want to stick with the current jungle of decentralised config files or do we want to move to a single centralised config file? Is there a smart (generic) way to handle new configuration options and merge them into the users individual config file/files?

nik0 commented 6 years ago

I vote for a uniq config file in /etc. /etc will work for the old and new bootloader

EliasKotlyar commented 6 years ago

Yes, /etc/ sounds fine. Any idea how to migrate everyone to the new system?

jmtatsch commented 6 years ago

Step by step. First I would actually need to get my rootfs to boot ;) I have only macs which dislike writing ext3 and one Linux Box which needs to use a LTE stick to write a minisd. Everytime I test a rootfs, the filesystem is destroyed :( Also, I have not yet soldered a serial bridge to one of my cameras, so I am kind of blind during boot phase.

jmtatsch commented 6 years ago

Is there something wrong with my recipe to build the rootfs?

# identify your sdcard 
sudo fdisk -l
# in my case its /dev/sdb

# repartition to have a single partition
sudo fdisk /dev/sdb
Command (m for help): n
Select (default p): p
Partition number (1-4, default 1): 1
First sector (starting-ending, default starting): starting
Last sector, +sectors or +size{K,M,G} (starting-ending, default ending): ending
Command (m for help): w

# format it with ext3 filesystem
sudo mkfs.ext3 /dev/sdb1

# mount it
sudo mount -t ext3 /dev/sdb1 /mnt

# remove lost & found so we can directly clone from git 
sudo rm -rf /mnt/lost+found

# clone the root file system into it
sudo git clone https://github.com/Dafang-Hacks/rootfs.git /mnt

# add your wifi credentials
sudo nano /mnt/etc/wpa_supplicant.conf

# change your memory partitioning for fullHD if desired
sudo nano /mnt/uEnv.txt

# safely remove the sdcard
sudo umount /mnt 
nik0 commented 6 years ago

For me it seems correct Your device is not booting at all ? How do you know that ? I had a problem with the wifi connection. Try adding some logs in /etc/init.d/rcSand also try adding chmod +x /etc/udhcpc.script somewhere in the script

jmtatsch commented 6 years ago

The blue led was not lit at the very start of the boot process. Changing to a proper miniSD reader instead of the LTE stick seems to have done the trick - it boots properly now :) I will fix some of the scripts now...

reikred commented 6 years ago

I like the idea of an ext3 filesystem. I'm ok with mounting the sdcard on linux for hacking. Would have been nice though if "user" data like /DCIM still could be on a fat32 so that one could slap it into any laptop and get images and videos out that way. On the other hand, with ext3 and a package manager on could get rsync perhaps, to do the job.

The limitations of fat32 became clear when I wanted to use scp:

[root@DAFANG:bin]# dropbearmulti scp -p /system/sdcard/DCIM/timelapse/2018-08-09/2018-08-09_194817_001.jpg 10.10.10.18: /usr/bin/dbclient: No such file or directory

Some symlinks may have fixed that problem, but, alas, no symlinks on fat32.

jmtatsch commented 6 years ago

Hello gents,

I started to work on the scripts in #3 can you have a look/comment/help?

smcallis77 commented 5 years ago

Is there something wrong with my recipe to build the rootfs?

# identify your sdcard 
sudo fdisk -l
# in my case its /dev/sdb

# repartition to have a single partition
sudo fdisk /dev/sdb
Command (m for help): n
Select (default p): p
Partition number (1-4, default 1): 1
First sector (starting-ending, default starting): starting
Last sector, +sectors or +size{K,M,G} (starting-ending, default ending): ending
Command (m for help): w

# format it with ext3 filesystem
sudo mkfs.ext3 /dev/sdb1

# mount it
sudo mount -t ext3 /dev/sdb1 /mnt

# remove lost & found so we can directly clone from git 
sudo rm -rf /mnt/lost+found

# clone the root file system into it
sudo git clone https://github.com/Dafang-Hacks/rootfs.git /mnt

# add your wifi credentials
sudo nano /mnt/etc/wpa_supplicant.conf
# change your memory partitioning for fullHD if desired
sudo nano /mnt/uEnv.txt

# safely remove the sdcard
sudo umount /mnt 

I had a couple of problems using this recipe. I have added the additional comments above. All working for me now.

My primary reason for trying this rootfs version is to try and eliminate the 'timeout' issue that has been raised in many issues. I have four of these cameras, all Xiaomi Dafang 128MB models. All four have the issue from time to time (its intermittent and inconsistent). There have been various comments made around MQTT control/status being the cause but for me at least this is not the case. I have killed all of the running processes I can leaving just 'dropbear' and I still get the issue albeit much less often. I also get a significant number of dropped packets which leads me to believe the issue is either in the wireless driver or the wireless connection itself. I have upgraded one of the cameras to rootfs and am still getting the dropouts and dropped packets - dang.