I was testing a MikroElektronika SmartG100 board and was facing some issues to get its serial line working.
“Fortunately” many people suffered from same issue before me:
If you read all the threads, the conclusion is: “you need to supply an external 5V and GND in to connector CN2”. This is not for me!
Looking at SmartG100 schematic in the last pages of its manual I noticed there are two transistors BJTs for each signal (TXD, RXD, CTS and RTS) used as level shifter.
Then if I remove R5 I could connect my USB/Serial RXD pin to SmartG100 RXD signal, same apply to R14, removing it I could to connect USB/Serial CTS to it.
But for TXD I need to remove R10 and Q4 transistor and connect the USB Serial TXD pin to TXD signal. And same to RTS, removing R13 and Q6 I could to connect USB/Serial RTS pin to RTS signal.
Then I proceed!!! And the serial line worked and I can issue some commands in the minicom terminal:
ATZ OK AT+CGMI u-blox OK
Now, I could use wvdial to connect to the Internet!
$ vi /etc/wvdial.conf [Dialer Defaults] Phone = Username = Password = New PPPD = yes [Dialer tim] Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 Init3 = AT+IFC=0,0 Init4 = AT+CGDCONT=1,"ip","tim.br" Stupid Mode = 1 ISDN = 0 Phone = *99***1# Ask Password = 0 Modem = /dev/ttyUSB0 Username = tim Dial Command = ATD Password = tim Baud = 115200
Finally call wvdial to connect:
$ sudo wvdial tim --> WvDial: Internet dialer version 1.61 --> Cannot get information for serial port. --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 OK --> Sending: AT+IFC=0,0 AT+IFC=0,0 OK --> Sending: AT+CGDCONT=1,"ip","tim.br" AT+CGDCONT=1,"ip","tim.br" OK --> Modem initialized. --> Sending: ATD*99***1# --> Waiting for carrier. ATD*99***1# CONNECT --> Carrier detected. Starting PPP immediately. --> Starting pppd at Fri Sep 4 18:24:42 2015 --> Pid of pppd: 11395 --> Using interface ppp0 --> local IP address 100.88.170.54 --> remote IP address 100.88.170.54 --> primary DNS address 220.127.116.11 --> secondary DNS address 18.104.22.168
P.S.: If you don’t want to use flow control, add “AT+IFC=0,0” to init strings, but wvdial source code needs to be modified because it uses flow control by default.
That’s all folks!