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

How to disconnect and reconnect from the CMUX example code? (IDFGH-10729) #328

Closed
2 of 3 tasks
fmadhurakkariyan opened this issue Jul 25, 2023 · 2 comments
Closed
2 of 3 tasks

Comments

@fmadhurakkariyan
Copy link

fmadhurakkariyan commented Jul 25, 2023

Answers checklist.

  • I have read the documentation for esp-protocols components and the issue is not addressed there.
  • I have updated my esp-protocols branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Suppose a condition where the internet connection gets dropped and I want to try to disconnect and then try to reconnect from the CMUX sample code. How would I go about doing this?

@github-actions github-actions bot changed the title How to disconnect and reconnect from the CMUX example code? How to disconnect and reconnect from the CMUX example code? (IDFGH-10729) Jul 25, 2023
@david-cermak
Copy link
Collaborator

Probably the fastest option would be to exit and re-enter the CMUX mode, if your device supports it.

If not, you can use manual CMUX commands to setup the PPP mode again, but only on the virtual channel already created.
I'd suggest playing with the modes a bit using the modem-console example. You can use these commands:

https://github.com/espressif/esp-protocols/blob/5143f5ac01f27b669add28c80ac809b023d2cb1f/components/esp_modem/examples/modem_console/main/modem_console_main.cpp#L238C1-L247

If you get disconnected, some devices also exit the PPP mode automatically, if that's the case, you can:

  • set_mode CMUX3 (CMUX_MANUAL_SWAP) to be able to talk to the secondary terminal
  • cmd AT to check if you're already in command mode
  • set_mode CMUX4 (CMUX_MANUAL_DATA) to re-enter the PPP mode

@david-cermak
Copy link
Collaborator

Any update?

If not, I'm going to merge this test #363
are refer to the manual CMUX mode processing in

if (dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_MODE) &&
dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_SWAP) &&
dce->set_mode(esp_modem::modem_mode::CMUX_MANUAL_DATA)) {
as a resolution

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

No branches or pull requests

3 participants