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

'OK' is tangling in the Receive Buffer (IDFGH-10582) #323

Closed
3 tasks done
diplfranzhoepfinger opened this issue Jul 6, 2023 · 12 comments
Closed
3 tasks done

'OK' is tangling in the Receive Buffer (IDFGH-10582) #323

diplfranzhoepfinger opened this issue Jul 6, 2023 · 12 comments

Comments

@diplfranzhoepfinger
Copy link
Contributor

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

Code: https://github.com/diplfranzhoepfinger/esp-protocols-tree-master-components-esp_modem-examples-simple_cmux_client/tree/feature/AT_CPSI

Log: https://gist.github.com/diplfranzhoepfinger/dde959578cb954f23908c07fb10b463a

we observe the following:

the Command "AT+CPSI?" is sent out.
the Response is coming inside the 500ms Timeout.
but the OK is only received after we send out another "AT" with dce->sync();

this happens in CMUX Mode.

is the receive Buffer not flushed while waiting for the OK ? Or what can be the Reason ?

@github-actions github-actions bot changed the title 'OK' is tangling in the Receive Buffer 'OK' is tangling in the Receive Buffer (IDFGH-10582) Jul 6, 2023
@diplfranzhoepfinger
Copy link
Contributor Author

@diplfranzhoepfinger
Copy link
Contributor Author

@david-cermak any news ? 

SIMCOM side or Espressif side ?

@david-cermak
Copy link
Collaborator

Those are probably leftovers from the previous command. Does it cause any trouble?

We can flush the buffers before sending a new command.

@diplfranzhoepfinger
Copy link
Contributor Author

Those are probably leftovers from the previous command. Does it cause any trouble?

yes, as we get "Inquiring UE system information ERROR or TIMEOUT" 

because the "OK" is not coming. 

We can flush the buffers before sending a new command.

that would not solve anything. as the Parser needs the OK to parse right, also it is Part of the Command.

@david-cermak
Copy link
Collaborator

yes, as we get "Inquiring UE system information ERROR or TIMEOUT"

it was probably timeout, so the OK was actually coming, but didn't make it before timeout. And the OK response was buffered and appeared in the next command processing.

Clearing buffers before commands is probably the right thing to do, but wouldn't help much (just gives ~4 bytes to buffer size available)

@diplfranzhoepfinger
Copy link
Contributor Author

yes, as we get "Inquiring UE system information ERROR or TIMEOUT"

it was probably timeout, so the OK was actually coming, but didn't make it before timeout. And the OK response was buffered and appeared in the next command processing.

Thw Question is:

in Command Mode we never see this Problem. 

in CMUX Mode we see this Problem even if we make a really long timeout to this Command, like 15s. 

and the OK comes once we issue a "AT" to the Modem. 

so we are unsure if this is a SIMCOM Modem or a esp-modem Problem.

@david-cermak
Copy link
Collaborator

in CMUX Mode we see this Problem even if we make a really long timeout to this Command, like 15s.

Could you please connect another UART-USB converter to modem Tx line and check if the OK comes before or after those 15s?
It might be theoretically also possible that the modem flow control is preventing the SIMCOM device to continue? (ESP32 is not ready to receive? in that case #312 should fix it as well)

@diplfranzhoepfinger
Copy link
Contributor Author

ah, i will test immediately with #312 so we know.

@diplfranzhoepfinger
Copy link
Contributor Author

diplfranzhoepfinger commented Jul 21, 2023

Test here:
https://github.com/diplfranzhoepfinger/esp-protocols-tree-master-components-esp_modem-examples-simple_cmux_client/tree/feature/AT_CPSI4

Again no IP:
https://gist.github.com/diplfranzhoepfinger/a49c4325bcb75f270b93b49a96dfce81

Test again: working:
https://gist.github.com/diplfranzhoepfinger/7656fcdd4f1ac351ca72b3d092762a59

(it looks like not working, but this is because the Parser is not fully written)

the OK is no more tangling. That is good. Write the Parser is just work.

@david-cermak
Copy link
Collaborator

If I understand correctly the change in #312 fixed this issue, correct?

If not please reopen

@diplfranzhoepfinger
Copy link
Contributor Author

diplfranzhoepfinger commented Oct 11, 2023 via email

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