Author Topic: PiGateway v9.1.0 Released  (Read 7858 times)

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
PiGateway v9.1.0 Released
« on: April 19, 2020, 09:45:11 PM »
The CHANGELOG is in this blog post.
This thread can serve as discussion, bug reporting, and help with upgrading to this release.

sparky

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #1 on: April 22, 2020, 08:19:06 PM »
IP for thermostat no longer in settings?  Or am I missing something


Thanks

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #2 on: April 24, 2020, 09:28:42 AM »
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

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #3 on: April 24, 2020, 10:58:17 AM »
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!
« Last Edit: April 24, 2020, 03:07:59 PM by sparky »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #4 on: April 24, 2020, 03:21:59 PM »
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

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #5 on: April 24, 2020, 03:41:35 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

Quote
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.

Menu after updating PiGateway sketch attached

« Last Edit: April 24, 2020, 05:55:39 PM by sparky »

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #6 on: April 25, 2020, 10:54:35 AM »
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

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #7 on: April 25, 2020, 01:58:05 PM »
@ssmall

Thanks for the info.

HeneryH

  • Full Member
  • ***
  • Posts: 229
Re: PiGateway v9.1.0 Released
« Reply #8 on: April 25, 2020, 03:50:16 PM »
Anyone have any experience with this
Quote
npm-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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #9 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.

@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

  • Full Member
  • ***
  • Posts: 229
Re: PiGateway v9.1.0 Released
« Reply #10 on: April 26, 2020, 07:14:16 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

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #11 on: April 26, 2020, 07:37:38 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #12 on: April 26, 2020, 08:13:44 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

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #13 on: April 26, 2020, 08:18:29 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

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #14 on: April 26, 2020, 08:39:21 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.
« Last Edit: April 27, 2020, 08:19:17 AM by sparky »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #15 on: April 28, 2020, 12:04:58 PM »
The app itself doesnt (currently) know what ID the gateway is, and maybe it should not, it's not its job to have too much knowledge about the RF gateway.
I could implement a fix but it would really have to go in the RF gateway sketch not in the app itself (ie to check if the ID==self, then dont send anything anywhere).
OR we just need to know that for gateway query-ing there is no ID (sorry if this is non obvious).

So for now dont type a node number, the node ID is only for when the destination is NON gateway. If you type 1 the RF gateway will send a packet "UPTIME" to node ID=1 which is itself, so it will never get a response. Its a bit of a LOL right?

The takeaway for now is just type UPTIME in the message when you want to query the gateway.

sparky

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #16 on: April 28, 2020, 05:44:34 PM »
Felix,

Thanks!

Also, just a reminder, the commit you posted to add radiothermostat to the settings file has not been added to the latest code.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #17 on: April 28, 2020, 10:19:10 PM »
Also, just a reminder, the commit you posted to add radiothermostat to the settings file has not been added to the latest code.
Is is in the latest code, just not in the latest release (9.0). To get it, it has to be done either manually, or installing "latest available code" in the setup script.
As I build a list of more fixes I will make a new minor release.

sparky

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #18 on: April 29, 2020, 07:05:42 AM »
Is is in the latest code, just not in the latest release (9.0). To get it, it has to be done either manually, or installing "latest available code" in the setup script.
As I build a list of more fixes I will make a new minor release.

Little confused by your response but no biggie..  All I can say is that yesterday when I sent that response I had just finished re-installing the "latest code" and I had to manually change the setting.json5 file.  If this is what you meant we are good.

If you look here the file has been changed;
https://github.com/LowPowerLab/RaspberryPi-Gateway/blob/master/settings.json5

But if you look here the file is not changed;
https://github.com/LowPowerLab/RaspberryPi-Gateway/releases/tag/9.1.0

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #19 on: April 30, 2020, 11:23:32 AM »
Clarification: A release is a snapshot of the codebase at that point in time.
The setup script allows you to install the latest release (9.1 snapshot), or the latest available code. Two different things.
I hope that is more clear now.

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #20 on: May 02, 2020, 06:48:08 PM »
I have looked into modifying things to try and get the Garage: Auto Close to work again.  I think I'm on the right track but I have a question.

@Felix is there a way to retrieve a node from the DB and allow the node to exist beyond the scope of the function defined in the  db.findOne call?

Example:

db.findOne({ _id : nodeAtScheduleTime._id }, function (err, nodeRightNow) {

  code to modify nodeRightNow

  return nodeRightNow;
});

Thanks

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #21 on: May 03, 2020, 07:33:08 PM »
Nevermind. I have Garage: Auto Close working again. I am testing out the changes. I will create a PR when I'm done testing.

Cam

  • NewMember
  • *
  • Posts: 2
Re: PiGateway v9.1.0 Released
« Reply #22 on: May 17, 2020, 06:33:46 PM »
I have several virtual nodes that send data to the gateway via a GET request similar to this: https://raspberrypi/httpendpoint/?id=1234&MOTION&F=77.77

Here is an example of a python script that just sends the temperature, the relevant code is:
Code: [Select]
requests.get('https://%s/httpendpoint/?id=%s&F=%s' % (gateway_ip, device_id, temperature), verify=False, auth=(username, password))
These all worked well on 9.0, but has been very inconsistent with many values not being recorded on 9.1.

It appears that every time a GET request is sent (every 5 minutes), the gateway is disconnected, app reboots, and I get the following message in the browser before it reconnects: "App server was disconnected. Waiting for new connection..."

The log looks like this:
Quote
[05-17-20 18:12:21.674] [LOG]    post: /home/pi/gateway/data/db/0120_F.bin [1589753541,76.55]
/home/pi/gateway/gateway.js:1142
          db.update({ _id: id }, { $set : entry}, {}, function (err, numReplaced) { console.info(`[${id}] DB-Updated: httpEndPointHandler(${queryString}):entry=${JSON.stringify(entry)}`) });
                                                                                                                                            ^
TypeError: Cannot convert object to primitive value
    at /home/pi/gateway/gateway.js:1142:141
    at newArguments.(anonymous function) (/home/pi/gateway/node_modules/nedb/lib/executor.js:29:17)
    at /home/pi/gateway/node_modules/nedb/lib/datastore.js:642:18
    at /home/pi/gateway/node_modules/nedb/lib/persistence.js:201:12
    at FSReqCallback.args [as oncomplete] (fs.js:145:20)
[05-17-20 18:12:25.968] [INFO]   *********************************************************************
[05-17-20 18:12:25.977] [INFO]   ************************* GATEWAY APP START *************************
[05-17-20 18:12:25.978] [INFO]   *********************************************************************

Anyone have ideas why the TypeError and app reboot is happening or how to further investigate it?

Thanks.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #23 on: May 18, 2020, 02:47:52 PM »
Cam,
I submitted a fix, please replace your gateway.js and this should take care of it.
« Last Edit: May 18, 2020, 03:29:44 PM by Felix »

Cam

  • NewMember
  • *
  • Posts: 2
Re: PiGateway v9.1.0 Released
« Reply #24 on: May 18, 2020, 09:26:02 PM »
That did it - it works great now. Thanks!

sparky

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #25 on: June 01, 2020, 09:51:13 AM »
Felix,

Now thats its sprinkler season I ran into an issue where my programs stop well before the 61 bytes max string length.  After noticing the issue I tried your IOShield example, specifically the "Run Z1-8 5min", and the program stopped after completing zone 3.

This issue just started with the new version of your PiGateway, V9.1.0

Thanks! 

Edit:

Below is all that was in the log regarding this issue.  Note that although zone #1 came on when I ran "Run Z1-8 5min" it just didn't show up as running in the UI nor did it show up in the log.

Code: [Select]
[06-01-20 12:46:09.295] [LOG]    /dev/ttyUSB0>:[2] ZONE:2 SS:-68
[06-01-20 12:46:09.299] [LOG]    post: /home/pi/gateway/data/db/0002_ZONE.bin[1591029969,2]
[06-01-20 12:46:09.301] [LOG]    post: /home/pi/gateway/data/db/0002_RSSI.bin[1591029969,-68]
[06-01-20 12:46:09.306] [INFO]   [2] DB-Updated: processSerialData('[2] ZONE:2 SS:-68\r',undefined):entry={"_id":2,"updated":1591029969299,"type":"SprinklerMote","label":"Sprinkler Controller","descr":"[2]","metrics":{"START":{"label":"START","value":"Started","updated":1591011355564},"RSSI":{"label":"RSSI","value":-68,"unit":"db","updated":1591029969299,"graph":1,"pin":0},"ZONE":{"label":"ZONE","value":2,"updated":1591029969299,"pin":1589654523313,"graph":1}}}

[06-01-20 12:51:09.242] [LOG]    /dev/ttyUSB0>:[2] ZONE:3 SS:-68
[06-01-20 12:51:09.246] [LOG]    post: /home/pi/gateway/data/db/0002_ZONE.bin[1591030269,3]
[06-01-20 12:51:09.248] [LOG]    post: /home/pi/gateway/data/db/0002_RSSI.bin[1591030269,-68]
[06-01-20 12:51:09.253] [INFO]   [2] DB-Updated: processSerialData('[2] ZONE:3 SS:-68\r',undefined):entry={"_id":2,"updated":1591030269245,"type":"SprinklerMote","label":"Sprinkler Controller","descr":"[2]","metrics":{"START":{"label":"START","value":"Started","updated":1591011355564},"RSSI":{"label":"RSSI","value":-68,"unit":"db","updated":1591030269245,"graph":1,"pin":0},"ZONE":{"label":"ZONE","value":3,"updated":1591030269245,"pin":1589654523313,"graph":1}}}

[06-01-20 12:56:09.178] [LOG]    /dev/ttyUSB0>:[2] ZONES:OFF SS:-69
[06-01-20 12:56:09.183] [LOG]    post: /home/pi/gateway/data/db/0002_ZONE.bin[1591030569,0]
[06-01-20 12:56:09.184] [LOG]    post: /home/pi/gateway/data/db/0002_RSSI.bin[1591030569,-69]
[06-01-20 12:56:09.190] [INFO]   [2] DB-Updated: processSerialData('[2] ZONES:OFF SS:-69\r',undefined):entry={"_id":2,"updated":1591030569182,"type":"SprinklerMote","label":"Sprinkler Controller","descr":"[2]","metrics":{"START":{"label":"START","value":"Started","updated":1591011355564},"RSSI":{"label":"RSSI","value":-69,"unit":"db","updated":1591030569182,"graph":1,"pin":0},"ZONE":{"label":"ZONE","value":"OFF","updated":1591030569182,"pin":1589654523313,"graph":1}}}
« Last Edit: June 01, 2020, 01:28:25 PM by sparky »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #26 on: June 02, 2020, 08:08:20 AM »
Hi sparky,
I can't be sure why it would not show Z1 running. That sounds like the sprinkler mote packet never made it to the gateway.
For the rest of it, I will need to see your sprinkler event string that you send for the entire 8 zone.
A 9 zone should be accomodated within 57 chars, ex: PRG 1:300 2:300 3:300 4:300 5:300 6:300 7:300 8:300 9:300
Any way you could add some debug code to your sprinkler mote and see what it actually receives? Is it a truncated string?

sparky

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #27 on: June 02, 2020, 10:46:38 AM »
Quote
I can't be sure why it would not show Z1 running. That sounds like the sprinkler mote packet never made it to the gateway.

It's weird, it doesn't do it all the time but in the example I posted was one of the times


Quote
For the rest of it, I will need to see your sprinkler event string that you send for the entire 8 zone.
A 9 zone should be accomodated within 57 chars, ex: PRG 1:300 2:300 3:300 4:300 5:300 6:300 7:300 8:300 9:300

This particular event string of mine stopped after completing Z12;

Code: [Select]
MP : { states: [{ label:'Run Street', action:'PRG 10:600 12:600 13:600'}]},

and this one from your IOShield example stopped after completing Z3;

Code: [Select]
MN : { states: [{ label:'Run Z1-8 5min', action:'PRG 1:300 2:300 3:300 4:200 5:300 5:300 6:300 7:300 8:300'}]},

Quote
Any way you could add some debug code to your sprinkler mote and see what it actually receives? Is it a truncated string?

I'm not experienced enough to do this, don't even know where to start..  :-X

I was hoping you fired up your sprinklers and ran into the same issue.  ;D  Other than the new Gateway ver,  everything is the same code wise.  Let me know if you need any more info. Thank you!

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #28 on: June 02, 2020, 08:39:07 PM »
I am seeing the same issue.

Here is the string defined in the action that should be sent by the gateway:
PRG 1:900 2:1350 3:900 4:1800 5:1800 6:1050

This the string received by the mote:
PRG 1:900 2:1350 3:90

If I use the PiGateway_Basic sketch the string is not truncated and all zones are extracted.
« Last Edit: June 03, 2020, 01:07:55 PM by ssmall »

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #29 on: June 03, 2020, 07:40:20 PM »
Will need to look into this. When I turn my sprinklers and it fails?  ;D
If someone else wants to do more debugging that would be great.

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #30 on: June 04, 2020, 03:19:13 PM »
It looks like the PiGateway.ino has been modified in the last few days, so it differs from my version which is older.  However, I think the issue is still the same.
The dataPartvariable[MAX_BUFFER_LENGTH] declared in the processCommand method is too small to hold sprinkler strings.  MAX_BUFFER_LENGTH is defined at 25 in my sketch.  sprinkler strings are typically longer than that.

    targetId = atoi(dataPart);       // attempt to extract nodeID part
    ptr = strtok(NULL, "");          // get command part to the end of the string
    sprintf(dataPart, "%s", ptr);

The dataPart string in the sprintf is too small to handle the sprinkler string.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #31 on: June 05, 2020, 10:31:00 AM »
Good catch, it's fixed, get latest, retry and let me know if all is good.

sparky

  • Sr. Member
  • ****
  • Posts: 293
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #32 on: June 05, 2020, 02:04:38 PM »
All is good.

Just completed 3 zones without it stopping.

Thanks to both of you!!

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #33 on: September 13, 2020, 12:15:08 PM »
I would like to report a bug in the PiGateway.  When an active scheduled event is deleted via the web interface the event is removed but it appears that the event is still scheduled and still runs after the event is removed.  The following error occurs:

/home/pi/gateway/gateway.js:1195
  node.events[eventKey].executeDateTime = new Date(Date.now() + nextRunTimeout); //actual datetime when this is scheduled to execute
                                        ^

TypeError: Cannot set property 'executeDateTime' of undefined
    at global.schedule (/home/pi/gateway/gateway.js:1195:41)
    at /home/pi/gateway/gateway.js:1230:5
    at newArguments.(anonymous function) (/home/pi/gateway/node_modules/nedb/lib/executor.js:29:17)
    at Cursor.execFn (/home/pi/gateway/node_modules/nedb/lib/datastore.js:518:14)
    at callback (/home/pi/gateway/node_modules/nedb/lib/cursor.js:126:19)
    at /home/pi/gateway/node_modules/nedb/lib/cursor.js:193:12
    at /home/pi/gateway/node_modules/nedb/lib/datastore.js:329:14
    at Object.async.eachSeries (/home/pi/gateway/node_modules/nedb/node_modules/async/lib/async.js:130:20)
    at /home/pi/gateway/node_modules/nedb/lib/datastore.js:323:11
    at fn (/home/pi/gateway/node_modules/nedb/node_modules/async/lib/async.js:582:34)

This error does not happen if the scheduled event is first disabled and then deleted.
It happens on a given node's page that has a scheduled event setup for the node.  The event has to be active, then delete the event.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #34 on: September 14, 2020, 04:32:21 PM »
Thanks, I will look into it when I have a chance.

ssmall

  • Full Member
  • ***
  • Posts: 148
  • Country: us
Re: PiGateway v9.1.0 Released
« Reply #35 on: October 13, 2020, 06:29:39 PM »
I tried sending a request to one of my nodes to see if I could see the request in the ack using the new Gateway.ino sketch.  It wasn't working so I looked in the gateway logs and I am seeing the following:

[10-13-20 17:18:34.170] [INFO]   REQUEST SENT: REQUESTQUEUE:3:PGM\n
[10-13-20 17:18:34.170] [INFO]      [3] Added request:PGM
[10-13-20 17:18:34.174] [INFO]   SUBMITNODEREQUEST DB-Replaced:1
[10-13-20 17:18:34.355] [LOG]    /dev/ttyAMA0>:[0] 3:PGM:INV:ID-OUT-OF-RANGE
[10-13-20 17:18:34.356] [LOG]    NODEDATA PARTIAL NOMATCH>: 3:PGM:INV:ID-OUT-OF-RANGE

It looks like the Gateway sketch is having an issue parsing the nodeId

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #36 on: October 29, 2020, 11:05:10 AM »
Am having trouble of late getting a new install working.  I've tried multiple versions of the raspberry pi O/S, different SD cards, even different pi's, and it gets stuck on "Waiting for socket connection..."  I have documented all my specific steps from last time I did a fresh install and worked.  One thing I noticed this time is errors in the output I don't believe I have ever seen before.  I will attach the session output here if anyone wouldn't mind having a look.  Thanks in advance.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #37 on: October 29, 2020, 12:10:00 PM »
The log you show shows nodeJs errors out while trying to build nodeserialport.
Are you using the latest Pi distribution and gatewaysetup.sh?

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #38 on: October 29, 2020, 12:25:44 PM »
Am running the commands based on your guide and as below.  I assume these would grab the latest?

sudo wget https://raw.githubusercontent.com/LowPowerLab/RaspberryPi-Gateway/master/.setup/gatewaysetup.sh
sudo bash gatewaysetup.sh && sudo rm gatewaysetup.sh

Have tried 3 different Pi OS versions:  2020-08-20, 2020-05-27 (buster lite) and 2019-04-08 (stretch lite).

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #39 on: October 29, 2020, 01:57:39 PM »
Yes thats latest, and was tested on the buster 8-20 image, works.
What Pi do you have?

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #40 on: October 29, 2020, 09:30:45 PM »
I tested a Pi Zero and a 2B.  Same results for both.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #41 on: October 30, 2020, 09:25:58 AM »
Ok, use a Pi3 or above.

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #42 on: November 10, 2020, 07:04:19 PM »
Brand spanking new Pi 4 purchased.  Same result.  Waiting for socket connection..

Any advice would be appreciated.

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #43 on: November 12, 2020, 09:30:28 PM »
Attaching the session output from the latest install on the Pi4 on the latest release of OS Lite.  There are errors in the output that I don't think were there before I started experiencing problems.

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:329:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
gyp ERR! System Linux 5.4.51-v7l+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/gateway/node_modules/@serialport/bindings
gyp ERR! node -v v15.2.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@2.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@2.0.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #44 on: November 13, 2020, 01:47:20 PM »
serialnode fails to build. What is the command you use to start the PiGateway setup process?
I just tested on a Pi3B+ again again, and its smooth as silk, no errors, GUI boots right up, empty node list as you'd expect.
BUT i think the problem might be you're loading the [recommended] latest stable release instead of the latest available code, please try that instead.
I should make a new release...

EDIT: I made a new release now 9.2.0 so pulling either HEAD or latest release should be good now.

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #45 on: November 14, 2020, 08:31:41 AM »
That seemed to do the trick, thanks.  So the 9.1.0 version wasn't compatible with the latest Pi OS from Aug 20, 2020?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6531
  • Country: us
    • LowPowerLab
Re: PiGateway v9.1.0 Released
« Reply #46 on: November 14, 2020, 08:45:04 PM »
Not exactly, when the 9.1.0 release was picked during install, the package.json serialnode version in that release was not compatible with the latest node version. So building serialnode failed. Picking the latest available source code (which is what I usually do) got the latest available package.json which was compatible.
So anyway a new release to include this latest package.json fixed the issue.

jamacaulay

  • NewMember
  • *
  • Posts: 18
Re: PiGateway v9.1.0 Released
« Reply #47 on: November 15, 2020, 11:39:48 AM »
Have also confirmed 9.2.0 installs and works fine on a Pi 2B.