Skip to content

Bugfix: Changing value of property before loop prevents connection to cloud server. #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/ArduinoIoTCloudTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,18 @@ void ArduinoIoTCloudTCP::update()
_ota_error = static_cast<int>(err);
#endif /* OTA_ENABLED */

// Check if a primitive property wrapper is locally changed
updateTimestampOnLocallyChangedProperties(_property_container);

if(checkPhyConnection() != NetworkConnectionState::CONNECTED) return;
if(checkCloudConnection() != ArduinoIoTConnectionStatus::CONNECTED) return;

/* Check if a primitive property wrapper is locally changed.
* This function requires an existing time service which in
* turn requires an established connection. Not having that
* leads to a wrong time set in the time service which inhibits
* the connection from being established due to a wrong data
* in the reconstructed certificate.
*/
updateTimestampOnLocallyChangedProperties(_property_container);

if(_mqtt_data_request_retransmit && (_mqtt_data_len > 0)) {
write(_dataTopicOut, _mqtt_data_buf, _mqtt_data_len);
_mqtt_data_request_retransmit = false;
Expand Down