Open cho0p opened 1 month ago
Please update to the latest firmware, then use the log capture tool to capture all interaction logs and send them to us.
Thanks for your swift reply @lewisxhe . The modem was already running on the latest firmware B03. I have created the modem log file. The safe functionality gave me an error message - I was only able to safe it as *.csv. Hope this works as well. I have sent you the file via email to lewishe@***.com.
I checked my email and didn't receive the log you sent. Please upload it directly to this issue.
SIM7670G_WILL_Log_20241021_105737.csv
Here is the modem log file.
The exported log should be a zip archive, not a csv. Have you checked my usage video?
Yes, but as mentioned in the last message I get an error message when I click on the safe button in the logger software. I was only able to safe the log as csv.
This log is invalid. Simcom can only parse the correct log file. At which step did you encounter the error?
The error appeared after clicking on the safe button in the top menu of the tool. I will try to create another log in a few hours and share either the log or the error message when trying to safe it.
OK
SIM7670G_Log_20241022_102950.zip
Tried it with another PC and now it worked.
Ok, I'll update here if I get a reply.
SIMCOM replied that they used the same version of the modem for testing and MQTTWILLTOPIC could be used normally. They analyzed the logs you provided and found that the modem sent the CMQTTWILLTOPIC command normally. The problem may be on your server.
I don't think it's related to the MQTT server as it successfully manages will messages from other clients. I have several LilyGo ESP32 with Simcom modems connected to the server. They all use the Pubsubclient library and the will works fine. It's the first time that I test the SIM7670G with the build-in MQTT capabilities and it doesn't work. This is how the server log looks like:
ESP32 with SIM7000G using Pubsubclient:
2024-10-24 11:00:55: New client connected from x.x.x.x:xxxxx as esp32-00000-02 (p2, c1, k15, u'00000-02-zentec').
2024-10-24 11:00:55: Will message specified (7 bytes) (r1, q0).
2024-10-24 11:00:55 esp32-00000-02/status
2024-10-24 11:00:55: Sending CONNACK to esp32-00000-02 (0, 0)
ESP32 with SIM7670G using build-in modem MQTT capability:
2024-10-24 11:02:00: New client connected from x.x.x.x:xxxxx as esp32-00000-04 (p2, c1, k60, u'00000-04-zentec').
2024-10-24 11:02:00: No will message specified.
2024-10-24 11:02:00: Sending CONNACK to esp32-00000-04 (0, 0)
Do you have any other suggestions for debugging this?
After my own testing, the will message is normal and can be used. I will add examples later
I added an example and the test is ok https://github.com/Xinyuan-LilyGO/LilyGO-T-A76XX/tree/main/examples/MqttsBuiltlnWill
Thank you. The code works. Only one little remark regarding the example code in line 223:
// Initialize MQTT, use SSL, skip authentication server
modem.mqtt_begin(false);
I think it should be (if SSL should be used)
// Initialize MQTT, use SSL, skip authentication server
modem.mqtt_begin(true);
Oh! Whether this uses SSL depends on the server you are connecting to. I used a server without SSL when testing, so I forgot to change it.
The WILL message itself works now but I noticed that it doesn't have a retain flag. Unfortunately I couldn't find any retain option in the AT documentation. It's only mentioned for the AT+CMQTTPUB command. Do you know if it's somehow possible to set the retain flag for the WILL message as well when the client connects to the broker?
SIMCOM replied that there is no method to set this parameter.
Hello,
I have a Lilygo SIM7670G with the ESP32-S3. I use the TinyGSM Fork. The device connects to the internet without any problems. It also connects to my MQTT server via SSL which is great but I need to use the WILL functionality.
I have modified the TinyGsmMqttA76xx.h file and added the WILL AT commands according to the SIM767XX Series_AT_Command_Manual_V1.01.pdf:
My code looks like this:
Within void setup():
Within void loop():
handle_mqtt();
As said the code works and it connects. I cannot see any error message in the Serial with AT debug being enabled. In fact the modem replies with "OK" to the WILL AT commands:
The problem is that my Mosquitto broker doesn't receive any WILL message when the client connects. MQTT server logs:
The WILL message works fine with Pubsubclient on other ESP32 devices.
What could be wrong? @lewisxhe Do you have a suggestion? I couldn't find any further information in the SIM767XX AT commands documentation. Yesterday I flashed the modem to the latest firmware 2374B03SIM767XM5A_M_SIM7670G-MNGV_V202240702 but it didn't fix the issue either.
Thanks, cho0p