Closed EnziinSystem closed 2 months ago
Even the simplest MQTT example has a compile error. Did you not click the compile button before git push?
#define LILYGO_T_CALL_A7670_V1_0
The logs:
C:\Users\my\Desktop\GPS\LilyGO-T-A76XX\examples\MqttClient\MqttClient.ino:105:15: error: cannot declare variable 'client' to be of abstract type 'TinyGsmA7670::GsmClientA7670'
105 | TinyGsmClient client(modem);
| ^~~~~~
In file included from c:\Users\my\Documents\Arduino\libraries\TinyGSM\src/TinyGsmClient.h:66,
from C:\Users\my\Desktop\GPS\LilyGO-T-A76XX\examples\MqttClient\MqttClient.ino:80:
c:\Users\my\Documents\Arduino\libraries\TinyGSM\src/TinyGsmClientA7670.h:91:9: note: because the following virtual functions are pure within 'TinyGsmA7670::GsmClientA7670':
91 | class GsmClientA7670 : public GsmClient {
| ^~~~~~~~~~~~~~
In file included from C:\Users\my\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC1\cores\esp32/Arduino.h:197,
from C:\Users\my\AppData\Local\Temp\arduino\sketches\0450E4EFCA56BC5BF72AF8FB6E33D0DD\sketch\MqttClient.ino.cpp:1:
C:\Users\my\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC1\cores\esp32/Client.h:29:15: note: 'virtual int Client::connect(IPAddress, uint16_t, int32_t)'
29 | virtual int connect(IPAddress ip, uint16_t port, int32_t timeout) = 0;
| ^~~~~~~
C:\Users\my\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.0-RC1\cores\esp32/Client.h:31:15: note: 'virtual int Client::connect(const char*, uint16_t, int32_t)'
31 | virtual int connect(const char *host, uint16_t port, int32_t timeout) = 0;
| ^~~~~~~
exit status 1
Compilation error: cannot declare variable 'client' to be of abstract type 'TinyGsmA7670::GsmClientA7670'
When you find an error, check your configuration and the reason for the error instead of complaining about it here with a questioning attitude.
All examples have passed the compilation check of platformio. Please report your usage environment
I use the Ardruino IDE 2.3.2 and the flow guide in the Readme.
MqttsBuiltlnAuth is running normally here. I can only use the test.mosquitto.org public server for testing. I can't help with other private servers. Please debug it yourself based on the returned error reason.
I am getting +CMQTTCONNECT: 0,15 on a simple no SSL test using just AT commands. DNS works, AT+CPING works, AT+CIPOPEN opens the socket. The command sequence is exactly as in the MQTT(S) Appnote. What can be missing or wrong?
T-A7608-S3, A7608SA-H
MqttsBuiltlnAuth is running normally here. I can only use the test.mosquitto.org public server for testing. I can't help with other private servers. Please debug it yourself based on the returned error reason.
The problem is still not solved, I used a public server as you suggested:
// MQTT details
const char *broker = "test.mosquitto.org";
const uint16_t broker_port = 1883;
const char *broker_username = "";
const char *broker_password = "";
const char *clien_id = "mqttx_7bc3c8dc";
const char *subscribe_topic = "GsmMqttTest/subscribe";
const char *publish_topic = "GsmMqttTest/publish";
The logs:
14:35:32.003 -> ets Jul 29 2019 12:21:46
14:35:32.003 ->
14:35:32.003 -> rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
14:35:32.003 -> configsip: 0, SPIWP:0xee
14:35:32.003 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
14:35:32.003 -> mode:DIO, clock div:1
14:35:32.003 -> load:0x3fff0030,len:4916
14:35:32.003 -> load:0x40078000,len:16436
14:35:32.068 -> load:0x40080400,len:4
14:35:32.068 -> ho 8 tail 4 room 4
14:35:32.068 -> load:0x40080404,len:3524
14:35:32.068 -> entry 0x400805b8
14:35:32.623 -> Start Sketch
14:35:35.486 -> Start modem...
14:35:35.486 -> AT
14:35:35.809 -> AT
14:35:36.126 -> AT
14:35:36.385 -> AT
14:35:36.685 -> .
14:35:36.685 -> AT
14:35:36.985 -> AT
14:35:37.285 -> AT
14:35:37.585 -> AT
14:35:37.885 -> .
14:35:37.885 -> AT
14:35:52.118 -> PB DONE
14:35:52.118 -> AT+IPADDR
14:35:52.118 -> +IPADDR: 26.63.27.240
14:35:52.118 ->
14:35:52.118 -> OK
14:35:52.118 -> Network IP:26.63.27.240
14:35:52.118 -> AT+CMQTTSTART
14:35:52.118 -> AT+CMQTTSTART
14:35:52.118 -> OK
14:35:52.118 ->
14:35:52.118 -> +CMQTTSTART: 0
14:35:53.097 -> Connecting to test.mosquitto.orgAT+CSSLCFG="authmode",0,0
14:35:53.131 -> AT+CSSLCFG="authmode",0,0
14:35:53.131 -> OK
14:35:53.131 -> AT+CMQTTREL=0
14:35:53.131 -> AT+CMQTTREL=0
14:35:53.131 -> +CMQTTREL: 0,20
14:35:53.131 ->
14:35:53.131 -> ERROR
14:35:53.131 -> AT+CMQTTACCQ=0,"mqttx_7bc3c8dc",1
14:35:53.131 -> AT+CMQTTACCQ=0,"mqttx_7bc3c8dc",1
14:35:53.131 -> OK
14:35:53.131 -> AT+CMQTTCFG="version",0,4
14:35:53.131 -> AT+CMQTTCFG="version",0,4
14:35:53.131 -> OK
14:35:53.131 -> AT+CMQTTCONNECT=0,"tcp://test.mosquitto.org:1883",60,1,"",""
14:35:53.166 -> AT+CMQTTCONNECT=0,"tcp://test.mosquitto.org:1883",60,1,"",""
14:35:53.166 -> ERROR
14:35:53.166 -> Failed!
If you don't want to use the examples I provide, then you should check your parameters for correctness, not me.
It was a matter of using SSL or not.
Problem solved.
Thanks @lewisxhe
My device:
Step 1: Copy all folders in lib folder to Arduino library folder (e.g. C:\Users\my\Documents\Arduino\libraries) And NOT update libs when I start the Arduino IDE.
Step 2: Run the example MqttsBuiltlnAuth
The configure:
Step 3: Check the connection with MQTTX successfully
Step 4: Run MqttsBuiltlnAuth example
The logs:
I have not yet successfully run any of the MQTT related examples in this repository.
I use other brokers also have similar results.