-
Notifications
You must be signed in to change notification settings - Fork 293
new example mqtt_airlift_subscribe_time_keepalive.ino #235
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
Conversation
This approach stabilizes long-running MQTT connections on AirLift boards and prevents the “No socket available” disconnect condition that users are encountering.
|
@tyeth - I've tested this example code and it works. I'll work on updating the nina-fw to avoid the issue entirely, but many users will not be updating the Airlift Firmware so this work around will be helpful. |
brentru
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeysklar Overall, this is great. Proper SPI configuration for AirLift and a lot of print() statements for diagnostics will help people using AMQTT with airlift.
I have some feedback, also could you update the library version within library.properties so we can release this after approved?
| /*************************** Function Prototypes ***********************/ | ||
| void initWiFi(); | ||
| void MQTT_connect(); | ||
| void MQTT_ping(); | ||
| void printCurrentNet(); | ||
| void printWiFiData(); | ||
| void printMacAddress(byte mac[]); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but more commonly these functions would be implemented before setup() and loop(), not prototypes.
examples/mqtt_airlift_subscribe_time_keepalive/mqtt_airlift_subscribe_time_keepalive.ino
Outdated
Show resolved
Hide resolved
Thx @brentru . Changes have been made and tested. - rev library 2.6.1 -> 2.6.2 - move setup() / loop() to bottom - drop prototypes - -10 safety margin added as #define
brentru
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikeysklar Approved and merging in
This approach stabilizes long-running MQTT connections on AirLift boards and prevents the “No socket available” disconnect condition that users are encountering.
related links:
tested on:
credit to Bruce Conrad from above forum thread for code that demonstrates keepalive issue and workaround being used here.