emoncms: clean install in 5 commands

Got my second (full time dev) pi today. I just downloaded the latest raspian SD image and have got emoncms working in under ten five (with some suggestions from the forum) commands.

Just a reminder that the pkg-emoncms readme has the definitive installation guide for debian packaged emoncms. Please feel free to contribute improvements directly there :)

After running through the install, I registered for emoncms on the dev pi and grabbed my API write key, then set my "live" pi to forward on to the dev one (my live Pi is running the emoncms-module-rfm12pi package - the "raspberrypi" module - so this is configured from inside emoncms).

Inputs started flashing up immediately.

Obviously not feature complete (no PECL stuff for instance) and I've not tested all combinations of feed type and visualisation, but I'm quite encouraged nonetheless.

 

[final edit - just links to the documentation. Fewer places to maintain!]

ukmoose's picture

Re: emoncms: clean install in 5 commands

Looking good! To make this thread more useful for the slightly less experienced Pi user.

I'm guessing that following the command:

sudo vi /etc/apt/sources.list

You added the following line?

deb http://emon-repo.s3.amazonaws.com wheezy unstable

And if the text editor vi scares you, the same can be achieved using

sudo nano /etc/apt/sources.list

 

 

 

Schism's picture

Re: emoncms: clean install in 5 commands

Yeah, sorry - I should perhaps comment on some of the commands (when you install mysql-server you have to choose a non-empty root password, for instance).

The first command could be replaced with

sudo echo 'deb http://emon-repo.s3.amazonaws.com wheezy unstable' \
  >> /etc/apt/sources.list

and in fact, I'll edit the OP to make that clear :)

Ian Eagland's picture

Re: emoncms: clean install in 5 commands

Hi

Cleaned down my test PI and did a fresh installation.

All worked without a hitch following details above.

How do you set up live PI to forward to test PI?

A screen shot of a working set up would do the trick. I just need to know what goes where. I have API key and test PI network address.

Regards

Ian

 

pb66's picture

Re: emoncms: clean install in 5 commands

The packaging works really well

Is there a reason you chose to install mysql-server & mysql-client independently? Since they are installed as dependencies with emoncms, using just the one 

sudo apt-get install emoncms

line in place of the 3 install lines has worked well for me. in fact using

sudo apt-get -y --force-yes install emoncms

works even better because it bypasses the "ok to install?" & "ok to use alternative repo?" confirmation steps and takes you straight through to the mySQL password & emonCMS settings.

That makes it just 6​ commands, pretty cool!

Paul

pb66's picture

Re: emoncms: clean install in 5 commands

Ian - If using oem_gateway image the details go in the oemgateway.conf or if you're using the hdd image on your live pi (which i believe you are) do have the rfm2pi module installed? as you should be able to enter details on the raspberry pi page of emoncms as shown here http://emoncms.org/site/docs/raspberrypihdd and enter you're local test pi details in place of "emonCMS.org" details.

Sorry no screenshot as i am using oem_gateway on live pi and do not have rfm2pi module installed on test pi right now.

Paul

Schism's picture

Re: emoncms: clean install in 5 commands

@Paul - thanks for the feedback. This was literally the result of me running "history" on the prompt, so it's not perfect - I didn't rehearse ;-)

I've updated it with your command instead. I wanted to install mysql first so I could satisfy myself that it was set up by logging in, before I installed emoncms and committed the credentials. However, that's belt and braces (my live Pi was an image downloaded from this site, so I hadn't previously built from scratch).

@Ian - on my live Pi I've installed emoncms-module-rfm12pi (the "raspberrypi" module). Within emoncms when you are setting this up, you can fill out forwarding details as Paul has shown. I just used the local IP address of my test pi.

This is mainly so I don't need to buy another RFM12Pi board just for my test pi...

Ian Eagland's picture

Re: emoncms: clean install in 5 commands

Thanks

I had set this up with the wrong domain name.

Corrected and I now have "Authentication successful"

But I still do not see inputs so I guess I still have something wrong on the raspberrypi module set up.

Should there be anything other than / in Path to emoncms

Regards

Ian

Schism's picture

Re: emoncms: clean install in 5 commands

Ian, it's probably /emoncms - is that not the URL you use to view things on the test Pi?

Ian Eagland's picture

Re: emoncms: clean install in 5 commands

Hi

I was being slow. I don't have a RFM12B module. My PI is a remote server on a fixed IP address using the internet to get data from an emontx in a completely different location.

I have just realized the Raspberry Pi module is a RFM12 to Pi interface script, so presumably it will not forward the data unless it is received by radio.

I don't think I will bother to pursue data forwarding.  My interest is just to make sure that version 8 is debugged before I bite the bullet and upgrade my live PI. I don't want to lose any data or functionality.

Regards

Ian

Schism's picture

Re: emoncms: clean install in 5 commands

No problem Ian. I think the Python forwarder should be able to do what you want (and I strongly recommend you give it a try before upgrading, as I've had a few teething issues with my v7 to v8 upgrade)

borpin123's picture

Re: emoncms: clean install in 5 commands

Will this work on an i386 machine?  I am getting

W: Failed to fetch http://emon-repo.s3.amazonaws.com/dists/'lsb_release/-cs'/binary-i386/Pa... 404  Not Found

It may be I added the command into sources.list wrong (as I did it via nano).

pb66's picture

Re: emoncms: clean install in 5 commands

Yes the oemgateway will do the job I tried it out last night.

Works really well but a bit fiddy to install, if only there was a way to the installation steps easier .....(hint, hint)

Paul

ps probably just work in progress but thought I should mention the new repo url is not working but the old one still is.

tgmaxx's picture

Re: emoncms: clean install in 5 commands

That is better because lsb_release was not installed on my pi, so I assume the same for others?

 

 

Schism's picture

Re: emoncms: clean install in 5 commands

Hmm, I thought the whole point of LSB was that it was distro agnostic :(

I've updated the readme to suggest a slightly longer-winded, but ultimately more useful, way of setting up sources.list.

Cheers!

pb66's picture

Re: emoncms: clean install in 5 commands

your metion of LSB rang a distant bell with me and the penny has just dropped, I frequently get this message in amongst other messages 

insserv: warning: script 'mathkernel' missing LSB tags and overrides

it is not unique to any one image or install I have had it for months despite regular rebuilds and updates, I once briefly googled it and I vaguely recall something to do with the recent inclusion of "wolfram" in the Rasbian image as standard and that general consensus was it was just an annoyance so I have just ignored it. is this remotely linked ? ie the LSB tags are actually missing.

PB

Schism's picture

Re: emoncms: clean install in 5 commands

When I originally started looking at the debianization, I went with the raspberry pi module mainly because I liked the ease of configuring (via the emoncms interface), but there was some discussion over whether one or the other gateway should be preferred, to avoid splitting maintainer effort.

My experience since starting, especially with the v8 upgrade, has highlighted that the OEM gateway is almost certainly the more robust choice. The module weirds me out with the way it runs some of the PHP from the apache docroot as a daemon (with root permissions).

I'll turn my hand to packaging the OEM gateway soon, I promise :)

re: LSB - I have no idea. I just got it as a google result when trying to find a simple command that would return the distro...

borpin123's picture

Re: emoncms: clean install in 5 commands

I think the lsb_release command simply replaces the current release into the line added to sources.list.  In my case the machine I am trying it on is still on Lucid so apt just ignores it (if I put the repo in manually as wheezy).

Can you pull the deb off directly (wget)? I have found things like this are usually Ok even if it is not the right distro.

youngsyt's picture

Re: emoncms: clean install in 5 commands

Hi

I've been learning about the the various module and nodes since before Christmas and have EmonTHs and EmonTx v2 and v3 working with a RaspberryPi as the Emoncms central node running on an usb hard drive. My ultimate aim is to get a multi zone heating control system working to emulate the Owl Intuition system but without the dependency on an external server.

I would just like to thank everybody involved for the tremendous amount of work that has gone into getting the system where it is today.

To cut to the chase, I've been following the pkg-emocms readme instructions line by line. Everything appears to load OK except for the mathkernel warning shown above. However when I try to login into the emoncms  web interface I get this:

Can't connect to redis database, it may be that redis-server is not installed or started etc

I've tried a number of clean installs with the same result. I'm now out of my depth and am in desperate need of help to get Emoncms running again.

Thanks in advance.

 

Schism's picture

Re: emoncms: clean install in 5 commands

Hi, try: sudo apt-get install redis-server ?

Redis is supposed to be optional in v8 to avoid this type of issue, so I haven't paid too much attention to that side of the install. I did include the PECL part for completeness but in retrospect, this won't install the server part.

Has that helped?

pb66's picture

Re: emoncms: clean install in 5 commands

I have just tried upgrading my working emoncms v8.0.7 with redis and broke it, same error message. sudo apt-get install redis-server seems to of sorted it out.

Paul

youngsyt's picture

Re: emoncms: clean install in 5 commands

Hi

 

Thanks for both of your responses.

That fixed the problem. I have registered a user and set up frequency, group and node IDs along with the emonglcd broadcast time (5 secs ).

Unfortunately I  have another problem. The green activity light on the RFM12Pi is now permanently on when previously, before I did the Redis fix it was flashing occasionally indicating it was receiving packets. When I go into Emoncms and look at the Raspberry Pi settings, after I have done an Inform EmonCMS that run script is running, I get no date has been received from the RFM12Pi in the last 30s. Check if the Pi interface script is running, if not you may need to configure cron. When I check whether the run script is running I get false returned.

A few details:

All nodes working at 868MHz.

Raspberry Pi v2 over clocked at 900MHz.

RFM12Pi v2 from the shop updated with the latest firmware ( Although I don't know how to check it )

Rapbian Wheezy running from USB hard drive.

2 x EmonTH. One monitoring boiler flow and return temperature. The other one monitoring room temperature.

1 x EmonTX v3 sending RF packets but not doing anything useful at the moment. Mainly used to check range of RF with SMA connector and 433MHZ aerial (half wave length at 868MHz). It works well from one end of my house to the other diagonally through three walls.

1x EmonTX v2. Used for experiments in heating control. Presently set up to drive two relays, driven from EmonCMS using PacketGen.

1x EmonGLCD. Working but not doing anything useful at the moment apart from measuring the temperature in my office. Ultimately would like to use as display and controller for Multi Zone system.

 

Should I continue pursuing my problems in this thread or start a new one for this particular problem. From my perspective I would like us to end up with an idiots guide for installing EmonCMS from APT so that it is made straight forward to get a system up and running for people who are new to all this. That would be my way of giving something back to the community.

 

Terry 

 

pb66's picture

Re: emoncms: clean install in 5 commands

Hi Terry - I would recommend starting another thread with a more specific title and then post here with a link if the solution warrants it, that is to say if it is related to the process of installing the packages rather than how the content of what's installed operates, if that makes sense.

Paul

youngsyt's picture

Re: emoncms: clean install in 5 commands

Thanks Paul. I have started a new thread.

 

Terry

pb66's picture

Re: emoncms: clean install in 5 commands

please see http://openenergymonitor.org/emon/node/4777#comment-20231. 

Should the rfm2pi module package edit the inittab automatically or do we need to better document which of the manual steps are still required when using apt rather than git. also a little reminder about editing cmdline.txt for users starting with a fresh image maybe wise.

whilst trying to get rfm2pi working I noticed a couple of (what I thought were) odd file locations are these correct ?

1. README.md located in /var/www/emoncms/Modules/event

2. README.md missing from /usr/share/emoncms/www/Modules/event

3. rfm12piphp missing from /usr/share/emoncms/www/Modules/raspberrypi

4. rfm12piphp located in /usr/share/emoncms/www/Modules/node

5. rfm12pi_run.php located in /usr/share/emoncms/www/Modules/node

Paul

Schism's picture

Re: emoncms: clean install in 5 commands

Hey,

Thanks for picking these up. I'm not sure about the node module, that isn't one of the three I've "officially" added support for (emoncms, event and raspberrypi). I might have a tester for the node module on the apt repo from my early experiments I guess?

I have edited 1 -> 2 (will need to redeploy the package at some point for that to be picked up).

For 3 etc. the raspberrypi module (debian version) installs to the Modules/raspberrypi/ directory, see https://github.com/Dave-McCraw/pkg-emoncms-module-rfm12pi/blob/master/debian/install although indeed it doesn't try to do anything with the rfm12piphp script except deploy it to /etc/init.d

Would there be any reason for the rfm12piphp script to be in www/Modules/raspberrypi? AFAIK it's just run directly (as a 'service') from /etc/init.d?

I don't follow the references to inittab and cmdline.txt - as far as I know I've never tried to change either (which readme are you getting that from?)

cheers,

D.

 

pb66's picture

Re: emoncms: clean install in 5 commands

Hi Dave

Re 3 no. not a problem I just expected it to be there as references are made to it in pre apt documentation eg to copy it to /etc/init.d when manually installing etc so I wasn't sure if it was missing as I could see it on git.

re inittab - for the rfm2pi to work the inittab needs to be edited, the last line must be commented out, it was previously part of the raspberrypi module installation. It needs to either be done automatically by installing the rfm2pi module package or highlighted as a manual step in the install guide.

re cmdline.txt - no I don't think anything should be done it by the apt packages, but I think if it's essential the cmdline.txt is modified from the standard raspbian image it should be noted in the install documentation as some users may start from scratch and not be aware it is assumed to be done.

check the first and last sections here http://emoncms.org/site/docs/raspberrypihddbuild

Paul

Schism's picture

Re: emoncms: clean install in 5 commands

Wow... two very important bits of info there!

OK, it seems to me that what we're really saying is that owners of the rfm12pi board need to edit cmdline.txt and inittab, otherwise nothing on the Pi can use the board - emoncms-module-rfm12pi or otherwise.

I wonder if it would be worth creating a utility debian package, maybe 'rfm12pi-config', which just configures the Pi for rfm12pi use, that could then be a dependency of both the emoncms module and (in time) the OEM gateway package? 

Bit less duplication then if they ever ship an updated Pi where something else needs modified...

pb66's picture

Re: emoncms: clean install in 5 commands

I think the cmdline.txt edit is pretty common and a reminder should suffice, so many installs require the same edit that the majority of users will of encountered this before and a fair few existing systems having emoncms added to them will already be edited. It's just needed in the readme for completeness so if you take a virgin image and do this it will work,

Note the cmdline.txt can also be very easily edited with a pc as it's on the fat boot partition, there is also tool https://github.com/lurch/rpi-serial-console but I think is over kill for this purpose and actually adds steps to what is a simple edit. 

Regards the inittab, Yes it would be better if it was automated but I do not know if that is considered acceptable or even possible with guaranteed consistent results, due to other settings and shared resources etc. 

I'm all for the more modular approach and think the rfm2pi should definitely be more independent or more precisely the emoncms (and maybe oemgateway) should be absent of rfm2pi components by default as not every install has (or can have) a rfm2pi. there are a few reasons I think this approach is better but for this threads topic an independent rfm2pi module would keep the emoncms installation clear, applicable to all and to a minimum number of steps, by effectively moving these 2 manual steps ( 3 including "sudo service rfm12piphp restart") to another installation document.

If the oemgateway follows the debian package route all then the same details and steps will need to be duplicated in that packages instructions too or just add a link to the rfm2pi install doc if it's independent.

Paul

 

Schism's picture

Re: emoncms: clean install in 5 commands

I think I'll look at what would be required to package and configure the oem gateway first, so I understand both systems.

Ideally there would be three systems I think, of which the OEM gateway and raspberrypi module are sort of spanning two or three at a time:

An "rfm12pi interfacer" which deals with turning radio transmissions into inputs

An "input marshaller" which accepts inputs from any source (the rfm12pi interfacer just being one example) and can be configured to forward to multiple local / remote emoncms installations

Emoncms itself, which exposes a standard API for inputs and deals with storing and visualising them:

 

I think ideally we would have multiple subsystems within what we call "emoncms" too, but one step at a time.

pb66's picture

Re: emoncms: clean install in 5 commands

When the oemgateway was originally written it was apparently intended for this purpose although no mention of the debian packaging back then, see Jérôme's notes at the foot of this page , it says "it can be configured through the gui" which I haven't seen yet but that suggests it could work seamlessly with emoncms in place of the rfm2pi module or as a standalone solution.

You should also take a look at Trystans fork as he has added another listener/buffer for interfacing the nodes module,  

Paul

Schism's picture

Re: emoncms: clean install in 5 commands

Thanks - that is much clearer. I wish I could read Python, just attempted a quick scan of the code but it's certainly a bit different... 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.