EmonCMS on Synology NAS

Hi,

I'm evaluating EmonCMS for its usage with Openremote. First I've created account on emoncms.org but after few days I'm unable to login into it regardless of using correct password. This pushed me to install emoncms local on my Synology NAS to be able to hack in cases like this. I've followed the linux install steps omitting stuff that already is installed on the NAS (apache and mysql). It seems that almost everything is working except that my installation does not store data feeds. I can see the current feed's value but when I want to see raw data graph then it is empty. For sure something is missing in my install which is not mentioned in the linux installation guide. My guess is that data storage engine is not properly installed/configured. Can you give me hints how can I proceed to solve this problem (I'm programmer so the guide can be quite technical).

I hope to get it solved as emoncms looks very promising and has potential to become a part of my application.

Thank you,

Michal

Wxll's picture

Re: EmonCMS on Synology NAS

Michal,

I've been doing installs like Jira and Confluence on the Synology and it can be hellisch.. However I haven't worked with EmonCMS, but might be able to help...

Can you elaborate a bit more about the Syno you have? 

Is it an i386 based or ARM?

Did you bootstrap it? 
http://forum.synology.com/wiki/index.php/Overview_on_modifying_the_Synol...

 

I should have a look at the following:

Pulling custom webpages from the Syno, are you sure that it works?
Try doing a manual POST with Postman and Chrome to the Synology
https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnp...

Are you sure the synology is not redirecting your request url?

Can you see the request coming in on the Apach logs?
Did you try to write "Hello World" with a PHP script into the database table to make sure that PHP persistance is in fact working.

Can you create a simple chart with a dot on the screen ? just to check if there is enough graphical libs available for running EmonCMS

Hope this helps. and in the future I might give this a run on my Syno as well, for now waiting for my first Emon hardware :-)
Keep us posted how you proceed.

 

Wxll

 

aktur's picture

Re: EmonCMS on Synology NAS

Hi Wxll,

I think that I did everything for my syno. After consulting readme.md I discovered that I need timestore. Grab it from git, I've tweaked some paths for Synology to get it through install and finally got adminkey in /var/lib/timestore. This gives

DiskStation> /etc/init.d/timestore status
Timestore is running

but I doubt it as ps does not show it, pidof timestore returns empty string and I see nothing written to /var/lib/timestore - no feeds.

PHP and MySQL is good as I'm running many different applications on my Syno box without problems.

On my feed page I'm unable to change realtime feeds from timestore engine to mysql, after selecting mysql it flips back to timestore.

What I would need now is to know how I can bullet proof that the timestore engine is working, or switch the storing engine to mysql (I don't bother performance and DB size now, my Syno has 15T ;)

Michal

 

Wxll's picture

Re: EmonCMS on Synology NAS

Sounds you did a good job there so far. I'm lagging experience with it from here on. Sounds like a good idea to check the timestore on a mysql.

Hope you get it running.

aktur's picture

Re: EmonCMS on Synology NAS

Yes, I've got it running, quite a brute way ;) As I've said, although timestore reported running I did not belived it and decided to use only mysql anyway. I've forced in the feed_model.php that it always uses MYSQL engine. Now feeds data are stored in mysql tables and graphs are working. But this is not solution for 'normal' people ;) They need to wait for a proper Synology port, the best would be as Synology module of course, the same type as phpMyAdmin which is also PHP web aap.

fversteegen's picture

Re: EmonCMS on Synology NAS

Aktur, could you please share the edits you made so it runs only on MySQL? Timestore looks nice, but is way to complicated to run on webservers on which you do not have ssh access...

threldor's picture

Re: EmonCMS on Synology NAS

What port does timestore run on? is this causing problems on the NAS?

fversteegen's picture

Re: EmonCMS on Synology NAS

Nevermind my previous question. It has already been answered by Trystan:

 

fversteegen: yes, in fact I have just pushed an update today that allows you to change the default_engine to mysql that would allow use of emoncms exactly as before.

I have also added another feed engine called phptimeseries which is much faster than mysql but slower than timestore and without averaging, it also uses the same datafile format as mysql so its just a matter of copying the mysql datafiles. To use phptimeseries you need privileges to create a folder and assign www-data access to it.

fversteegen's picture

Re: EmonCMS on Synology NAS

Ok, I have been working on installing timestore, but I keep on getting stuck, What I did is the following (I use /volume1/web as temp dir)

  1. cd /volume1/web
  2. git clone http://www.mike-stirling.com/git/timestore.git
  3. cd timestore
  4. chmod +x install
  5. ipkg install libmicrohttpd (since it is not installing properly through the use of install)
  6. mkdir /opt/arm-none-linux-gnueabi/lib_disabled
  7. mv /opt/arm-none-linux-gnueabi/lib/libpthread* /opt/arm-none-linux-gnueabi/lib_disabled
  8. cp /lib/libpthread.so.0 /opt/arm-none-linux-gnueabi/lib/
  9. cd /opt/arm-none-linux-gnueabi/lib/
  10. ln -s libpthread.so.0 libpthread.so
  11. ln -s libpthread.so.0 libpthread-2.5.so
  12. Edit install and change first line to: #!/bin/sh
  13. sh install

After that everything seems to be working fine, but in the end I do not get a timestore admin key. I think that I need to change the foldernames in install, but do not know to what to change them. Any help appreciated!

flusk's picture

Re: EmonCMS on Synology NAS

Came across this page looking for tips on getting emoncms running on my Synology NAS with timestore. A few twists and turns along the way but I now have it working with DSM 4.2 on my DS209+II.

If you have built timestore but not sure it is working try running it from the command line:

timestore -a -d -v3

It should produce enough tracing to convince you if things are ok or not.

You may find like I did that everything looks like it should be working but your graphs are empty. DSM has PHP open_basedir set and you need to go into web settings -> PHP settings and add /var/lib/timestore.

I was migrating from initially having used mysql and found the migration process painless (and very slick).

 

 

 

 

rapzak's picture

Re: EmonCMS on Synology NAS

Hi..

I got a I686 NAS (DS710+)

When i install timestore i get this error:

1) COMPILE TIMESTORE
==============================
make -C src
make[1]: Entering directory `/volume1/upload/time/timestore/src'
gcc -c -Wall -g -Ilibmicrohttpd-0.9.24/image/include tsdb.c -o tsdb.o
tsdb.c: In function 'tsdb_update_layer':
tsdb.c:285: error: 'NAN' undeclared (first use in this function)
tsdb.c:285: error: (Each undeclared identifier is reported only once
tsdb.c:285: error: for each function it appears in.)
tsdb.c:377: error: 'INFINITY' undeclared (first use in this function)
make[1]: *** [tsdb.o] Error 1
make[1]: Leaving directory `/volume1/upload/time/timestore/src'
make: *** [all] Error 2
==============================
2) TIMESTORE DATA DIRECTORY
==============================
Timestore directory already exists
==============================
3) COPY INIT SCRIPT TO INIT.D DIRECTORY
==============================
Copying init script
install: line 35: can't create /etc/default/timestore: nonexistent directory
install: line 40: update-rc.d: not found
==============================
4) START TIMESTORE
==============================
install: line 46: /etc/init.d/timestore: not found
==============================
5) TIMESTORE ADMINKEY
==============================
cat: /var/lib/timestore/adminkey.txt: No such file or directory

 

Some one who has made a fix for this ?

 

BR 

Rapzak

Comment viewing options

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