Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is next ? #2

Open
nik0 opened this issue Jul 20, 2018 · 13 comments
Open

What is next ? #2

nik0 opened this issue Jul 20, 2018 · 13 comments

Comments

@nik0
Copy link
Contributor

nik0 commented Jul 20, 2018

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/ ?

  • Support both (creating a link of /system/sdcard on somewhere, not sure there is an easy way of doing this
  • Change the code everywhere to support multiple path
  • Or now forget about the /system/sdcard :-)

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

Nik0

@jmtatsch
Copy link
Contributor

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
Copy link
Contributor Author

nik0 commented Jul 20, 2018

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
Copy link
Contributor

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

@jmtatsch
Copy link
Contributor

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
Copy link
Contributor Author

nik0 commented Jul 25, 2018

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

@EliasKotlyar
Copy link
Contributor

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

@jmtatsch
Copy link
Contributor

jmtatsch commented Jul 27, 2018

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
Copy link
Contributor

jmtatsch commented Jul 27, 2018

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
Copy link
Contributor Author

nik0 commented Jul 28, 2018

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/rcS and also try adding chmod +x /etc/udhcpc.script somewhere in the script

@jmtatsch
Copy link
Contributor

jmtatsch commented Aug 8, 2018

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
Copy link

reikred commented Aug 10, 2018

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
Copy link
Contributor

Hello gents,

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

@smcallis77
Copy link

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
  • in /mnt select the appropriate uEnv_xxxxxxxxx.txt file according to the camera memory model and copy it to uEnv.txt.

  • edit /mnt/etc/init.d/rcS. In the Start Network section uncomment the insmod command for the appropriate network driver

# 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants