Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: stephanmg on August 15, 2020, 12:29:47 AM

Title: armv6 and realtek firmware
Post by: stephanmg on August 15, 2020, 12:29:47 AM
Dear all,

let me thank everbody for working on this exciting project.

I have an old Raspberry Pi (armv6) on which I would like to use my wireless usb adapter (Atheros) with TCL version 11.
I could not manage to find the atheros firmware here: http://distro.ibiblio.org/tinycorelinux/11.x/armv6/tcz/

I followed this instructionst to set up wifi:  >>>http://forum.tinycorelinux.net/index.php?topic=20964.0<<<
That is I loaded wifi.tcz and execute wifi.sh but it does not show the usb adapter or error messages in dmesg.

I guess this is because I do not have the atheros firmware loaded nor the corresponding kernel module? So, is armv6 still supported in TCL11? I presume I am doing something very obvious wrong.

Thanks in advance.

Best wishes,
Stephan

Title: Re: armv6 and realtek firmware
Post by: Juanito on August 15, 2020, 12:46:37 AM
You could try downloading this manually:

http://tinycorelinux.net/11.x/x86_64/tcz/firmware-atheros.tcz

If you use the "lsusb" command from the usbutils extension, does it show your wifi adapter?
Title: Re: armv6 and realtek firmware
Post by: Greg Erskine on August 15, 2020, 02:39:46 AM
I think that might be the wrong link for a RPi?
Title: Re: armv6 and realtek firmware
Post by: Juanito on August 15, 2020, 02:42:49 AM
Since it's for a plug-in device, the firmware would be machine agnostic, no?
Title: Re: armv6 and realtek firmware
Post by: Rich on August 15, 2020, 06:13:05 AM
Hi Juanito
USB devices are intended to plug into USB ports regardless of the hosts architecture. Firmware is intended to run on the guests
(Atheros) hardware. So it should not matter which repository it came from.

As long as it only modifies internal operations of the chip, I would expect the firmware to work regardless of how it is interfaced.
Title: Re: armv6 and realtek firmware
Post by: aus9 on August 15, 2020, 06:20:07 AM
I do not have RPi but it looks like lsusb command is supplied by usbutils.
http://repo.tinycorelinux.net/11.x/armv6/tcz/usbutils.tcz
On TC64 without loading any firmware, my non-atheros dongle still reports its usb-id  via the lsusb command
so stephanmg if you are unable to download via ethernet the firmware TCE could you post your usb id for your adaptor please
I am not sure if repo has wireless modules.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on August 15, 2020, 01:00:20 PM
Thanks for all your suggestions, I will try it out and report back to you when I'm back home from work.

Best wishes,
Stephan
Title: Re: armv6 and realtek firmware
Post by: Greg Erskine on August 15, 2020, 02:00:22 PM
Thanks for the info about USB, I wasn't aware ;D
Title: Re: armv6 and realtek firmware
Post by: aus9 on August 16, 2020, 07:56:30 AM
Yikes, I searched poorly.
Quote
I am not sure if repo has wireless modules
They are here for arm6
http://tinycorelinux.net/11.x/armv6/tcz/wireless-4.19.81-piCore.tcz.list
Title: Re: armv6 and realtek firmware
Post by: stephanmg on August 23, 2020, 05:54:54 AM
You could try downloading this manually:

http://tinycorelinux.net/11.x/x86_64/tcz/firmware-atheros.tcz

If you use the "lsusb" command from the usbutils extension, does it show your wifi adapter?

Hello,

yes it shows my adapter! How would I add the firmware/atheros module then? Thanks for pointing me into the right direction.

Should I install wireless-4.19.81-piCore.tcz? And then modprobe ath9?

Best wishes,
Stephan
Title: Re: armv6 and realtek firmware
Post by: Juanito on August 23, 2020, 06:28:06 AM
It would be good if you could paste what lsusb shows for your adapter.

You need to load the firmware-atheros extension before you load the wifi extension (which will load the other required extensions automatically). If things go well, the driver for your hardware should be loaded automatically.

Once you have loaded the extensions, use this command to check if the atheros driver loaded the firmware:
Code: [Select]
$ dmesg | tail -20..and paste the result here.
Title: Re: armv6 and realtek firmware
Post by: aus9 on August 23, 2020, 06:44:44 AM
Juanito

I use ethernet so forgive me for thinking I know something....but if my list link in reply 8 is correct, it appears that the wl module TCE has no install script?

and it looks like it might be the same for arm7/7l too? my arm7 info file has no mention of running depmod -a etc
Title: Re: armv6 and realtek firmware
Post by: Juanito on August 23, 2020, 06:56:42 AM
tce-load takes care of module extensions.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on August 24, 2020, 05:26:10 AM
lsusb reports this: Bus 001 Device 005: ID 1a2c:0e24.

Where would I find the atheros-firmware extenion exactly and would I load it with tce-load?

Should I grab the extension here and use tce-load? http://forum.tinycorelinux.net/index.php?topic=18483.0

It would be good if you could paste what lsusb shows for your adapter.

You need to load the firmware-atheros extension before you load the wifi extension (which will load the other required extensions automatically). If things go well, the driver for your hardware should be loaded automatically.

Once you have loaded the extensions, use this command to check if the atheros driver loaded the firmware:
Code: [Select]
$ dmesg | tail -20..and paste the result here.
Title: Re: armv6 and realtek firmware
Post by: Juanito on August 24, 2020, 05:34:22 AM
Code: [Select]
$ wget http://tinycorelinux.net/11.x/x86_64/tcz/firmware-atheros.tcz
$ wget http://tinycorelinux.net/11.x/x86_64/tcz/firmware-atheros.tcz.md5.txt
$ mv firmware-atheros.tcz* /mnt/mmcblk0p2/tce/optional
$ tce-load -i firmware-atheros
Title: Re: armv6 and realtek firmware
Post by: stephanmg on August 24, 2020, 05:56:07 AM
Code: [Select]
$ wget http://tinycorelinux.net/11.x/x86_64/tcz/firmware-atheros.tcz
$ wget http://tinycorelinux.net/11.x/x86_64/tcz/firmware-atheros.tcz.md5.txt
$ mv firmware-atheros.tcz* /mnt/mmcblk0p2/tce/optional
$ tce-load -i firmware-atheros

Okay, but, just wondering this says x86_64 not arm, right? After I downloaded this, then I can load the wifi extension (wifi.tcz) from here http://distro.ibiblio.org/tinycorelinux/11.x/armv6/tcz/
Title: Re: armv6 and realtek firmware
Post by: Juanito on August 24, 2020, 06:24:03 AM
Affirmative
Title: Re: armv6 and realtek firmware
Post by: stephanmg on August 24, 2020, 06:31:21 AM
Affirmative

Ok, I'll test this out when I'm back from work, probably in the evening. Thanks for your assistance!
Title: Re: armv6 and realtek firmware
Post by: aus9 on August 26, 2020, 06:53:04 PM
reply 13 from OP
Quote
1a2c:0e24
1a2c  China Resource Semico Co., Ltd.......Vendor ID known
   http://www.linux-usb.org/usb.ids

but a search of the product draws a blank so maybe it is?

Maybe OP could post their full lsusb output?
Title: Re: armv6 and realtek firmware
Post by: Juanito on August 26, 2020, 11:03:46 PM
piCore has busybox lsusb in the base, which gives this:
Code: [Select]
$ lsusb
Bus 001 Device 001: ID 1d6b:0002
Bus 001 Device 003: ID 0424:ec00
Bus 001 Device 002: ID 0424:9514

The full lsusb is more useful:
Code: [Select]
$ tce-load -i usbutils
$ /usr/local/bin/lsusb
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Title: Re: armv6 and realtek firmware
Post by: aus9 on August 27, 2020, 01:01:00 AM
I was trying to suggest to OP that we need the full lsusb. On my RPi I just happen to look at my lsusb and I have the exact device that the OP might be claiming is a network device.Its a multimedia keyboard brand JBurrows in Australia. Might be called something else overseas.

Code: [Select]
lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1a2c:0e24 China Resource Semico Co., Ltd --------------------its a kb
Bus 001 Device 003: ID 04f3:0235 Elan Microelectronics Corp. Optical Mouse
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Title: Re: armv6 and realtek firmware
Post by: aus9 on August 27, 2020, 02:14:54 AM
I should add some trivia, I did not know I had this USB id keyboard until just then.

What happened was, got tired of swapping my usb kb to a recently purchased RPi which I have only owned for a number of days. So only just bought the  cheapest kb for the RPI and thats when I discovered the id issue.

this is what my tower ids look like
Code: [Select]
lsusb
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0000:3825 
Bus 001 Device 010: ID c0f4:04c0 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Yep I buy cheap
Title: Re: armv6 and realtek firmware
Post by: stephanmg on August 28, 2020, 08:10:58 AM
Hello yes, I will provide full lsusb output. I didn't know I need to first tce-load something.

Btw.: The adapter is definitely an Atheros WLAN USB stick, which I bought years back as it was advertised to be supported by on RPi OOTB.

Will later post the lsusb output.

best,
Stephan
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 08, 2020, 03:34:45 AM
Can I somehow upload an image to the forum?

Unfortunately after loading the usbutils it reports:
Cannot find shared library libusb-1.0.so.0.

I figured out that I missed depdencies: here it comes.

Bus 001 Device 004: Edimax Techonology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUs].

So I take everything back I said: It seems to be Realtek. Sorry!
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 08, 2020, 04:23:11 AM
Driver registered in dmesg output. lsmod shows also the RTL module inserted.

However,
sudo wifi.sh,
yields
No "wireless devices".

What am I missing here?

Best wishes,
Stephan
Title: Re: armv6 and realtek firmware
Post by: Juanito on October 08, 2020, 04:45:57 AM
Does dmesg say anything about missing firmware for your device?
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 08, 2020, 06:06:41 AM
No all is good now, I had to load additional modules.
As a reference, maybe also for future TCL users and in particular for me, here is what I did:

Install stable release for ARMv6 (http://tinycorelinux.net/11.x/armv6/releases/RPi/)

Then I installed the following packages (http://distro.ibiblio.org/tinycorelinux/11.x/armv6/tcz/):

Code: [Select]
firmware-rpi-wifi
libnl
libudev
libusb
usb-ids
wifi
wireless-4.19.81-piCore
wireless_tools
wpa_supplicant

Created a shell script:
Code: [Select]
#!/bin/sh
tce-load -i firmware-rpi-wifi
tce-load -i libnl
tce-load -i libudev
tce-load -i libusb
tce-load -i usb-ids
tce-load -i wifi
tce-load -i wireless-4.19.81-piCore
tce-load -i wireless_tools
tce-load -i wpa_supplicant

Next I verified my device with
Code: [Select]
lsusb and
Code: [Select]
dmesg | tail -20 as well as
Code: [Select]
lsmod
Enabling my wireless interface via
Code: [Select]
sudo ifconfig wlan0 up (The interface can be found with `iwlist`)
Next, use
Code: [Select]
iwlist wlan0 scan to scan for wireless networks.

Use
Code: [Select]
wpa_passphrase to generate with ESSID and Passphrase a configuration, make sure you follow precisely the output provided by
Code: [Select]
iwlist for the fields
Code: [Select]
key_mgmt and
Code: [Select]
pairwise and
Code: [Select]
group Check if access point (AP) uses WPA1 or WPA2, uncomment the field proto maybe. (My AP said WPA2 but it really seems to be WPA1... then you get a Skip RSN/WPA proto mismatch error during running
Code: [Select]
wpa_supplicant in debug mode. Store in some location, I stored my config in /home/tc as wpa_supplicant.conf.

Next execute
Code: [Select]
wpa_supplicant -i wlan0 -D wext -c /home/tc/config -d & to authenticate with AP.

Check with
Code: [Select]
iwconfig if authenticated with AP, then use
Code: [Select]
udhcpc -i wlan0 to aquire an IP address. (Make sure that your AP has your device added. I use a Macfilter in my AP to allow only certain devices).

The last step in this tutorial is to add it to the boot configuration, which I right now do not know how to do, so I created a small script
Code: [Select]
wlan.sh
Code: [Select]
#!/bin/sh
sudo wpa_supplicant -i wlan0 -D wext -c /home/tc/config -d &
sudo udhcpc -i wlan0

Which I execute in my .ashrc configuration file.

Hit
Code: [Select]
backup then
Code: [Select]
reboot
Wireless LAN should be made available automatically now.

Best wishes,
Stephan

Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 08, 2020, 06:48:47 AM
I presume I could add the scripts to

Code: [Select]
/opt/bootlocal.sh
Correct?
Title: Re: armv6 and realtek firmware
Post by: Rich on October 08, 2020, 06:58:28 AM
Hi stephanmg
Yes, you can add them to  /opt/bootlocal.sh.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 08, 2020, 06:59:27 AM
Is this the best option?

I presume this is not the TCL-idomatic way, since I am learning TCL right now. :)


Hi stephanmg
Yes, you can add them to  /opt/bootlocal.sh.
Title: Re: armv6 and realtek firmware
Post by: Rich on October 08, 2020, 07:13:31 AM
Hi stephanmg
Things that need to run before a GUI are started (like kmaps) should go into  /opt/bootsync.sh.
Things that need to run after a GUI are started (like starting a GUI app) should go into  ~/.X.d.
Things that are not sensitive to when they are started should go into  /opt/bootlocal.sh  which runs in the background.

.X.d  is a hidden subdirectory in your home directory. Any files you place in there will have their contents (commands) read
line by line and executed. For example, a file containing:
Code: [Select]
exec aterm &will launch a terminal after the GUI is running. The  &  tells it to launch in the background so it does not block other commands
from being run.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 08, 2020, 09:29:50 AM
Thanks, great!

I cannot change the subset of the thread... it should really read: "armv6 and realtek firmware".
Title: Re: armv6 and realtek firmware
Post by: Rich on October 08, 2020, 01:06:53 PM
Hi stephanmg
... I cannot change the subset of the thread... it should really read: "armv6 and realtek firmware".
Done.
Title: Re: armv6 and realtek firmware
Post by: Greg Erskine on October 08, 2020, 01:43:28 PM
I don't understand how your wifi is working?

I think, firmware-rpi-wifi.tcz is the firmware for Raspberry Pi built-in wifi which is not a Realtek device.

For Realtek you need firmware-rtlwifi.tcz (Did I miss this somewhere in your posts?)
Title: Re: armv6 and realtek firmware
Post by: Greg Erskine on October 08, 2020, 01:59:04 PM

Created a shell script:
Code: [Select]
#!/bin/sh
tce-load -i firmware-rpi-wifi
tce-load -i libnl
tce-load -i libudev
tce-load -i libusb
tce-load -i usb-ids
tce-load -i wifi
tce-load -i wireless-4.19.81-piCore
tce-load -i wireless_tools
tce-load -i wpa_supplicant


This script is unnecessary.

/mnt/mmcblk0p2/tce/onboot.lst contains a list extensions to load during boot.

Your onboot.lst should contain something like this:

Code: [Select]
firmware-rtlwifi.tcz
wireless_tools.tcz
wpa_supplicant.tcz

piCore will load these extensions plus ALL their dependencies for you. Load firmware first.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 09, 2020, 10:09:27 AM
No you did not miss anything.

I am just now realizing this, the firmware must then have been provided by another extension?
I did not load
Code: [Select]
firmware-rtlwifi.tcz by myself.

I don't understand how your wifi is working?

I think, firmware-rpi-wifi.tcz is the firmware for Raspberry Pi built-in wifi which is not a Realtek device.

For Realtek you need firmware-rtlwifi.tcz (Did I miss this somewhere in your posts?)
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 09, 2020, 10:10:06 AM
Thanks! I will make the changes accordingly now on my system.

I stored in /home/tc the extensions I load with my script. Should I then specify the path to these extensions in the onboot.lst? Or can I somehow make these persistent, but preferably not in my /home/tc directory?


Created a shell script:
Code: [Select]
#!/bin/sh
tce-load -i firmware-rpi-wifi
tce-load -i libnl
tce-load -i libudev
tce-load -i libusb
tce-load -i usb-ids
tce-load -i wifi
tce-load -i wireless-4.19.81-piCore
tce-load -i wireless_tools
tce-load -i wpa_supplicant


This script is unnecessary.

/mnt/mmcblk0p2/tce/onboot.lst contains a list extensions to load during boot.

Your onboot.lst should contain something like this:

Code: [Select]
firmware-rtlwifi.tcz
wireless_tools.tcz
wpa_supplicant.tcz

piCore will load these extensions plus ALL their dependencies for you. Load firmware first.
Title: Re: armv6 and realtek firmware
Post by: Rich on October 09, 2020, 10:34:18 AM
Hi stephanmg
... I stored in /home/tc the extensions I load with my script. Should I then specify the path to these extensions in the onboot.lst? Or can I somehow make these persistent, but preferably not in my /home/tc directory? ...
Copy the extensions to your  tce/optional/  directory.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 12, 2020, 06:59:05 AM
Thanks!

Is this the commonly refered to persistent TCE directory?

Hi stephanmg
... I stored in /home/tc the extensions I load with my script. Should I then specify the path to these extensions in the onboot.lst? Or can I somehow make these persistent, but preferably not in my /home/tc directory? ...
Copy the extensions to your  tce/optional/  directory.
Title: Re: armv6 and realtek firmware
Post by: Rich on October 12, 2020, 07:21:24 AM
Hi stephanmg
Is this the commonly refered to persistent TCE directory?
Yes it is.
Title: Re: armv6 and realtek firmware
Post by: stephanmg on October 15, 2020, 03:44:01 AM
Thank you kindly for confirming.