LilyGO T-SIM7000G does not work with esp_modem

takeshiba
Posts: 1
Joined: Tue May 31, 2022 9:18 am

LilyGO T-SIM7000G does not work with esp_modem

Postby takeshiba » Tue May 31, 2022 9:59 am

Dear all,

I am trying to use LilyGO T-SIM7000G with ESP-IDF 4.4.1 and latest esp_modem (it works with Arduino and TinyGSM library but is not reliable, that's why I am trying to move to ESP-IDF and esp_modem).

With SIM7000G esp_modem is not receiving reply to its `ATE0` command. Same code is working nicely with LilyGo T-CALL (based on SIM800), SIM800 and SIM7000G are similar and ESP32/Modem parts of the boards are the same. Same code is running without any modification under Arduino/TinyGSM.

I have tried many code for SIM7000G poweron/reset, with no luck with SIM7000G while OK with SIM800. I have extended delays as SIM7000G is initializing slower than SIM800.

I have set up a GITHUB repo with minimal code https://github.com/U03/esp_modem_test, works with SIM800 and not with SIM7000G.

In `DTE::command` it can be seen that `read_callback` is never called, would mean that either command is not received by SIM7000G or reply does not reach back ESP32.

This is driving me nuts :( anybody has any idea? Thanks in advance.
  1. command_result DTE::command(const std::string &command, got_line_cb got_line, uint32_t time_ms, const char separator)
  2. {
  3.     ESP_LOGD("TAG", "command     111");
  4.     Scoped<Lock> l(lock);
  5.     ESP_LOGD("TAG", "command     222");
  6.     command_result res = command_result::TIMEOUT;
  7.     ESP_LOGD("TAG", "command     333");
  8.     command_term->set_read_cb([&](uint8_t *data, size_t len) {
  9.         ESP_LOGD("TAG", "command     444");
  10.  
  11.         if (!data) {
  12.             ESP_LOGD("TAG", "command     555");
With SIM7000G leads to:
  1. V (21423) command_lib: set_echo
  2. V (21423) command_lib: generic_command_common
  3. V (21433) command_lib: generic_command
  4. D (21433) command_lib: generic_command command ATE0
  5. D (21433) TAG: command     111
  6. D (21443) TAG: command     222
  7. D (21443) TAG: command     333
With SIM800 works fine:
  1. V (21434) command_lib: set_echo
  2. V (21434) command_lib: generic_command_common
  3. V (21444) command_lib: generic_command
  4. D (21444) command_lib: generic_command command ATE0
  5.  
  6. D (21444) TAG: command     111
  7. D (21454) TAG: command     222
  8. D (21454) TAG: command     333
  9. D (21464) TAG: command     444
  10. D (21464) TAG: command     555
  11. D (21464) TAG: command     777
  12. D (21464) command_lib: Response:
  13. OK

da_789
Posts: 6
Joined: Sat May 28, 2022 9:37 am

Re: LilyGO T-SIM7000G does not work with esp_modem

Postby da_789 » Sun Oct 09, 2022 2:53 pm

Hi!

Did you finally solve it?
I am trying to get esp_modem working with Lilygo sim7000g so I can connect via LTE and receive GPS coordinates with AT commands.

da_789
Posts: 6
Joined: Sat May 28, 2022 9:37 am

Re: LilyGO T-SIM7000G does not work with esp_modem

Postby da_789 » Mon Oct 10, 2022 6:08 pm

I have an error when i try to build this project ( https://github.com/U03/esp_modem_test ):

Code: Select all

FAILED: sim7000g-esp_modem_T2.elf 
cmd.exe /C "cd . && C:\Espressif\tools\xtensa-esp32-elf\esp-2021r2-patch3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address  @CMakeFiles\sim7000g-esp_modem_T2.elf.rsp -o sim7000g-esp_modem_T2.elf  && cd ."
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp_netif/libesp_netif.a(esp_netif_lwip_defaults.c.obj):C:/Espressif/frameworks/esp-idf-v4.4.2/components/esp_netif/lwip/esp_netif_lwip_defaults.c:52: undefined reference to `esp_netif_lwip_ppp_input'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/main/libmain.a(main.c.obj):(.literal.app_main+0x30): undefined reference to `NETIF_PPP_STATUS'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/espressif__esp_modem/libespressif__esp_modem.a(esp_modem_netif.cpp.obj):(.literal._ZN9esp_modem5Netif21esp_modem_post_attachEP13esp_netif_objPv+0x10): undefined reference to `esp_netif_ppp_get_params'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/espressif__esp_modem/libespressif__esp_modem.a(esp_modem_netif.cpp.obj):(.literal._ZN9esp_modem5Netif21esp_modem_post_attachEP13esp_netif_objPv+0x14): undefined reference to `esp_netif_ppp_set_params'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/espressif__esp_modem/libespressif__esp_modem.a(esp_modem_netif.cpp.obj): in function `esp_modem::Netif::esp_modem_post_attach(esp_netif_obj*, void*)':
C:/Users/dgoml/Desktop/TFM/ESP32/sim7000g-esp_modem_T2/managed_components/espressif__esp_modem/src/esp_modem_netif.cpp:60: undefined reference to `esp_netif_ppp_get_params'
c:/espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:/Users/dgoml/Desktop/TFM/ESP32/sim7000g-esp_modem_T2/managed_components/espressif__esp_modem/src/esp_modem_netif.cpp:67: undefined reference to `esp_netif_ppp_set_params'

It's related to netif, but at the moment I can't find the solution. Did it happen to someone else?

Thanks.

nicklasb
Posts: 10
Joined: Sun Apr 24, 2022 9:11 pm

Re: LilyGO T-SIM7000G does not work with esp_modem

Postby nicklasb » Tue Oct 25, 2022 9:08 pm

da_789 wrote:
Mon Oct 10, 2022 6:08 pm
I have an error when i try to build this project ( https://github.com/U03/esp_modem_test ):
Just wanted to say I have the same problem.
For some reason the esp-modem component can't get to some of the esp_netif stuff.
Going crazy.

BTW; the project shown seem to manually add the "components" library, is that necessary?
Last edited by nicklasb on Tue Oct 25, 2022 11:04 pm, edited 1 time in total.

nicklasb
Posts: 10
Joined: Sun Apr 24, 2022 9:11 pm

Re: LilyGO T-SIM7000G does not work with esp_modem

Postby nicklasb » Tue Oct 25, 2022 10:52 pm

da_789 wrote:
Mon Oct 10, 2022 6:08 pm
I have an error when i try to build this project ( https://github.com/U03/esp_modem_test ):
I solved it, at least for me, now it builds.
I took a real deep-dive and found this in netif:s CMakeLists.txt:
  1. if(CONFIG_PPP_SUPPORT)
  2. list(APPEND srcs "lwip/esp_netif_lwip_ppp.c")
  3. endif()
Apparently,

Code: Select all

Component config > LWIP > Enable PPP support (new/experimental)
..must be enabled for it to be compiled or else the implementation file lwip/esp_netif_lwip_ppp.c will not be included.

Which means that neither will be any declarations that tries to point to it.

da_789
Posts: 6
Joined: Sat May 28, 2022 9:37 am

Re: LilyGO T-SIM7000G does not work with esp_modem

Postby da_789 » Fri Oct 28, 2022 6:52 am

Thank you! I'll try to replicate it.

Can you use gps functions with esp_modem and sim7000?

Who is online

Users browsing this forum: Baidu [Spider] and 116 guests