-
Notifications
You must be signed in to change notification settings - Fork 82
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
All registration of callbacks for various "on connection attempt" failures #243
base: master
Are you sure you want to change the base?
Conversation
…nnection' failure types: - Can not connect to the network (WiFi, GSM, ...) - Can not connect to MQTT broker - Can not subscribe to MQTT topics.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #243 +/- ##
=======================================
Coverage 95.15% 95.15%
=======================================
Files 24 24
Lines 867 867
=======================================
Hits 825 825
Misses 42 42 ☔ View full report in Codecov by Sentry. |
I like the solution |
Yes @ubidefeo, I agree! MQTT is not a user-facing concept for Arduino Cloud users, at least for now. It's a protocol used under the hood, so I would not use it in the naming of the hooks. In my notes I mapped these events that would be useful to expose via API so that they can be exposed in the UI of a device (display, LEDs, buzzer...):
The proposed The proposed @aentinger Do you think we can achieve more granularity like this schema? |
I see why you'd desire such a fine-grained granularity as it would for extremely user-friendly error messages. Right now 1) and 2) can not be distinguished as for the AIOTC firmware stack it's simply a failure to connect. One could though distinguish failure case 1) by checking the availability of the Now 3) and 4) unfortunately really can't be distinguished by technical means right now. Maybe there is a way but I'll have to dig very deep in all concerned components (the SSL stack is kind of opaque, maybe its possible to check for "aliveness" of the server via a ping - be aware though that such steps further complicate the connection procedure and might introduce other errors). . 6) Isn't detectable at all. If your variables don't exist in the cloud there's no error feedback mechanism. It would fall to the cloud to notify the user if properties are sent under a thing-id which have not been configured. |
Lastly: I agree, MQTT is a bit technical (but not overly so, it's quite common sense among many people, even if not die-hard programmers). I'm open for suggestions for other callback names though. |
Requires arduino-libraries/Arduino_ConnectionHandler#57.