-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp_modem_dte dual-port mode not working with all modems (IEC-58) #249
Comments
@DaStoned Thanks for the issue. First of all, you must make sure that your modem supports USB dual-mode. The easiest way to do so, is by plugging the modem to any PC and check whether it creates two AT serial ports. Not all modems support this. There is a regression in esp_modem 1.0.2 that breaks this function. Could you please try with esp_modem 1.0.1? In your main idf_component.yml only define Here is a link to the 1.0.1 source code for your convenience https://github.com/espressif/esp-protocols/tree/modem-v1.0.1/components/esp_modem More info:
That is correct. These functions manage transitions of the DTE from 'data' to 'command' mode. Since your DTE is in DUAL_MODE there is no need to change anything. The DTE DUAL_MODE is set in the constructor: https://github.com/espressif/esp-protocols/blob/modem-v1.0.1/components/esp_modem/src/esp_modem_dte.cpp#L30 |
@tore-espressif - thank you for the quick response. Dual mode is tested and supposed to work - that's good to hear. My modem is a SIMCOM SIM7070G which creates 6 virtual serial ports when plugged into a Linux PC. Their documentation (SIM7070_SIM7080_SIM7090 Series_Linux_Application Note_V1.02.pdf) says:
I plugged in indexes 2 and 5 into the macro Perhaps I'm using some part of the API wrong in dual port mode. E.g. how am I supposed to start a PPP session in dual port? And I'm using esp_modem version 1.0.3, but I tried with 1.0.1 - no change. I'm calling
|
I'll add the modem & PPP bringup code for reference:
|
The dual port mode assumes that the two ports are interchangeable. It doesn't seem to be the case in your modem. You can easily test it out. In your application, open the USB modem with single interface 2 and single interface 5. They should both work the same. Alternatively, you can connect your modem to a PC and send AT commands to interface 5. In case interface 5 can't accept AT commands, your modem does not support dual mode. |
That's strange. When I conduct an experiment with a SIM7070G devkit connected to my Linux PC, those two ports are interchangeable. I can open either port 2 or 5 with minicom and issue commands
But when I try the experiment that you suggested with my board where a module of the same model is connected to ESP32S3 via USB, then port 5 doesn't receive any reply to any commands issued through it. |
I talked to the SimCom FAE and they confirmed - SIM7070G is a dual-port modem:
My experiments on Linux confirm this. So I suspect there's something going on in the Espressif stack which doesn't allow me to use port 5. |
Thanks for all the information, I'll try to get the modem and test for regressions |
I'm not very far from you (Estonia), so I can ship my evaluation board to you if there's nothing easily available. |
i did test the i opened another issue espressif/esp-usb#76, |
@diplfranzhoepfinger Thanks for the confirmation. It must something specific to SIM7070G then |
@tore-espressif you sit in Brno ? @david-cermak has a A7672E-FASE from me. so you could ask him for a Demo. |
Yep, will do |
SIM7070G has at least a Problem: the GPS and the Network cannot work simultaneous. this Reason we went from SIM7070G to A7672E-FASE Regards, Franz |
Just to clarify, we're not using GPS in our project, just network connection. |
@DaStoned I got SimTech SIM7070G and could do more testing. This is devices that appear on windows 10: Interface 2 corresponds to AT port, which is correct and works fine. For now, you must use single interface 2 and switch between CMD and DATA modes. |
I'll rename this issue so we can collect similar request here and possibly reconsider this feature in the future. |
OK, a negative answer is still much better than no answer :) Thank you. |
With the significant differences among modems with similar names (eg. SIM7070 and SIM7670) I'd prefer a list of supported devices. We will add it in next release |
Answers checklist.
Which component are you using? If you choose Other, provide details in More Information.
Other
ESP-IDF version.
v5.1.1
Development Kit.
ESP32S3-DevKitC
Used Component version.
esp_modem_usb_dte 1.1.0~1
More Information.
Quoting public documentation for esp_modem_usb_dte 1.1.0:
This feature does not seem to be implemented. Sure, I can set the secondary inteface in
esp_modem_usb_term_config
andcreate_usb_dte()
will happily give me an USB DTE. The PPP dialup connection comes up, but when I try to issue any AT commands they time out. I can see from debug logs ofusb_terminal
that it tries to inject the AT command directly into the PPP data stream which doesn't work for obvious reasons.I cannot issue commands to the USB-connected modem (SIM7070) when it's in data mode. When I go and look at relevant code in the component "esp_modem", there is absolutely nothing that actually implements a dual mode feature.
Clearly
DTE::set_mode(modem_mode m)
does absolutely nothing when told to activate DUAL_MODE:https://github.com/espressif/esp-protocols/blob/ea14e15a6f113b1335f2a2511119c63b897f354d/components/esp_modem/src/esp_modem_dte.cpp#L199
And
DCE_Mode::set_unsafe()
explicitly ignores DUAL_MODE:https://github.com/espressif/esp-protocols/blob/ea14e15a6f113b1335f2a2511119c63b897f354d/components/esp_modem/src/esp_modem_dce.cpp#L95
Am I missing something obvious or are you advertising a feature that's not implemented?
The text was updated successfully, but these errors were encountered: