Skip to content

[CM-474] Notify user if thing id is wrong / thing does not exist #43

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 1 commit into from
Mar 22, 2019

Conversation

aentinger
Copy link
Contributor

@aentinger aentinger commented Mar 21, 2019

Device will stay in mode IOT_STATUS_CLOUD_CONNECTING and display an error message for the user to inform him about the probable cause of the error.

[ 1742 ] ***** Arduino IoT Cloud - configuration info *****
[ 1742 ] Device ID: * 
[ 1743 ] Thing ID: *
[ 1743 ] MQTT Broker: mqtts-sa.iot.arduino.cc:8883
[ 2287 ] WiFi.status(): 0
[ 2288 ] Current WiFi Firmware: 19.5.4
[ 2288 ] Connecting to "my-wifi"
[ 26835 ] Connected to "my-wifi"
[ 27505 ] Connecting to Arduino IoT Cloud...
ERROR - Please verify your THING ID

@aentinger aentinger force-pushed the CM-474/notify-user-wrong-thing-id branch 3 times, most recently from 0a76682 to 479518d Compare March 21, 2019 12:11
Copy link
Collaborator

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use the same format for Serial output?
please replace Serial.println(...) with debugMessage("ERROR - Please verify your THING ID", 0).
this will also help in setting a custom Serial port (or Stream) to output messages to :)

@aentinger
Copy link
Contributor Author

We can of course do this - one thing though: I image the debug messages to be removed from the code at some point in time - this message should always be displayed. What's your thoughts on this?

@ubidefeo
Copy link
Collaborator

We have other messages which are as important, such as the ones related to network hardware or loss of connection.
If the user has to rely on Serial to obtain this message I think that doing it via the current logging method will allow us to later implement better filters and not having to go look for this single occurrence of Serial.println(...).
As usual I'm open to better alternatives, Alex ;)

@aentinger
Copy link
Contributor Author

aentinger commented Mar 21, 2019

Honestly I've got no better idea at this point. I'd feel better though if we coud assign constants to the numerical values used for signifying the debug message level so its better understandable what is important and what is not, e.g. 0 => LOG_ERROR, 1 = LOG_WARNING, 2 = LOG_INFO, 3 = LOG_DEBUG, 4 = LOG_BLABBERMOUTH and then call debugMessage accordingly:

sprintf(msgBuffer, "ERROR - Please verify your THING ID");
debugMessage(msgBuffer, LOG_ERROR);

@aentinger aentinger force-pushed the CM-474/notify-user-wrong-thing-id branch 2 times, most recently from dae4c02 to 2326c64 Compare March 22, 2019 05:37
@aentinger
Copy link
Contributor Author

I've rebased the branch on top of the current master and am therefore ready to merge 😉

@ubidefeo
Copy link
Collaborator

Well done, @lxrobotics
you can merge when you want

@aentinger aentinger force-pushed the CM-474/notify-user-wrong-thing-id branch from 2326c64 to d41cee8 Compare March 22, 2019 09:38
@aentinger aentinger merged commit c8da6e7 into master Mar 22, 2019
@aentinger aentinger deleted the CM-474/notify-user-wrong-thing-id branch March 22, 2019 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants