Blynk with A7 GSM module can connect to GPRS but output is Cmd skipped:29 and blynk.cloud is not reachable

Hey there,

I am currently working with the Ai Thinker A7 GSM+GPS module and want to connect it via GPRS to the blynk.cloud (the Blynk APP). Unfortunately I get stuck in the Blynk.begin() function, because it seems like the module couldn’t connect to the blynk.cloud. The output in the serial monitor looks like this without changing its output for several minutes…:

[153] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v1.0.1 on ESP32

[155] Modem init...
[591] Connecting to network...
[865] Network: NettoKOM
[865] Connecting to internet.eplus.de ...
[1218] Connected to GPRS
[1335] Connecting to blynk.cloud:8080
[6343] Cmd skipped:29
[10604] Connecting to blynk.cloud:8080
[13362] Cmd skipped:29
[17625] Connecting to blynk.cloud:8080
[20321] Cmd skipped:29
[20440] Connecting to blynk.cloud:8080
[23159] Cmd skipped:29
[27420] Connecting to blynk.cloud:8080
[30143] Cmd skipped:29
[34404] Connecting to blynk.cloud:8080
[37140] Cmd skipped:29

Can someone tell me what does the Cmd Skipped:29 mean?

A few sentences to my hardware setup and the things I have done so far:

  1. I am using an ESP32 dev board with an A7 shield on a breadboard. General AT communication with the module is working and is done over Serial1 port of the ESP32.
  2. I have added a huge capacitor directly next to the power input. Already gone through this problematic earlier…
  3. Same code is working with a different GSM module (SIM800 by Simcom).
  4. Module does not connect to blynk.cloud when using the old Blynk version as well. It will stay in the connection loop either.
  5. I have changed server (blynk.cloud, blynk-cloud.com, IP-address) and port (80, 8080, 430) but nothing changed.
  6. Neither inside nor outside possible.

My code is:

#define BLYNK_PRINT Serial
#define BLYNK_DEBUG
#define BLYNK_DEBUG_ALL Serial

#define BLYNK_TEMPLATE_ID "XXX"
#define BLYNK_DEVICE_NAME "XXX"
#define BLYNK_AUTH_TOKEN "XXX"

#define TINY_GSM_MODEM_A7
#define TINY_GSM_RX_BUFFER   1024  // Set RX buffer to 1Kb
#define MODEM_TX             27
#define MODEM_RX             26

#include <TinyGsmClient.h>
#include <BlynkSimpleTinyGSM.h>

char auth[] = BLYNK_AUTH_TOKEN;

char apn[]  = "internet.eplus.de";
char user[] = "nettokom";
char pass[] = "nettokom";

TinyGsm modem(Serial1);

BLYNK_WRITE(V0){
  int in = param.asInt();
  Serial.print("in: ");
  Serial.println(in);
}

void setup(){
  Serial.begin(115200);
  delay(100);
  Serial1.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX);

  // Blynk.begin(auth, modem, apn, user, pass);
  Blynk.begin(auth, modem, apn, user, pass, "blynk.cloud", 8080);
}

void loop(){
  Blynk.run();
}

Can someone help what is going on here? Or has someone noticed similar problems using the Ai Thinker A7 module?

Any help is appreciated!

Thanks in advance and regards,
Moritz

Facing connection issue recently when using GPRS, but for me it is due to DNS issue. I update the library to use direct IP of blynk.cloud and it worked.

But for connection thru wifi, no problem. so i am not sure what is the real root cause.

Anyhow, direct IP is just a quick workaround.

So you are using the IP address in the Blynk.begin() function? Just like:

Blynk.begin(auth, modem, apn, user, pass, "46.101.217.214", 80);

I’ve already tried this, without success. :expressionless:
I got the IP address of blynk.cloud through pinging the website:

❯ ping blynk.cloud
PING blynk.cloud (46.101.217.214): 56 data bytes
64 bytes from 46.101.217.214: icmp_seq=0 ttl=56 time=15.504 ms
64 bytes from 46.101.217.214: icmp_seq=1 ttl=56 time=23.530 ms
64 bytes from 46.101.217.214: icmp_seq=2 ttl=56 time=22.828 ms
64 bytes from 46.101.217.214: icmp_seq=3 ttl=56 time=21.647 ms
64 bytes from 46.101.217.214: icmp_seq=4 ttl=56 time=20.442 ms

Ok, I solved this problem while looking a little bit deeper into the TinyGSM library, which Blynk uses as well. For those of you having the same issue, this should help either.

In the TinyGsmClientA6.h file there is a method called bool modemGetConnected(uint8_t) which you have to modify.

I have struggled with this a couple of hours, doing all the AT commands by hand to find out that the A7 module can handle up to eight TCP connections at the same time, with a MUX (? correct me if I’m wrong). I have modified this method to be able to work with the first channel only.

This is the original file (already marked with a TODO sign):

bool modemGetConnected(uint8_t) {
    sendAT(GF("+CIPSTATUS"));  // TODO(?) mux?
    int8_t res = waitResponse(GF(",\"CONNECTED\""), GF(",\"CLOSED\""),
                              GF(",\"CLOSING\""), GF(",\"INITIAL\""));
    waitResponse();
    return 1 == res;
  }

At first sight, I think that the MUX feature is not yet implemented?! The answer of the AT+CIPSTATUS will not be read correctly and get stuck here for ever (or at least it repeats this function till it receives one of the mentioned responses). I solved this (only for one active TCP connection) by editing the waitResponse function to this:

bool modemGetConnected(uint8_t) {
    sendAT(GF("+CIPSTATUS"));  // TODO(?) mux?
    int8_t res = waitResponse(GF("0,CONNECT OK"), GF("0,CLOSED"),
                              GF("0,CLOSING"), GF("0,INITIAL"));
    waitResponse();
    return 1 == res;
  }

Actually the zero is the MUX value, but for me and my current project the first “channel” is sufficient at the moment.

So your problem is connected to the Internet in general, not specifically about blynk.cloud?

Yes, it seems like it is only related to the TinyGsm lib and not with Blynk in general.

What version of the TinyGSM library are you using?

Pete.

It is version 0.11.4. It should be the latest release - at least I hope so…

Looks like the latest version is 0.11.3 - is that a typo by you?

@vshymanskyy have you seen this?

Pete.

I’ve looked it up in the configuration file of my PlatformIO project:

lib_deps = 
    blynkkk/Blynk@^1.0.1
	vshymanskyy/TinyGSM@^0.11.4

Edit: But yes, on Github it says latest release version is 0.11.3. Nevertheless, 0.11.3 has the MUX feature not yet implemented as well.

If your main controller is ESP32, I’d look into the PPPOS mode:

@moekoe I checked with AI Thinker a few months ago. They said A6 and A7 is obsolete. They only produce A9 and A9G only