olliiiver / esp_lte_modem

ESP32 / esp-idf LTE UART modem library for sim7600 with cmux support
MIT License
54 stars 19 forks source link

SIM800 CMUX #2

Open Arto1994 opened 3 years ago

Arto1994 commented 3 years ago

Hello everyone , I was testing the ppp from the original ESP IDF example and it works for SIM800L , but when I try to test the CMUX with this repository it didn't work.I get the same errors in the logs refered in the .md , due to modem initialization (+RDY , CPIN READY , etc).The commands AT like a RSSI , and the other works , but the ppp never get and IP :( . I want to know if this was tested for sim800L.

PD: My IDF is 4.2.1

Thanks in advance !

olliiiver commented 3 years ago

Hi. I only have one SIM7600 modem around here.

Have you tried to enable debug?

Are there any CMUX frames coming from the modem (see esp_dte_handle_cmux_frame in esp_modem.c)?

Arto1994 commented 3 years ago

Thanks for the reply .Yes , I can see it detects some CMUX frames , but I think something is corrupting the ppp part.Do you know how to select the correct AT command reference version , there is a lot of versions for SIM800.Today I'm going to do more testing and show the logs.

Arto1994 commented 3 years ago

This is what the console show image

olliiiver commented 3 years ago

Hi, looks like the response from the modem is somehow different.

... Unknow line received: cmux ...

Artiom9 commented 2 years ago

@Arto1994 Hello, did you manage to solve this problem? I'm also prone to this problem and don't understand how to solve it. Thanks for the answer!

Artiom9 commented 2 years ago

Hello, @olliiiver! For my project, I need to run the SIM868 modem in CMUX mode to transmit data and read GNSS at the same time. I'm facing the same problem as the @Arto1994 but can't figure out what the problem is. Judging by the official documentation (I'll attach it to the comment), everything is working more or less normally (section 4.1). As far as I understood, "unknown strings" should come after the TE request, but they come by themselves. I do not know how critical this is, but it seems that the channels do not collapse because of this, but then the PPP connection is not established due to an incomprehensible reason. If you could help me figure out what's wrong, I would be very grateful! Thanks! Here's a screenshot of what's going on: Снимок экрана 2022-04-05 121135 Снимок экрана 2022-04-05 121103

SIM800 Series_Multiplexer_Application Note_V1.04.pdf

olliiiver commented 2 years ago

hi @Artiom9. Can't say about the errors you get. Seems SIM868 works differently.

Have you tried the official repo? Looks like it supports CMUX also now:

https://github.com/espressif/esp-protocols/blob/master/components/esp_modem/src/esp_modem_cmux.cpp

Artiom9 commented 2 years ago

Hello, @olliiiver. I found a solution, I apologize for not writing a solution. I still don't understand why it works this way, but you need to replace the line in the file "sim800.c:318" DCE_CHECK(dte->send_cmd(dte, "ATD*99#\r", MODEM_COMMAND_TIMEOUT_MODE_CHANGE) == ESP_OK, "send command failed", err); to DCE_CHECK(dte->send_cmd(dte, "ATD*99***1#\r", MODEM_COMMAND_TIMEOUT_MODE_CHANGE) == ESP_OK, "send command failed", err); But this only fixes the connection to GSM, and when setting up CMUX, "Unknow line received" remain, because the SIM800 sends additional messages, but they do not affect anything, so they can be ignored. As for the official repository, I initially tried to do it on it, but nothing worked for me, and I already found your repository and tried to do it on it. At the moment I have solved the problem with the official repository and will prepare a commit to fix the problem) Thank you for your answer!