I have a water/gas/electricity build( which I must put up here!). One emontx is for water, and the other does gas+electricity....
All the inputs are coming in fine, but for some reason; the water [mV and pulse count] won't propogate through to their respective feeds..
I reinstalled emoncms; I created a totally new database and started from the beginning and it's still happening. I've even created a new user.
I have noticed in my serial[ from the emonbase] that after a while it starts to flag the following error
Fatal error : call to a member function fetch_array() on a non-object in /var/emoncms3/I ; and that's all I get. I expect it's db.php in the 'Includes' dir though. I was getting this error initially upon logging in(Google Chrome), but by granting my emoncms3 user all privilages it sorted it. Always worried when I don't have a root cause though!
I'm using my own version of the following https://github.com/openenergymonitor/NanodeRF/blob/master/NanodeRF_singleCT_RTCrelay_GLCDtemp/NanodeRF_singleCT_RTCrelay_GLCDtemp.ino
[ must put it up on github, though since the inputs are being populated correctly, I'm assuming it's working]
Has anyone else had a feed that could be created, but didn't get updated even though the input was working fine?
thanks, Eamonn
Re: Certain Feeds will not update.....
That looks like a PHP error, i.e. an error with the emoncms software.
The error message doesn't say which file it is coming from but it's probably from db.php which includes the fetch_array command. This command is executed every time there is a database query. Considering the error message complains about a non-object, this would suggest the database connection hasn't been started successfully.
First thing would be to make sure you've got the correct database settings in settings.php.
Re: Certain Feeds will not update.....
Sean,thanks for your input.
I checked the settings file a while back, and it's correct. Also, other feeds are updating ok so that would confirm we can access the DB etc. There's something specific about the feed from the water emontx thats not working. It's writing the data correctly to the 'input' table, but even the simplest process of feeding it straight through to a feed isn't happening.
It's definately related to my emoncms installation, and I thought it might be file permissions issue in my ubuntu environment but that's not the case I think. I opened up file permissions fully to test this.
thanks again - enjoy the w/end - you know what I'll be doing :-)
Eamonn
Re: Certain Feeds will not update.....
And it's working now.... I wish I could say I fixed it. I did change the emonbase sketch though to clean up the Serial o/p... we'll see.
Re: Certain Feeds will not update.....
I'm convinced the root cause is with my emonbase sketch, but it'll have to wait till 2morrow :-)
Re: Certain Feeds will not update.....
Still not working ;
I'm taking inputs from 2 emontx's and can see the inputs update correctly.No matter what I do though, either my gas or water feeds will fail to update. Interesting that the electrical feed always works.When the feed fails I get the 'Fatal error: Call to a member function fetch_array() on a non-object in /var/www/emoncms3/I'
I've reinstalled latest emoncms3, created a new db, new user [ALL db priviliges], so I'm definately after breaking something....
Re: Certain Feeds will not update.....
Hello Eamonn, It is strange that it sometimes works and othertimes does not. what are your input/feed names? can you paste here the json string? It might be that your running to the end of the string buffer on the nanode?
Re: Certain Feeds will not update.....
Now that's a possibility....here's a sample of the serial output.
Re: Certain Feeds will not update.....
Great, thanks, It looks like it should be within the buffer length, comes to 124 characters. The buffer length is 150 and is set on line 70:
char buf[150];
You could try setting it to 200 to be safe.
It may also be worth stripping out the brakets in Gas(W) but thats probably not causing the problem.
Re: Certain Feeds will not update.....
Do you still get the error if you paste:
/emoncms3/api/post.json?apikey=7dc7a502ce8cfd9b008a6acad90b0fc7&json={rf_fail:0,Real:0.00,App:1379.41,V:227.92,I:0.00,PF:0.00,Pwr-Vcc:3312,Gas(W):6653.00,Pulse:20582,Wtr_mV:3312,Wtr_Pulse:7657}
manually into the address bar on your browser?
Re: Certain Feeds will not update.....
yeah; I had already increased the buffer length to 200 ; and I get the same error when I paste that string into the address bar;
I was thinking though that all my inputs are updating correctly; This should exclude the possibility of there being a sketch/buffer lenger issue I think.
It seems to me like, I'm trying to INSERT into the table but there's nothing to fetch...
db_fetch_array() is returning nothing - so I'm seeing if I can figure out why the array would be empty : needles, haystacks :-)
Re: Certain Feeds will not update.....
works if I paste the following into the address bar though....which seems to just a restriction on the JSON string length - I just deleted some of the string.... Is there a limitation elsewhere in mysql?
http://localhost/emoncms3/api/post.json?apikey=7dc7a502ce8cfd9b008a6acad90b0fc7&json={rf_fail:0,PF:0.00,Pwr-Vcc:3312,Gas(W):6653.00,Pulse:20582,Wtr_mV:3312,Wtr_Pulse:7657}
Re: Certain Feeds will not update.....
Both strings work fine for me here when I put them in the address bar and I can add as many characters as I like it seems. I will let you know if I can think of something
Re: Certain Feeds will not update.....
no prob; I've definately found a way of breaking it :-) which would be useful if it were intended. Thanks for the ideas.
Re: Certain Feeds will not update.....
Is it possible to get it working in the short term by changing the names?
Re: Certain Feeds will not update.....
/emoncms3/api/post.json?apikey=7dc7a502ce8cfd9b008a6acad90b0fc7&json={rf_fail:0,R:0.00,P:4694,W:9173}
Re: Certain Feeds will not update.....
When do the errors first start appering? is it at the feed creation stage? or input registering?