Tiny Core Base > Raspberry Pi
Raspberry Pi Zero Wireless and piCore14.x LAN Connectivity
KeithA:
I have always found the combination of a Raspberry Pi Zero W and piCore a very useful platform for projects such as remote controllers and a mini NAS. To start a project I initially connect the RPi0W to my router using a USB to LAN adapter so I can SSH into the Pi from PuTTY running on a laptop then use the tce commands to install wifi on the Pi. Once I have wireless connectivity, the USB to LAN adapter can be removed leaving me with a remote wirelessly connected Pi. This worked with piCore13 but with piCore14 I cannot connect via LAN to my router so am unable to use tce commands to install wifi onto the Pi.
As a workaround I downloaded the extensions and their dependencies for firmware-rpi-wifi, wifi and wireless-6.1.68-piCore from the repository http://tinycorelinux.net/14.x/armv6/tcz/ to a USB Flash and transferred them on to the Pi using a similar method as described in the topic: How to get wifi working on Raspberry Pi Zero 2 W ? https://forum.tinycorelinux.net/index.php/topic,26659.html and I got wifi working on a RPi0W with piCore14.
I've done some investigation and comparing the diagnostic messages dmesg from the Pi for piCore13 and piCore14, although in both cases the USB to LAN adapter is recognised correctly, piCore13 dmesg has the two lines:
--- Code: ---[ 6.639085] cdc_ether 1-1.1:2.0 eth0: register 'cdc_ether' at usb-20980000.usb-1.1, CDC Ethernet Device, 00:e0:4b:36:2d:b3
[ 6.639416] usbcore: registered new interface driver cdc_ether
--- End code ---
These lines are missing in piCore14.
Listing the loaded kernel modules with lsmod for piCore13 and piCore14 shows cdc_ether present for piCore13.
--- Code: ---tc@box:~$ lsmod
Module Size Used by Not tainted
squashfs 40960 3
cdc_ether 16384 0
raspberrypi_hwmon 16384 0
zram 24576 1
zsmalloc 28672 1 zram
--- End code ---
But not for piCore14.
An old post https://forum.tinycorelinux.net/index.php/topic,20082.html Topic: Pi Zero usb LAN adapter, suggested installing the module net-usb-KERNEL-piCore. This is a single extension with no dependencies so I manually copied the two files net-usb-6.1.68-piCore.tcz and net-usb-6.1.68-piCore.tcz.md5.txt to RPi0w with piCore14's uSD storage partition extensions folder /mnt/mmcblk0p2/tce/optional and added the line net-usb-6.1.68-piCore.tcz to the onboot list file /mnt/mmcblk0p2/tce/onboot.lst
It worked, cdc_ether is back. The Pi connects to the router and I can SSH my way in and tce download and install wifi. This is much easier than the first method of manually downloading and copying over twenty files to the Pi. Still not ideal though.
I know piCore is a minimal operating system which you customise by installing extensions but expecting users to manually download extensions and copy them to a pi is expecting a bit much, especially for beginners. There are plenty of pitfalls and I'm sure I fell down them all.
A plea to the hard working experts who maintain piCore: Earlier versions of piCore supported cdc_ether for USB-LAN adapter connectivity, is there any possibility it could be re-introduced for the benefit of Raspberry Pi Zero W users? Many thanks.
CentralWare:
@KeithA: Thanks for reaching out!
Speaking from personal experience with the RasPi line, I found a solution quite some time ago which may help you with your projects.
Note: This is a one-time necessity for each major release of piCore, though you may wish to tweak it to your needs before calling it complete.
This is being posted in hopes to assist those in similar situations with piCore as it solves a good deal of issues under one roof.
Think of this as the "Universal piCore Boot Image" for RasPi 4, 3, 2, 1, Zero and Zero-2
From your regular PC (or laptop!):
* Download piCore 14's zip file and extract the picore#.img file
* Using your preferred method, "install" the image file onto a USB stick, SD card, etc. that you can erase without worrying about what's on it
* Once installed, open the device on your PC and COPY all of the files from that FAT32 partition onto your computer into a directory called piCore14 (you can erase the USB/SD - it served it's purpose.)
* Replace the config.txt in your PC's directory with the one provided below
* Replace the cmdline.txt with the one provided below
* Create COPIES of the new cmdline.txt naming them cmdline_pi0.txt, cmdline_pi02.txt (for the Pi Zero 2W), cmdline_pi1.txt and so on up to pi4, they're all listed in config.txt, one for each RasPi hardware device. RasPi5 is not supported in this image.
* Create an empty text file here and rename it to bootmmc.sh
* In your PC's directory where cmdline###.txt and config.txt files are, create a new directory called tce. Inside that, create another one called optional.
* Download firmware and support files from the piCore repository and place them inside /tce/optional/
cmdline.txt
--- Code: ---zswap.compressor=lz4 zswap.zpool=z3fold console=tty1 root=/dev/ram0 rootwait quiet nortc loglevel=3 noembed tce=LABEL=piCore14
--- End code ---
* What ever you format/name the SD card must match to what's listed here as tce=LABEL=piCore14
config.txt
--- Code: ---# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details
#
# For Device-tree overlays, please reference overlays/README on the boot partition.
#
[PI0]
initramfs rootfs-piCore-14.1.gz,modules-6.1.68-piCore.gz followkernel
kernel kernel6168.img
cmdline=cmdline_pi0.txt
[PI02]
initramfs rootfs-piCore-14.1.gz,modules-6.1.68-piCore-v7.gz followkernel
kernel kernel6168v7.img
cmdline=cmdline_pi02.txt
[PI1]
initramfs rootfs-piCore-14.1.gz,modules-6.1.68-piCore.gz followkernel
kernel kernel6168.img
cmdline=cmdline_pi1.txt
[PI2]
initramfs rootfs-piCore-14.1.gz,modules-6.1.68-piCore-v7.gz followkernel
kernel kernel6168v7.img
cmdline=cmdline_pi2.txt
[PI3]
initramfs rootfs-piCore-14.1.gz,modules-6.1.68-piCore-v7.gz followkernel
kernel kernel6168v7.img
cmdline=cmdline_pi3.txt
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
#dtoverlay=vc4-kms-v3d
[PI4]
initramfs rootfs-piCore-14.1.gz,modules-6.1.68-piCore-v7l.gz followkernel
kernel kernel6168v7l.img
cmdline=cmdline_pi4.txt
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
dtoverlay=vc4-kms-v3d-pi4
max_framebuffers=2
[ALL]
# Run as fast as firmware / board allows
arm_boost=1
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16
# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720
# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1
# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1
# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2
# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4
# uncomment for composite PAL
#sdtv_mode=2
#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800
# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18
# Additional overlays and parameters are documented /boot/overlays/README
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
#dtoverlay=vc4-fkms-v3d
--- End code ---
Finally, wipe out your intended Micro-SD card and create a single, primary partition on it (say 512MB for a little extra elbow room) and format it FAT32 with a name/label of piCore14 Once formatted, simply COPY your files from this directory on your PC onto the newly formatted SD partition and properly eject the SD card to ensure it writes and releases from the PC.
Boot the SD card from your RasPi. Type in the following command to check it:
--- Code: ---readlink /etc/sysconfig/tcedir
--- End code ---
If it returns /mnt/mmcblk0p1/tce we're in business. If it returns /tmp/tce something went wrong above.
Edit /opt/bootsync.sh and bootlocal.sh to create a "universal" start-up that does everything you want it to do whether it's fired up on a Pi4 or a PiZero. Disregard the USB WiFi for the moment as this is specific to a single device, not "all" of them. In addition, inside bootlocal.sh right after the # line that says to add things "here" add the following lines as being the first thing(s) bootlocal.sh does:
--- Code: ---mount /mnt/mmcblk0p1 >/dev/null 2>&1
. /mnt/mmcblk0p1/bootmmc.sh
--- End code ---
Entering
--- Code: ---filetool.sh -b
--- End code ---
should back up changes you've made to bootlocal.sh and/or bootsync.sh onto the SD card.
--- Code: ---sudo poweroff
--- End code ---
when you're done tweaking and have backed up the system for ALL RasPi types of devices. Eject the SD card and put it back into your PC.
COPY the files from the SD card's partition back into your existing PC directory, overwrite everything when prompted and then set that directory aside. Again, you can wipe the SD card as it has served its purpose. Your PC/laptop now contains everything you need for any of the supported devices. Simply follow the creation instructions below:
* Insert an appropriate SD card into your PC
* Remove all SD partitions, create a single partition >128MB
* Format the partition FAT32 and label it to match the cmdline###.txt tce=LABEL=something
* COPY the contents from your PC to the SD card
* EDIT the config/cmdline files if necessary to accommodate your needs
* EDIT the bootmmc.sh file to execute start-up needs (see below)
* EJECT the SD and insert/boot your RasPi with itNow, for your USB WiFi needs... Create an SD card as described above.
EDIT the SD card's bootmmc.sh file from your PC OR the Pi -- up to you, and add
--- Code: ---su -c "tce-load -i net-usb-KERNEL.tcz" tc
--- End code ---
Hope this helps!
CentralWare:
In regards to whether or not include usb-net-KERNEL there's a level of inconvenience if we do, or if we don't.
A) If we INCLUDE drivers specific to a given hardware layout, everyone who does NOT have that layout would have to recompile the kernel in order to rid themselves of all the unnecessary content; and those percentages are pretty large.
B) If we do NOT INCLUDE hardware-specific drivers (like the many, many USB devices on the market) it may in fact be a pain for some users who rely on those devices to get online in order to download drivers (etc.) but we can't predict how each user is going to put their devices to work.
NOTE: You CAN, however, build your own customized kernel with what ever drivers you wish to have as part of it and alleviate the need for driver extensions completely - with the understanding of A/B above. It's not all that difficult to do, but does take quite a while to compile on a Pi.
The main goal is to include the required basics (in this case, all of the hardware devices that come built into the RasPi 0,1,2,3,4,0-2 and I think the 400/SOM series are in there as well. (For example, we have a couple USB Ethernet dongles we use while flashing RasPi-Zero boards... the drivers aren't built in because the other hundred or so images we used throughout the year don't have need for it and would otherwise just add bloat to the kernel.)
Paul_123:
My usb Ethernet modules do not use that module, so moving that one module to the initrd is not going to help everyone. If you plug in a usb Ethernet device, you need the net-usb modules package.
KeithA:
Hi CentralWare, Thanks for your prompt and very detailed response.
I agree with you absolutely that piCore should avoid creeping bloat. I usually use piCore in copy mode to provide uSD card resilience and regard ram, especially the miserly 512 MB on the Raspberry Pi Zero W, as a valuable resource not to be squandered.
However, I think there are two considerations to be made in this case.
The first is that given a Raspberry Pi Zero W and piCore14 there is no way of accessing the piCore repository over the internet without "cheating"
and many users will be put off using piCore by this inability to plug and play.
The second is that I'm not asking for anything new. I'm asking for a feature that was present in piCore13 and dropped in piCore14 to be re-introduced.
Incidentally, Raspberry Pi Zero 2W and piCore64-14 will connect to my router through a USB to LAN adapter. No problem there
Many thanks for your help.
Navigation
[0] Message Index
[#] Next page
Go to full version