Trouble downloading Emoncms.org feed to local Emoncms and seeing it

I searched quite a bit but can't find a forum post addressing this.

Here is what I did:

1.  Obtained the backup utility located here: https://github.com/emoncms/usefulscripts

2.  Set the following in backup.php

    $link_to_local_emoncms = true; 
    $local_emoncms_location = "/var/www/html/emoncms/"; 
    $local_emoncms_userid = 1; 
    $backup_inputs = false;

3.  Added this command to backup.php to limit it to just one feed.

     foreach ($feeds as $feed) {
       if ($feed->id == 85722) {

4.  Ran the utility using "php backup.php". Got an error that the phpfiwa directory was not found. Ran it using "sudo php backup.php". The utility ran succesfully and created entries in my /var/lib/phpfiwa directory.

5. Ran "sudo chown -R www-data:root /var/lib/phpfiwa" since root was the owner of the files. The result looks like this:

-rw-r--r-- 1 www-data root 1335176 Mar  9 15:20 85722_0.dat
-rw-r--r-- 1 www-data root  133524 Mar  9 15:21 85722_1.dat
-rw-r--r-- 1 www-data root   22256 Mar  9 15:21 85722_2.dat
-rw-r--r-- 1 www-data root      36 Mar  9 15:20 85722.meta

6. Logged into my local emoncms and looked for the feed. I don't see it.

Any ideas?

Thanks.

TrystanLea's picture

Re: Trouble downloading Emoncms.org feed to local Emoncms and seeing it

Can you check your emoncms mysql database to see if it was registered there?

SELECT * FROM feeds;

Might also be worth flushing redis: $ redis-cli "flushall"

baldockery's picture

Re: Trouble downloading Emoncms.org feed to local Emoncms and seeing it

Running flushall didn't cause the feed to appear in my feed list.

Running the mysql query I got the following result:

+-------+-------------------+--------+---------+------------+---------+----------+--------+--------+--------+-------------+
| id    | name              | userid | tag     | time       | value   | datatype | public | size   | engine | processList |
+-------+-------------------+--------+---------+------------+---------+----------+--------+--------+--------+-------------+
|     1 | node:1:Damper1    |      1 | Node 1  | 1457618414 |      73 |        1 |      1 |   NULL |      5 | NULL        |
|     2 | node:1:Damper2    |      1 | Node 1  | 1457618415 |      73 |        1 |      1 |   NULL |      5 | NULL        |
|     3 | solar_power       |      1 | Node 10 | 1457618412 | 424.406 |        1 |      1 |   NULL |      5 | NULL        |
|     4 | house_power       |      1 | Node 10 | 1457618412 | 710.097 |        1 |      1 |   NULL |      5 | NULL        |
|     5 | node:1:Furnace_On |      1 | Node 1  | 1457618402 |      56 |        1 |      1 |   NULL |      5 | NULL        |
|     8 | Downstairs Temp   |      1 | Node 19 | 1457618388 |   59.54 |        1 |      1 |   NULL |      5 | NULL        |
|     7 | Main Level Temp   |      1 | Node 20 | 1457618389 |   69.08 |        1 |      1 |   NULL |      5 | NULL        |
|     9 | Upstairs Temp     |      1 | Node 21 | 1457618412 |   68.54 |        1 |      1 |   NULL |      5 | NULL        |
|    10 | Outside Temp      |      1 | Node 30 | 1457618403 |      39 |        1 |      1 |   NULL |      5 | NULL        |
| 85722 | node:0:temp       |      0 | Node:0  |       NULL |    NULL |        1 |      1 | 401404 |      6 | NULL        |
+-------+-------------------+--------+---------+------------+---------+----------+--------+--------+--------+-------------+
10 rows in set (0.00 sec)

The last entry is the feed in question. Looks like the node is 0, and maybe that is the problem? If so, how would I change that?

Thanks!

TrystanLea's picture

Re: Trouble downloading Emoncms.org feed to local Emoncms and seeing it

The issue is the userid assigned,
$local_emoncms_userid = 1 should have put it in the right place, so Im not sure why its on 0.

You can manually set the userid with

UPDATE feeds SET userid=1 WHERE id=85722;

then you will need to do a redis-cli "flushall"
 

baldockery's picture

Re: Trouble downloading Emoncms.org feed to local Emoncms and seeing it

That worked. Thanks!

I might be able to explain the '0' user ID.

My first attempt at running backup.php I had $local_emoncms_userid = "emoncms", which gave me an error. I corrected the userid and ran it again. Could it have brought in the data the second time but the userid the first time?

 

Comment viewing options

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