WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: piCore 12 & RPi Zero W (hopefully fun times)  (Read 9654 times)

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
piCore 12 & RPi Zero W (hopefully fun times)
« on: October 23, 2020, 08:43:00 AM »
I'll start by saying my favorite kernel is... Sanders!

Please forgive me.  I've read the site and documentation (over 10 or so days) and still understand pitifully little.  New to Linux (and RPi), I've been a dreaded "IT generalist" all my 30 year career.

But, the RPi Zero W and TinyCore Linux caught my attention.

I'm getting "No wireless devices found!" when I
Code: [Select]
sudo wifi.sh.

I've successfully booted, expanded partition 2, saved ssh keys, downloaded and added tcz's (from http://distro.ibiblio.org/tinycorelinux/12.x/armv6/tcz/ to onboot.lst (via
Code: [Select]
echo and
Code: [Select]
vi. I've used
Code: [Select]
tce-run to initialize the tcz's in ../optional/

My humble request is someone indicate the tcz's and where they need to be, go or be listed to minimally get wifi up and running on a RPi Zero with piCore 12.

Apologies and gratitude in advance.
« Last Edit: October 23, 2020, 08:46:18 AM by EversteelE »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14534
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #1 on: October 23, 2020, 08:56:21 AM »
Assuming you have an RPi0 with built-in wifi, you need the extensions listed here: http://tinycorelinux.net/12.x/armv6/tcz/wifi.tcz.tree

..and http://tinycorelinux.net/12.x/armv6/tcz/firmware-rpi-wifi.tcz

for each extension download *tcz, *tcz.dep (where it exists) and *tcz.md5.txt, for example:

http://tinycorelinux.net/12.x/armv6/tcz/wifi.tcz
http://tinycorelinux.net/12.x/armv6/tcz/wifi.tcz.dep
http://tinycorelinux.net/12.x/armv6/tcz/wifi.tcz.md5.txt

.and copy them to /mnt/mmcblk0p2/tce/optional

You then need:
Code: [Select]
$ tce-load -i firmware-rpi-wifi
$ tce-load -i wifi
$ sudo wifi.sh

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #2 on: October 23, 2020, 10:21:29 AM »
Wait... checking something stoopid (of me)!!! Ignore this for now!

Thank you for the quick reply, Juanito.

I had those file from the repo I mentioned, but re-downloaded them from the one you mentioned. Including tcz, dep and md5.txt (where they exist).

Code: [Select]
tce-load -i firmware-rpi-wifi ... returns that it is already installed.
Code: [Select]
tce-load -i wifi ... returns "No wireless devices found!"
Code: [Select]
sudo wifi.sh ... returns "No wireless devices found!"

If it's not seeing a wireless device... I assume it's on the one on the RPi (firmware related)?

Yes Sir, it is a RPi Zero W - with wireless, has been operational before (Raspberry Pi OS and with piCore (but that try was a hack and I probably crossed versions and repos) and never got TC (the GUI to work)... this is newly flashed SD.
« Last Edit: October 23, 2020, 10:43:50 AM by EversteelE »

Offline EversteelE

  • Newbie
  • *
  • Posts: 24
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #3 on: October 23, 2020, 11:22:06 AM »
Wait... checking something stoopid (of me)!!! Ignore this for now!

It worked, thank you so much for the quick reply, Juanito!

In my haste, I misplaced the downloaded firmware file and it never made it to the /tce/optional folder.

Offline rbrown_acertaralabs

  • Newbie
  • *
  • Posts: 2
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #4 on: December 05, 2020, 11:39:16 PM »
Hello...I am encountering similar errors trying to get TC 12.0 on an RPi0w.  I have followed Juanito's instructions and I think I am very close.  I am also getting "No wifi devices found!" message when running "sudo wifi.sh".  But I have verified all of the .tcz and .dep files exist in tce/optional...screenshot attached.  Of note is that "iwconfig" returns "command not found" and ifconfig does not show wlan0.  I tried "modprobe -l | grep ath" to check if the Atheros driver was installed (per http://wiki.tinycorelinux.net/doku.php?id=wiki:setting_up_wifi), and that initially did not list the driver so I issued a "sudo modprobe ath9k" which seemed to run with no errors and then a subsequent "modprobe - | grep ath" does indeed list ath9k drivers which appear to be loaded...but at this point ifconfig nor iwconfig nor wifi.sh work.   I did not do a reboot after loading the ath9k driver because I don't know how to make a driver/modprobe change persist across a TC power cycle (or if that is even the root cause).  Am I on the right track with the drivers?  Or am I missing something else?  I've run through "tce-load -i" successfully for firmware-rpi-wifi.tcz, libnl.tcz, ncurses.tcz, readline.tcz, wifi.tcz, wireless-5.4.51-piCore.tcz, wireless_tools.tcz, and wpa_supplicant.tcz (some of these being automatically installed presumably because of the .dep dependencies).  I've also added these items to /mnt/mmcblk0p2/tce/onboot.lst (and I have already successfully gone through the steps to expand TC into that second partition).  Key points highlighted in the attached screenshots.  Thank you to anyone that can shed some light on this and identify maybe the missing link(s).  NOTE: in the attached screenshot of onboot.lst, it shows "#wireless_tools.tcz" (commented out), but I have subsequently uncommented it with no change in outcome.

Update: just now issued "ifconfig -a"  (was not using the "-a" option previously) ... and  now I see wlan0!  This is progress, but when running "sudo wifi.sh" it still reports "No wifi devices found!".  I must be very close...any ideas?

Yet another update: just now issued "ifconfig wlan0 up"   and now a plain "ifconfig" reports wlan0 as up.  Again...more progress, but "sudo wifi.sh" still reporting "No wifi devices found!"   Is there something besides wifi.sh I can do to get wlan configured to my SSID?

Tried to manually create ~/wifi.db and /etc/wpa_supplicant.conf (followed by sudo ifconfig wlan0 down and sudo ifconfig wlan0 up) ... but this did not work...still hunting...

Reviewing wifi.sh, it appears that it is using iwconfig to find wifi devices...so since my system does not have iwconfig, then wifi.sh is bailing out with "No wifi devices found!".  I thought iwconfig was installed with wireless_tools.tcz?  If I can manage to install iwconfig, maybe that will resolve the problem with wifi.sh...
« Last Edit: October 27, 2022, 07:41:25 PM by Rich »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14534
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #5 on: December 06, 2020, 01:26:29 AM »
If you are using the RPi0 built-in wifi there is no need of ath9k.

You need the following:
Code: [Select]
$ cat /mnt/mmcblk0p2/tce/onboot.lst
firmware-rpi-wifi.tcz
wifi.tcz
openssh.tcz
..where firmware-rpi-wifi must come before wifi.

After reboot you should see:
Code: [Select]
$ tce-status -i
ca-certificates
firmware-rpi-wifi
libnl
ncurses
openssh
openssl
readline
regdb
wifi
wireless-5.4.51-piCore
wireless_tools
wpa_supplicant

..and:
Code: [Select]
$ lsmod
Module                  Size  Used by    Not tainted
brcmfmac              290816  0
brcmutil               20480  1 brcmfmac
sha256_generic         16384  0
libsha256              20480  1 sha256_generic
cfg80211              671744  1 brcmfmac
rfkill                 28672  2 cfg80211
squashfs               40960 12
zstd_decompress        77824  1 squashfs
xxhash                 20480  1 zstd_decompress
raspberrypi_hwmon      16384  0
i2c_bcm2835            16384  0
zram                   24576  1
zsmalloc               28672  1 zram

..and:
Code: [Select]
$ dmesg | tail -10
[   16.509423] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   16.684374] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   16.750153] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   16.772071] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   16.772450] usbcore: registered new interface driver brcmfmac
[   17.073574] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   17.073749] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   17.074767] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[  118.449838] random: crng init done
[  119.869911] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

After you connect to your wifi access point for the first time, modify bootlocal such that:
Code: [Select]
$ cat /opt/bootlocal.sh
#!/bin/sh
...
# ------ Put other system startup commands below this line
wifi.sh -a
..and then make a backup to save /opt/bootlocal.sh and /home/tc/wifi.db

After reboot your RPi0w will now connect to your wifi access point automatically.
« Last Edit: December 06, 2020, 01:35:14 AM by Juanito »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14534
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #6 on: December 06, 2020, 01:29:46 AM »
..and btw, why do you have the files bcm27*, fixup*, kernel*, modules*, rootfs*and start* in /mnt/mmcblk0p2/tce/optional (they should be in /mnt/mmcblk0p1)?

Online vinceASPECT

  • Hero Member
  • *****
  • Posts: 749
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #7 on: December 06, 2020, 04:29:52 AM »
hello there,

you do see similar threads to this one which come and go....

.....it makes me think of the simple "android device over usb" approach for giving internet
to any TCL computer.

1) Firstly,connect a usb cable between your android device and your computer.

    (.....your Android device must have "usb debugging" enabled in it's
   "developer menu".... and the device must be connected to it's own source
    of internet via it's own wi-fi connection screen. It must also have the
    "usb tethering" screen enabled.)

2) Assuming nothing else is "usb connected" to your computer since you
     use bluetoothe mouse and keyboard?
     Type "sudo udhcpc -i usb0"
     into the tcL terminal at the dollar prompt
    ........and then press enter.


that's it.........your computer is connected to the network and internet.

The full story about this is available in this forum (They mention "dmesg"
but it's often not necessary.)
http://forum.tinycorelinux.net/index.php/topic,24391.msg154600.html#msg154600

thx

V

(ps....In this forum there are also mentions of a similar method using an iphone to connect.)

i appreciate that this info above is not using your RPi's wi fi chip.  However, it may help you
 along with your endeavors with tcl.

« Last Edit: December 06, 2020, 04:53:45 AM by vinceASPECT »

Offline DrRob

  • Jr. Member
  • **
  • Posts: 60
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #8 on: December 06, 2020, 11:25:04 AM »
Hi,

I'm following the instructions given above by Juanito (thanks!) with a Pi Zero W and piCore-12.0 and see something strange.  If I have a small USB hub plugged into the Pi when it boots up then I see the output of wifi.sh as it connects to wifi a moment after the command prompt appears on the HDMI output, but if I boot the Pi without the USB hub connected there is a long pause between the command prompt appearing and the output of wifi.sh appearing.

Looking in the output of dmesg, when the USB hub is not connected and there is the delay, I see this:

Code: [Select]
[   16.615759] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   17.074136] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   17.266484] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   17.300184] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   17.300586] usbcore: registered new interface driver brcmfmac
[   17.816063] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   17.816256] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   17.817400] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[  146.529293] random: crng init done
[  147.998617] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

Note the long delay before "random: crng init done".

Here's the end of dmesg when the USB hub is plugged in:

Code: [Select]
[    9.438435] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[    9.640017] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[   17.813504] random: crng init done
[   18.864054] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   19.312348] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   19.469697] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   19.493639] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   19.494078] usbcore: registered new interface driver brcmfmac
[   19.912011] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   19.912207] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[   19.913342] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 22 2019 01:59:28 version 7.45.98.94 (r723000 CY) FWID 01-3b33decd
[   20.952469] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

Note that "random: crng init done" occurs much sooner.

Any ideas what might cause that and how to avoid it?

Thanks,
Rob.

ps. the USB hub has a wireless dongle for a keyboard plugged into it but I think the same happens if that isn't present.  The USB hub also has an ethernet socket, but there's no cable plugged into it.

Offline rbrown_acertaralabs

  • Newbie
  • *
  • Posts: 2
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #9 on: December 06, 2020, 11:41:33 AM »
Thanks for you suggestions, Juanito.

I changed onboot.lst to reflect what you described:

Code: [Select]
firmware-rpi-wifi.tcz
wifi.tcz
openssh.tcz

...did a reboot, but running "sudo wifi.sh" still produces "No wifi devices found!" and now "ifconfig -a" does not show wlan0.  I changed onboot.lst to include "wireless-5.4.51-piCore.tcz" ...

Code: [Select]
firmware-rpi-wifi.tcz
wifi.tcz
openssh.tcz
wireless-5.4.51-piCore.tcz

...did a reboot, and then "ifconfig -a" DOES show wlan0.   Are dependencies not getting loaded?  Or perhaps, as you say in your subsequent post, I need files bcm27*, fixup*, kernel*, modules*, rootfs*and start* in /mnt/mmcblk0p1  ...  these files are present in /dev/mmcblk0p1 (note: /dev in that previous path) BUT  /dev/mmcblk0p1 is not mounted automatically at boot (thus, there is no /mnt/mmcblk0p1 after boot.  Is this the source of my problem....somehow I need to make sure /dev/mmcblk0p1 is auto-mounted to /mnt/mmcblk0p1 ?
 
Adding attachment which shows results of df, fdisk -l, and showing my onboot.lst file
« Last Edit: December 06, 2020, 12:16:45 PM by rbrown_acertaralabs »

Offline DrRob

  • Jr. Member
  • **
  • Posts: 60
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #10 on: December 06, 2020, 11:08:37 PM »
rbrown_acertaralabs - are your .dep files broken or missing?  wifi.tcz.dep refers to wireless_tools.tcz and wireless_tools.tcz.dep refers to wireless-KERNEL.tcz, which should cause wireless-5.4.51-piCore.tcz to be loaded when wifi.tcz is loaded.

Offline DrRob

  • Jr. Member
  • **
  • Posts: 60
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #11 on: December 07, 2020, 12:06:01 AM »
I'm following the instructions given above by Juanito (thanks!) with a Pi Zero W and piCore-12.0 and see something strange.  If I have a small USB hub plugged into the Pi when it boots up then I see the output of wifi.sh as it connects to wifi a moment after the command prompt appears on the HDMI output, but if I boot the Pi without the USB hub connected there is a long pause between the command prompt appearing and the output of wifi.sh appearing.

A bit more info: the long pause occurs while waiting for /usr/local/etc/init.d/openssh start to return in bootlocal.sh.

A bit tricky to debug further because without the USB hub I can't connect a keyboard and without wifi I can't ssh in.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14534
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #12 on: December 07, 2020, 02:01:37 AM »
Or perhaps, as you say in your subsequent post, I need files bcm27*, fixup*, kernel*, modules*, rootfs*and start* in /mnt/mmcblk0p1  ...  these files are present in /dev/mmcblk0p1 (note: /dev in that previous path) BUT  /dev/mmcblk0p1 is not mounted automatically at boot (thus, there is no /mnt/mmcblk0p1 after boot.  Is this the source of my problem....somehow I need to make sure /dev/mmcblk0p1 is auto-mounted to /mnt/mmcblk0p1 ?

/mnt/mmcblk0p1 is the mount point for /dev/mmcblk0p1- i.e. they contain the same data.

/dev/mmcblk0p1 is deliberately not mounted after boot to protect the boot files, which are not required after boot has completed and are not the cause of your problem.

You can delete the bcm27*, fixup*, kernel*, modules*, rootfs*and start* files in /mnt/mmcblk0p2/tce/optional.

Your problem is most probably that one of the *dep files is missing or incorrect.

Online vinceASPECT

  • Hero Member
  • *****
  • Posts: 749
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #13 on: December 07, 2020, 03:00:58 AM »
Dr Rob, and thread members,


A bit tricky to debug further because without the USB hub I can't connect a keyboard and without wifi I can't ssh in..........qoute

......maybe this method below could help you (Laptop needed)

https://www.youtube.com/watch?v=aL1pWI2K60w

thx

v



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11212
Re: piCore 12 & RPi Zero W (hopefully fun times)
« Reply #14 on: December 07, 2020, 07:10:28 AM »
Hi DrRob
... If I have a small USB hub plugged into the Pi when it boots up then I see the output of wifi.sh as it connects to wifi a moment after the command prompt appears on the HDMI output, but if I boot the Pi without the USB hub connected there is a long pause between the command prompt appearing and the output of wifi.sh appearing. ...
The random number generator uses the keyboard and mouse as additional sources of entropy (randomness) so it initializes
quicker when they are attached.

You could:
Code: [Select]
tce-load -wi havegedAdd this to the beginning of  /opt/bootlocal.sh :
Code: [Select]
/usr/local/sbin/haveged
Found here:
http://forum.tinycorelinux.net/index.php/topic,23917.0.html