Emoncms bug and dev list NOVEMBER 2012

Emoncms bug and dev list November 2012

In October good progress was made on refactoring emoncms code along more modular lines. Several new modules were also created to extend emoncms functionality such as the raspberry pi module for communicating directly with the RFM12PI board.

Following on from octobers bug and dev list there are still several bugs and dev items still to do and no doubt some more bugs with the new version, here they are so far:

Bug list

Messages
Close X in blue twitter bootstrap type message box does nothing - the action is not yet coded.

strtotime() error on raspberry PI (Does not show up as an error anymore?)
http://openenergymonitor.org/emon/node/893

Add new dashboard "+" button does not function reliably across browsers - I though this was fixed but then it did not work in chrome on a mac
http://openenergymonitor.org/emon/node/945

There is no implementation of kwhd histogram zoomer in the visual dashboard editor
http://openenergymonitor.org/emon/node/1104

Dev list

Text based status indicators
http://openenergymonitor.org/emon/node/296#comment-2486

View html source option in dashboard editor
Reinstating a feature that existed before

Import vs Export
https://github.com/openenergymonitor/emoncms3/issues/44

Better implementation of multigraph visualisation builder
Allowing for multiple multigraphs and a nicer drop down menu feed selector could make the whole interface very compact and clean.

Name, edit, delete input node
So that its possible to tell what the node is at a glance and easier to delete un-needed inputs.

Quick vis view link on feeds - so that its easier to check what a feed is doing without having to go to vis

Algorithm for removing unneccessary datapoints to save space. Only store datapoints when there is a change.

Forward data from raspberry pi emoncms to remote emoncms in bulk uploads.

If you can help with any of these that would be great.

If you're interested in becoming an emoncms developer, you might want to start by looking at the application architecture page, note that these pages need a bit of updating to reflect the new directory structure: http://openenergymonitor.org/emon/node/312 and also the pages here: http://openenergymonitor.org/emon/emoncms/development-challenges.

Petrik's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Is it possible when adding the node tabs that the node numbering counter started from zero instead of one ? It looks like my nodes are all shifted by one - e.g. in this picture you can see the node10_4 being inactive (vRMS) which now looks like the value is in node10_3. Dont recall having node10_0 at all in the past and all the feeds seems to be incorrect on the dashboards.

(edit - also on multigraph dashboard I get an error message: Notice: Undefined variable: write_apikey in /var/www/emoncms/Modules/vis/vis_controller.php on line 133)

 

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

O dear!! I missed that, that will have created a big block of messed up data, im sorry about that. I've changed it back numbering now starts from 1. Also fixed the notice. Thanks a lot for finding those

Petrik's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Thanks, now the dials and graphs work again

How is it with text type ? Looks like that text fields are not updating ?

Petrik's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Looks like there is a need to reselect all feedvalue (text) feednames again after the latest update. Emoncms.org had lost it to which feed each feedvalue (text field) is linked to.

 

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Fixed a bug in the average input processor - it was creating the wrong feed type without the data2 column. If you have created a feed with an average input processor in the last few days the way to get it working again is to delete the old average feed and create another with the latest updated emoncms. 

Larsjo's picture

Re: Emoncms bug and dev list NOVEMBER 2012

public dashboard

When clicking the view publich dashboard, i get nothing only the black header line.

ex: http://82.147.231.132/sol/lars.juelsminde&id=20 (dashboard 20)

But the dashboard is working.

alco's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Development wish1:

A user specific option to set the CSS theme from the emoncms. (or at least a database option to set by user ID). Useful for integration of emoncms dashboards within websites (like my website, that has a "brown" color background...not white like the default EmonCMS3 skin). Also on github issue tracker: https://github.com/openenergymonitor/emoncms3/issues/96

Development wish 2:

Make use of the github TAG command to make releases and good revision numbers. see topic: http://openenergymonitor.org/emon/node/1321

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Fixed bug blank public dashboard bug, I missed updating the default.settings.php file to point to the new public dashboard location which is:

// Public profile functionality
  $public_profile_enabled = TRUE;
  $public_profile_controller = "dashboard";
  $public_profile_action = "view";

rather than

// Public profile functionality
  $public_profile_enabled = TRUE;
  $public_profile_controller = "dashboard";
  $public_profile_action = "run";

To get this feature working again, easiest way is to open your settings.php file if you have already created one and edit $public_profile_action to be equal to "view"

Ian Eagland's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi

Just after login  evening 16/11/2012 using Chrome  I saw the following:-

Notice: session_start(): ps_files_cleanup_dir: opendir(/var/lib/php5) failed: Permission denied (13) in /var/www/emoncms/core.php on line 45

Regards

 

Ian

 

stephen's picture

Re: Emoncms bug and dev list NOVEMBER 2012

After running emoncms on a Raspberry Pi for almost two weeks I see that there are getting on for 200,000 rows in the feed_n tables.  Clearly it's going to run out of storage at some point.  I've had a look at the code and can't find anything to prevent this.  Is this correct?  It seems to me that the data needs coalescing so that the older it is the longer the time between samples.

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

A few more development items for the list:

Better implementation of multigraph visualisation builder
Allowing for multiple multigraphs and a nicer drop down menu feed selector could make the whole interface very compact and clean.

Name, edit, delete input node
So that its possible to tell what the node is at a glance and easier to delete un-needed inputs.

Quick vis view link on feeds - so that its easier to check what a feed is doing without having to go to vis

Algorithm for removing unnecessary datapoints to save space. Only store datapoints when there is a change.

Forward data from raspberry pi emoncms to remote emoncms in bulk uploads.

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hello Stephen, yes your quite right about running out of space. I think the solution is an algorithm that removed datapoints when there is no change in the value, so only storing datapoints where the feed is changing. That way we should be able to store all the important detail but with many less redundant datapoints. Will try and have a look at this soon.

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hello Ian, yes also noticed that error, seems to appear every now and then but then go away just as fast, not sure what the fix is yet, will have to look into it

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Couple of other things to add:

Apikey reference in input api helper, feed api helper and user account.

and

Clearer feed authentication:

I'd like to add a new authentication level, public feeds:

Public feeds - no authentication required accessible to everyone - these would be for use in public dashboards which also require no authentication.

Non public read only feeds - accessible via read apikey (but not public unless you share your read apikey publicly) useful for sharing with someone privately, ie sending a link via email to a trusted person.

write only feeds - accessible via write apikey, strictly a private apikey (not to be shared as this would give others write access to your account)

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Update:

  • Input ontime input processor is fixed, 
  • apikey helper added to input and feed api help pages.
  • read apikey added to embed code on vis page
  • feed list updates every 5 seconds
TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

New commit:

If on visiting the vis page and trying to select a feed you notice that your feed is missing, its likely that its type has not been set. New feeds should have their type automatically selected but old ones may not be specified.

On the feeds page the feed type is now described rather than a number, and a select box is shown when edit feed is selected. There is also a helper note on the vis page.

Which should make it easier to select the datatype in the event that a feeds type is not set.

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

New commits:

- Raspberry PI module: Moved remote server authentication check to raspberrypi/set action rather than when main config page is loaded every time to speed up loading of the config page and reduce number of requests to remote. Run admin -> db update after downloading latest commit.

- Refactoring of Input, feed and deleted feed list code, made a start on creating a javascript dynamic list constructing library, that could be used by any lists in the application. 

fluppie007's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Wish: RFM2Pi sends out the current time, see http://openenergymonitor.org/emon/node/1348

Bug: Forward data to remote emonCMS. I have a Ubuntu server (192.168.2.12) virtual machine running on my server, installed emonCMS to it without any problem. It will act as the remote server.

Configured my Raspberry Pi with RFM2Pi (192.168.2.13) to send data to a remote emonCMS.
Domain name: 192.168.2.12/emoncms
Write apikey: 3fa0314f47eafbb78526...

I get "Authentication successful" in emonCMS on the Rasp. Pi. Sadly the input page of the Ubuntu server running emonCMS stays empty. I'm sure that my "remote emonCMS" works and the API is right. I verified this by using this URL: http://192.168.2.12/emoncms/input/post?json={power:200}&apikey=3fa0314f47eafbb78526...

Bug: I installed the "event" module to get e-mail notifications when some value is to low or high. My e-mail address is configured in the account section. Tested it by raising the temperature, sadly, no e-mail. In the event screen the trigger works, gets green and true. But on the other hand, how does the Rasp. Pi server know my outgoing e-mail server? Should I not define this somewhere? So that's not a real bug I guess, probably a user-error.
But then, after the trigger is gone, it says: Last true: 1970-1-1 01:00:00. Even though my system time is correct and my timezone (Europe/Brussels) is defined in the raspi-config and in the php.ini file.

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hello Philippe.

Thanks for the wish, that would certainly be a good thing to have.

I will test the remote server forwarder to a local server here and see if I can debug, not sure why that is not working.

Event module is in a very early stage of development, the email sending part is not actually built yet, thought I would put the code up there anyway just incase anyone else wants to help develop that module.

Trystan

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

New commits:

- list.js the script that creates the input/ feed and deleted feed list now uses a single javascript object to describe the list.

- public/private feed implementation. By making a feed public you can make it possible for others to access the feed without an  apikey, see comment on the 21st above. 

Run admin->db update required to update database schema with a new field for feeds public state.

stephen's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Visualisations in the dashboard are implemented with an Iframe.  When viewing emoncms running on a private network from the internet using Network Address Translation, the IP address in the iframe src tag contains the local IP address.  As this isn't accessible from the internet the visualisation cannot display.

See discussion at http://openenergymonitor.org/emon/node/1479

 

jb79's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Wishes:

The number of digits after the decimal point should be adjustable for the dials. At the moment the dial only displays one digit after the decimal point when under 10kWh, over 10kWh there is no digit after the decimal point.

Emoncms should be able to run in a subdirectory. When I tried to install it in a subdirectory it doesn't work. When it's in /var/www/emoncms/ everything is ok, but when I try to install in /var/www/xyz/emoncms/ I get no inputs from RaspberryPI: see details here. Maybe it's no problem of Emoncms but ruther of  the RaspberryPI module of Emoncms.

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, I'm getting same issue "Authentication successful" but sadly not posting to remote site ether. Any luck getting it working or is it a bug.

Thanks Peter

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

If you open minicom is there an output there? try exiting minicom without a reset, that seems to fix the issue of no data coming through sometimes.

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi Trystan,

I may have not been clear above, my problem isn't  receiving data, I can see data from emontx on minicom ok and it sent ok to emoncms on raspberry pi - this has been working for two weeks now.

Problem is sending data to a remote url, just can't seem to get this working.  I'm getting Authentication successfully but nothing received by remote url emoncms. Is there a working example or guide to setting this up, can it be as simple as input domain and apikey in raspberry pi dashboard.

Thanking you in advance.

Cheers

Peter

P.S. http://cms.wedo.ie/emoncms/time/local.json?apikey=202e3b8a8dc2236d3af59d...

gives me response t22,12,59 (time I presume)

 

 

 

 

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi,

Download latest emoncms, raspberry pi and completed Update & Check ok. Remote still will Authenticate Successful ok but no inputs received at far end. Am I missing something basic do I need sync installed at remote end or this end.

Anyone recommend a  protocol analyzer  for raspberry pi so I can trace what's happening?

Also I note that my own input naming have changed to Node10_1 then Node10_307 then Node10_308, see attached. This is due in some way to latest version of Raspberry Pi.

Thanks

Peter

 

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Are you using your write apikey? 

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Yes definitely.
I take from your comment that it should be as simply add remote domain and ApiKey (write). I have latest emoncms and raspberry pi (also events and energy - assume they shouldn't have any impact on this feature). Sync module is not loaded.

I was thinking it may be a port setting as I have static IP address and I'm using NAT to forward port 80 to internal 192.168.1.31 which is my raspberry pi.

Thanks Peter

TrystanLea's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hmm, not sure if it will change anything, but I just fixed a couple of things in the raspberrypi module that where causing incorrect node input names. Yes it should be as simple as the domain and apikey

domain without the http:// bit so just emoncms.org or your domain. Are the inputs coming through to the local pi inputs page ok?

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Yes, inputs are received by rfm12b module (I can see them with minicom) and are forwarded to emoncms ( I will update emoncms and check node id's issue is resolved when I get home).

I used correct domain and ApiKey.

I will also try http://cms.wedo.ie/emoncms/time/local.json?apikey=202e3b8a8dc2236d3af59d... from raspberry pi to see if it works ( as stated above I've checked this from my laptop browser and it returns the time). This may help identify if its a routing issue on my network or not.

Thanks Peter

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi,

Just updated emoncms & Raspberry Pi modules. the input data discussed above Node10_2, Node10_3, Node10_4 is now back working, however I still have the spurious inputs coming in e.g. Node10_308, Node10_309, Node10_310 & more - all updating.

On update remote emoncms issue I tried link below from raspberry pi and it returns time, I assume this means my network is ok.  http://cms.wedo.ie/emoncms/time/local.json?apikey=202e3b8a8dc2236d3af59d... returns time ok (t18,47,24)

At a loss, is there some code I could use directly in raspberry pi module to send to remote emoncms to at least test this part.

Thanks in advance

Peter

ukmoose's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Peter,

you can add some code simply copy the two lines below 

$homepage = file_get_contents('http://cms.wedo.ie/emoncms/time/local.json?apikey=202e3b8a8dc2236d3af59dc822486efa');
echo $homepage;

after the 

Emoncms - open source energy visualisation

  Part of the OpenEnergyMonitor project:
  http://openenergymonitor.org
  */

at the top of the raspberrypi_view.php page. then click on raspberrypi in your menu.  you should see the time appear underneath the orange or green bar.

 

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, Yep that works it gives " t21,44,15" over Raspberry Pi in Dashboard as one would expect. I assume this proves domain and apikey are correct. Also that raspberrpi pi module is running.

Could I be missing something really obvious, do I have to set some values to get it to work e.g. true???

Thanks Peter

ukmoose's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Just tested it on my rasppi and with the latest version the syncing from my Rasppi to emoncms.org it  just works.

It isn't immediate as the script would appear to batch data and bulk send.

 

Have you tried sending the data to emoncms.org?  If might allow us to narrow down where if the problem is on the pi or remoteserver.

 

 

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, Created emoncms account as suggested and tried forwarding with no luck see attached screen shots of Raspberry Pi dashboard and emoncms.org dashboard.

I'm still getting some very strange input data see attached screen shot of raspberry pi input data, its like the inputs are been repeated with a delay could it be looping back to raspberry pi somehow.

Cheers Peter

P.S. I could try a fresh install with another SD card tomorrow to see it that works although I would like to find the root cause. Thanks for your help.

 

fluppie007's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi Peter, wipe out your API key, otherwise someone with bad intentions could 'ruin' your emonCMS data.

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

I will be doing a fresh install on raspberry pi tonight, Thanks anyway Peter

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, Tried new install on spare SD card and using emoncms.org as remote url. emoncms is up and working on localhost receiving input data ok from  emontx. I then set remote domain and apikey key which authenticates successful however there are no data inputs received at remote url. I've tried suggestion above to include line in raspberrypi_view.php "echo hompeage" to test and this works ok as  I received the time back. It would be great to be able to trace TCP traffic to see what's happening. Also its the same directly plugged into router which has static IP address and also using 3G dongle directly into raspberry pi (think this proves local network). I'm going to try fresh install again tonight. Cheers Peter

P.S. issue with spurious values for nodeid resolved with fresh install.

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, I stand corrected, just checked before I tried new fresh install and it's working towards remote url "emoncms.org", maybe I didn't give it long enough not sure, I'll do some testing. Thanks a mil Peter

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi,

Getting closer to the issue.

From above send data to remote url is now working for emoncms.org following a fresh install.

Changed the destination of  remote url from emoncms.org in Dashboard to my new site and although it authenticates successful it doesn't post any data to my site.

Checked emoncms database values for remote domain using phpmyadmin on raspberry pi and it shows the new domain name and correct apikey. Strange thing is that my raspberry pi is still posting the input data of raspberry pi to emoncms.org.

Thanks

Peter

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, Completed a fresh install on emoncms on Raspberry PI with new mysql database. Set up to my private remote url and started receiving after 15-20 mins, its working for 8 hours now. Strange thing is I changed remote url to my emoncms.org account 7 hours ago. It seems that once remote url is set first time it remembers this one only, looks like an update to new remote isn't working for me.

Thanks

Peter

PeterN's picture

Re: Emoncms bug and dev list NOVEMBER 2012

Hi, Further testing indicates that in my case there is a time delay of between 15 mins and one hour till new remote url becomes active. In that time it is still posting to original remote url.

Thanks

Peter

Comment viewing options

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