I am very interested in wpa_supplicant boot option because we can change very fast the configuration without change any cable, only dismounting SD and changing in a minute wpa_supplicant file in boot (I can do it by windows too).
I am trying to do it but I can not achieve, any recommendation?
Thanks
[moved from emonPi SD Card Build as thread has been quiet for 18mths and this is relevant to any emonSD]
The method you refer to is unlikely to work on the emonSD as the OS is read-only.
The Raspian feature of reading the wpa_supplicant.conf file from the boot partition at start up and using it to overwrite the pre-existing one at /etc/wpa_supplicant/wpa_supplicant.conf will fail as the target is not writable.
Perhaps Cygwin or a similar utility that allows you to access Linux partitions from windows, it you have another Linux device it may be easier to plug your card reader and sdcard into that to do it.
Actually there is a way to to set up the emonPi to allow editing in windows if you still have access to the emonPi now.
Add a file with the contents of your wpa_supplicant.conf in it, I recommend using a different file name to steer clear of the Raspbian feature (in case it deletes it) eg âwifi.confâ, and symlinking that file to where the file is currently would work.
i understand this, but I am using Raspberry PI zero and I am thinking in First boot without Ethernet.
Now I start the process with a Raspberry 2 with ethernet and then I move the SD to a Raspberry PI zero, I am trying to configure Wifi user and password before frist boot.
I am working with Virutal Box Ubuntu, I think nowadays there is not another solution.
Ah, yes. That is a weakness of the current emonSD.
I would certainly expect so, but I have no experience with using Virtual Box.
How many first boots are you anticipating? For one or two, accessing the image to edit via a linux OS (or utility) is going to be ok.
If you are deloying lots of Pi zeroâs or expacting to reinstall often, you could do my suggested move and symlink to one image using the Pi2 and create your own image for deploying to ther devices with an editable /boot/wifi.conf.
Or why not just keep a standard Raspbian SDcard for use in the Pi2 and plug your emonSD cards into that with a card reader for editing?
I am accesing to Linux partition without any problem.
Any of the other solutions you provied are more complicated for me.
I think the best option is to make this with a Pure Linux Distribution in a laptop (not a virtualbox). Virtualbox is a bit hard because I have to create a raw partition to access SD and I must do it manually and one by one.
I am very interested in this solution. Can you explain me better? I do not understand symlink and I do not understand the process in general.
Is it there any problem if I âopenâ the permissons to etc/network folder and I am able to change interfaces with Notepad ++ in Windows directly using Ext2fsd application
I need to take a closer look at this as I had forgotten that the emonSD images wpa_supplicant file is already symlinked and placed on the writable /data partition. This may play havoc on trying to edit the file whilst it is mounted on another host OS, either VM or Linux box etc.
The emonSD image is altered this way so that the wifi page from emoncms can edit the wifi details.
I think symlinking the file from /boot to /data might be easiest, I will need to study the emonpi fs again and give it a try to be sure.
Unfortunately it might not be that straight forward because of the way the emoncms wifi config module, the read-only filesystem and the windows compatible boot partition work.
In theory you could move and symlink the ~/data/wpa_supplicant.conf file to the /boot partition so that everyone can find it and you can edit it in windows, however from the Raspbian OS, only root can write to the /boot partition, so the emoncms module may fail to write to the symlinked file on the /boot partition. You could try it I guessâŚ
Moving the file to the /boot partition is an option but I would do this with caution as it may cause unintended consequences and cause issues with future updates.
OK, the right address is /data/wpa_supplicant.conf
I prefer to edit it via Virtual Box UBUNTU, When I use ExtFsd or other Pure Windows Tools I can not write because it is a Only-Read Partition.
How I can fix it using only windows? I can not change this without open Windows
Is it /data/wpa_supplicant.conf a writtable folder?
The correct address when mounted on the emonSDâd OS is /home/pi/data/wpa_supplicant.conf Glynâs reference of~/data/wpa_supplicant.conf uses â~â which is a linux shortcut for âthe current users home/root directoryâ which only when accessed via the emonSD by user pi will be /home/pi.
Since the 3rd partition is mounted as /home/pi/data that is the most accurate path whilst mounted ie via the emonSD OS.
data is an ext2 linux partition, when using a âwindows reader utilityâ to read the linux partition, it is not writable. However it is writable when mounted in a linux OS. The windows readers tend to make a copy of the file that windows can read, in which case any edits will be to a windows only copy file and not to the original linux file, so no change when you put the card back in the emonpi.
The ONLY way of doing it with âwindows onlyâ is to put the file on the vfat formatted boot partition, it is the only partition that is recognized by both linux and windows, that is the reason it exists.
This is always good advice, more so when editing the emonSD as itâs difficult to predict what may change. But since the wpa_supplicant.conf cannot be âjust overwrittenâ by the emonpi updater deleting and replacing it without losing users wifi settings, it is unlikely this move will prevent future updates. The one time I would predict trouble would be IF the OS was writable and a wpa_supplicant.conf file was accidentally added to the boot partition before a reboot, since the OS is RO and this function doesnât work, this is unlikely to happen.
Any move from âstockâ emonSD could comeback and bite you. But it is the only way to do this without a 2nd linux OS (VM or Pi etc) AFAICT.
1- Use Extfsd Windows aplication (it is able to write in writtable ext2 partitions). I like this option I will try it.
2- As Paul explain before make a symlink from data/wa_supplicant.conf to boot/wifi.conf. In this option I do not why you change the name of the file. I supouse you are preventing any problem copy/pasting a âwpa_supplicant.confâ file accidentaly as you explain.
I think I have more than enough solutions to do it very fast.