WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Newbie: Have I undersood how this works?  (Read 5434 times)

Offline Will8

  • Newbie
  • *
  • Posts: 14
Newbie: Have I undersood how this works?
« on: February 23, 2019, 01:23:01 PM »
Hi guys,

Background:
I'm running a robotics program for 14 years olds (https://hr-robocon.org/) which uses a Raspberry Pi3b+, but some people are never happy and are complaining about system boot and shutdown times. Ever willing to throw myself into extra work, and keen to improve resilience against "abrupt power loss", TCL seems to be what I'm looking for... but I have a specific set of requirements which i'm having trouble with.

Detail:

Firstly, we have a mix of Pi3B and 3B+ I think means I need v10, but its still in beta. What does "Beta" mean for TCL?

The software stack consists of a PI, PI camera (Is this supported?), a custom board on I2C which provides Analog in, Digital IO and servos (I2C is supported as a kernal module), a motor controller hat which uses the GPIO and PWM (supported though wiringpi.tcz?). Students might extend the system by plugging in ardinio like devices (supported by usb-serial-4.19.13-piCore-v7.tcz). The board is shut down though a GPIO device tree module (all device tree stuff is supported because its just a RPI kernel - but you need to manually mount /boot?).

In development mode our system boots as a HostAP and dnsmasq (these appear to be missing on 10.x - are they inside some other package, do I have to build them some other way, or are they missing because they don't build yet?) redirects all traffic to a local port which serves a code development interface written in Python2 (python2.7.tcz), students write code through the interface and when they 'save' it the code is written to the PI filesystem so it persists from boot to boot (is filetool.sh -b meant to be used like this? Saving is reasonably infrequent.)

When the code is "run" any logs are displayed in the web interface and images that are taken by the camera are displayed. The images are analyzed by a python/C library, identifying simplified QR codes which the robot uses to navigate autonomously, these images and logs don't need to persist, but if a user has inserted a USB stick then they are saved there for inspection later.

Finally, during the competition there are 4 special USB sticks which allocate the corner of the arena to a robot (and hence which walls and cubes it hunts). The sticks are mounted using udev rules (I assume this supported, but I'm not sure how to make changes - do I make my own tcz, if so can you point me at instructions?) and at the next boot the brain is reconfigured to connect to an arena Access Point(wifi.tcz, wireless-4.19.13-piCore-v7.tcz, wpa_supplicant.tcz), with a fixed IP address (so the red corner is always 192.168.0.2 etc). I haven't worked out exactly why, but this requires a reboot to switch from HostAP mode.


Am I on the right track?

Offline Greg Erskine

  • Sr. Member
  • ****
  • Posts: 402
Re: Newbie: Have I undersood how this works?
« Reply #1 on: February 23, 2019, 01:51:31 PM »
hi Will8,

What is a typical boot time?

My initial thought was "that is a lot of work and they will still complain about boot times at the end of it!"

regards
Greg

Offline Will8

  • Newbie
  • *
  • Posts: 14
Re: Newbie: Have I undersood how this works?
« Reply #2 on: February 23, 2019, 02:27:42 PM »
Boot time is in the 30s range at the moment, shutdown is in the 10s.

Oddly i get more complaints about shutdown because people just want to hit the button and pull the battery.

The real problem I'm sidestepping is the two boot cycle time to change between arena mode and development mode - which I'm sure is going to turn out to be something in Rasperian that i'm not properly resetting (I think that I've got a stale IP hanging round somewhere when the mode switches - rebooting fixes it, but is slow).

Personally my priority is making it more robust from pulling power, but this is the second year and we haven't had a fault that can be directly traced to that, so perhaps i'm worrying about nothing.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Newbie: Have I undersood how this works?
« Reply #3 on: February 23, 2019, 05:42:16 PM »
Hi Will8
Keeping the size of your backups to a minimum will help keep boot/shutdown times down. Setting up persistent  /home  and
/opt  directories will allow you to remove those 2 entries from your  /opt/filetool.lst  file. If, for example, you have a config file
called  /usr/local/etc/alsa/asound.state  that you need to preserve, add that to your backup. Don't backup entire subdirectories
unnecessarily.

If you want to see where your boot time is being spent, add the following boot codes:
Code: [Select]
printk.time=1 syslogIf you then execute (after rebooting):
Code: [Select]
dmesg > dmesg.txtyou can see if there are any slowdowns in the boot process by looking through  dmesg.txt.  You can also look through
/var/log/messages  to check for other possible delays.

Quote
In development mode our system boots as a HostAP and dnsmasq (these appear to be missing on 10.x - are they inside some other package,
Why don't you run 9.x? According to this:
http://tinycorelinux.net/9.x/armv6/tcz/info.lst
it has  hostapd.tcz  and  dnsmasq.tcz.

If you haven't already, you might also want to take an hour to read this excellent book:
http://tinycorelinux.net/book.html
While not specific to Pi, there's a lot of useful information about using Tinycore.


Offline Will8

  • Newbie
  • *
  • Posts: 14
Re: Newbie: Have I undersood how this works?
« Reply #4 on: February 24, 2019, 12:39:05 AM »
Ive already tied optimizing boot time in Rasprian, but not got as far as having the system up on TCL.

I started with 9.x but I get a flashing red light and stuck on the rainbow screen with flashing power signal which is indicative of firmware too old to run the pi3b+. 10.x runs and boots fine.

I don't know if there is a backport for the kernel and firmware to support the 3b+ on 9.x, if such a thing exists, can I install it onto the SDcard from a (linux) machine, I can't so it from within 9.x because I have no way to boot it (The Pi3s are out in the field till May)

Offline mocore

  • Hero Member
  • *****
  • Posts: 506
  • ~.~
Re: Newbie: Have I undersood how this works?
« Reply #5 on: February 24, 2019, 03:13:15 AM »

Quote
In development mode our system boots as a HostAP and dnsmasq (these appear to be missing on 10.x - are they inside some other package,
Why don't you run 9.x?

i guess because of the b3+
http://forum.tinycorelinux.net/index.php/topic,21170.msg137021.html#msg137021
Just trying to boot a RPI 3 B+ with 9.0.3
I get the rainbow screen with power symbol. 
piCore 9 is not compatible with RPi 3 B+, yo will need piCore 10


FTR copying a updated rpi firmware to a 9x picore and it should boot on a b3+, but the b3+ wifi kernel module will be 'missing' ...


According to this:
http://tinycorelinux.net/9.x/armv6/tcz/info.lst
it has  hostapd.tcz  and  dnsmasq.tcz.
i guess it would be possible to try and copy ` hostapd.tcz  and  dnsmasq.tcz ` and deps from picore 9x to 10x ?




Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Newbie: Have I undersood how this works?
« Reply #6 on: February 24, 2019, 05:31:40 AM »
Hi mocore

Quote
In development mode our system boots as a HostAP and dnsmasq (these appear to be missing on 10.x - are they inside some other package,
Why don't you run 9.x?

i guess because of the b3+
http://forum.tinycorelinux.net/index.php/topic,21170.msg137021.html#msg137021
Thanks, wasn't aware of that.

Offline Will8

  • Newbie
  • *
  • Posts: 14
Re: Newbie: Have I undersood how this works?
« Reply #7 on: February 24, 2019, 05:42:09 AM »
a TCZ is just a squshfs filesystem right?

If so, where would i find the actual files?

http://tinycorelinux.net/9.x/armv7/tcz/ appears to be a list

and how would I use them - copy them into the tce/optional directory?

is there a cost to loading lots of tcz's - is there some flattening of the filesystem I should do once I have a working image?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Newbie: Have I undersood how this works?
« Reply #8 on: February 24, 2019, 05:45:54 AM »
Hi Will8
According to this:
http://tinycorelinux.net/9.x/armv6/tcz/info.lst
it has  hostapd.tcz  and  dnsmasq.tcz.
i guess it would be possible to try and copy ` hostapd.tcz  and  dnsmasq.tcz ` and deps from picore 9x to 10x ?
You could try downloading the following 2 files:
http://tinycorelinux.net/9.x/armv6/tcz/hostapd.tcz
http://tinycorelinux.net/9.x/armv6/tcz/hostapd.tcz.dep
then run a dependency check on 10.x to resolve any missing dependencies.

dnsmasq.tcz  may present a problem. According to this:
http://tinycorelinux.net/9.x/armv6/tcz/dnsmasq.tcz.dep
it depends on  ipv6-KERNEL.tcz  which is kernel specific and not yet available in TC10.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Newbie: Have I undersood how this works?
« Reply #9 on: February 24, 2019, 05:51:53 AM »
Hi Will8
a TCZ is just a squshfs filesystem right?
Yes.

Quote
If so, where would i find the actual files?
They are usually  loop mounted  under  /tmp/tcloop/.

Quote
newbielink:http://tinycorelinux.net/9.x/armv7/tcz/ [nonactive] appears to be a list

and how would I use them - copy them into the tce/optional directory?
Append the filename of interest to the URL as shown in my previous answer.

Offline Will8

  • Newbie
  • *
  • Posts: 14
Re: Newbie: Have I undersood how this works?
« Reply #10 on: February 24, 2019, 05:58:01 AM »
Cool.
Its possible that dnsmasq won't be a problem because I'm not actually using any IPv6 stuff - assuming dnsmasq loads libraries on demand.

In most cases the PI will only ever be connected to one other device, I can't imagine more than five people connecting to it, at which time they will be so busy fighting about who is editing the code that the robot could burst into flames and nobody would notice.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Newbie: Have I undersood how this works?
« Reply #11 on: February 24, 2019, 06:10:02 AM »
Hi Will8
Cool.
Its possible that dnsmasq won't be a problem because I'm not actually using any IPv6 stuff - assuming dnsmasq loads libraries on demand.
It's worth a shot, just don't download the  .dep  file.

Offline Will8

  • Newbie
  • *
  • Posts: 14
Re: Newbie: Have I undersood how this works?
« Reply #12 on: February 24, 2019, 06:23:05 AM »
 :( Trying to install the dependencies first - when I try

tce-load -wi wireless_tools

it fails with

md5sum: wireless-4.14.42-piCore-v7.tcz: No such file or directory

which looks suspiciously like a kernel module so can't be pulled over :(

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Newbie: Have I undersood how this works?
« Reply #13 on: February 24, 2019, 06:36:25 AM »
Hi Will8
As far as I can see here:
http://tinycorelinux.net/10.x/armv6/tcz/info.lst
I don't see kernel dependent extensions. They probably haven't been compiled yet.

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1063
Re: Newbie: Have I undersood how this works?
« Reply #14 on: February 24, 2019, 06:48:20 AM »
Beta5 has moved to a 4.19.y kernel base, Betas 1-4 are no longer viable.  (Beta5 is only loaded for the armv7 boards)

hostapd depends on openssl, which has been updated in 10.x, so you cannot copy it from the 9.x repo.  I have it built, I'll send it in.
« Last Edit: February 24, 2019, 06:51:25 AM by Paul_123 »