Notifications
Clear all

Multiple Wifi network credentials  

  RSS
Maxiprint
(@maxiprint)
Eminent Member
Multiple Wifi network credentials

Hi

TL;DR: is is possible to have multiple WiFi credentials with Prusa link?

I have 2 WiFi Networks where I stay. And I need to switch between then from time to time.
I know you can manually add credentials to a file on the SD card. Or have 2 SD cards that you swap. But how would affect my Prusa Link and Connect settings?
Possible? Asking from those who tried it. Otherwise, I' just stay on the one.

Ce sujet a été modifié il y a 3 months par Maxiprint
Publié : 27/09/2024 12:56 pm
Walter Layher
(@walter-layher)
Prominent Member
RE: Multiple Wifi network credentials

In this thread there are some solutions for this, working for several different versions of RaspiOS:
https://raspberrypi.stackexchange.com/questions/11631/how-to-setup-multiple-wifi-networks
I myself have used the one with editing wpa_supplicant.conf to use a Raspi Zero W at home and with my mobile hotspot without re-configuring it every time.

Publié : 27/09/2024 3:55 pm
Maxiprint
(@maxiprint)
Eminent Member
Topic starter answered:
RE: Multiple Wifi network credentials
Posted by: @walter-layher

In this thread there are some solutions for this, working for several different versions of RaspiOS:
https://raspberrypi.stackexchange.com/questions/11631/how-to-setup-multiple-wifi-networks
I myself have used the one with editing wpa_supplicant.conf to use a Raspi Zero W at home and with my mobile hotspot without re-configuring it every time.

Some good advice there. I will do another SD card tomorrow and test it.
Thanks!

 

Publié : 27/09/2024 4:17 pm
Walter Layher
(@walter-layher)
Prominent Member
RE: Multiple Wifi network credentials

I just tested it again on my CUBOTino running RaspiOS (debian_version says it is debian 11.8).
I executed the command below and it gave me a working entry that I could append to the file /etc/wpa_supplicant/wpa_supplicant.conf on my Pi Zero W. After rebooting the Pi I switched off my main WiFi network and the Pi connected instantly to my mobile hotspot without interaction from me. I don't know if it will work the same way with Prusa's version of RaspiOS.

pi@someraspi ~ $ wpa_passphrase "My Secret SSID" "My very secret password"
network={
        ssid="My Secret SSID"
        #psk="My very secret password"
        psk=82b18943c9a51e43f1e0ca9c3594965d2c926f7cc6f5fa79233440a470eac6d9
}
Publié : 27/09/2024 6:35 pm
Maxiprint
(@maxiprint)
Eminent Member
Topic starter answered:
RE: Multiple Wifi network credentials

It is still Debian back end. Prusa link or Octoprint are just layers on top of that.
You can still SSH into it as with standard Debian. (that is how I tested my Pi Zero 2 W).
From what I learned from your article in your first reply, with wpa_supplicant.conf you can add multiple instances of your WiFi credentials.Like:
network={ ssid="My Secret SSID" #psk="My very secret password" }

The available network will automatically be selected then.

I will do this tomorrow, just concerned how Prusa link and Connect will deal with it. But you learn by testing!

Publié : 27/09/2024 7:05 pm
Walter Layher
(@walter-layher)
Prominent Member
RE:

From what I have heard newer debian versions (12+) use NetworkManager for WiFi now. I have not tested WiFi on one of those yet so I cannot say if this method is compatible with them.
But with the wpa_supplicant.conf configuration you can have as many network entries as you want or need. You can also add a line with "priority=1", "priority=2" etc. to each network block in order of your preference, in case two or more are available at the same location.
Also you need to put the password through a hashing program with debian 11, because it will not connect if you put in the password in clear text into the file. That is what the program "wpa_passphrase" is for.

Publié : 27/09/2024 7:28 pm
_KaszpiR_
(@_kaszpir_)
Prominent Member
RE: Multiple Wifi network credentials

Configuration file can include one or more 'network' blocks

which means you can have multiple 'network={ ... }' sections in the config, for each specific network. Priority can be used if those networks are available in the same moment. 

https://w1.fi/cgit/hostap/plain/wpa_supplicant/wpa_supplicant.conf

 

See my GitHub and printables.com for some 3d stuff that you may like.

Publié : 27/09/2024 8:48 pm
Partager :