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

AT command APDU has trouble communicating with Quectel modem #167

Open
ecm0708 opened this issue Nov 17, 2024 · 1 comment
Open

AT command APDU has trouble communicating with Quectel modem #167

ecm0708 opened this issue Nov 17, 2024 · 1 comment

Comments

@ecm0708
Copy link

ecm0708 commented Nov 17, 2024

There's a problem using the AT command APDU with quectel modems. It seems to be related to the method of writing to the serial device.

@steely-glint has a fork which solves the problem. In driver/apdu/at.c, it replaces fprintf(fuart...) with possibly smaller sized write(uart_fd...). After merging this fork with the current upstream and reducing the maximum segment size ctx->es10x_mss, it works well on a Quectel modem. I haven't tested on another modem. Hopefully, this method of communicating through the serial device would also be compatible with other modems. (Or maybe an environment variable could be used to select the method.) It looks like the fork on its own does not work since it doesn't have the ability to reduce ctx->ex10x_mss from upstream.

Would it be feasible to merge this upstream? If needed, I could provide a patch or PR with the merge conflicts resolved.
main...pipe:lpac-quectel:main#diff-d85497acc8400d3fa4f69b00a762a91dc21f1ef20bdacc9e37cf46218c529287R99

@CoelacanthusHex
Copy link
Contributor

CoelacanthusHex commented Nov 17, 2024

In driver/apdu/at.c, it replaces fprintf(fuart...) with possibly smaller sized write(uart_fd...).

It may be caused by buffered io. Invoking setbuf(uart_fd, NULL) after fopen to disable buffered I/O should fix the issue.

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

2 participants