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

ssmall

  • Full Member
  • ***
  • Posts: 158
  • 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: 6866
  • 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: 296
  • 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: 158
  • 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: 6866
  • 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: 158
  • 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: 6866
  • 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: 6866
  • 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: 6866
  • 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: 6866
  • 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.