Note that it’s specifically ssh (lower-case) rather than SSH.
By default SSH access is disabled in Raspbian. To enable SSH, create a file called ssh and save it to the root directory of the boot mount on the SD card. The file can be blank, and it has no extensions. It should exist at the same location as the other files that were edited.
I re-flashed the emonSD on to a 16GB microSD card, added an amended wpa file, and an ssh file. I don’t have access to a microUSB keyboard or mouse, so just attached the Zero c/w EmonTx to a TV via HDMI; several boot pages scrolled up (too fast to read), but then stopped at this one.
Can one learn anything from what it says? Can one deduce whether or not it has connected to the internet? It still isn’t showing on my router’s CP, so I suspect not. I googled “Failed to start Log2Ran” but couldn’t find anything. I’ll give @djh 's usb>ssh url a try later.
Woo Hoo! Commenting out those two lines ( arm_freq=1200 and gpu_mem=16 ) & rebooting the Pi Zero, and it appears in the router’s CP.
After typing in the LAN IP I get the “Welcome to your emonPi” page. This is presumably what @lgheorghe was seeing on Getting setup wizard page instead of login . I clicked on the wifi option, and then after reconnecting to emonpi.local I get in to a bit of a loop - searching for networks (again).
Not sure how important this is - possibly related to the above - but above the Welcome page there is a warning message
**Warning** : file_get_contents(/etc/wpa_supplicant/wpa_supplicant.conf): failed to open stream: Permission denied in **/var/www/emoncms/Modules/setup/setup_model.php** on line **24**
The Pi is powered through my emonTx, with the wires connected as per @pb66 's second schematic:
4: 5v > 5v
6: Gnd > gnd
8: tx > tx
10: rx > rx
12: p12 > rts
I am able to ssh in to the Pi, but my linux skills are so limited that I although I am able to use some very basic commands (cd and ls etc), am not yet able to poke around (or change) anything. (EDITORS Note: Good job probably )
So, progress (thank you all), but still not quite there yet.
Well I suppose that setup_model.php is run as the pi user, so it won’t be able to read that, as it says. wpa_supplicant.conf is -rw-r–r-- 1 root root on my emonBase so I suppose you need to add the extra read permissions. i.e.
I don’t understand why it was -rw------- to begin with though. How was it created?
edit: I just looked at a pi zero i fairly recently set up with buster and wpa_supplicant.conf is root-only access on there too (there’s no emoncms on that m/c) so perhaps there’s some conflict between raspbian defaults and emoncms expectations? Maybe @TrystanLea would know?
Yeah those 2 lines have been an issue for quite sometime, unless you are running a Pi3. But I believe on the latest image @TrystanLea has now moved back to using the default setup (allowing the Pi to set these) which caters equally for all Pi’s.
What I believe is happening (and this is true and tested on the pre-emonscript images so may have carried over) is that your wpa_supplicant file in the boot directory is overwriting the OEM’s (modified permissions) file at start up as it is designed to in the OS image, then the OEM stuff (emoncms?) isn’t able to read/write as needed.
This has been addressed in previous images by loading the image to a sdcard then putting it in a Pi with Ethernet so that you can modify the location and symlink the OEM copy and then you can modify the wpa_supplicant file at will on a PC or via ssh or indeed still use the emoncms setup.
Brian or Trystan may be able to advise more on the current image, I have to say I thought this was going to be implemented on the emonScripts images TO enable the use of Pi Zero’s without any additional difficulties. Perhaps that was missed or not working quite right? What files do you have in the boot folder?
ls -la /boot
anything there wifi related that isn’t the wpa_supplicant file?
I would of expected putting a wpa_supplicant file in /boot “to work” too, the only reason it didn’t work on earlier images was that they booted in RO mode so the OS couldn’t over write the existing file with the one found in /boot. Although I would expect issues with the OEM WiFi setup due to permission issues, but the wifi should connect ok even if the wifi setup page isn’t able to modify it moving forward.
I don’t see anything there that looks WiFi related, other than your " ._wpa_supplicant.conf" file.
Because that is where you are supposed to put it if you want the OS to use a preset wpa_supplicant from the next boot.
Because that is/was “the fix” and the best way to ensure easy access to the wifi settings when there is no Ethernet to get around being “locked out” due to a network change of SSID or PSK, you can just whip out the SD card and edit any text file in the /boot partition from any OS, it doesn’t need to be mounted as a Linux file-system.
By putting the wpa_supplicant.conf file on the boot partition under any other name, strictly NOT “wpa_supplicant.conf” it will always be accessible and will not trigger an over write at boot time.
Numpty question: JFTAOD, and I don’t even know if it matters, but when I uploaded the wpa_supplicant.conf file to the SD card it was called just that … ie: wpa.suplicant.conf ; not sure why it now says _wpa_supplicant.conf . Or does this happen as part of the overwrite during boot?
The wpa_supplicant.conf file that gets used is the one in /etc/wpa_supplicant/. The one with the same name in /boot/ is used at first boot time to set that one up if you need wireless to work from first boot, just the same as the empty ssh file in /boot.