Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: full-pixel on December 22, 2020, 11:22:24 PM

Title: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 22, 2020, 11:22:24 PM
I've followed guides over and over and flashed my sd card over and over but it still can't detect the wifi in my area even after it saying "OK" when testing the wifi. What is kerne7, if I am to delte that to make room? I tried last version 9 of picore and deleted 9.0v7.gz, I guessed that I was supposed to as a youtuber using a version 9 deleted a similar filename, but there's also 9.0.gz, I don't know what to delete so that the /opt/ folder with the wifi module in it can fit. I suppose 9.0v7.gz was not it and broke it? The readme nor the book are helping my pondering over why it keeps failing to install the wifi module. I tried the v 12 first, but the guide didn't match closely anywhere. One says to delete kernel7, where that is I don't know, one says to make the opt folder and one doesn't, it's all so confusing. Is it because 'filetool.sh -b' isn't included in guides online? I thought echo made it remember things. I'd keep trying but I'm bound to burn out the sd card.

tl;dr: the guides always have something impossible to follow, where is this kernel7? Which file do I delete to make room for opt? Why is opt called opt and not optional? Why would it say Ok but not be able to detect the wifi right afterwards?
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on December 22, 2020, 11:42:59 PM
Hi full-pixel
After you have flashed the image onto the SD card, you need to expand the second partition.
From:
http://tinycorelinux.net/11.x/armv6/releases/RPi/README
Code: [Select]
SD card partitioning
====================

First partition, mmcblk0p1 is VFAT type; it contains the basic piCore
system and the Raspberry Pi boot loader, firmware and other support
files. Partition is unmounted during operation, system is not using it
after boot and never writes.

Second partition, mmcblk0p2 is a Linux ext4 partion which contains
preinstalled extensions, openssh and mc (Midnight Commander) and
configuration files. It is a small partion with no free space, you must
expand its size to have enough room for additional extensions, updates
and  backups. It can be done on the running system locally or remote
via SSH following these steps:

1) Start fdisk partitioning tool as root:

   sudo fdisk -u /dev/mmcblk0

   Now list partitions with 'p' command and write down the starting and
   ending sectors of the second partition.

2) Delete second partition with 'd' than recreate it with 'n' command.
   Use the same starting sector as deleted had and provide end
   sectore or size greater than deleted had having enough free space
   for Mounted Mode. When finished, exit fdisk with 'w' command. Now
   partition size increased but file system size is not yet changed.

3) Reboot piCore. It is necessary to make Kernel aware of changes.

4) After reboot expand file system to the new partition boundaries with
   typing the following command as root:

   resize2fs /dev/mmcblk0p2

Now you are ready to use the bigger partition.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 12:03:10 AM
I followed such guides and the fdisk part worked out, but not the wifi part, even though when tested it outputs ok for things. I assume I'm deleting the wrong file to make room for /opt/ wherein the wifi module goes?

What file is to be deleted to make room so I don't break the OS trying to install the wifi module?
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on December 23, 2020, 12:05:27 AM
Hi full-pixel
... I assume I'm deleting the wrong file to make room for /opt/ wherein the wifi module goes? ...
Where are you finding that information?
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 12:11:29 AM
https://www.novaspirit.com/2018/01/09/tiny-core-raspberry-pi-zero-w-install/

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

Such places ^ as the readme was hard for me to wrap my mind around on it's own. One says delete kernel7, the other says to delete a filename I don't see. Confusing.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on December 23, 2020, 12:21:59 AM
Hi full-pixel
Do you have a wired network connection you can plug into your pi?
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 12:30:08 AM
No. There's only wifi here, and even if not this is a pi zero w that has no ethernet port anyway. Because it's a pi zero putting raspbian on it is silly so I was looking for a smaller Linux that has gui, but so far raspbian won't fit on the sd, and this os doesn't like it's own wifi module software, or I'm derping hard and missing some step somehow, I assume it has to do with the file being deleted to make room for the module software on the card. Without deleting a file there's no room in the /opt/ folder.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on December 23, 2020, 12:40:39 AM
Hi full-pixel
After you expanded the second partition, you will have room to add the extensions you need. The files you need to download
go into  tce/optional/  on the second partition. Skip the delete kernel7 part.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 01:06:11 AM
I tried following the tutorial, without adding the wifi module software into the opt folder, and then after resizing I put it into my computer again to paste it into it but it says there's not enough room. I suppose windows 7 can't alter linux partitions this way? Win7 32bit is what I'm using to install it. I'd boot up something like lubuntu on it, live, but I'm locked out of the bios boot order and could never crack the code to get into the bios's boot order. I could remove the cmos but don't want to break my win7 laptop, to try to reset the password and all.

Anyway, it's still not working out. I can't paste it in without deleting something.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on December 23, 2020, 01:17:19 AM
Hi full-pixel
I'm not very familiar with pi so I can't tell you which files can be deleted.
The second partition uses an EXT4 file system. Google  win7 ext4 support  to find a driver so you can write to the card.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Greg Erskine on December 23, 2020, 01:24:30 AM
There are multiple kernels on your SD card so it will work on both single and quad core CPUs.

So if your are using a 4 core RPi it is not a good idea to delete its kernel. If the instructions are for a single core RPi0 then it will tell you to delete the quad core kernel and visa-versa.

Look at config.txt for which kernel it is using.

"opt" is a confusing directory name as there are both /opt and /mnt/mmcblk0p2/tce/optional directories on the root partition. If it is just a temporary directory on your boot partition for transferring extensions, then you can call it anything you like.

What RPi is it?
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: CNK on December 23, 2020, 01:28:53 AM
I believe Windows usually isn't able to access the second partition on an SD card, which is where the extensions go. And even if it could access the second partition in Windows, you'd have to install 3rd party ext file system drivers. You're likely copying to the first partition, used for booting. This is small, and isn't expanded during installation, hence you're running out of space.

If you have enough space in the first partition to hold every extension on its own, you could copy them one-by-one, booting the Pi can moving them over to the tce/optional directory on the second partition from there afterwards. Easier would be to use a USB memory stick (AKA "flash drive"), put the extensions on that from the Windows PC, then connect it to the Pi Zero (via a microUSB - USB adapter) and copy them from the memory stick to to tce/optional/ on the SD card's second partition.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 01:52:16 AM
There are multiple kernels on your SD card so it will work on both single and quad core CPUs.

So if your are using a 4 core RPi it is not a good idea to delete its kernel. If the instructions are for a single core RPi0 then it will tell you to delete the quad core kernel and visa-versa.

Look at config.txt for which kernel it is using.

"opt" is a confusing directory name as there are both /opt and /mnt/mmcblk0p2/tce/optional directories on the root partition. If it is just a temporary directory on your boot partition for transferring extensions, then you can call it anything you like.

What RPi is it?

It's a pi zero w.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 01:53:27 AM
Hi full-pixel
I'm not very familiar with pi so I can't tell you which files can be deleted.
The second partition uses an EXT4 file system. Google  win7 ext4 support  to find a driver so you can write to the card.

I don't want to break my win7. Last time I installed a driver on it, it bluescreened over a wifi dongle. Dell pc's and drivers have given me learned helplessness with it, so I used my roommate's lubuntu laptop and it said there wasn't enough room on the disc and that it copied with errors, so I will have to reflash the sd yet again. I must have pasted it into the wrong partition. I didn't realize it showed up as two drives, the other drive must have been the partition that wasn't named picore. It's confusing because I had a flash drive with the module, and then the picore showing up as two drives, I guess that's how the partitions are shown but oh well because the roommate will be bothered if I sit there with his computer a second time tonight. As it is I don't know where to paste it in the second drive, in it's root, or in one of it's sub-folders? I can't try again right now without inciting drama with the roomie. He's going to sleep now.

Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: CNK on December 23, 2020, 03:13:32 AM
The extensions go in tce/optional ("optional" folder inside the "tce" folder) on the second partition. Add the names of the extensions on individual lines in the tce/onboot.lst file (edit it as a text file) if you want them to load on start-up.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 23, 2020, 05:37:13 PM
The extensions go in tce/optional ("optional" folder inside the "tce" folder) on the second partition. Add the names of the extensions on individual lines in the tce/onboot.lst file (edit it as a text file) if you want them to load on start-up.

It wouldn't let me paste it into the second partition either, optional copied with errors the contents of the wifi module. It also wouldn't let me make an opt folder within opt, as I tried that too. Some files were the same within optional.

So I'm still failing to do it so far. I really need a tutorial of some kind.

Edit: and yes I deleted the 2 and resized it and all properly so that there was space. It still said errors were made.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: polikuo on December 24, 2020, 10:20:34 AM
Hi

The latest stable release right now is piCore-12.0 (http://forum.tinycorelinux.net/index.php/topic,24384.0.html)

I'm using RPI4, but the principles are the same.

You flash the image on your SD card and expand the second partition.

To get wifi working, you'll need firmware-rpi-wifi.tcz and wifi.tcz

Usually, we fetch the extensions along with their dependencies with tce-load

However, that requires internet connection.

So the work around is to download the files on other machine, and then you move it to where it should be.

In your case, the required files are: (piCore12)
Code: [Select]
firmware-rpi-wifi.tcz
wifi.tcz
wireless_tools.tcz
wireless-5.4.51-piCore.tcz
wpa_supplicant.tcz
libnl.tcz
openssl.tcz
ca-certificates.tcz
readline.tcz
ncurses.tcz

These files take less than 20MB of space, which should be able to fit in the first partition without deleting anything.

Download these extensions from http://tinycorelinux.net/12.x/armv6/tcz/

Store them in the first partition of your SD card with your windows 7

Boot up the machine, move them to your tce/optional
Code: [Select]
mount /mnt/mmcblk0p1
mv /mnt/mmcblk0p1/*.tcz /mnt/mmcblk0p2/tce/optional

Load the extensions to see if the wifi works
Code: [Select]
cd /mnt/mmcblk0p2/tce/optional
tce-load -i *.tcz
sudo wifi.sh

If everything goes well, generate the checksums and download the dep files
Code: [Select]
cd /mnt/mmcblk0p2/tce/optional
for F in *.tcz; do
  md5sum $F > ${F}.md5.txt
done
tce-audit updatedeps
tce-update
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on December 31, 2020, 09:37:36 PM
http://tinycorelinux.net/12.x/armv6/tcz/

I don't see how that leads to downloadable files. Should I just delete the files that don't belong within what I got from novaspirit's download? They seem to match names from what I'm seeing, but there's a bunch of stuff that isn't in your list that is there to delete.

But I don't get how to find extensions on this site of which is bothering me. 

Also, last time I tried it only had about 3 mb of space, so 20 would be too large from what I tried in the past.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on December 31, 2020, 09:51:05 PM
Hi full-pixel
http://tinycorelinux.net/12.x/armv6/tcz/

I don't see how that leads to downloadable files. ...
If you use anothe Linux machine, you can:
wget http://tinycorelinux.net/12.x/armv6/tcz/firmware-rpi-wifi.tcz

Or if you want, enter this into the address bar of your browser:
wget http://tinycorelinux.net/12.x/armv6/tcz/firmware-rpi-wifi.tcz
and it should ask you where you want to save it.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on January 01, 2021, 12:41:03 AM
After booting it up it fails to detect the keyboard this time with the files in the first partition using v12 without deletion of anything with a fresh image installed to it. It's happened before, it ignoring the keyboard, during random attempts, so I know the usb micro female works on the zero, and the keyboard works on the win7 I'm using to type this right now. So it didn't work I guess.

There was enough room though using v12 so I was wrong about that. It's the older versions that had no room it seems, not that it mattered.

I tried more than one otg also in case it was a short.

Furthermore while going over what might have happened and typing out this message, it was still on and after 2 minutes or so, maybe 3, the keys were generated. That's kind of slow for it to take minutes to boot up that way, it's never been that slow before. I thought I must have saved them, or the os did, but it was just taking minutes to generate the keys.

Could it take five minutes for the keyboard to be recognized randomly during this process or what am I to think?


Thanks for showing me how to download the files by the way, I would never have though to add them at the end of the url.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Rich on January 01, 2021, 01:04:19 AM
Hi full-pixel
It sounds like maybe the random number generator is slow to build up entropy. That was also an issue here:
http://forum.tinycorelinux.net/index.php/topic,24392.msg155790.html#msg155790
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on January 01, 2021, 03:05:09 AM
I tried again and it told me write error and that there was no space left, when trying to move the files to optional, using v12. It gave me three write errors after deletion of /mnt/mmcblk0p2/tce/optional/ca-certificates.tcz/ and /mnt/mmcblk0p2/tce/optional/popenssl.tcz, then the mv had three write errors and that there was no space left.

Tried anyway and it told me thing swere already installed and that things were okay but  mounting /dev/loop9 on /tmp/tcloop/wireless-5.4.51-picore failed and that it was an invalid argument(s).

So I kept going anyway and then did sudo wifi.sh anyway and no devices were found.

Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: xenodius on January 02, 2021, 05:56:19 PM
I tried again and it told me write error and that there was no space left, when trying to move the files to optional, using v12.

I just setup wifi on v12 armv7l and aarch64, I'm on a pi4B but that shouldn't matter, and I had no problems copying the .tcz's just as described by polikou. I'd consider reflashing, maybe there's something leftover from following other guides? If that doesn't work, you should be able to mount a USB drive and copy them from there, just search for mounting usb I'm sure I've seen guides posted. Or you could use a usb->ethernet adapter, if you have ethernet available.
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: full-pixel on January 03, 2021, 07:45:34 AM
Yeah, I don't see how I'd be able to do well with usb mounting if I can't succeed doing anything else. Furthermore, doesn't learning the console  and mounting of usbs defeat even installing wifi and a gui at this point? My thread has an ironic goal if so. I could just install everything with the console via the usb. But then, it didn't work before so there's no reason to think it'd work then, so I gave/give up.  :'(

and no I rent wifi from a library, no ethernet, nor dongle either
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: xenodius on January 03, 2021, 01:53:29 PM
Well, your hardware limits make it a bit harder than in most cases to setup wifi. But this only has to be done once. Tinycore is supposed to be as minimalist as possible. Once you setup wifi then you can simply read a copy of the whole image as backup and never have to use a usb drive to load .tcz's again. You can simply tce-load [opt] [package]...

The reason I suggested reflashing is because I had enough space to do what polikou described... so perhaps part of some other guide you followed is causing problems.

If there's no alternative but USB, first find out the name of the drive, in my case and probably yours it's 'sda1'. Use one of the following:
Code: [Select]
fdisk -l /dev/sda
fdisk -l /dev/sdb
which for me returns sda1:
Code: [Select]
Disk /dev/sda: 30 GB, 32015679488 bytes, 62530624 sectors
3892 cylinders, 255 heads, 63 sectors/track
Units: sectors of 1 * 512 = 512 bytes

Device  Boot StartCHS    EndCHS        StartLBA     EndLBA    Sectors  Size Id Type
/dev/sda1 *  0,0,33      1023,254,63         32   62530623   62530592 29.8G  7 HPFS/NTFS

Once you know the name you just have to:
Code: [Select]
# Mount drive:
mount /dev/sda1
# Copy files:
cd /mnt/mmcblk0p2/tce/optional
sudo cp /mnt/sda1/firmware-rpi-wifi.tcz .
sudo cp /mnt/sda1/wifi.tcz .
# Add to onboot:
echo "wifi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
echo "firmware-rpi-wifi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
# Restart:
sudo reboot
Title: Re: I can't find a working tutorial that gets the wifi module installed.
Post by: Greg Erskine on January 03, 2021, 02:21:17 PM
I think you need load firmware-rpi-wifi.tcz before wifi.tcz.

So you may need:

Code: [Select]
echo "firmware-rpi-wifi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
echo "wifi.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst