WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore 9.0.3 boot to python script with GUI  (Read 22309 times)

Offline Pacca

  • Newbie
  • *
  • Posts: 37
Re: piCore 9.0.3 boot to python script with GUI
« Reply #60 on: May 15, 2020, 11:46:06 AM »
Code: [Select]
Jan  1 00:00:04 box user.notice kernel: [    4.507954] random: crng init done
Jan  1 00:00:04 box user.info kernel: [    4.525273] squashfs: version 4.0 (2009/01/31) Phillip Lougher
Jan  1 00:00:05 box user.info kernel: [    5.785504] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
Jan  1 00:00:05 box user.info kernel: [    5.880092] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
rpi0, piCore9.0.3
(great thread btw, i've learned a lot.  thanks.)
So it's either the Raspberry Pi Zero or version 9.0.3 of piCore, because you have my same setup and also for you squashfs driver takes 1.8 seconds.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: piCore 9.0.3 boot to python script with GUI
« Reply #61 on: May 15, 2020, 11:59:32 AM »
Hi Pacca
... So it's either the Raspberry Pi Zero or version 9.0.3 of piCore, because you have my same setup ...
So far that's what it looks like. The units in the  bmarkus  thread (RPi2, PIi2B, and RPiB+) did not have this delay.
Juanito also came in at a quick ~0.026 seconds with an RPi4 on piCore-11.x.

Quote
... and also for you squashfs driver takes 1.8 seconds.
I beg to differ :):
Code: [Select]
tc@box:~$ calc 5.785504-4.525273
1.26023
tc@box:~$
« Last Edit: May 15, 2020, 12:20:07 PM by Rich »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: piCore 9.0.3 boot to python script with GUI
« Reply #62 on: May 15, 2020, 12:26:34 PM »
Aren't there other commands between the squashfs modprobe and the mount? It'd mean you can't use the mount timestamp to measure squashfs.
The only barriers that can stop you are the ones you create yourself.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: piCore 9.0.3 boot to python script with GUI
« Reply #63 on: May 15, 2020, 12:38:56 PM »
Hi curaga
Aren't there other commands between the squashfs modprobe and the mount? ...
You're right. The  squashfs  module is loaded by  tc-config  and the  mount  commands are likely from there too. So there could be
something in  tc-config  causing the delay.

Offline redFrik

  • Newbie
  • *
  • Posts: 6
Re: piCore 9.0.3 boot to python script with GUI
« Reply #64 on: May 15, 2020, 01:58:07 PM »
Code: [Select]
Jan  1 00:00:02 box user.info kernel: [    2.841660] Adding 228160k swap on /dev/zram0.  Priority:-1 extents:1 across:228160k SSFS
Jan  1 00:00:02 box user.info kernel: [    2.895318] squashfs: version 4.0 (2009/01/31) Phillip Lougher
Jan  1 00:00:03 box user.info kernel: [    3.292090] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
Jan  1 00:00:03 box user.info kernel: [    3.395755] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)

rpi3b, piCore9.0.3

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: piCore 9.0.3 boot to python script with GUI
« Reply #65 on: May 15, 2020, 02:10:37 PM »
Hi redFrik
Thanks for the additional data. So that appears to suggest It may be RPi0 related. The zero is a stripped down Pi, isn't it? So maybe
it's caused by something the zero doesn't have that tc-config is looking for? RTC? eth0? Random number generator? What makes
the zero different?

Offline Pacca

  • Newbie
  • *
  • Posts: 37
Re: piCore 9.0.3 boot to python script with GUI
« Reply #66 on: May 16, 2020, 04:11:07 AM »
Hi Rich,
RPi0 does not have an ethernet port and that's why I am using an usb adapter. Can this be the problem?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: piCore 9.0.3 boot to python script with GUI
« Reply #67 on: May 16, 2020, 08:32:54 AM »
Hi Pacca
Try adding the  nodhcp  boot code just to see if it changes the timing.

Offline Pacca

  • Newbie
  • *
  • Posts: 37
Re: piCore 9.0.3 boot to python script with GUI
« Reply #68 on: May 16, 2020, 02:54:21 PM »
Even with nodhcp it still takes more than one second to load.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: piCore 9.0.3 boot to python script with GUI
« Reply #69 on: May 16, 2020, 11:46:51 PM »
Hi Pacca
Well, looking through  tc-config  and the  RPi Zero  specs nothing jumps out at me. So now you have to ask yourself the following:

"How badly do i want to try to eliminate that 1 second delay?"

Before answering, consider the following:
1. There might be something inherent in the Zero and the delay can't be eliminated.
2. It might be something in the kernel, in which case it likely would be difficult to track down.
3. It is something in  tc-config, and would require adding some debug code to track down.
4. It could be something entirely different that I haven't thought of.

Only item 3 looks like you might be able to do something about. It would require extracting the  tc-config  file from the piCore image
file. You then need to find the line that says:
Code: [Select]
modprobe -q squashfs 2>/dev/null
You can now add code that writes markers to the log files so you can see execution time of sections of  tc-config,  something like:
Code: [Select]
echo "***** TC 1 *****" >> /dev/kmsg
So you would add the code like this:
Code: [Select]
modprobe -q squashfs 2>/dev/null
echo "***** TC 1 *****" >> /dev/kmsg

# Original tc-config code

echo "***** TC 2 *****" >> /dev/kmsg

# Original tc-config code

echo "***** TC 3 *****" >> /dev/kmsg

# Original tc-config code

You would then need to repack the image file. I don't know how to unpack/repack ARM images, so someone else will need to
answer that.

The logs will then have markers with whatever text you echoed into  /dev/kmsg.
« Last Edit: May 17, 2020, 07:18:44 AM by Rich »

Offline Pacca

  • Newbie
  • *
  • Posts: 37
Re: piCore 9.0.3 boot to python script with GUI
« Reply #70 on: May 18, 2020, 04:01:51 AM »
Hi
Hi Pacca
Well, looking through  tc-config  and the  RPi Zero  specs nothing jumps out at me. So now you have to ask yourself the following:

"How badly do i want to try to eliminate that 1 second delay?"
Hi Rich,
1 second delay is nothing compared to the time that the python script needs to load, so is not that bad. I was just curious to understant where that delay was coming from. The unpacking/repacking process is something completely new for me, I will try to see if I can do that. But I don't understand why I can't simply edit /etc/init.d/tc-config from PiCore and backup with filetool.sh -b.

Another idea would be to try piCore 11 but unfortunately the net-usb-KERNEL.tcz is not present in the TCZs catalog and I need that to connect to the internet and download the packages I need.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14799
Re: piCore 9.0.3 boot to python script with GUI
« Reply #71 on: May 18, 2020, 04:53:03 AM »
net-usb-KERNEL added to piCore-11.x repos

Note that the python version changes to 3.8...

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11594
Re: piCore 9.0.3 boot to python script with GUI
« Reply #72 on: May 18, 2020, 07:56:14 AM »
Hi Pacca
... But I don't understand why I can't simply edit /etc/init.d/tc-config from PiCore and backup with filetool.sh -b. ...
Because your backup doesn't get restored until the end of  tc-config.

Offline Pacca

  • Newbie
  • *
  • Posts: 37
Re: piCore 9.0.3 boot to python script with GUI
« Reply #73 on: May 18, 2020, 02:32:43 PM »
Hi Pacca
... But I don't understand why I can't simply edit /etc/init.d/tc-config from PiCore and backup with filetool.sh -b. ...
Because your backup doesn't get restored until the end of  tc-config.
Hi Rich,
it makes sense.

net-usb-KERNEL added to piCore-11.x repos

Note that the python version changes to 3.8...
Thank you very much Juanito. Unfortunately piCore 11 does not load and returns the message "kernel panic".

I think I will stick to version 9.0.3 and keep everything as it is!

Offline Pacca

  • Newbie
  • *
  • Posts: 37
Re: piCore 9.0.3 boot to python script with GUI
« Reply #74 on: May 25, 2020, 05:58:16 AM »
I'm sorry for pushing this post up again. I am trying to play a wave audio file from my python script. What do I need to play audio through HDMI? Are alsa-modules-4.9.2-piCore, alsa.tcz and alsa-utils.tcz required? And then how can I force HDMI audio since Raspberry Pi Zero lacks a jack connector? Thank you very much!