0

Errore message from Adafruit
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

Errore message from Adafruit

by LLenvir on Sun Mar 07, 2021 10:36 am

Some one could tell me what happen ?

Thank you so much.
Attachments
167250C1-D443-4B44-AA6D-958D63E5BFE2.jpeg
167250C1-D443-4B44-AA6D-958D63E5BFE2.jpeg (68.24 KiB) Viewed 172 times

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by jwcooper on Sun Mar 07, 2021 11:21 am

This usually indicates you're passing the wrong auth credentials. I would try one of the example sketches of whichever client library you are using, and make sure you are using the proper username and aio key.

You can also post your example code here (remove any sensitive data!) and we can try and see why it's failing.

jwcooper
 
Posts: 774
Joined: Tue May 01, 2012 9:08 pm

Re: Errore message from Adafruit

by LLenvir on Tue Mar 09, 2021 7:04 am

Hi,

I'm using tinyGSM library for mqtt message.
The message appear after one day of sending data.

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by jwcooper on Tue Mar 09, 2021 11:31 am

Is this the only device you have connected to Adafruit IO? It is possible for another device to trigger authentication errors, impacting all connected devices.

We may need to see your sanitized code. Simplifying it to a core reproducible simpler code would help us or others diagnose the issue quicker.

My initial thoughts are that your device is running fine for one day, but it gets into an authentication loop. This can happen multiple ways, but particularly if the device is crashing and restarting (or disconnecting and re-authenticating, which may be the case here), causing the authentication to happen rapidly.

You could put a sleep function before or after authentication so you don't hit the auth throttle limits.

jwcooper
 
Posts: 774
Joined: Tue May 01, 2012 9:08 pm

Re: Errore message from Adafruit

by LLenvir on Tue Mar 09, 2021 1:23 pm

Thank you I will verified tomorrow

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by LLenvir on Thu Mar 11, 2021 11:37 am

Hi,

I'm using the TinyGSM library from github.
Here the webpage : https://github.com/vshymanskyy/TinyGSM

There is a mqtt.loop() function, Is this the problem?

thanks

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by LLenvir on Thu Mar 11, 2021 11:53 am

I'm using mqqt.client example in particular.

For a payed account do you have a cleint service by phone?

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by jwcooper on Thu Mar 11, 2021 5:15 pm

LLenvir wrote:I'm using mqqt.client example in particular.

For a payed account do you have a cleint service by phone?


At this time, we do not have paid support. We will help on the forums and in support emails as appropriate. In this case, it's best to handle this in the forums so that anyone in the future can also see the solution.

In order to further help you, we'll need a simplified (and sanitized) version of the code that is breaking. You can post that here as a reply.

Also, as tinyGSM is not an Adafruit library, you may want to reach out to that developer and see if they offer paid support to figure out why the library isn't working for you. There are no known issues with Adafruit IO right now regarding MQTT and disconnections after a day of running.

jwcooper
 
Posts: 774
Joined: Tue May 01, 2012 9:08 pm

Re: Errore message from Adafruit

by LLenvir on Mon Mar 15, 2021 3:21 am

Here the code core:

void loop() {

if (rtc.getMinutes() == 59 && rtc.getSeconds() == 00 ){ //lettura all'ora
mqtt.loop();
sensor_read(); // a function to read the sensor, 100% work

if (!mqtt.connected()) {
SerialUSB.println("=== MQTT NOT CONNECTED ===");
// Reconnect every 10 seconds
uint32_t t = millis();

if (t - lastReconnectAttempt > 5000) {
lastReconnectAttempt = t;
if (mqttConnect()) {
lastReconnectAttempt = 0;
}
}
delay(100);
return;
}
}
if (rtc.getMinutes() == 29 && rtc.getSeconds() == 00 ){//lettura alla mezza
mqtt.loop();
sensor_read();

if (!mqtt.connected()) {
SerialUSB.println("=== MQTT NOT CONNECTED ===");
// Reconnect every 10 seconds
uint32_t t = millis();


if (t - lastReconnectAttempt > 5000) {
lastReconnectAttempt = t;
if (mqttConnect()) {
lastReconnectAttempt = 0;
}
}
delay(100);
return;
}
}

}

mqtt.loop(); <-- I don't know how it works

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by brubell on Mon Mar 15, 2021 9:59 am

Are you connecting to the Adafruit IO MQTT server on port 1883 or the secure port (8883)?

Do you know if the code tries to initiate reconnection after a day of running? Do you have the serial monitor's output from that point in time?

brubell
 
Posts: 1319
Joined: Fri Jul 17, 2015 10:33 pm

Re: Errore message from Adafruit

by LLenvir on Tue Mar 16, 2021 3:06 am

This is the message shown:

07:38:38.063 -> AT+CIPRXGET=4,0
07:38:38.063 ->
07:38:38.063 -> +CME ERROR: operation not allowed
07:38:38.063 -> AT+CIPSTATUS=0
07:38:38.110 ->
07:38:38.110 -> +CME ERROR: operation not allowed
07:38:40.969 -> AT+CIPRXGET=4,0
07:38:40.969 ->
07:38:40.969 -> +CME ERROR: operation not allowed
07:38:40.969 -> AT+CIPSTATUS=0
07:38:41.016 ->
07:38:41.016 -> +CME ERROR: operation not allowed
07:38:43.032 -> === MQTT NOT CONNECTED ===
07:38:43.032 -> Connecting to io.adafruit.comAT+CIPRXGET=4,0
07:38:43.032 ->
07:38:43.032 -> +CME ERROR: operation not allowed
07:38:43.079 -> AT+CIPSTATUS=0
07:38:43.079 ->
07:38:43.079 -> +CME ERROR: operation not allowed
07:38:45.094 -> AT+CIPRXGET=4,0
07:38:45.094 ->
07:38:45.141 -> +CME ERROR: operation not allowed
07:38:45.141 -> AT+CIPSTATUS=0
07:38:45.141 ->
07:38:45.141 -> +CME ERROR: operation not allowed
07:38:47.203 -> AT+CIPCLOSE=0,1
07:38:47.203 ->
07:38:47.203 -> +CME ERROR: operation not allowed
07:38:47.250 -> AT+CIPSSL=0
07:38:47.250 ->
07:38:47.250 -> +CME ERROR: unknown
07:38:47.250 -> AT+CIPSTART=0,"TCP","0.0.0.0",0
07:38:47.297 ->
07:38:47.297 -> +CME ERROR: operation not allowed
07:40:02.233 -> [65897612] ### Unhandled: +CME ERROR: operation not allowed
07:40:02.233 -> AT+CIPRXGET=4,0
07:40:02.233 ->
07:40:02.233 -> +CME ERROR: operation not allowed
07:40:02.233 -> AT+CIPSTATUS=0
07:40:02.279 ->
07:40:02.279 -> +CME ERROR: operation not allowed
07:40:04.295 -> AT+CIPRXGET=4,0
07:40:04.295 ->
07:40:04.295 -> +CME ERROR: operation not allowed
07:40:04.342 -> AT+CIPSTATUS=0
07:40:04.342 ->
07:40:04.342 -> +CME ERROR: operation not allowed
07:40:06.357 -> AT+CIPRXGET=4,0
07:40:06.404 ->
07:40:06.404 -> +CME ERROR: operation not allowed
07:40:06.404 -> AT+CIPSTATUS=0
07:40:06.404 ->
07:40:06.404 -> +CME ERROR: operation not allowed
07:40:08.467 -> AT+CIPRXGET=4,0
07:40:08.467 ->
07:40:08.467 -> +CME ERROR: operation not allowed
07:40:08.514 -> AT+CIPSTATUS=0
07:40:08.514 ->
07:40:08.514 -> +CME ERROR: operation not allowed
07:40:10.529 -> AT+CIPRXGET=4,0
07:40:10.529 ->
07:40:10.529 -> +CME ERROR: operation not allowed
07:40:10.576 -> AT+CIPSTATUS=0
07:40:10.576 ->
07:40:10.576 -> +CME ERROR: operation not allowed
07:40:12.592 -> success
07:40:12.592 -> AT+CIPRXGET=4,0
07:40:12.639 ->
07:40:12.639 -> +CME ERROR: operation not allowed
07:40:12.639 -> AT+CIPSTATUS=0
07:40:12.639 ->
07:40:12.685 -> +CME ERROR: operation not allowed

What do you think about it?
Thank you

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Re: Errore message from Adafruit

by brubell on Wed Mar 17, 2021 11:27 am

Code: Select all | TOGGLE FULL SIZE
if (!mqtt.connected()) {
SerialUSB.println("=== MQTT NOT CONNECTED ===");
// Reconnect every 10 seconds
uint32_t t = millis();

if (t - lastReconnectAttempt > 5000) {
lastReconnectAttempt = t;
if (mqttConnect()) {
lastReconnectAttempt = 0;
}
}
delay(6000);
return;
}
}


You could try increasing the delay time from milliseconds to a minute after you authorize with Adafruit IO, check the updated code snippet above:

brubell
 
Posts: 1319
Joined: Fri Jul 17, 2015 10:33 pm

Re: Errore message from Adafruit

by LLenvir on Wed Mar 24, 2021 11:20 am

Thank you, I'll check if is enough this week.
Have a nice day

LLenvir
 
Posts: 16
Joined: Tue Dec 29, 2020 8:32 am

Please be positive and constructive with your questions and comments.