-
Notifications
You must be signed in to change notification settings - Fork 17
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
How to use all 4 USB Lines of a SIMCOM A7672E-FASE (IEC-74) (IEC-179) #76
Comments
Hi @diplfranzhoepfinger thanks for issue. Here's some information that might help you getting started:
esp_err_t cdc_acm_host_open_vendor_specific(uint16_t vid, uint16_t pid, uint8_t interface_num, const cdc_acm_host_device_config_t *dev_config, cdc_acm_dev_hdl_t *cdc_hdl_ret); relevant example is here https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_host
This is not the first time that this example confused someone, I'll try to describe better what is this example for. Thanks for the feedback! |
Thanks, we will have a Look. |
@diplfranzhoepfinger Do you any any other inputs on this or can we close? |
@tore-espressif i did try, but it chrashes. i need to deep into this again. i will reopen this issue once i go back into it. |
FYI: my trys were here: and here: i will do a fresh restart now here: hold on |
so, use a modified ESP DEVKIT C, Connecting a Devkit: Devkit Part Number: give this Output: https://gist.github.com/diplfranzhoepfinger/ccd7a71ee613e9501ce8721ed5ac037a with this Code: |
now, using a modified Version of: https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_host visible here: Ports (interface_num)we know that Port 4&5 is used for esp_modem according to SIMCOM the following Ports should be there:
probe the other ports: it seems that Port Number 1 2 3 4 5 are the Valid Port Number. 4 and 5 are for esp_modem, one the PPP and the other the AT Line. Port 0https://gist.github.com/diplfranzhoepfinger/5695190fbecd22cf8302f167560f2b46 invalid. Port 1https://gist.github.com/diplfranzhoepfinger/6af2de2f31c87c309ba316f9168591c9 Port 2this Port seems to be the diagnostic Data Port. To be approved.
https://gist.github.com/diplfranzhoepfinger/e2af955c576abf2d6f18cbff167f3685 https://gist.github.com/diplfranzhoepfinger/f46aefa394a79bccac215a72eec44a5d Port 3https://gist.github.com/diplfranzhoepfinger/463efe69da42cabc4774523f4d20dd8b NMEA Output https://gist.github.com/diplfranzhoepfinger/c68f51bac18e09e2ba9c9da9ee4c2051 likely:
Port 4
https://gist.github.com/diplfranzhoepfinger/a9eb561d2acf4f2b6e1636bb636c192a Port 5
https://gist.github.com/diplfranzhoepfinger/45c1dd8bc8e6dc8ca24ffbce9fc53715 Port 6https://gist.github.com/diplfranzhoepfinger/d8157748f95df4265bb0c10dfed2bc30 invalid. |
next Step: connect the SIMCOM Kit to a Linux, and testing something: /dev/ttyUSB0 constantly sending stuff. ... might be the Diagnostic port for log messages /dev/ttyUSB1 /dev/ttyUSB2 unable to open /dev/ttyUSB3 seeems to be a AT Port. doe the following:
after this, the Port /dev/ttyUSB4 start to output GPS NMEA sentences. /dev/ttyUSB4 this Port sends NMEA Data. |
now, i found out Port 3 is the NMEA Port, and if i enabled the Modem before (with my Linux) to output NMEA Sentences, this Code here: https://github.com/diplfranzhoepfinger/esp-protocols-tree-master-components-esp_modem-examples-pppos_client-II/tree/nmea_001 does read NMEA sentences and output it to the Console. NOW: if i uncomment this Line: i get an Error. https://gist.github.com/diplfranzhoepfinger/b10ab400f3d4c0452113af673f3b8b72 for me this is obvious, as the esp_modem component does call so the idea then would be: let esp-modem first do its Things, and then connect to the Port 3. i remove the i get this Error: Code: Error:
|
I assume you are using IDF version >5.0 and latest usb_host_cdc_acm driver v2.0.4 https://components.espressif.com/components/espressif/usb_host_cdc_acm/versions/2.0.4 EDIT: CDC-ACM driver v2.0.5 release just now. It fixes some edge cases in device opening, although it should not affect your device and example The CDC driver opens the CDC interfaces based on the bInterfaceNumber in Configuration descriptor, for your device this can be 0-5. Interface 0&1:These 2 interfaces are bound together with Interface Association Descriptor (so they belong to the same USB Function) with USB Class = 0xE0:
Interfaces 2-5Seem to be working OK Interface 6Does not exist in this device
For usecases when USB host is used for other purposes the communication with
This way you can install USB Host library in you application main and it can be shared with multiple threads |
i did like your Suggestions:
now i still geht the Error. i am on
|
That's really weird... So if you run the example without opening the NMEA port, it works OK? I'll have to test on HW, meanwhile, if you could find where this call fails, it would help o lot |
what and how should i test ? the Backtrace is included in the Gist. |
@tore-espressif here you see which parts i used: |
@diplfranzhoepfinger OK, I think I got. ESP32-S3 has 8 USB channels (implemented in HW). The USB Host Library allocates 1 channel per endpoint. 1 endpoint is reserved for EP0, the rest is allocated to endpoints you open. Your device implements 3 endpoints in each interface 3, 4 and 5. So you require (1 + 3x3) = 10 channels. That is why the last interface fails to open. When we tested multiple CDC interfaces, we only tested with 2, so we never got the problem! The only feasible way is not to ignore the Interrupt Endpoint of each interface. This endpoint is used for CDC notifications but it is not used in Modem Terminal
This will require change in the CDC-ACM driver or even USB Host lib, so it will take some time. Meanwhile, if you want to hack it yourself, you will have to modify this section so it does not allocate the INTR endpoint (always the first one in your device) EDIT: Easier workaround is to use just one CDC port for modem ESP_MODEM_DEFAULT_USB_CONFIG(0x1E0E, 0x9011, 4) This way, the modem would use the same port for data and commands, leaving enough USB channels for the NMEA port Thank you for all your testing! |
Hello,
@david-cermak
@igrr
@Others
the Example: https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples/pppos_client
we use this Line:
https://github.com/espressif/idf-extra-components/blob/86fab3ed9299d09173a5e98fd216aed14f14b6c7/usb/esp_modem_usb_dte/include/esp_modem_usb_config.h#L75
to access Interface 4 and 5 of the SIMCOM A6772-FASE.
it would be interesting to use also Interface 1 and 3 (guessed Numbers [now proofed, see below], but possible to find out):
1 is for the DIAG Server, if we have Problems to Report to SIMCOM we can take Modem Traces there,
3 is for the NMEA Port.
what to do to access the Other Ports as well ?
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/usb/host/cdc/cdc_acm_vcp seems not to help, as it does tooo much Driver stuff and all this, we have already a lot inside the above Example.
Thanks,
Franz
The text was updated successfully, but these errors were encountered: