guysoft / OctoPi

Scripts to build OctoPi, a Raspberry PI distro for controlling 3D printers over the web
GNU General Public License v3.0
2.45k stars 366 forks source link

Unable to setup wifi on Octopi Bullseye arm64 lite 1.0.0 #809

Open flo269 opened 1 year ago

flo269 commented 1 year ago

What were you doing?

  1. Downloaded octopi-bullseye-arm64-lite-1.0.0.zip from releases
  2. Write image to SD card with Raspberry Pi Imager v.1.7.3
  3. Remount SD card and edit /boot/octopi-wpa-supplicant.txt with nano (removed the leading #'s for WPA/WPA2 and country, then added wifi config)
  4. Unmout
  5. Boot Raspberry Pi (Pi 3 Model B Rev 1.2) from SD Card

What did you expect to happen?

Octopi connecting to specified wifi

What happened instead?

Not connected to wifi

I was able to connect via Ethernet and everything worked fine that way. I just wasn't able to get wifi working. Also not via raspi-config. Octopi-wpa-supplicant.txt shows the edits made before via nano.

"sudo iwlist wlan0 scan" shows me my wifi, so it shouldn't be a hardware issue.

Also, when I repeat the steps above with the 32bit image, same SD card and same raspberry pi, it connects to my wifi and everything works as expected.

Please let me know if I can provide additional info or a log of some sort. Thanks!

Version of OctoPi

octopi-bullseye-arm64-lite-1.0.0

I have read the FAQ.

flo269 commented 1 year ago

For the record, this is what the relevant parts of my octopi-wpa-supplicant.txt look like:

## WPA/WPA2 secured
network={
  ssid="WifiSSID"
  psk="SecretOPassphrase"
}

## Open/unsecured
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#}

## WEP "secured"
##
## WEP can be cracked within minutes. If your network is still relying on this
## encryption scheme you should seriously consider to update your network ASAP.
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#  wep_key0="put password here"
#  wep_tx_keyidx=0
#}

# Uncomment the country your Pi is in to activate Wifi in RaspberryPi 3 B+ and above
# For full list see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
#country=GB # United Kingdom
#country=CA # Canada
country=DE # Germany
#country=FR # France
#country=US # United States
doucettom commented 1 year ago

I have the same exact problem.

doucettom commented 1 year ago

For the record, this is what the relevant parts of my octopi-wpa-supplicant.txt look like:

## WPA/WPA2 secured
network={
  ssid="WifiSSID"
  psk="SecretOPassphrase"
}

## Open/unsecured
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#}

## WEP "secured"
##
## WEP can be cracked within minutes. If your network is still relying on this
## encryption scheme you should seriously consider to update your network ASAP.
#network={
#  ssid="put SSID here"
#  key_mgmt=NONE
#  wep_key0="put password here"
#  wep_tx_keyidx=0
#}

# Uncomment the country your Pi is in to activate Wifi in RaspberryPi 3 B+ and above
# For full list see: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
#country=GB # United Kingdom
#country=CA # Canada
country=DE # Germany
#country=FR # France
#country=US # United States

You can try without specifying the country code.

doucettom commented 1 year ago

Ok I did further testing. I also edited the file with either nano or mousepad if that helps. I tried the 32bits version and it works like it always did so the issue is solely with the 64bits build. I didn't try the latest 64bits nightly though.

Uro1 commented 1 year ago

@doucettom There were issues reported in the rpi-imager repo about Raspberry Pi Imager failing to escape wifi password strings correctly in a few different cases.

You could try the pre-release v1.7.4 of Raspberry Pi Imager linked to in this issue comment to see if that fixes your Wifi issues as it seems to have fixed it for others: https://github.com/raspberrypi/rpi-imager/issues/541#issuecomment-1403794458

I also had problems getting this new release imaged correctly with v1.7.3 of Raspberry Pi Imager, every time it would fail to connect to my WiFi network, after double and triple checking my Wifi credentials in rpi-imager I resorted to unplugging it from my printer and hooking it up to a monitor to see what was going on, in the end with nothing obvious out of the ordinary I reset the WiFi credentials locally via raspi-config before I found the linked issue, it's not ideal having to tear down a headless printer in order to set the WiFi credentials. 😅

Please do report back if this fixes anything for you, as it may nudge the rpi-imager maintainers to release an official 1.7.4 build.

doucettom commented 1 year ago

@doucettom There were issues reported in the rpi-imager repo about Raspberry Pi Imager failing to escape wifi password strings correctly in a few different cases.

You could try the pre-release v1.7.4 of Raspberry Pi Imager linked to in this issue comment to see if that fixes your Wifi issues as it seems to have fixed it for others: raspberrypi/rpi-imager#541 (comment)

I also had problems getting this new release imaged correctly with v1.7.3 of Raspberry Pi Imager, every time it would fail to connect to my WiFi network, after double and triple checking my Wifi credentials in rpi-imager I resorted to unplugging it from my printer and hooking it up to a monitor to see what was going on, in the end with nothing obvious out of the ordinary I reset the WiFi credentials locally via raspi-config before I found the linked issue, it's not ideal having to tear down a headless printer in order to set the WiFi credentials. sweat_smile

Please do report back if this fixes anything for you, as it may nudge the rpi-imager maintainers to release an official 1.7.4 build.

Thanks for your reply. I am not using Windows to write the image to the SD card and the problem happened with a good old dd as well. I'll still give 1.7.4 a try if I can find a linux version.

Uro1 commented 1 year ago

There is a Linux .deb of the pre-release rpi-imager 1.7.4 in this comment, I should have also linked it in my previous comment: https://github.com/raspberrypi/rpi-imager/issues/486#issuecomment-1345625533

If you are not keen on installing pre-release/unoffical releases then you could always build it from source, the build instructions are in the README.md for the repo: https://github.com/raspberrypi/rpi-imager/blob/qml/README.md

spanzetta commented 1 year ago

I am not sure it is the same issue.. but I have Octoprint on Raspberry PI 3A+ running from over 2 years.. and it was always working.. Now it doesn't connect to wifi .. and the problem is that I configured (a while ago) the automatic Desktop start.. and when Desktop start the Keyboard doesn't work.. So now I am in stalemate condition:

cp2004 commented 1 year ago

If you have not just installed the OctoPi 1.0.0 64 bit image and you don't have the same problem as this issue, don't sidetrack this issue to your own problem. Head on over to the community forums or discord server where helpful people can help you troubleshoot.

flo269 commented 1 year ago

@doucettom There were issues reported in the rpi-imager repo about Raspberry Pi Imager failing to escape wifi password strings correctly in a few different cases.

I used the rpi-imager to write the sd, but I did not use the inbuilt functionality to preset the wifi credentials. So rpi-imager should not have changed the files written to the sd, it should just have "copied" them over.

What I failed to mention at the beginning is that I had also tried writing the image with dd and had the same (not working) result.

What I'm trying to say is, I don't think rpi-imager is the problem here. But I'm happy to be proven wrong. ;-)

doucettom commented 1 year ago

@doucettom There were issues reported in the rpi-imager repo about Raspberry Pi Imager failing to escape wifi password strings correctly in a few different cases.

I used the rpi-imager to write the sd, but I did not use the inbuilt functionality to preset the wifi credentials. So rpi-imager should not have changed the files written to the sd, it should just have "copied" them over.

What I failed to mention at the beginning is that I had also tried writing the image with dd and had the same (not working) result.

What I'm trying to say is, I don't think rpi-imager is the problem here. But I'm happy to be proven wrong. ;-)

Exact Same here but seemingly some special characters are causing troubles. I might try to convert it to hex to see if it goes through. This was suggested in one of the linked issues

flo269 commented 1 year ago

I just tried to connect to a wifi with a passphrase containing only upper and lowercase letters - no special characters. But same result: No connection. :-(

WolfiMuc commented 1 year ago

I had exactly the same issue with Octopi 1.0 on a Raspberry 4 installed using the Pi Imager.

Diving a bit deeper into it I discovered that only some of the wifi parameters from Pi Imager got transferred into the system. I'm using a hidden SSID and am living in "DE" - that's what I also specified in the Imager. After booting the Pi wifi was not up and I could only connect through ethernet. Turns out, in the system's native file "/etc/wpa_supplicant/wpa_supplicant.conf" the country was still set to GB and the switch "scan_ssid=1" in the network settings was missing. The SSID-name and password where correct, though. I changed the country-setting and added the scan_ssid parameter and voila - after a reboot wifi was working as expected.

WolfiMuc commented 1 year ago

I had exactly the same issue with Octopi 1.0 on a Raspberry 4 installed using the Pi Imager.

Diving a bit deeper into it I discovered that only some of the wifi parameters from Pi Imager got transferred into the system. I'm using a hidden SSID and am living in "DE" - that's what I also specified in the Imager. After booting the Pi wifi was not up and I could only connect through ethernet. Turns out, in the system's native file "/etc/wpa_supplicant/wpa_supplicant.conf" the country was still set to GB and the switch "scan_ssid=1" in the network settings was missing. The SSID-name and password where correct, though. I changed the country-setting and added the scan_ssid parameter and voila - after a reboot wifi was working as expected.

FYI - I also tried setting these parameters in the "/boot/octopi-wpa-supplicant.txt" without any luck...

doucettom commented 1 year ago

I was able to make it work by logging in via Ethernet port and do some manipulation with iwconfig but this won't work with a Raspberry Pi 3A+ or a Pi Zero 2W. I am not really able to plug my 3A+ on the think we'll have to get a new release from @guysoft that fixes this and luckily will also include 1.8.7 :)

guysoft commented 1 year ago

@doucettom do you remember what you had to change?

doucettom commented 1 year ago

@doucettom do you remember what you had to change?

Today's testing help me to find out that adding rfkill unblock wifi to rc.local make the wifi work even on headless Pi. This is a workaround and yes, the country domain is set. Wireless interface was soft blocked somehow

doucettom commented 1 year ago

@guysoft I also tried removing /var/lib/systemd/rfkill/ two files prior to booting my flashed instance and it worked. This was reported by a user in RC2 "main" issue thread.

dek3rr commented 9 months ago

this cmd did it for me rfkill unblock wlan

zahansellars commented 7 months ago

Bit of necro here but this is still an issue. It appears OctoPi no longer uses WPA-Supplicant If you select Wi-Fi hot spot in the Raspberry Pi Imager Wi-Fi will work but the WPA-Supplicant won't have that Wi-Fi info. If you then add an additional Wi-Fi hotspot in WPA Supplicant nothing happens. Not a massive issue for most people but i use my OctoPi instances with multiple Wi-Fi hotspots.

guysoft commented 7 months ago

@zahansellars You mean the file wpa-supplicant right? Or you mean the pi uses now NetworkMangaer?

zahansellars commented 7 months ago

Pi isn't using WPA-Supplicant. 3x separate pis tested (1x pi3b and 2x pi4bs). WiFi info from initial setup will work but doesn't push through to WPA supplicant file and any changes to that file don't seem to work. Connecting to an additional WiFi network from the optional raspian front end/gui also works.

Sent from Outlook for Androidhttps://aka.ms/AAb9ysg


From: Guy Sheffer @.> Sent: Sunday, November 26, 2023 8:09:11 PM To: guysoft/OctoPi @.> Cc: zahansellars @.>; Mention @.> Subject: Re: [guysoft/OctoPi] Unable to setup wifi on Octopi Bullseye arm64 lite 1.0.0 (Issue #809)

@zahansellarshttps://github.com/zahansellars You mean the file wpa-supplicant right? Or you mean the pi uses now NetworkMangaer?

— Reply to this email directly, view it on GitHubhttps://github.com/guysoft/OctoPi/issues/809#issuecomment-1826884339, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYMPWGFEQ2FEBIMG3MJPSLDYGOOWPAVCNFSM6AAAAAAVEQMXT6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWHA4DIMZTHE. You are receiving this because you were mentioned.Message ID: @.***>

Gaffalover commented 6 months ago

Hi, just had another look at this as I had the same problem.

Wifi is softblocked

pi@octopi:/etc $ rfkill list wifi 0: phy0: Wireless LAN Soft blocked: yes Hard blocked: no

For some reason this is due to the Wifi country code not set, although specified in octopi-wpa-supplicant.txt.

I ran sudo raspi-config nonint do_wifi_country DE and it works after reboot.

Alternatively run sudo raspi-config > 5 Localisation Options > L4 WLAN Country and pick the right one.

guysoft commented 5 months ago

Ah, ok, thats the issue. Rpi by default block the wifi and have a service to unblock it when the country. code is set.

In CustomPiOS I remove the code here: https://github.com/guysoft/CustomPiOS/blob/devel/src/modules/network/start_chroot_script#L31

Can you look if there is anything here?:

ls /var/lib/systemd/rfkill/
Kjubyte commented 2 months ago

I can confirm this issue. Works with armhf image, but not with arm64. After I set WLAN country with raspi-config and reboot, wlan starts to work.

Can you look if there is anything here?:

ls /var/lib/systemd/rfkill/
pi@octopi:~ $ ls -l /var/lib/systemd/rfkill/
total 12
-rw-r--r-- 1 root root 2 Sep 22  2022 platform-3f300000.mmcnr:wlan
-rw-r--r-- 1 root root 2 Sep 22  2022 platform-fe300000.mmcnr:wlan
-rw-r--r-- 1 root root 2 Sep 22  2022 platform-soc:bluetooth

Both wlan files contain 1, after fix its 0.

guysoft commented 2 weeks ago

On bookworm I get:

~ $ ls /var/lib/systemd/rfkill/
platform-1001100000.mmc:wlan  platform-107d50c000.serial:bluetooth

We have this line in the build: https://github.com/guysoft/CustomPiOS/blob/devel/src/modules/network/start_chroot_script#L32C8-L32C25

So its likely added in a different way

The build process does delete it for bullseye, I can see in the log:

 + rm /var/lib/systemd/rfkill/platform-3f300000.mmcnr:wlan /var/lib/systemd/rfkill/platform-fe300000.mmcnr:wlan