emoncms / event_archived

Setup actions to occur when a feed goes above, below or is equal a set value. Set another feed or send an email
8 stars 25 forks source link

Doesn't work with VLow Write EMONCMS V8.5 #45

Closed sheppy99 closed 5 years ago

sheppy99 commented 9 years ago

I've just installed this and everything sets up OK. The test button works but the feed values are all sat at 1970-1-1 12:00:00 suggesting it can't see the feed data. I've attached a pic of the problem. Is there any chance this can be fixed as it looks like a very useful extension to EMONCMS eventmodule

aniston commented 9 years ago

Hi, I'm having the same issue after upgrading to 8.5.2 XT and adding the latest event module which did work on OEM 8.3.6

My error looks like this .. Fatal error: Call to a member function get() on a non-object in /var/www/html/Modules/event/event_model.php on line 238

During a test run the MQTT Pub fires correctly so it's the part after the code that handles the compare to condition that's failing on line 238. Hopefully we will get closer to the problem ;)

ciao, aniston

elyobelyob commented 9 years ago

If you explain the migration to Vlow then I may have a look at it.

On Monday, 13 July 2015, Aniston notifications@github.com wrote:

Hi, I'm having the same issue after upgrading to 8.5.2 XT and adding the latest event module which did work on OEM 8.3.6

My error looks like this .. Fatal error: Call to a member function get() on a non-object in /var/www/html/Modules/event/event_model.php on line 238

During a test run the MQTT Pub fires correctly so it's the part after the code that handles the compare to condition that's failing on line 238. Hopefully we will get closer to the problem ;)

ciao, aniston

— Reply to this email directly or view it on GitHub https://github.com/emoncms/event/issues/45#issuecomment-121012561.

aniston commented 9 years ago

Hello elyobelyob, I don't think I can explain the Vlow migration part, I have never checked that branch out on my PI2, I'm testing on a shared hosting service, my comment part was to add notes on the error.

I did a checkout of the Master branch (at the bottom OEM resolves to v8.4) and with a stock installation on a Linux shared hosting the Event module works without errors (old problems w.rt. Event Settings are alwalys there)

Apparently even on a stock v8.5 branch the event Module works, but with v8.5 I had the "NAN ago" issue and Feeds being updated but not being processed.

sheppy99 commented 9 years ago

I'm using the latest image from this thread on a Raspberry Pi2 - details and download link for the image here http://openenergymonitor.org/emon/node/10729 Discussion on the difference between VLowWrite and standard images here http://openenergymonitor.org/emon/node/10934 Thanks in advance for taking a look if you have time!

elyobelyob commented 9 years ago

Not sure I can help without destroying my own setup. Quite happy with IPE.

I'd plan to go one line ahead of the error and print_r() whatever is the issue. It'll be a change in database/structure somewhere.

Nick

On Tue, Jul 14, 2015 at 11:12 PM, sheppy99 notifications@github.com wrote:

I'm using the latest image from this thread on a Raspberry Pi2 - details and download link for the image here http://openenergymonitor.org/emon/node/10729 Discussion on the difference between VLowWrite and standard images here http://openenergymonitor.org/emon/node/10934 Thanks in advance for taking a look if you have time!

— Reply to this email directly or view it on GitHub https://github.com/emoncms/event/issues/45#issuecomment-121407971.

simsasaile commented 9 years ago

I have the same problem, but with the standard emoncms V8.5.2 (not the low-write). So maybe the problem isn't connected with the low-write version...?

elyobelyob commented 9 years ago

Well, I'm still on 8.4 Master and am not recommended to upgrade to 8.5 - according to the github page. So, can't really help at this point.

But as 8.4 & 8.5 aren't compatible, that very well could be the problem.

There used to be a global variable that event used called $feed - has this been removed in the new version. Possibly.

Nick

On Mon, Aug 3, 2015 at 6:47 PM, simsasaile notifications@github.com wrote:

I have the same problem, but with the standard emoncms V8.5.2 (not the low-write). So maybe the problem isn't connected with the low-write version...?

— Reply to this email directly or view it on GitHub https://github.com/emoncms/event/issues/45#issuecomment-127346526.

elyobelyob commented 9 years ago

Ok, had a quick look as I get the issue also! (I don't use my own module that much TBH).

It looks like there has been a big change in the db structure.

                case 5:
                    // increased by
                    $feedname = 'feed_'.$feedid;

This is no longer the table name, it used to be feed_7 etc, not anymore.

                    $resultprev = $this->mysqli->query("SELECT * FROM

$feedname ORDER BY time DESC LIMIT 1,1"); //$resultprev = $this->mysqli->query("select * from event where eventfeed = $feedid order by lasttime desc limit 1,1");

The commented out SQL is the new method which looks like it works

                    $rowprev = $resultprev->fetch_array();

                    if ($value > ($rowprev['data']+$row['eventvalue']))

{ //if ($value > ($rowprev['eventvalue']+$row['eventvalue'])) {

OK, my other new fix is the bottom commented line.

\ UNFORTUNATELY **, it just keeps sending out the message repeatedly. So, this does need more investigation. Who changed the db structure so massively? Can they help?

Nick

On Tue, Aug 4, 2015 at 4:56 PM, Nick Boyle nick@elyob.com wrote:

Well, I'm still on 8.4 Master and am not recommended to upgrade to 8.5 - according to the github page. So, can't really help at this point.

But as 8.4 & 8.5 aren't compatible, that very well could be the problem.

There used to be a global variable that event used called $feed - has this been removed in the new version. Possibly.

Nick

On Mon, Aug 3, 2015 at 6:47 PM, simsasaile notifications@github.com wrote:

I have the same problem, but with the standard emoncms V8.5.2 (not the low-write). So maybe the problem isn't connected with the low-write version...?

— Reply to this email directly or view it on GitHub https://github.com/emoncms/event/issues/45#issuecomment-127346526.

pb66 commented 9 years ago

I do not claim to understand the inner workings of emoncms or the event module or for that matter their interaction, but having experienced issues with getting the events module to work myself, I recently realized I have never managed to get it working with the low-write version and assumed an incompatibility. Having now read this thread, I am quietly confident this is the case as the events module seems quite focused on the SQL tables and the finger being pointed at the missing "feed_" prefix sort of confirms the problem as SQL feeds are still named that way. But low write does not use SQL for feed data. The new feeds are all named using just the feedid and are not SQL they are flat files, just a stream of bytes, data is found by calculating the position from the file creation time and datapoint size. v8.5 has SQL disabled by default and I have just tried using a SQL feed in v9 (in development) with no joy. There is alot of change in v9 (aka v8.6xt+) including pulling the low-write, standard and extebded versions together in one variant. This discussion might get the attention of those that know if it was in the forum. I only stumbled across it because a saw mention of "a recent discussion" by Nick in an emoncms issue I opened by accident while looking for something else and then couldn't find any recent posts on the OEM forum so checked Nicks "public activity". I will include a link on the OEM forum.

Paul

pb66 commented 9 years ago

See Events module and emoncms compatability