Newbie. Trouble geting OpenEnergyMonitor to work

Hello,

just bought the whole setup from open energy shop. Emontx v3.4 with 433mhz module, raspbery pi with RFM69Pi 433mhz and preloaded micro sd card. Tried to set it up according the:

https://github.com/openenergymonitor/documentation/blob/master/Applicati...

Through Putty I added the opencms.org Write API and changed the Node to 10 (that should be default as I read)

My problem is that after I set up the raspberry according the guide I don't see anything at the http://emoncms.org/. In the input screen it just says no input created. I'm missing the usb to uart programmer to see what the Emontx is sending and in raspberry when I tried to set up and read the log file I got this:

[email protected] ~ $ rpi-rw
Filesystem is unlocked - Write access
type ' rpi-ro ' to lock
[email protected] ~ $ sudo service emonhub restart log
[ ok ] Restarting OpenEnergyMonitor emonHub: emonhub has been restarted ok.
[email protected] ~ $
[email protected] ~ $ tail -F -n 40  /var/log/emonhub.log
tail: cannot open `/var/log/emonhub.log' for reading: No such file or directory

Could some one help me where should I look for the problem?

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

"Through Putty I added the opencms.org Write API and changed the Node to 10 (that should be default as I read)"

You do need to set the apikey but you shouldn't need to change the node id to 10, the node id is set in the nodes firmware and emonhub(.conf) only needs to know about nodes that run non-standard datatypes (all others are assumed default) as you don't have a programmer I'm guessing the emonTx is using the default firmware.

The base id (node id for the base) needs to be set and was probally pre-set to 15 which is correct. The "node 99" at the bottom of the conf file is an example of using non-standard datatypes and if you have changed the 99 to 10 you are telling emonhub your node 10 is sending non-standard data in the form stated, which it isn't, so emonhub may not be forwarding your data as it isn't what it expects.

The log file is at   /var/log/emonhub/emonhub.log

If neither of these help set the loglevel to DEBUG in the conf and recheck the log.

Paul

intruder82's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Hi Paul,

thanks for clearing that up.. I was assuming that this is the node ID..  I changed that back to 99

Haven't got anything in my Emoncms account so I set the loglevel to debug and got this:

Couldn't send to server, URLError: [Errno -2] Name or service not known

I have set it to "url = http://emoncms.org" as in the guide. is it wrong?

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Well that is very interesting and I wonder if anyone else is having an issue?

This maybe a coincidence I am currently trying to work out why I'm getting exactly that same error message, it just so happens I have changed ISP and router today and have been getting that exact same message all day, I assumed it was a problem at my end, I now question the server end.

Have you changed router, dchp server or any network configurations anywhere ie on the Pi or at the router etc?

intruder82's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

strange my coments are " queued for moderation"

no changes in the raspberry only the site url and api key. Router untouched either. Only pluged in the network cable to the raspberry.

Paul Reed's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

When you see that your comment is held for moderation, please don't continue to post the same message!
I have just deleted the duplicates. In future please wait until a moderator publishes your comment from the moderation queue.

Paul

intruder82's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

sorry about that. saw that only after second coment.. will not repeat.

So doe's any one have any clue where to start looking for a problem? still have the same error..

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Sorry, no I'm not sure what the issue is I've not seen it before and have already overwritten my image to resolve it so I can't dig ant deeper.

I did start this tread but have had no response so I assume it's not a server problem.

glyn.hudson's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Sorry to hear that your having trouble. Please could you post your emonhub.conf log file on the forum here so we can double 

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

And a log excerpt from emonHub so we can check the url formation the way it's sent.

intruder82's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Hi,

because I'm new to the raspbery here are the commands that I entered:

[email protected] ~ $ rpi-rw
Filesystem is unlocked - Write access
type ' rpi-ro ' to lock
[email protected] ~ $ sudo service emonhub restart log
[ ok ] Restarting OpenEnergyMonitor emonHub: emonhub has been restarted ok.
[email protected] ~ $
[email protected] ~ $ tail  /var/log/emonhub/emonhub.log

this is what I got:

2015-02-18 16:32:21,403 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 16:32:21,406 WARNING Send failure: wanted 'ok' but got
2015-02-18 16:32:21,569 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 16:32:21,571 WARNING Send failure: wanted 'ok' but got
2015-02-18 16:32:21,738 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 16:32:21,741 WARNING Send failure: wanted 'ok' but got
2015-02-18 16:32:21,903 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 16:32:21,905 WARNING Send failure: wanted 'ok' but got
2015-02-18 16:32:22,067 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 16:32:22,069 WARNING Send failure: wanted 'ok' but got

excerpts from the emonhub.conf looks like this:

nano /etc/emonhub/emonhub.conf

# This reporter sends data to emonCMS
[[emonCMS]]
    Type = EmonHubEmoncmsReporter
    [[[init_settings]]]
    [[[runtimesettings]]]
        url = http://emoncms.org
        apikey = XXX

# This interfacer manages the RFM2Pi module
[[RFM2Pi]]
    Type = EmonHubJeeInterfacer
    [[[init_settings]]]
        com_port = /dev/ttyAMA0
    [[[runtimesettings]]]
        group = 210
        frequency = 433
        baseid = 15

[[99]]
        datacode = h
        datacodes = l, h, h, h,

 

If I left something out just let me know..

Thank you!

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Can you set loglevel to DEBUG emonhub.conf so we can see how the URL is formatted, although I'm pretty sure it will be correct.

intruder82's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Here's the log with debug:

2015-02-18 17:47:00,354 INFO Sending: http://emoncmc.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1424281592.32,10,-11,-84,21,0,24630,0],[1424281602.1,10,-10,-85,21,0,24618,0],[1424281613.34,10,-11,-86,20,0,24751,0]]&sentat=1424281620
2015-02-18 17:47:00,416 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 17:47:00,418 WARNING Send failure: wanted 'ok' but got
2015-02-18 17:47:00,521 INFO Sending: http://emoncmc.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1424281592.32,10,-11,-84,21,0,24630,0],[1424281602.1,10,-10,-85,21,0,24618,0],[1424281613.34,10,-11,-86,20,0,24751,0]]&sentat=1424281620
2015-02-18 17:47:00,582 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 17:47:00,584 WARNING Send failure: wanted 'ok' but got
2015-02-18 17:47:00,696 INFO Sending: http://emoncmc.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1424281592.32,10,-11,-84,21,0,24630,0],[1424281602.1,10,-10,-85,21,0,24618,0],[1424281613.34,10,-11,-86,20,0,24751,0]]&sentat=1424281620
2015-02-18 17:47:00,757 WARNING Couldn't send to server, URLError: [Errno -2] Name or service not known
2015-02-18 17:47:00,760 WARNING Send failure: wanted 'ok' but got
2015-02-18 17:47:00,863 INFO Sending: http://emoncmc.org/input/bulk.json?apikey=E-M-O-N-C-M-S-A-P-I-K-E-Y&data=[[1424281592.32,10,-11,-84,21,0,24630,0],[1424281602.1,10,-10,-85,21,0,24618,0],[1424281613.34,10,-11,-86,20,0,24751,0]]&sentat=1424281620

 

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

As I thought, that all looks normal except a url we know to be good is "not known" and I have no idea why!

What we see there is exactly what I had, but I assumed it was something to do with changing ISP/router (not that I whole heartedly believed that as it was my only problem device and I have a couple of Pi's sending to emoncms.org)

Unless someone has a better suggestion I would recommend starting again with the latest image, hot off the press not even in the shop yet. http://openenergymonitor.org/files/emonSD-17-02-15.zip 

See New Raspberry Pi 2 pre-built SD card image (emonSD-12-02-15.img) BETA for more info. Although if you use a 4GB card I would wait until Glyn revises the image to make it smaller.

It's probably not the resolution you were looking for but it will give you all the latest revisions of software.

Paul

Robert Wall's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

"except a url we know to be good..." Oh no it isn't. I see a typo - http://emoncmc.org

Or it's been corrupted somewhere.

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

Well spotted... that will be why it wasn't a recognized "Name or service". 

But it is spelt correctly in the settings given, so still a bit of a mystery as to what's happening.

Does removing that line (or comment it out with a #) from the conf make any difference? emoncms.org is also the hard coded default if omitted.

intruder82's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

wow nice catch. thank's! It was a typo in the /boot/emonhub.conf.

Not sure why there are two of them and in the github guide it refers to boot/emonhub.conf and you guys refer to /etc/emonhub/emonhub.conf. (Misstype was in the boot/emonhub.conf)

Could you explain this so I could better understand the raspberry system? And thank you for your help!!!

pb66's picture

Re: Newbie. Trouble geting OpenEnergyMonitor to work

The usual place for the settings is in /etc. because the boot partition is fat32 and can be read by a windows PC the SDcard image has the settings file relocated to the /boot partition. This can cause confusion but the latest image will have a symlink in place so that even though the settings will actually be on the boot partition they will also be accessible via the symlink in /etc so that everyone can get their settings file via the same path /etc/emonhub/emonhub.conf which is the standard, Additionally,the settings on sdcard images can be edited using a windows PC before putting it in the Pi. 

Comment viewing options

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