I think I now have all of the bits I need, but a couple of quick questions as the PiZero doesn’t show up within my router’s CP (although the small green LED does come on / flash) …
I added a (blank) ssh.txt file and a wpa_supplicant.conf file to the boot partition - the contents of the latter being
Should I expect the Pi Zero to “work” without being connected to an emonTx or not? Maybe I have tried to run before I can walk, as I have not yet connected the emonTx.
Yes get the Pi working first and it should just work IME. If not, connect up to a monitor and see what it is saying. If a new emonSD image, usual caveats re allowing it to finish updating before removing power or rebooting.
Many thanks; still not appearing in my router’s list of clients, so probably a wifi thing. I needed to obtain a mini-HDMI adapter (just arrived now), so will try to hook up a monitor tomorrow.
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?