Cannot read/write data from /dev/ttyGSM*
qianfan-Zhao opened this issue · 6 comments
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!
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
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.
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.
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?");
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.
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.
-
Line 297 changed from
tio.c_cflag |= CRTSCTS;
to
tio.c_cflag &= ~CRTSCTS;
because I was not using HW flow control lines. -
AT+CMUX has fewer arguments as per SIM7600 AT Commands manual. Changed that too.
Thanks all for the inputs shared here.