Skip to content
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

fix(modem): Fixed mode transitions between any state and UNDEF #416

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

david-cermak
Copy link
Collaborator

Closes #320

Copy link
Collaborator

@euripedesrocha euripedesrocha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Left a few minor comments.

components/esp_modem/src/esp_modem_dte.cpp Outdated Show resolved Hide resolved
components/esp_modem/src/esp_modem_dte.cpp Show resolved Hide resolved
@fdkz
Copy link

fdkz commented Nov 9, 2023

Doesn't seem to fully work as intended with SIM7600.

Test case:

dce->set_mode(esp_modem::modem_mode::CMUX_MODE); // OK
physically reset modem
dce->set_mode(esp_modem::modem_mode::UNDEF); // OK
dce->set_mode(esp_modem::modem_mode::CMUX_MODE); // FAIL

esp_modem starts to send +++ and AT wrapped:
\xF9\t\xEF\x07+++5\xF9
\xF9\t\xEF\x07AT\r5\xF9

and doesn't recognize the unwrapped response by the modem:
AT\r\r\nOK\r\n

@david-cermak
Copy link
Collaborator Author

Doesn't seem to fully work as intended with SIM7600.

Test case:

dce->set_mode(esp_modem::modem_mode::CMUX_MODE); // OK physically reset modem dce->set_mode(esp_modem::modem_mode::UNDEF); // OK dce->set_mode(esp_modem::modem_mode::CMUX_MODE); // FAIL

esp_modem starts to send +++ and AT wrapped: \xF9\t\xEF\x07+++5\xF9 \xF9\t\xEF\x07AT\r5\xF9

and doesn't recognize the unwrapped response by the modem: AT\r\r\nOK\r\n

That's not how the UNDEF mode is supposed to work. It just a meta-state indicating that all transitions are allowed, not that they'd necessarily succeed (nor it is a synonym to INIT or RESET state).

What you describe in your test case is more like a situation suitable for mode detection (another planned feature), in other words: We don't know what state the modem is in, so we check how it responds to all protocols and set the mode accordingly.

@david-cermak david-cermak merged commit afbca53 into espressif:master Nov 28, 2023
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

need a Forced Exit of CMUX Mode (IDFGH-10551)
4 participants