WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Configure wifi without wifi.sh?  (Read 542 times)

Offline MagicMatt

  • WikiUser
  • *
  • Posts: 10
Configure wifi without wifi.sh?
« on: May 23, 2018, 05:59:41 PM »
Due to an issue with my Pi Zero not liking the USB hub, I can't have my WiFi card and keyboard plugged in at the same time.

I need to configure the network, which I have done on Raspbian before just by editing the wpa_supplicant config file.

Is it the same on PiCore? Where is that illusive file?

Offline Greg Erskine

  • Full Member
  • ***
  • Posts: 226
Re: Configure wifi without wifi.sh?
« Reply #1 on: May 23, 2018, 06:47:54 PM »
hi MagicMatt,

I believe in a normal setup, wifi.sh creates /etc/wpa_supplicant.conf at boot time from information in /home/tc/wifi.db.

So if you make /etc/wpa_supplicant.conf manually it might get clobbered.

If I understand you correctly, you need to run wifi.sh interactively to setup wifi.db (even though you don't want to run wifi.sh)  :)

I don't use the GUI so I can't help there.

regards
Greg

Offline MagicMatt

  • WikiUser
  • *
  • Posts: 10
Re: Configure wifi without wifi.sh?
« Reply #2 on: May 24, 2018, 05:20:56 AM »
I'mnot using the GUI either.

The issue is simply that wifi.sh needs a WiFi dongle there in order to run, but I can't have the dongle and the keyboard plugged in at the same time...

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1653
Re: Configure wifi without wifi.sh?
« Reply #3 on: May 24, 2018, 06:28:25 AM »
You could try creating  ~/wifi.db  manually ...
Code: [Select]
echo "*YOUR_WIFI_ACCESS_POINT*    *YOUR_SSID*    WPA" > ~/wifi.db
then add the following to  /opt/bootlocal.sh ...
Code: [Select]
wifi.sh -a &
then do a backup
Code: [Select]
filetool.sh -b
and finally reboot with your wifi dongle attached.
Download a copy and keep it handy: Core book ;)

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5830
Re: Configure wifi without wifi.sh?
« Reply #4 on: May 24, 2018, 06:39:46 AM »
Hi MagicMatt
You might also need one of the firmware extensions for your WiFi dongle. If you post the make and model of your dongle
someone on this forum might be able to offer some further advice.

Offline MagicMatt

  • WikiUser
  • *
  • Posts: 10
Re: Configure wifi without wifi.sh?
« Reply #5 on: May 24, 2018, 10:59:07 AM »
I've obviously misunderstood somewhere along the line, as I thought "tce-load -i" added them to boot, but it doesn't.
I've added the following to my /mnt/mmvblk0p2/tce/onboot.lst
Code: [Select]
mc.tcz
openssh.tcz
firmware-rtlwifi.tcz
wifi.tcz

I have a Realtek RTL8188CU dongle, so hopefully that's the right tcz for it.

Making ~/wifi.db manually didn't work, but I think maybe I have the formatting wrong.

Assuming my network router shows as "TellMyWiFiLoveHer" and the password is "KissyKissy", is it...
TellMyWiFiLoveHer <TAB> KissyKissy <TAB> WPA"  ?

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5830
Re: Configure wifi without wifi.sh?
« Reply #6 on: May 24, 2018, 11:14:15 AM »
Hi MagicMatt
Yes, that looks like the correct format.

Offline MagicMatt

  • WikiUser
  • *
  • Posts: 10
Re: Configure wifi without wifi.sh?
« Reply #7 on: May 24, 2018, 11:51:18 AM »
I'm getting a /etc/wpa_supplicant.conf created, but the key in it is half a mile lone! The original key is also there, commented out with a #. It doesn't connect to the network.


Offline MagicMatt

  • WikiUser
  • *
  • Posts: 10
Re: Configure wifi without wifi.sh?
« Reply #8 on: May 25, 2018, 06:26:33 AM »
Still no joy.

It's finding the WiFI dongle ok, it's scanning the networks ok, but it's presenting the wrong key to the router. The router itself is rejecting the connection as "Authentication Failed - incorrect key".

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5830
Re: Configure wifi without wifi.sh?
« Reply #9 on: May 25, 2018, 07:04:24 AM »
Hi MagicMatt
This is what my  /etc/wpa_supplicant.conf  file looks like:
Code: [Select]
# reading passphrase from stdin
network={
ssid="NETGEAR53"
#psk="icywiener"
psk=1234567890123456789012345678901234567890123456789012345678901234
}

Offline Greg Erskine

  • Full Member
  • ***
  • Posts: 226
Re: Configure wifi without wifi.sh?
« Reply #10 on: May 25, 2018, 04:58:53 PM »
I'mnot using the GUI either.

The issue is simply that wifi.sh needs a WiFi dongle there in order to run, but I can't have the dongle and the keyboard plugged in at the same time...

Sorry MagicMatt,

I assumed wifi.sh would allow you to create wifi.db without a USB wifi adaptor. I imagine when the wifi.sh was written no one thought a computer would only have one USB port.  :(

If the USB wifi adaptor is not connecting usually the SSID or password is wrong. The wpa_passphrase program take the SSID and password and generates a passphrase then creates wpa_supplicant.conf

Here is a list of possible issues I have come across over the years.

Code: [Select]
Wrong password.
Wrong SSID.
does not support hidden SSID.
does not support special characters in SSID or password.
Wifi adaptor does not support wifi channel selected on wifi router.
USB wifi adaptor and buit-in wifi adaptor both trying to run at the same time.
Some audio cards interfere with Raspberry Pi built-in wifi adaptors.
Wifi drivers changing from wext to nl80211 standard.
Occasionally, kernel upgrades break USB wifi drivers.

regards
Greg



Offline TimJ

  • WikiUser
  • *
  • Posts: 20
Re: Configure wifi without wifi.sh?
« Reply #11 on: June 01, 2018, 01:40:49 PM »
I expect that you are sorted by now, but anyway I wanted to do the same, for different reasons, and I found that the methed outlined by Misalf worked for me.

I explicitly made sure that the wifi.db was exactly the same format as produced by wifi.sh, ie field seperated by a sindle tab and no spaces. It might be worth a try.

Tim

Code: [Select]
$ hexdump -c ~/wifi.db
0000000   N   E   T   G   E   A   R   -   D   u   a   l   B   a   n   d
0000010   -   N  \t   1   7   4   9   8   8   6   9  \t   W   P   A  \n
0000020


Offline MagicMatt

  • WikiUser
  • *
  • Posts: 10
Re: Configure wifi without wifi.sh?
« Reply #12 on: June 03, 2018, 02:31:21 PM »
Sadly, no.

I'm becoming convinced that TinyCore 9.0.3 just doesn't work on the Pi Zero. It apparently works on Pi Zero W, but that's not what I have. I've even gone to the extent of buying a selection of different USB WiFi dongles, and purchasing the "official" Pi Zero USB hub. I've verified all the USB dongles work fine under Raspbian, which means I also know that the passwords are correct and that they are compatible with the network and the Pi hardware. TinyCore gives exactly the same issue all the time, even when using wifi.sh - it sees the networks, it just refuses to connect.