Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: danny on April 12, 2020, 10:29:28 PM

Title: piCore-11beta wifi problem
Post by: danny on April 12, 2020, 10:29:28 PM
Hi
I can't find wifi on rpi3b+ in piCore-11beta
When I key "sudo /usr/local/bin/wifi.sh".
I got "No wifi devices found!".
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 12, 2020, 10:36:34 PM
This works for me:
Code: [Select]
$ tce-load -i firmware-rpi-wireless
$ tce-load -i wireless-KERNEL
$ tce-load -i wifi
$ sudo wifi.sh

Note that the firmware must be loaded first
Title: Re: piCore-11beta wifi problem
Post by: danny on April 12, 2020, 10:58:16 PM
I executed "tce-load -i firmware-rpi-wireless"
I got firmware-rpi-wireless.tcz not found!
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 12, 2020, 11:51:14 PM
What does this show for you:
Code: [Select]
$ version
11.0beta1a

$ uname -m
armv7l
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 13, 2020, 01:11:58 AM
I executed "tce-load -i firmware-rpi-wireless"
I got firmware-rpi-wireless.tcz not found!

What about this:
Code: [Select]
$ tce-load -wil firmware-rpi-wireless
Title: Re: piCore-11beta wifi problem
Post by: danny on April 13, 2020, 01:14:06 AM
Please refer this when I executed "uname -m".
armv7l
And then I executed "tce-load -wil firmware-rpi-wireless".
I got the following:
Downloading: firmware-rpi-wireless.tcz
Connecting to repo.tinycorelinux.net (89.22.99.37:80)
wget: server returned error: HTTP/1.1 404 Not Found
md5sum: firmware-rpi-wireless.tcz.md5.txt: No such file or directory
Error on firmware-rpi-wireless.tcz

Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 13, 2020, 04:20:37 AM
Sorry, my mistake, that should have been:
Code: [Select]
$ tce-load -wil firmware-rpi-wifi
..it used to be called firmware-rpi-wireless in the 9.x repo...
Title: Re: piCore-11beta wifi problem
Post by: danny on April 14, 2020, 01:11:47 AM
Hi Juanito
I got the same message "No wifi device found!"
It seems unable to detect "wlan0".

Thanks
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 14, 2020, 01:36:08 AM
Do you get something similar to this after reboot and without loading anything "onboot":
Code: [Select]
$ tce-load -i firmware-rpi-wifi
$ tce-load -i wireless-KERNEL
$ dmesg | tail -15
...
[ 3737.522708] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 3737.543585] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 3737.543692] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 3737.543698] cfg80211: failed to load regulatory.db
[ 3737.556288] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 3737.560204] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 3737.560365] usbcore: registered new interface driver brcmfmac
[ 3737.751547] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 3737.751621] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[ 3737.752178] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
Title: Re: piCore-11beta wifi problem
Post by: danny on April 14, 2020, 07:17:37 PM
I got the following message:
Code: [Select]
tc@box:~$ dmesg | tail -15
[   10.330499] random: fc-cache: uninitialized urandom read (4 bytes read)
[   10.334269] random: fc-cache: uninitialized urandom read (4 bytes read)
[   10.334992] random: fc-cache: uninitialized urandom read (4 bytes read)
[   10.539697] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   10.581086] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   10.581191] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[   10.581197] cfg80211: failed to load regulatory.db
[   10.608695] brcmfmac: F1 signature read @0x18000000=0x15264345
[   10.619324] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[   10.619504] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.bin failed with error -2
[   10.619923] usbcore: registered new interface driver brcmfmac
[   11.629176] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[   11.772219] i2c /dev entries driver
[   11.798151] random: crng init done
[   11.798158] random: 6 urandom warning(s) missed due to ratelimiting

    [EDIT]: Added code tags.  Rich
Title: Re: piCore-11beta wifi problem
Post by: Rich on April 14, 2020, 07:36:01 PM
Hi danny
Please use  Code Tags  when posting commands and responses seen in a terminal. To use  Code Tags  click on the  #  icon
above the reply box and paste your text between the  Code Tags  as shown in this example:

Quote
[code][   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517[/code]

It will appear like this in your post:
Code: [Select]
[   36.176529] pcm512x 1-004d: Failed to get supply 'AVDD': -517
[   36.176536] pcm512x 1-004d: Failed to get supplies: -517
[   36.191753] pcm512x 1-004d: Failed to get supply 'AVDD': -517

Code Tags  serve as visual markers between what you are trying to say and the information you are posting. They also preserve
spacing so column aligned data displays properly.
Title: Re: piCore-11beta wifi problem
Post by: danny on April 14, 2020, 08:00:10 PM
Hi Rich,
Sorry to cause you confuse.
Thanks for your notice.
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 14, 2020, 10:01:09 PM
It looks like firmware-rpi-wifi does not contain the correct firmware for your machine - what does this show for you:
Code: [Select]
$ cat /proc/cpuinfo | grep Model
Model           : Raspberry Pi 3 Model B Rev 1.2
Title: Re: piCore-11beta wifi problem
Post by: danny on April 14, 2020, 11:00:04 PM
I got the following information:

Code: [Select]
Model           : Raspberry Pi 3 Model B Plus Rev 1.3
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 15, 2020, 08:03:21 AM
After some checking, it looks like the firmware for your hardware is present in firmware-rpi-wifi - I don't know why it doesn't load.
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 16, 2020, 01:12:14 PM
I supplied the firmware package for this.  And all wifi is definitely working.  Make sure the firmware is loaded before the kernel drivers.

Perhaps show us the contents of /mnt/mmcblk0p2/tce/onboot.lst
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 16, 2020, 10:27:21 PM
When you say "all wifi", does this include RPi4?

I'm having problems getting wifi (firmware) and hardware acceleration to work on an RPi4 - it seems something is not set up correctly in piCore-11.0beta1a as it looks in the armv7 rather than armv7l repo?
Title: Re: piCore-11beta wifi problem
Post by: Greg Erskine on April 16, 2020, 11:17:03 PM
I am not sure if Paul tests everything on the "official" piCore OS, but full support, including wifi, on piCorePlayer for the RPi4B happened a few days after it's release. From memory Paul did the development before he had a RPi4B, I did the RPI4B/wifi testing and have used it ever since.

I think Paul submits the wifi extensions back to Bela for piCore.

So wifi "should" work on piCore.
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 16, 2020, 11:50:40 PM
Here's what I get:
Code: [Select]
$ cat /proc/cpuinfo
Model           : Raspberry Pi 4 Model B Rev 1.2

$ tce-load -i firmware-rpi-wifi
$ tce-load -i wireless-KERNEL
wireless-4.19.81-piCore-v7l.tcz: OK [repo problem]

$ dmesg
...
[ 1355.441188] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 1355.453736] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 1355.453817] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 1355.453822] cfg80211: failed to load regulatory.db
[ 1355.461645] brcmfmac: F1 signature read @0x18000000=0x15264345
[ 1355.465789] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[ 1355.465981] usbcore: registered new interface driver brcmfmac
[ 1356.583073] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50
[ 1357.591700] brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50

..but no wlan0 created

With an RPi3:
Code: [Select]
[ 3737.522708] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[ 3737.543585] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[ 3737.543692] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[ 3737.543698] cfg80211: failed to load regulatory.db
[ 3737.556288] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[ 3737.560204] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 3737.560365] usbcore: registered new interface driver brcmfmac
[ 3737.751547] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[ 3737.751621] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[ 3737.752178] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Oct 23 2017 03:55:53 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f

..and wlan0 created
Title: Re: piCore-11beta wifi problem
Post by: Greg Erskine on April 17, 2020, 03:57:57 AM
What version of firmware-rpi-wifi.tcz?

Code: [Select]
Title:          firmware-rpi-wifi.tcz
Description:    Firmware for RPi onboard WiFi adapter
Version:        7.45.98.38
Author:         Cypress
Original-site:  http://archive.raspberrypi.org/debian/pool/main/f/firmware-nonfree/firmware-brcm80211_0.43+rpi6_all.deb
Copying-policy: See LICENCE.broadcom_bcm43xx
Size:           656k
Extension_by:   paul-123
Tags:           FIRMWARE RPI4 RPI3 RPI0W WIFI WIRELESS
Comments:       Binaries only
                ----
                Packed for piCore 10.x / RPi3 and RPi0W
Change-log:     2016/06/28 First version 7.45.41.26
                CVE-2017-9417: Broadpwn issue fix
                Add CY string in the version string.
                AMPDU sequence number deadlock fix (potential fix for this issue)
                CLM version upgrade
                CVE-2017-0572: memory corruption fix
                2017/08/08 version 7.45.41.46 (r666254 CY) FWID 01-f8a78378
                2018/01/24 version 7.45.98.38 (r674442 CY) FWID 01-e58d219f
                2018/03/17 Add RPi3B+ Firmware brcm43455 version: 7.45.154
                2018/08/19 Add NVRAM parameters for BT COEXIST
Current:        2019/07/01 Update brcm43455 firmware for RPi4, v7.45.154

Dependency: crda.tcz
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 17, 2020, 04:46:19 AM
Thanks - using crda from piCore-10.x armv7, I get this:
Code: [Select]
cfg80211: loaded regulatory.db is malformed or signature is missing/invalid
..and whereas the RPi3 wifi still works with this error, on the RPi4 no wifi interface is created.
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 17, 2020, 05:36:06 AM
I downloaded a new copy of regulatory.db and the p7s file from https://kernel.googlesource.com/pub/scm/linux/kernel/git/sforshee/wireless-regdb but the error persists.

(I see /usr/local/lib/firmware is not valid for piCore)
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 17, 2020, 05:53:06 AM
Correct, the chipset looks in /lib/firmware, I'm not sure that can be changed.

I should have said I submitted that package back in earlier alpha versions of piCore11.   In its latest beta, Bela upgraded openssl,  I have not built crda against the latest openssl.

Let me take a look at it this weekend.
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 17, 2020, 07:05:34 AM
Thanks - am I right in thinking that the RPi4 WiFi won’t work without the Reg db?
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 17, 2020, 08:04:30 AM
There is a good chance of that.  But I can't totally remember.....I did most of this work with weeks of the 4B+ board coming out.

The other thing that "may" be required is setting country code.  Which wifi.sh does not handle today.  But country code is not what's keeping the interface from showing up.
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 17, 2020, 08:27:42 PM
Did some digging.  I would have to say that this is a kernel problem.  I verified I get the same messages as you with piCore11-b1.  So I moved to the piCorePlayer kernel.

Loaded firmware-rpi-wifi.tcz  (With crda not loaded)
Load wireless-KERNEL.tcz

I get this in dmesg, and the wlan0 interface is created.
Code: [Select]
[  101.979732] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  101.987811] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  101.987913] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[  101.987918] cfg80211: failed to load regulatory.db
[  102.004738] brcmfmac: F1 signature read @0x18000000=0x15264345
[  102.008958] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[  102.010563] usbcore: registered new interface driver brcmfmac
[  102.226141] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[  102.236540] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04

then I rebooted, but before loading the drivers, I grabbed regulatory.db and regulatory.db.p7s from git.kernel.org/pub/scm/linux/kernel/git/sforshee/wireless-regdb.git and put them in /lib/firmware.

Then loaded wireless-KERNEL.tcz

Code: [Select]
[  145.733574] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[  145.746486] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[  145.768444] brcmfmac: F1 signature read @0x18000000=0x15264345
[  145.772471] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[  145.774052] usbcore: registered new interface driver brcmfmac
[  145.851578] random: crng init done
[  145.990147] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[  146.000295] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Feb 27 2018 03:15:32 version 7.45.154 (r684107 CY) FWID 01-4fbe0b04

And the interface is created.  I did not load the full crda, so that has nothing to do with it.
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 17, 2020, 09:21:06 PM
I got through all this and I realized I never checked the firmware md5 against my copy.   The firmware extension in the TC repo has something wrong with it.  If I use the pCP firmware package on piCore11,  then the driver loads.

There is still a problem regulatory.db, which I'm not sure what's going on there.


oh, BTW, if you look at tc-functions, you will see its pointing armv7l to armv7
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 17, 2020, 09:51:53 PM
That's good to know - could you point me to the correct pCP firmware so I can rebuild the piCore firmware extension.

Ref tc-functions, I knew there had to be a problem for RPi4 somewhere...
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 18, 2020, 12:24:21 AM
I managed to get hold of the pCP firmware-rpi-wifi extension and wifi now works on the RPi4 without the reg db or crda.

Better still, the RPi4 can see both 2.4 and 5ghz access points  8)

I'll post the pCP firmware-rpi-wifi to the piCore 11.x repos without the crda dep for now.

..and now to attack hardware acceleration for the RPi4...
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 18, 2020, 06:00:25 AM
Cool.  Rpi/Broadcom just release new firmware for the rpi 4.....letting it bake a little in Raspbian before I pack it.
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 18, 2020, 06:37:01 AM
WiFi firmware or firmware in general?
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 18, 2020, 01:25:07 PM
This is wifi that I'm talking about.  But they have upgraded the several chipset firmware since launch. 
Title: Re: piCore-11beta wifi problem
Post by: danny on April 20, 2020, 03:02:22 AM
I have installed firmware wifi without error.
What should I do to find wlan0 and scan nearby wifi?

Thanks
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 20, 2020, 04:09:11 AM
Code: [Select]
$ tce-load -i firmware-rpi-wifi
$ tce-load -i wifi
$ sudo wifi.sh
Title: Re: piCore-11beta wifi problem
Post by: danny on April 24, 2020, 01:04:31 AM
This is content of onboot.lst on my piCore 11.X:
Code: [Select]
mc.tcz
openssh.tcz
libgcrypt.tcz
TC.tcz
firmware-rpi-wifi.tcz
dillo.tc
wget.tcz
wireless-4.19.81-piCore-v7.tcz
wifi.tcz
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 24, 2020, 01:45:52 AM
You can remove wireless-4.19.81-piCore-v7.tcz from onboot.list since it is a recursive dep of the wifi extension.

You also need to update the firmware-rpi-wifi extension as it was modified recently.
Title: Re: piCore-11beta wifi problem
Post by: danny on April 24, 2020, 03:22:29 AM
Hi Juanito
When I partition disk of piCore11.X, I can't reconnect  network by Ethernet.
How can I solve this problem?

Thanks
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 24, 2020, 03:49:54 AM
What I see (with a gigabit ethernet connection) is that it takes about 5 minutes after reboot before I can ssh into an RPi4 running piCore-11.x.

With an RPi3 running piCore-11.x it takes about 20 seconds.

You can see here that it's taking a while to get going:
Code: [Select]
$ dmesg
...
[    6.201902] bcmgenet fd580000.genet: configuring instance for external RGMII (no delay)
[    7.271857] bcmgenet fd580000.genet eth0: Link is Down
[   11.431873] bcmgenet fd580000.genet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
Title: Re: piCore-11beta wifi problem
Post by: danny on April 26, 2020, 06:26:00 PM
I also can't connect to network by Ethernet after waiting 20 seconds.
Is it possible that partition disk on piCore happen some problem?
I followed this web to partition disk.
https://iotbytes.wordpress.com/picore-tiny-core-linux-on-raspberry-pi/
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 26, 2020, 10:17:18 PM
If piCore boots to a console prompt I'd guess that the problem is more likely to be with the RPi and/or its firmware.

As said, using an RPi3 with piCore-11.x takes about 20 seconds before ssh connects whereas an RPi4 with piCore-11.x takes 5 minutes - and this is using the same sd card and same network cable.
Title: Re: piCore-11beta wifi problem
Post by: Paul_123 on April 27, 2020, 07:53:32 PM
I'm not sure whats going on with piCore11, as our 4.19.y based systems become responsive must faster than that.  My initial suspect is something with openssl.    I wonder if it is setup using a blocking call to random?

Might have to install rngd to see if that helps.
Title: Re: piCore-11beta wifi problem
Post by: danny on April 28, 2020, 01:05:35 AM
Is it possible that connect wifi which I have connected automatically after reboot rpi?

Thanks
Title: Re: piCore-11beta wifi problem
Post by: Juanito on April 28, 2020, 01:14:43 AM
Yes:

* add firmware-rpi-wifi and wifi to onboot.list
* add wifi.sh -a 2>&1 > /tmp/wifi.log to /opt/bootlocal.sh
* make a backup (this will save bootlocal.sh and ~/wifi.db)
Title: Re: piCore-11beta wifi problem
Post by: danny on May 13, 2020, 08:03:23 PM
I install piCore on compute module 3.
I want to share my PC network to it by USB to Ethernet cable.
But I don't see Ethernet interface when I execute "ifconfig".