PiGateway v9.1.0 Released

Started by Felix, April 19, 2020, 09:45:11 PM

Felix

The CHANGELOG is in this blog post.
This thread can serve as discussion, bug reporting, and help with upgrading to this release.

sparky

IP for thermostat no longer in settings?  Or am I missing something


Thanks

Felix

You're right, first bug is in!
I somehow dropped that when I merged the diffs for the settings file, and I had it on my Gateway unchanged so I totally missed it in testing.
I posted a commit and if you install the latest code it will pick it up otherwise you can add that section to your settings.json5 file.
Thanks!!

sparky

#3
Thanks Felix!

Also;

* Have you personally used or tested the "Garage: Auto CLOSE" metric you have in the example folder?  I haven't been able to get it to work.

* On the UI drop down, Gateway Uptime and Freq. show unknown.. where is it grabbing this information from?

Thanks for all the great work!

Felix

Quote* Have you personally used or tested the "Garage: Auto CLOSE" metric you have in the example folder?  I haven't been able to get it to work.
It was contributed and I haven't used it. Hence no interest or time to debug it. I would welcome help fixing bugs though!

Quote* On the UI drop down, Gateway Uptime and Freq. show unknown.. where is it grabbing this information from?
Those come from the sketch running on the RF Gateway. You will need to update your RF Gateway sketch as mentioned in the blog release.

sparky

#5
Quote from: Felix on April 24, 2020, 03:21:59 PM
It was contributed and I haven't used it. Hence no interest or time to debug it. I would welcome help fixing bugs though!

I'll keep trying

QuoteThose come from the sketch running on the RF Gateway. You will need to update your RF Gateway sketch as mentioned in the blog release.

Menu after updating PiGateway sketch attached


ssmall

With regard to Garage: Auto CLOSE not working with PiGateway V9.x.x, I believe the reason for this is that the node is updated in the event and saved to the database.  However the function

global.runAndReschedule = function(functionToExecute, node, eventKey) which invokes the event calls

global.schedule = function(node, eventKey).  This function updates the executeDateTime on the node.  It then retrieves the node from the database sets the event on the retrieved node and saves the node back to the database.  I believe it is here that the data that was written by the Garage: Auto CLOSE is overwritten by global.schedule causing the metric to not work properly.

@Felix, I am open to suggestions as to how to fix the issue.  It looks like it would involve reworking how scheduled events work.

Hope that makes sense,

-Steve

sparky


HeneryH

Anyone have any experience with this
Quotenpm-request replaced with native node http module – this is to handle any http requests (like for the CT50 Thermostat)

Can this be used for sending http posts to the gateway to initiate events?

Felix

@sparky, does your sketch send an UPTIME message response? (Ie if you type UPTIME in terminal)
Both the sketch is made to send that, and the gateway to ask for it, when they restart.

@ssmall, a PR with the fix would be great.

@HeneryH,
It does not matter to PiGateway how you generate the HTTP request so long as it is valid.

HeneryH

Quote from: Felix on April 26, 2020, 06:32:04 PM
@HeneryH,
It does not matter to PiGateway how you generate the HTTP request so long as it is valid.
Is there any reference anywhere as to what 'valid' is?

sparky

Quote from: Felix on April 26, 2020, 06:32:04 PM
@sparky, does your sketch send an UPTIME message response? (Ie if you type UPTIME in terminal)
Both the sketch is made to send that, and the gateway to ask for it, when they restart.

No response in terminal when sending UPTIME.. or SYSFREQ..

When doing a restart the only thing I get other than normal node data is;
11:53:09.563 : SERVERTIME OFFSET: 3161ms

Felix

Quote from: HeneryH on April 26, 2020, 07:14:16 PM
Is there any reference anywhere as to what 'valid' is?

Not 100% sure what you're asking.
I blogged about this feature in the 9.0 release.

Here is a simple GET request with a query string:  https://raspberrypi/httpendpoint/?id=1234&MOTION&F=77.77
You could simply type this in the browser and it will post the 2 metrics to node 1234.
If you need to generate a HTTP request from some other place, then there are MANY methods to do so.

Felix

Quote from: sparky on April 26, 2020, 07:37:38 PM
No response in terminal when sending UPTIME.. or SYSFREQ..

When doing a restart the only thing I get other than normal node data is;
11:53:09.563 : SERVERTIME OFFSET: 3161ms

Did you verify you have the correct PiGateway sketch running on your RF gateway?
Look starting at line 191 in the link above. It prints out a few commands back to the gateway.

sparky

#14
Quote from: Felix on April 26, 2020, 08:18:29 PM
Did you verify you have the correct PiGateway sketch running on your RF gateway?
Look starting at line 191 in the link above. It prints out a few commands back to the gateway.

Yes, that's the sketch I'm using..

Results from SEND & SIMULATE UPTIME msg;

08:15:47.823 : /dev/ttyUSB0(simulated)>:[1]UPTIME
08:15:46.563 : GARAGE POLL STATUS: CLOSED
08:15:40.458 : /dev/ttyUSB0>:[6] CM:3 SS:-28
08:15:24.328 : /dev/ttyUSB0>:DEBUG:handleSerialData:1:UPTIME

But I never get a response.