Really basic set up for emonCMS and Raspberry Pi?

Thanks, I didn’t realsie that the SD will now stay inside the RPi. I guess I have to take it out to install emonCMS as well… or maybe I can do that from the RPi via ethernet? I have the emon 08May21 release saved on my laptop but annoyingly it has no SD slot.

When I had the SD in the RPi, it came up with install options, and I selected Raspberry Pi (full) 32 bit OS. I wonder then if Noobs is just the bit of software that helps “noobs” like me to get set up?
It’s now doing a very slow “download & install updates” and it just says Raspberry Pi Operating System, nothing about noobs.
I will try to post a photo of the screen.

I wouldn’t know the answer to either of those, so I can’t help you. As I see it, you can either buy the pre-loaded SD card, or buy a card reader/writer. That might well be the better option long-term.

I really need either @TrystanLea or @borpin to help me out here.

Now that the OS is all updated, I’ve found the internet connection direct from the RPi - is there any reason I can’t download the emonCMS directly from the openenergymonitor github directly?
I checked the OS using cat /etc/os-release and it says “Raspbian GNU / Linux 10 (buster)” which I understand means Raspberry Pi OS version 10. I think “noobs” was a bit of a red herring.

That’s essentially it.
NOOBS stands for New Out Of Box Software.

Ref:

No reason. But if you do download the image and write it to the SD card you’ve written NOOBS on, everything on the card now will be overwritten by the emonSD image. As Robert mentioned a bit earlier, if you want to save the current contents of your SD card, you can save it to another device (e.g. laptop computer) as an image file before you overwrite the card with the emonSD image.

Otherwise, if you don’t mind losing what’s on the card now, simply write the emonSD image to the card.
Balena Etcher is one utility available that can do the job.

The Raspberry Pi Imager is another.

That said, the image method is the preferred way to get emonCMS up and running quickly with the fewest
number of problems.

There is another installation method, but it is quite a bit more involved.
As you are new to OEM, I’d recommend using the image.

Thank you Bill.
I don’t mind losing what’s on the SD, as long as the emonSD contains everything, including the OS… I think it does - it says it is “Based on Debian Raspberry Pi OS (32-bit) Lite, 2021-03-04”. The SD is 32GB.

  • You say I start with the SD in my laptop - as it has no SD, is there any reason I can’t do this all direct on the RPi? I found it helpful to have the screen etc plugged into the RPi so I could see what’s going on.
  • you say “first in emonHub…” I assume that will be accessible on the RPi when the emonSD has been installed.
  • The meters I bought come with two connections only for RS485/modbus, so there’s no allowance for an earth anyway.

Is the following the right procedure? I am assuming all will be done directly on the RPi (rehearsing here to follow later!):

  1. Download & install Etcher from: https://etcher.download/
  2. Download and install GParted from: GParted -- Download
  3. Download and save the image file “emonSD-08May21.img” from: Home · openenergymonitor/emonpi Wiki · GitHub (done already)
  4. Open Etcher and use it to set up the SD with emonSD
  5. Open GParted and expand the data partition (it’s the one that is not boot or rootfs ) as far as it will go
  6. Enable ssh OR set up a pair of key files following Robert’s guide.
  7. Set up wifi credentials (although I intend to connect by ethernet when installed)
  8. Connect a meter (although it won’t be measuring anything) to the RPi.
    (I assume for this test I can use any wire, I don’t have to use the fancy & fiddly RS485 cable that I have for the final installation).
  9. Open emonHub on the RPi, check you can see meter readings.
  10. Open your emonCMS online account, check you can see meter readings

Many thanks!

I found a thread saying I can install Etcher direct on the RPi, so this should all be good to go now.

A µSD card reader will solve that issue. Here’s an example:

https://www.amazon.co.uk/Beikell-High-speed-Adapter-Supports-MMC-Compatible-Windows/dp/B07L9VT8YY/ref=sr_1_3?dchild=1&keywords=usb+micro+sd+card+reader&qid=1628532637&sr=8-3

You don’t have to buy this specific reader. As long as the one you buy has a USB connector that matches the USB ports on your laptop machine, and a µSD card slot, it should work.

Indeed it does. The image is a “complete package.” i.e apps and OS all in one.

Although there is a method that enables installing emonSD directly on the Pi, it’s more involved than simply
writing the image file to a µSD card. As I mentioned earlier, the image is the recommended method.
Once you have a USB-µSD card reader, writing the image will be quick and easy.

Yes, emonHub is part of the emonSD image and will be available after the image is written to the SD card.

Yes and no.

Steps 1 through 5 are performed on your laptop computer. Step 6 is performed on both the RPi and your laptop computer. Step 8 will involve the RPi and your laptop machine, Step 9 and 10 will be performed on your laptop computer. If you won’t be using Wi-Fi at all, e.g. testing, you won’t need to do step 7.

  1. Yes. Performed on your laptop computer.

  2. This assumes a computer running Linux is available. If not, you can download and burn a copy of
    gparted live to a CD. If your laptop computer lacks a CDROM drive, gparted live can be written to, then
    booted from, a USB storage device. Get gparted live here: GParted -- Live CD/USB/PXE/HD

  3. As you mentioned, this one’s done.

  4. Yes. Performed on your laptop computer.

  5. Step 2 applies here as well. Performed on your laptop computer.

  6. You’ll generate the keys on your laptop, then copy them to your Pi.
    i.e. you enable SSH on the Pi AND set up a pair of keys.

  7. If you’re not going to use Wi-Fi, then you don’t need to set up Wi-Fi credentials.
    That assumes you’ll be using ethernet during testing as well as the final installation.

  8. Yes. You should be able to use any wire for testing your setup. Unless the distance betwenn your RPi
    and meters is short (a few metres) you’ll want to use the correct wire for your permanent installation.
    BTW, what’s the make and model of your meters?

  9. Yes. This can be done remotely via SSH as well as directly on the RPi.

  10. Yes. As the early versions of the RPi generally lack the raw “horsepower” to be usable web browsing
    platforms, most users do this step using another computer. That changed with the introduction of the RPi 4 as the “4” does have sufficient “oomph” to do the job.


Getting Modbus instruments “up and running” is not difficult, but neither is it trivial. At this point, I’d suggest
getting emonSD running first. Once you have it working properly, then tackle the Modbus part.

Another red herring.
The USB-SD card reader route is the way to go.

Brilliant, thank you VERY much, I have ordered a card reader/adapter as you suggest and will wade through those very comprehensive looking and clear instructions tomorrow.
Cheers,
Daniel

YVW,S!

What OS do you run on your laptop computer?

Robert’s instructions assume logging into the RPi from a machine running Linux.
(the link is in post 4, in this thread. Command Line Cheatsheet - #3 by Robert.Wall)

The next post in that thread has instructions applicable to a Windows box.

Thanks Bill,

My laptop runs Windows 10. I’ll look for those instructions.

Bill - sorry, but I can’t find the post to which you referred with instructions for a Windows machine (when you wrote “The next post in the thread has instructions applicable to a Windows box”). I can’t see anything that looks like a similar set of instructions… Would you mind please sharing a direction or link or just copying them here? The next post I can see is your one about another red herring. It may be that the thread I see is different from what you see? Just guessing from other platforms. Many thanks!

The link is in post 4 of this thread.
Command Line Cheatsheet - #3 by Robert Wall
(drag the light blue vertical bar at the right side of your screen upward, until the first number changes to 4).
slider

The instructions for a Windows box are in the second post of that thread

I note that nearly all the instructions end with a cheery “And you’re good to go”.
How, though, do I know that it is good to go? When I tried the first time and I set up the Raspberry pi with the raspberry OS the screen which was plugged into it showed a home screen like Windows does. This screen also showed a “power off” function - I understand teh Raspberry like sto be switched off rather than unplugged.
Now I’ve installed emonSD and I have just a black screen with a command line “pi@emonpi:~ $”. Is there something else needing doing?

Dear Bill, thank you I found some instructions, I have done the thing with the SD card, which is now in the RPi, it has run through lots of activity and now it’s asking for a emonpi login.
I have looked all over for login & password details but can find none. Am I missing something?

It seems it’s
User ID is pi and the password is emonpi2016

It sounds like you were succesful at writing the image to the µSD card.

That said, I think you may a bit confused.

Although your Pi now hosts an instance of emonCMS, you access it via a web browser from another
computer. e.g. your laptop machine. Configuration and administration are also done via the browser.
It’s actually quite rare that anyone uses a monitor and/or keyboard connected to the Pi itself.
That’s not to say it never happens, as there are times when it’s very handy or even necessary to have
them connected, but those instances usually involve troubleshooting, i.e not normal day to day operation.

Typically, a browser is “pointed at” ip_address_of_your_Pi/emoncms
As you have a monitor connected to your Pi, finding its IP address will be easy. If you don’t already have
a keyboard connected, connect a keyboard, log in, then type the command /sbin/ifconfig
That will give you some text that should look something like this:

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.105  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::4f80:c585:ef84:246f  prefixlen 64  scopeid 0x20<link>
        ether b8:27:eb:5f:ba:84  txqueuelen 1000  (Ethernet)
        RX packets 19793498  bytes 2072271914 (1.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 14819490  bytes 2312777407 (2.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In this example, the IP address is in the second line: 192.168.1.105
So, the text to enter in a browser URL box is: 192.168.1.105/emoncms

You’ll use the IP address the ifconfig command gives you.

When you log in for the the first time, you’ll see choices regarding ethernet and Wi-Fi.
After you make your choice, you’ll eventually get to the login screen.

IIRC, you need to register first. You only need to do that one time.
(I may not have this sequence 100% correct. I haven’t run emonCMS for about 4 years, and
many changes have been made in that span of time)

Yes, the first time, you do need to register, choose and set a user name, an email address (why? - I don’t know, it never emails me) and choose and set a password that you will use for emonCMS alone.

If memory serves, that’s because the mailer app needs to be installed and configured.

Ref:

sendmail?

I think it’s called SwiftMailer.
At least that’s what a search turns up.
I added a link to my post.