Community
OpenEnergyMonitor

Community

Can't connect to emonBase with ssh

emonbase
ssh
Tags: #<Tag:0x00007f16a6d45238> #<Tag:0x00007f16a6d450f8>

(Robert Wall) #21

If the button itself works, there’s only one implication there: you had a faulty connection that allowed a drop-out.


(Trystan Lea) #22

Actually thinking about it, its likely because the code that handles the push button is part of the emonPiLCD script, with the emonPiLCD not present I notice the script is not active on my emonbase at home. Which suggests this isn’t an option. @glyn.hudson can confirm to be sure.


(Trystan Lea) #23

@djh if you need an SD card reader or adapter, drop us a message at [email protected] and we will send one over.

If you have a standard sized SD card reader we have plenty of the adapters that go from the older standard size to the micro SD card size.


(Greebo) #24

@TrystanLea, maybe these adapters should be included by default in any SD Card image orders from the shop that don’t also include an emonPi? I’ve seen a lot of external card readers, none of which handled micro-SD cards without an adapter.


(Dave Howorth) #25

Hi Tristan, thanks for the offer. I already ordered one. I have two readers but neither takes microSD. I’d found some online but Robert alerted me to the existence of adapters.

I do tend to agree with Greebo’s suggestion though. It would have been useful to have one included as long as it is necessary.


(Glyn Hudson) #26

Trying to simulate a push button won’t work since the emonPi LCD script kills itself on startup if no I2C LCD is detected, as is the case on an emonBase.

If no button / LCD is present SSH can be enabled by adding a file called ssh to the /boot partition. This can be done externally to the Pi using a micro SD card reader (the /boot partition is FAT so will mount on WIndows). Or the /boot/ssh fie can be created on the device using a attached usb keyboard.

You will need to login with username pi and pass emonpi2016 then run

sudo touch /boot/ssh

Then reboot.

Alternatively you could run

sudo /home/pi/emonpi/lcd/enablessh.sh


(Trystan Lea) #27

@glyn.hudson the issue here was that @djh did not have a SD card reader handy, and so we were trying to work out another way of helping him.

I think we can do that, will double check with @glyn.hudson and @Gwil :slight_smile:


(Glyn Hudson) #28

Sure we can include and adaptor. We have plenty spare.

I was wondering it they keyboard and hdmi monitor method I mentioned above would be a possibility as simulating button press won’t work since script. Is not running on emonBase.


(Dave Howorth) #29

It would be if I had an HDMI lead :frowning: I might buy one today; I think I should have a spare.


(Glyn Hudson) #30

Could you ‘borrow’ an HDMI lead from your PC or TV?! It will only be needed for a few min. Although the same goes for a micro SD card adaptor. In the future we will be shipping all emonBase with an SD card adaptor.


(Dave Howorth) #31

Status update: as mentioned on the ssh disabled thread, I just got ssh to work. I have a microSD card adapter on order but I went out today and bought an HDMI cable, so I’ve done it by attaching a monitor and console. (There’s no way I’m extracting a cable from the rat’s nest that is my hi-fi, and I need my PC working whilst I play with the emonBase)

I created the /boot/ssh file, though I couldn’t do what I wanted. I first tried ‘sudo cat’-ting some text into the file to remind me what it’s there for in the future, but I got a permission error. So I used touch. I still don’t see what the problem is with putting some text in the file, unless its something sudo specific? (I hardly ever use sudo)

More seriously, even with the /boot/ssh file in place, the server still wasn’t active. So I decided to try another technique. I went to https://www.raspberrypi.org/documentation/remote-access/ssh/ and tried the systemctl method, but that asks for the root password and I don’t know what that is. Should I?

So then I tried raspi-config and that worked as advertised, so I logged in via ssh and got a long OpenEnergy login message. But there’s nothing there prompting me to change my password!?

Of course I can change it myself, but I’ll wait until I have a better understanding of why I didn’t get prompted, and also until my microSD card adapter arrives. I don’t fancy locking myself out of the machine without root access.


(Dave Howorth) #32

Ah, OK. I now understand that root access is disabled on the pi so I just have to gird my loins to change the pi user password. And perhaps systemctl would have worked if I used sudo? I need to think of a harmless systemctl command that needs rootly powers to experiment.


(Glyn Hudson) #33

Did you reboot after adding the /boot/ssh file?

sudo should be required to write a file into the /boot partition. I think the ssh file should be blank, I’ve not tested with contents in the file. I’m not sure if this would effect the operation


(Dave Howorth) #34

No, the page https://guide.openenergymonitor.org/technical/credentials/ doesn’t say it is necessary. But I prefer one of the other conventional mechanisms to enable a service without rebooting.

Yes, agreed. What I don’t understand is why I can’t write contents in the file, even if it’s the wrong thing to do. Though I’ll be surprised if whatever script uses that file to control the service actually checks not only whether it is present but also whether it is empty.


(Glyn Hudson) #35

Ìt is neccerarry. I will as this to the guide.

Alterantcaly you could just run

~/emonpi/lcd/enablessh.sh

which runs these two commands:

sudo update-rc.d ssh enable
sudo invoke-rc.d ssh start