Day: October 19, 2019

Ping on NuttX returning EALREADY

After the GSM modem connection I’m trying to “ping 8.8.8.8” and it is returning an error:

 ATZ
 OK
 chat: cmd 1, arg ON
 chat: cmd 4, arg 30
 chat:  ATE1
 chat: OK AT+QACCM=0,0
 ATE1
 OK
 chat: OK AT+CGDCONT=1,"IP","tim.br"
 AT+QACCM=0,0
 OK
 chat: OK ATD99**1#
 AT+CGDCONT=1,"IP","tim.br"
 OK
 chat: CONNECT 
 ATD99**1#
 CONNECT
 IP: 192.168.254.254 
 IP: 100.74.7.202 
 IP: 100.74.7.202 
 nsh> ifconfig
 nsh: ifconfig: opendir failed: 20
 nsh> mount -t procfs /proc
 nsh> free
              total       used       free    largest
 Umem:        24416      15016       9400       9400
 nsh> ifconfig
 ppp0    Link encap:TUN at UP
         inet addr:100.74.7.202 DRaddr:192.168.254.254 Mask:0.0.0.0
 nsh> ping 8.8.8.8
 PING 8.8.8.8 56 bytes of data
 No response from 8.8.8.8: icmp_seq=0 time=1000 ms
 No response from 8.8.8.8: icmp_seq=1 time=1000 ms
 No response from 8.8.8.8: icmp_seq=2 time=1000 ms
 No response from 8.8.8.8: icmp_seq=3 time=1000 ms
 No response from 8.8.8.8: icmp_seq=4 time=1000 ms
 No response from 8.8.8.8: icmp_seq=5 time=1000 ms
 No response from 8.8.8.8: icmp_seq=6 time=1000 ms
 ERROR: sendto failed at seqno 7: 114
 7 packets transmitted, 0 received, 100% packet loss, time 7070 ms
 nsh>

I suspect the issue is in the Mobile Operator TIM

UPDATE: I was using a bad antenna. Using a better GSM antenna everything worked fine: