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

ssmall

  • Full Member
  • ***
  • Posts: 146
  • 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: 6279
  • 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: 291
  • 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!!