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

Cannot read/write data from /dev/ttyGSM* #3

Open
qianfan-Zhao opened this issue Apr 21, 2016 · 6 comments
Open

Cannot read/write data from /dev/ttyGSM* #3

qianfan-Zhao opened this issue Apr 21, 2016 · 6 comments

Comments

@qianfan-Zhao
Copy link

Hello:

I try to use cmux in my atmel board ( linux 4.4.4) , cross compile cmux and run successful.
It created 4 virtual tty for me. /dev/ttyGSM1 ~ /dev/ttyGSM4.

When i write data to /dev/ttyGSM1 by using shell, like this: printf "at\r\n" > /dev/ttyGSM1 ,data was sent successful, using salease logic analyze tool, can see the GPRS module responds with OK using GPRS0710 protocol.

But when i using microcom (linux serial port tools in busybox, like minicom) in command line:
microcom -s 115200 /dev/ttyGSM1, After that, microcom seems dead ! microcom cannot send/read anything, and I cannot close microcom by using CTRL+C.

I do not know who cause this problem, cmux,GPRS module or linux kernel ? or microcom ?
can you help me to solve this problem? Thanks!

@codeinearts
Copy link

were you able to solve it? can you provide more information?
According with what you say, sounds more like a problem with microcom. You can actually communicate with the board, so I would discard the other stuff -within my humble knowledge though-.
Regards

@mraugit
Copy link

mraugit commented Sep 18, 2016

Hi
I have the same problem with the following configuration:
Raspberry Pi with SIM900 shield connected to the Pis UART.
Linux Kernel 4.4.21
n_gsm.ko is loaded.

cmux creates 4 virtual /dev/ttyGSMx on top of the physical ttyS0.

Logfile from cmux start:
SERIAL_PORT = /dev/ttyS0
AT : AT OK
AT&F0 : AT&F0 OK
AT+IFC=0: AT+IFC=0,0 OK
AT+GMM : AT+GMM SIMCOM_SIM900 OK
AT+IPR=1: AT+IPR=115200 OK
AT+CMUX=: AT+CMUX=0,0,5,512,10,3,30,10,2 OK
Line dicipline set
Created /dev/ttyGSM1
Created /dev/ttyGSM2
Created /dev/ttyGSM3
Created /dev/ttyGSM4
Going to background

I try to communicate with microcom to /dev/ttyGSM1 without success. I try to send AT to the modem, but I got no answer. Can you please give me advice how to debug the problem.

Thanks.

@spr-lfeliu
Copy link

I'm using cmux on an embedded linux arm device and it works fine. I had to change the MTU value to 127 because that's what the device's modem supports. I'm not using microcom but do send AT commands and establish a ppp connection without issues.

@mraugit
Copy link

mraugit commented Sep 30, 2016

Thanks for you feedback. I've fixed my problem by comment out line 329.

/* use n_gsm line discipline */
//sleep(2);
if (ioctl(serial_fd, TIOCSETD, &ldisc) < 0)
    err(EXIT_FAILURE, "Cannot set line dicipline. Is 'n_gsm' module registred?");

@vikacisys
Copy link

I am using SIM7600 connected to UART2 on Beaglebone board. Facing the same problem.
Can't connect to /dev/ttyGSM[1-4] using any utility. For eg. screen utility terminates immediately.
If I try cat, it says Level 2 Halted. Tried commenting the sleep line as suggested above.

@vikacisys
Copy link

Got the SIM7600 connected to UART2 on Beaglebone board working. Apart from commenting out line 329
//sleep(2);
I had to do two more changes.

  1. Line 297 changed from
    tio.c_cflag |= CRTSCTS;
    to
    tio.c_cflag &= ~CRTSCTS;
    because I was not using HW flow control lines.

  2. AT+CMUX has fewer arguments as per SIM7600 AT Commands manual. Changed that too.

Thanks all for the inputs shared here.

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

5 participants