Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: bonbonbaron on January 16, 2020, 06:47:42 AM

Title: wifi.sh says "no devices found" on piCore 9.0.3
Post by: bonbonbaron on January 16, 2020, 06:47:42 AM
Hi,

I followed the steps word-for-word listed at http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi (http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi) to get wifi on my Pi Zero W with piCore 9.0.3. There was a message when tce-loading wifi.tcz saying that mounting /dev/loop16 on /tmp/tcloop/wpa_supplicant failed with an invalid argument, but I had no idea where that was coming from. When I ran dmesg, it said something might be up with mmcblk0. Wifi.sh was nowhere to be found either. But I went ahead and added the firmware and wifi.tcz to onboot.lst anyway, and when I rebooted, there were no complaints in dmesg about mmcblkp0, and wifi.sh appeared to be working!

However, when I ran wifi.sh, it said, "No wifi devices found!" What could be the cause of that? The router's in my basement, and my Desktop (right next to my Pi) can find it just fine. It's not a signal strength thing is it? The steps in the link above say nothing about configuring anything else, so I'm at a loss. Any advice is appreciated.

Thanks in advance for your help,
Michael
Any thoughts? Thanks,

Michael
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Rich on January 16, 2020, 08:14:00 AM
Hi bonbonbaron
...  There was a message when tce-loading wifi.tcz saying that mounting /dev/loop16 on /tmp/tcloop/wpa_supplicant failed with an invalid argument, but I had no idea where that was coming from. ...
You may have a corrupted download. Try this:
Code: [Select]
cd /etc/sysconfig/tcedir/optional
md5sum -c wpa_supplicant.tcz.md5.txt
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on January 16, 2020, 07:09:32 PM
Did you expand your partition?
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: bonbonbaron on January 16, 2020, 07:35:57 PM
Did you expand your partition?
Yes, I expanded it to the default (max) value.
You may have a corrupted download. Try this:
Code: [Select]
cd /etc/sysconfig/tcedir/optional
md5sum -c wpa_supplicant.tcz.md5.txt
Thanks for the tip, but md5sum verified everything.

A friend suggested I try a more conventional OS like Raspbian to make sure my wireless card works. That's what I'll try next. I'm still open to ideas here though.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: bonbonbaron on January 16, 2020, 08:59:16 PM
A friend suggested I try a more conventional OS like Raspbian to make sure my wireless card works. That's what I'll try next. I'm still open to ideas here though.
Yep, WiFi works on Raspbian. Tomorrow I'll try piCore 9.0.1 instead.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Juanito on January 16, 2020, 09:32:58 PM
Remember to check the last 20 lines of dmesg for errors if you get the "No wifi devices found" message again.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: bonbonbaron on January 17, 2020, 05:38:56 AM
I changed to piCore 9.0.1, used all the exact same TCZ files I used for 9.0.3 and it worked!!! Whoohoo!!! How do you know where the appropriate place to download TCZ files is?
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Rich on January 17, 2020, 05:58:00 AM
Hi bonbonbaron
... How do you know where the appropriate place to download TCZ files is?
That is typically resolved by either  tce-load  or the  Apps  utility. There are no 9.01 or 9.03 repositories, only 9.x. The correct
repository is the one that matches your processor, either:
http://tinycorelinux.net/9.x/armv6/tcz
or:
http://tinycorelinux.net/9.x/armv7/tcz
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: bonbonbaron on January 18, 2020, 06:46:30 AM
Gotcha. Well, at any rate it doesn't appear to work on 9.0.3. Wish I knew why.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: kissmurphy on February 03, 2020, 11:49:12 PM
Hi bonbonbaron and anyone else finding this thread,

Gotcha. Well, at any rate it doesn't appear to work on 9.0.3. Wish I knew why.

The instructions at http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi (http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi) worked for me in getting the wifi up and running on my Pi Zero W.

In case there are different hardware version, on the back my Pi Zero W is printed:

Code: [Select]
  Raspberry Pi Zero W V1.1
    "Copyright Symbol" Raspberry Pi 2017

My "tomato" router is set up with "WPA/WPA2 Personal" with "TKIP/AES" encryption, with a shared key. It's in automatic wireless mode (B/G) and there is a DHCP server available on the wifi network.

I opted to adjust the above procedure to follow the general wifi setup instructions here:

  Tiny Core Linux Wiki - Setting Up Wifi
  http://wiki.tinycorelinux.net/wiki:setting_up_wifi (http://wiki.tinycorelinux.net/wiki:setting_up_wifi)

I wanted to avoid using the "wifi.sh" setup script as it created, and required, my wifi network passphrase, in plaintext, to reside in a file in the installing user's home directory, default "~/tc/". Rather, you can generate an /etc/wpa_supplicant.conf file containing a *hashed* version or your wifi passphrase using the command below. You can do this on the PiZeroW, or on your desktop linux box and copy the wpa_supplicant.conf file onto the sdcard for easy deployment to your PiZeroW. Note that being able to generate this file on another machine means that once obtained, anyone can use this file, along with the wpa_supplicant software to connected to your wifi network. So, you should still keep your PiZeroW physically secure, but at least the passphrase it not stored in plaintext.

Code: [Select]
wpa_passphrase your_wifi_SSID your_plaintext_passphrase > wpa_supplicant.conf
The general procedure is to use the same piCore image placed onto your sdcard:

Code: [Select]
wget -c -nv --show-progress http://www.tinycorelinux.net/9.x/armv6/releases/RPi/piCore-9.0.3.zip
but only the following TC Extensions are "essential" to get wifi up and running on the PiZeroW, at least with the piCore image above:

Code: [Select]
firmware-rpi3-wireless
libnl
wireless-4.9.22-piCore
wpa_supplicant

Of course you may wish to load other handy TC extensions and although this could be done after wifi is up and running, if you have problems getting wifi up and running you may wish to include the "wireless_tools" TC Extension to help troubleshoot your wifi setup. Note that this extension depends on the libiw TC Extension so you will need to "pre-download" that to your sdcard too.

Download the ".tcz" ".tcz.md5.txt" files for the above mentioned TC Extensions from:

  http://www.tinycorelinux.net/9.x/armv6/tcz/

For example, for the wpa_supplicant TC Extension:

Code: [Select]
wget -c http://www.tinycorelinux.net/9.x/armv6/tcz/wpa_supplicant/.tcz
wget -c http://www.tinycorelinux.net/9.x/armv6/tcz/wpa_supplicant.tcz.md5.txt

and place them onto the first partition of sdcard.

Note: On a text based machine with no networking it can save a lot of time, and typos, to have a working mouse installed so you can cut and paste commands from a file you prepared earlier and copied to the sdcard. The TC Extension gpm provides mouse support on a text console. However, it's not available in the 9.x repository, but it is available in the 7.x repository - and worked just fine for me - so you may wish so download it and copy it onto your sdcard's first partition along with the other TC extensions:

Code: [Select]
wget -c http://www.tinycorelinux.net/7.x/armv6/tcz/gpm.tcz
wget -c http://www.tinycorelinux.net/7.x/armv6/tcz/gpm.tcz.md5.txt

Once the sdcard's second partition and the second partition's filesystem has been expanded, and your PiZeroW rebooted, copy these files to "/mnt/mmcblk0p2/tce/optional/", "cd" to that directory and install each of them with:

Code: [Select]
tce-load -i TcExtensionName
With these TC extensions modules loaded the "lsmod" command shows the wifi chipset wifi modules:

Code: [Select]
brcmfmac
brcmutil

have been loaded. With these modules loaded running the command:

Code: [Select]
ifconfig -a
should now show you the wifi network interface wlan0. It's not been told how to configure itself yet so there will be no IP address.

Note: On my system not all, the TC extensions were added to the onboot.lst file automatically, and not because they were dependent on other TC extensions, so I put each of the above TCE Extension modules names into onboot.lst to ensure they are loaded at boot time. Maybe not the most efficient for a fast booting I know, but good to be going on with for now. For example:

Code: [Select]
echo "TcExtensionName.tcz" >> /mnt/mmcblk0p2/tce/onboot.lst
Run the gpm software for a USB connected PS2 mouse on a PiZeroW using:

Code: [Select]
gpm -m /dev/input/mouse0 -t imps2 -R
and to cause this command to run at each boot use:

Code: [Select]
echo "gpm -m /dev/input/mouse0 -t imps2 -R" >> /opt/bootlocal.sh
To configure the wpa_supplicant software place the wpa_supplicant.conf file, which contains your wifi SSID and a hashed passphrase, into the /etc/ directory. To prevent the wpa_supplicant program complaining and failing to start set the file ownership and permissions:

Code: [Select]
sudo cp wpa_supplicant.conf /etc/
sudo chown root.root /etc/wpa_supplicant.conf
sudo chmod 600 /etc/wpa_supplicant.conf
echo "etc/wpa_supplicant.conf" >> /opt/.filetool.lst

With the wifi software and wifi hardware support installed and wpa_supplicant program and it's config file set up wifi should be ready to go, provided it's configured correctly for your wifi network and your wifi network doesn't need to be prepared in any other way. Try to start wifi with the following commands. Note that you should *not* substitute your PiZeroW's hostname, just run the commands exactly as they appear below:

Code: [Select]
sudo /usr/local/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
sudo /sbin/udhcpc -b -i wlan0 -x hostname $(hostname) -p /var/run/udhcpc.wlan0.pid

If it doesn't start but "ifconfig -a" shows you "wlan0" then the above two commands may need adjusting or the wpa_supplicant.conf file needs adjusting or something else on your wifi network needs to be changed or factored into this config. Perhaps you need to configure wpa_supplicant.conf to use a static IP address, hostname, routing and also set tell PiZeroW about DNS servers. And/Or perhaps you need to tell your wifi router about your PiZeroW's wifi mac address, which is in the output of "ifconfig -a". Anyways, the wireless-tools TCE Extension, mentioned above, and "ifconfig -a"  would probably be most helpful in debugging the issue.

Once your wifi is up and you know the above two commands, or your versions of them, are working to your satisfaction you can tell the system to run them at boot time with:

Code: [Select]
echo "/usr/local/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf" >> /opt/bootlocal.sh
echo "/sbin/udhcpc -b -i wlan0 -x hostname $(hostname) -p /var/run/udhcpc.wlan0.pid" >> /opt/bootlocal.sh

I hope this helps.

Cheers!
Rob

    [EDIT]: Added code tags.  Rich
    [EDIT]: Last 4 commands adjusted as per reply #12.  Rich
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Rich on February 04, 2020, 05:54:20 AM
Hi kissmurphy
Welcome to the forum.

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: wifi.sh says "no devices found" on piCore 9.0.3
Post by: kissmurphy on February 04, 2020, 01:25:58 PM
Hi Rich,

Thanks you for your reply.

Welcome to the forum.

Please use  Code Tags  when posting commands and responses seen in a terminal. ...

And thanks for the welcome, the Code Tags tip and for fixing up my post, it looks much clearer and more "copy and pasteable" :D

Cheers!
Rob
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: redFrik on May 02, 2020, 05:35:42 AM
thank you kissmurphy for this very good guide.  it helped me set up internet access on a rpi0 using a tplink usb wifi adapter.

for anyone else reading this note that these two lines need sudo...

Code: [Select]
sudo /usr/local/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
sudo /sbin/udhcpc -b -i wlan0 -x hostname $(hostname) -p /var/run/udhcpc.wlan0.pid

and these commands need to use append (double >>) to not overwrite the bootlocal.sh file.

Code: [Select]
echo "/usr/local/sbin/wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf" >> /opt/bootlocal.sh
echo "/sbin/udhcpc -b -i wlan0 -x hostname $(hostname) -p /var/run/udhcpc.wlan0.pid" >> /opt/bootlocal.sh
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Rich on May 02, 2020, 05:48:48 AM
Hi redFrik
Thanks for the heads up, especially the append vs. overwrite issue. Post adjusted.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: JovianPyx on June 15, 2020, 07:57:39 AM
A friend suggested I try a more conventional OS like Raspbian to make sure my wireless card works. That's what I'll try next. I'm still open to ideas here though.
Yep, WiFi works on Raspbian. Tomorrow I'll try piCore 9.0.1 instead.

I had the same issue, no wifi device found using piCore 9.0.3.  I saw this post and tried 9.0.1 and it worked immediately.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Juanito on June 15, 2020, 11:32:17 PM
Have you tried piCore-11.0?
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: alessio on July 15, 2020, 02:39:31 PM
Have you tried piCore-11.0?

Hi Juanito,

I'm trying with piCore-11.0 on Raspberry Pi Zero W but "sudo wifi.sh" says: No device found!

in attachment the DMESG output.

regards

Alessio
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on July 15, 2020, 04:03:23 PM
Looks perfectly normal.   What extensions do you have loaded?
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: alessio on July 16, 2020, 01:45:45 PM
Looks perfectly normal.   What extensions do you have loaded?

Hi Paul,


I also tryed to change the boot order with the same result...

Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on July 16, 2020, 08:12:53 PM
Did you add wireless_tools.tcz

Make sure you have downloaded the entire dependancy chain.  Each extension should have a .tcz  .tcz.md5sum.txt and make sure to get the .tcz.dep if its there.

Here is the tree
Code: [Select]
wifi.tcz
   wireless_tools.tcz
      wireless-4.9.22-piCore.tcz
   wpa_supplicant.tcz
      libnl.tcz
      openssl.tcz
         ca-certificates.tcz
      readline.tcz
         ncurses.tcz

onboot.lst should have

firmware-rpi-wifi.tcz
wifi.tcz
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: alessio on July 17, 2020, 02:15:07 PM
Hi Paul,

I put all files that you say but but wifi still isn't recognized.

I can not see errors / logs.

I am frustrated. I tryed DietPi on the same RasberryPi Zero W in 5 minutes: downloaded, edit only one txt file direct on SD , powered up and connected via ssh in wifi....
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on July 17, 2020, 04:31:12 PM
The more I look at the tree below, we are missing a dependency to libiw.tcz

Juanito, can you add libiw.tcz as a dependancy for wireless_tools

alessio,

Run the following

Code: [Select]
echo "libiw.tcz" >> /mnt/mmcblk0p2/tce/optional/wireless_tools.tcz.dep

tce-audit builddb
tce-audit fetchmissing

That should fix your local copy for now.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on July 17, 2020, 05:45:22 PM
Sorrry, I was brain dead from work when I wrote that.  Without network access tce-audit does no good.

And i forgot to check the repo.  Somehow libiw is missing..... guess everyone is either upgrading or proficient from pulling from old versions

You should be able to use this copy.
http://distro.ibiblio.org/tinycorelinux/9.x/armv6/tcz/libiw.tcz
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Juanito on July 18, 2020, 12:35:27 AM
Juanito, can you add libiw.tcz as a dependancy for wireless_tools

I'm not sure why, but wireless_tools contains libiw in piCore-11.x (which means that we are missing the dev files).
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on July 18, 2020, 05:27:00 AM
I looked, I’ve never built libiw, I must have copied since piCore 8.  Libiw was a dependency in 8 and 9 too.  iwconfig is what is linked to libiw.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Juanito on July 18, 2020, 06:34:46 AM
I just checked with:
Code: [Select]
$ tce-load -i firmware-rpi-wifi wifi
$ sudo wifi.sh
..and it works, so iwconfig is using the copy of libiw in wireless_tools
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Paul_123 on July 18, 2020, 07:54:51 AM
Seems it doesn't care much about version.  I had libiw installed on mine, and ldd was showing that link.

So then I don't know what the problem is on his end.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: full-pixel on December 23, 2020, 05:37:47 PM
http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi


permission denied
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: TT on December 25, 2020, 06:29:16 AM
http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi
permission denied
http://forum.tinycorelinux.net/index.php/topic,24531.msg156151.html#msg156151
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Rich on December 25, 2020, 10:05:48 AM
Hi TT
Were you able to connect to  picore:pi_zero_w_wifi  using your redirector? I couldn't find that link at the linuxsecrets site.

This site lists a  web.archive.org  link to  picore:pi_zero_w_wifi :
https://moin.meidokon.net/TinyCoreLinux
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: full-pixel on December 31, 2020, 11:28:44 PM
http://wiki.tinycorelinux.net/picore:pi_zero_w_wifi
permission denied
http://forum.tinycorelinux.net/index.php/topic,24531.msg156151.html#msg156151


Too burned out to know what redirect add-on is about.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: TT on December 31, 2020, 11:47:32 PM
C'mon, could you click a link at the TOP of my post?
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: full-pixel on January 01, 2021, 12:08:46 AM
TT, it's installed now, but doesn't stop the link from saying permission denied.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: TT on January 01, 2021, 05:58:52 AM
Follow the instructions given, and modify the rules. Obviously, no extension without "knowing" about TinyCore wiki could help, you need to configure it first.

UPD: Oh, forgive my ignorance! There is no 'pcore' wiki for the moment, only dcore and wiki.
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: Rich on January 01, 2021, 06:24:37 AM
Hi TT and full-pixel
See my reply #29:
http://forum.tinycorelinux.net/index.php/topic,23445.msg156289.html#msg156289
Title: Re: wifi.sh says "no devices found" on piCore 9.0.3
Post by: TT on January 01, 2021, 06:40:23 AM
Thanks, Rich! I've missed your post somehow due to forum pagination, I guess. Your directions are always helpful, as usual!