adafruit / Adafruit_Wippersnapper_Arduino

WipperSnapper is a firmware for creating no-code IoT electronics projects.
https://io.adafruit.com/welcome
MIT License
27 stars 40 forks source link

API V2: Remove Initial Pin Configuration Routine #551

Open brentru opened 4 months ago

brentru commented 4 months ago

Within the connect() loop, there is a blocking loop that polls until the pinCfgCompleted flag is set. While Loren and I were auditing code in preparation for the transition to api-v2, we noticed that the pinCfgCompleted flag is only set when a pin configuration message arrives at the device.

Expected Behavior: If the device does not receive a pin configuration message from the broker, this segment of code will poll forever causing an endless reboot due to the watchdog resetting.

Current Behavior: The broker incorrectly sends a (empty?) pin configuration message that sets the pinCfgCompleted flag regardless if any components exist on the device page.

Migration for API V2: In the Protobuf for API V2, we removed the message containing this is_complete field. In Arduino, the code surrounding handling this message and enforcing this check should be removed.