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

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: 6357
  • 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: 6357
  • 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