Hi, I have built the Pirate Radio since a long time and it worked like a charm. Lastly I have changed my Internet LiveBox and so the WiFi code has changed. So I have used the command sudo nano /etc/wpa_supplicant/wpa_supplicant.conf to modify the SSID and Password accordingly in the Pi system. But it seems my changes are not taken into account despite the fact I used Ctrl x, Yes, and after Reboot the Radio Kit can’t connect to the Internet . I have understood thet the PI system in the Radio Kit is copied to a Swapfile. So I guess it could be that the swapfile changes are not recopied in the SD card and so at reboot I retrieve always the previous set-up. As I am not a Linux expert I don’t know how to set-up all this easily. I am afraid. Can you help ? Thks. Jean
If you’re using our “Pirate Python” Pirate Radio software then the running system is all in something called a “ram disk” which, as the name suggests, is a disk in RAM. You’re right- it’s never synced back to the SD card, intentionally so to avoid any configuration changes breaking the system, and additionally to mitigate any possibility of card corruption during the fairly turmultuous usage pattern of a radio.
The file you need to edit is the wpa_supplicant.conf
directly on the root of the SD card, within that would be otherwise the /boot
partition. It’s best to do this from a host computer. This file is copied over the ramdisk /etc/wpa_supplicant.conf
at boot.
If you need a template file to start from, you can find it here: https://github.com/pimoroni/PiratePython/blob/master/sdcard/wpa_supplicant.conf
Dear Sir I’am afraid because I don’t know how to edit the wpa_supplicant.conf directly on the root of the SD card. The SD card is no longer available for me because the entire system is located in the RAM when the PI Radio is activated. Can you tell me what Linux command I should use in order to perform such a trick ? My Pi Radio is connected to an Hdmi Monitor and to a keyboard. Otherwise I can put the SD card in a card reader linked to my PC but this one is Windows 7 only … Dear oh Dear it is crazy this kind of situation.
You should be fine putting it in a PC and editing it from there. Particularly so if that’s the PC from whence you originally prepared the SD card. The /boot
partition (or so it is named from the perspective of Linux) is actually just “the entire SD card” which should be formatted in a way that pretty much any computer can read. If you put it into your SD card reader and connect to your computer, you should see a new drive pop up with a wealth of files including settings.txt
and maybe even an existing wpa_supplicant.conf
I suspect there are ways to mount and edit it directly from the Pi, but they may be more prone to error.
Sorry again. I have put the SD card in a reader connected to my Windows 7 PC. I have opened the new drive directory where I have seen several files, such as settings.txt, but no wpa_supplicant.conf file So I have opend my txt editor, entered the correct generic data including correct SSID and WiFi password, then I have saved that file onto the SD card, and named it wpa_supplicant.conf then ejected the SD card, put into the Pi Zero Radio, activate the PI and … damned it doesn’t work! Or may I am a stupid idiot! Use this process two times and it failed each time… So I am pretty sure there could be a way some how to reinject the RAM disk newly modified /etc/wpa_supplicant/wpa_supplicant.conf into the SD card using the PI keyboard through SSH so that all will be correct , so that it will not be the ancient SD card wpa_supplicant.conf which will be copied in RAM at next PI boot. But the fact is that I don’t know the Hell command to do that. And so I am a bit surprised that there is not any PI Radio user who has been already in front of this WiFI code change during his Pi Radio life and also that the way to solve that without reformatting the SD card has not been yet documented. But, that’s life. Anyway, if anyone can help he/she is welcome! Thanks
If you boot up the Pi with your display and keyboard, and run cat /etc/wpa_supplicant/wpa_supplicant.conf
do you see the contents of the file you created and placed onto the SD card?
Yes sure when I do that I see the content of the wpa_supplicant.conf file. But I am quite sure it is not the one on the SD card! It is the one in the RAM disk. My question is : While the system is living in the RAM disk (beacause my Pi is running but with no WiFi) how can I edit the wpa_supplicant.conf file in the SD card in order that at next boot it will be copied in the RAM disk ? It seems quite clear to understand but not so easy to do ! In fact even if the system is in the RAM disk, is it possible to “see” the SD card content ?
Hello,
I see from the above that you have a monitor and a keyboard attached.
Have you tried doing it the old fashioned way ?
sudo raspi-config
https://www.raspberrypi.org/documentation/configuration/raspi-config.md
(I think Option 2 is for the network settings.)
Hope that helps,
Simon.
Yes for sure I have tried this. But for the same result. In fact it is logical : In doing that you change the config of the system for next boot, but, as the system is in RAM the changes can’t be memorized for next PI boot as the RAM content faints at each new boot and is not copied over the previous config in the SD card. Hummmm ?
It seems that my only solution is to reformat a SD card and reinstall all that pieces of software but, you know, I find this neither elegant nor practical !
The RAM is volatile - when the power is off, the data disappears. So you need to back the completed files off to SD card every now and again. SO MY QUESTION IS : HOW TO DO THAT ?
OK OK I reformat the SD Card …