<div dir="ltr"><br><div class="gmail_quote"><div dir="ltr"><div>Hi Aleksander Morgado,</div><div>i'm using qmicli with sim7000e and raspberry PI for my gps project.</div><div></div><div><br></div><div>I can't stay connect to the network because sometimes i receive error messages like:</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:12px;line-height:16px;white-space:pre-wrap"><div><span style="color:rgb(106,153,85)"> error: couldn't start network: QMI protocol error (14): 'CallFailed'</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># call end reason (3): generic-no-service</span></div></div></div><div><br></div><div>or</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:12px;line-height:16px;white-space:pre-wrap"><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># error: couldn't start network: QMI protocol error (14): 'CallFailed'</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># call end reason (12): (null)</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># verbose call end reason (2,201): [internal] error</span></div></div></div><div><br></div><div>Here the schema and code where i try to keep alive the connection.</div><div><br></div><div><br></div><div><div><img src="cid:ii_k7qe70l70" alt="SchemaGPS.jpg" width="546" height="467"><br><br></div></div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"Droid Sans Mono","monospace",monospace,"Droid Sans Fallback";font-weight:normal;font-size:12px;line-height:16px;white-space:pre-wrap"><div><span style="color:rgb(86,156,214)">def</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(220,220,170)">keepAlive</span><span style="color:rgb(212,212,212)">(</span><span style="color:rgb(156,220,254)">myCounter</span><span style="color:rgb(212,212,212)">):</span></div><br><div><span style="color:rgb(212,212,212)">    modemStatus = soCmd(</span><span style="color:rgb(206,145,120)">"qmicli -d /dev/cdc-wdm0 --wds-get-packet-service-status"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">10</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">)</span></div><br><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(206,145,120)">"'connected'"</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">in</span><span style="color:rgb(212,212,212)"> modemStatus:</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(106,153,85)">#<a href="http://logging.info" target="_blank">logging.info</a>("WATCHDOG: CONNECTED.")</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">not</span><span style="color:rgb(212,212,212)"> soCmd(</span><span style="color:rgb(206,145,120)">"ifconfig wwan0 | grep 'inet '"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">3</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">):</span></div><div><span style="color:rgb(212,212,212)">            soCmd(</span><span style="color:rgb(206,145,120)">"udhcpc -q -f -n -i wwan0"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">15</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">else</span><span style="color:rgb(212,212,212)">:</span></div><div><span style="color:rgb(212,212,212)">            myIps = soCmd(</span><span style="color:rgb(206,145,120)">"hostname --all-ip-addresses"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">3</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">            <a href="http://logging.info" target="_blank">logging.info</a>(</span><span style="color:rgb(206,145,120)">"WATCHDOG: CONNECTED. "</span><span style="color:rgb(212,212,212)"> + myIps.rstrip(</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(215,186,125)">\n\r</span><span style="color:rgb(206,145,120)">"</span><span style="color:rgb(212,212,212)">) + </span><span style="color:rgb(206,145,120)">" "</span><span style="color:rgb(212,212,212)"> + </span><span style="color:rgb(78,201,176)">str</span><span style="color:rgb(212,212,212)">(myCounter))</span></div><div><span style="color:rgb(212,212,212)">            sleep(</span><span style="color:rgb(181,206,168)">60</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(197,134,192)">else</span><span style="color:rgb(212,212,212)">:</span></div><div><span style="color:rgb(212,212,212)">        <a href="http://logging.info" target="_blank">logging.info</a>(</span><span style="color:rgb(206,145,120)">"----------------------------- SCAN: "</span><span style="color:rgb(212,212,212)"> + </span><span style="color:rgb(78,201,176)">str</span><span style="color:rgb(212,212,212)">(myCounter) + </span><span style="color:rgb(206,145,120)">" -----------------------------"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">        <a href="http://logging.info" target="_blank">logging.info</a>(modemStatus)</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(206,145,120)">"'disconnected'"</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">in</span><span style="color:rgb(212,212,212)"> modemStatus:</span></div><div><span style="color:rgb(212,212,212)">            qmiStart(modemStatus)</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">else</span><span style="color:rgb(212,212,212)">:</span></div><div><span style="color:rgb(212,212,212)">            qmiReset(modemStatus)</span></div><br><div><span style="color:rgb(86,156,214)">def</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(220,220,170)">qmiStart</span><span style="color:rgb(212,212,212)">(</span><span style="color:rgb(156,220,254)">modemStatus</span><span style="color:rgb(212,212,212)">):</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> config.PIN:</span></div><div><span style="color:rgb(212,212,212)">        soCmd(</span><span style="color:rgb(206,145,120)">'qmicli -d /dev/cdc-wdm0 --uim-verify-pin=PIN1,'</span><span style="color:rgb(212,212,212)"> + config.PIN, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">3</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">        sleep(</span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(212,212,212)">) </span></div><br><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)">#soCmd("qmicli -d /dev/cdc-wdm0 --nas-get-signal-strength | tr '\"' ' ' | grep Network | head -1", "", 5, True, False)</span></div><br><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># Next line for Stretch OS -- Change APN Name!</span></div><div><span style="color:rgb(212,212,212)">    cmdlog = soCmd(</span><span style="color:rgb(206,145,120)">'qmicli -d /dev/cdc-wdm0 --device-open-"net=net-raw-ip|net-no-qos-header" --wds-start-network="apn='</span><span style="color:rgb(212,212,212)"> + config.APN + </span><span style="color:rgb(206,145,120)">',ip-type=4" --client-no-release-cid'</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">20</span><span style="color:rgb(212,212,212)">)</span></div><br><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># ERRORE 1: <a href="https://lists.freedesktop.org/archives/libqmi-devel/2013-November/000669.html" target="_blank">https://lists.freedesktop.org/archives/libqmi-devel/2013-November/000669.html</a></span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># error: couldn't start network: QMI protocol error (14): 'CallFailed'</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># call end reason (3): generic-no-service</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># </span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># Descrizione:</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># The modem simply doesn't think you have access to the LTE network with your SIM.  </span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># Are you sure your SIM is provisioned with access for the APN you're using?  </span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># Des the same SIM work on other devices with the APN?</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)">#</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># Possibile soluzione</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)">#if "generic-no-service" in cmdlog:</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)">#    qmiReset(modemStatus)    </span></div><div><span style="color:rgb(212,212,212)">        </span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># ERRORE 2: <a href="https://lists.freedesktop.org/archives/libqmi-devel/2016-March/001535.html" target="_blank">https://lists.freedesktop.org/archives/libqmi-devel/2016-March/001535.html</a></span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># error: couldn't start network: QMI protocol error (14): 'CallFailed'</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># call end reason (12): (null)</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># verbose call end reason (2,201): [internal] error</span></div><div><span style="color:rgb(212,212,212)">    </span></div><br><div><span style="color:rgb(212,212,212)">    setWwan0Interface()</span></div><br><br><div><span style="color:rgb(86,156,214)">def</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(220,220,170)">setWwan0Interface</span><span style="color:rgb(212,212,212)">():</span></div><div><span style="color:rgb(212,212,212)">    soCmd(</span><span style="color:rgb(206,145,120)">"ip link set dev wwan0 down"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(106,153,85)"># Enable OS Raw IP Mode setting (not persistent) </span></div><div><span style="color:rgb(212,212,212)">    soCmd(</span><span style="color:rgb(206,145,120)">"echo Y > /sys/class/net/wwan0/qmi/raw_ip"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    soCmd(</span><span style="color:rgb(206,145,120)">"ip link set dev wwan0 up"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    sleep(</span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(212,212,212)">)</span></div><br><div><span style="color:rgb(86,156,214)">def</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(220,220,170)">qmiReset</span><span style="color:rgb(212,212,212)">(</span><span style="color:rgb(156,220,254)">modemStatus</span><span style="color:rgb(212,212,212)">):    </span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(206,145,120)">"cannot access"</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">in</span><span style="color:rgb(212,212,212)"> soCmd(</span><span style="color:rgb(206,145,120)">"ls -l /dev/ttyUSB2"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">3</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">):</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">if</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(206,145,120)">"cannot access"</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(86,156,214)">in</span><span style="color:rgb(212,212,212)"> soCmd(</span><span style="color:rgb(206,145,120)">"ls -l /dev/ttyS0"</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(206,145,120)">""</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(181,206,168)">3</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(86,156,214)">False</span><span style="color:rgb(212,212,212)">):</span></div><div><span style="color:rgb(212,212,212)">            <a href="http://logging.info" target="_blank">logging.info</a>(</span><span style="color:rgb(206,145,120)">"ERRORE: GRAVE"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">            <a href="http://logging.info" target="_blank">logging.info</a>(modemStatus)</span></div><div><span style="color:rgb(212,212,212)">        </span><span style="color:rgb(197,134,192)">else</span><span style="color:rgb(212,212,212)">:</span></div><div><span style="color:rgb(212,212,212)">            qmiResetTTY(</span><span style="color:rgb(206,145,120)">"/dev/ttyS0"</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    </span><span style="color:rgb(197,134,192)">else</span><span style="color:rgb(212,212,212)">:</span></div><div><span style="color:rgb(212,212,212)">        qmiResetTTY(</span><span style="color:rgb(206,145,120)">"/dev/ttyUSB2"</span><span style="color:rgb(212,212,212)">)</span></div><br><div><span style="color:rgb(86,156,214)">def</span><span style="color:rgb(212,212,212)"> </span><span style="color:rgb(220,220,170)">qmiResetTTY</span><span style="color:rgb(212,212,212)">(</span><span style="color:rgb(156,220,254)">port</span><span style="color:rgb(212,212,212)">):    </span></div><div><span style="color:rgb(212,212,212)">    <a href="http://logging.info" target="_blank">logging.info</a>(</span><span style="color:rgb(206,145,120)">"WATCHDOG: Reset modem "</span><span style="color:rgb(212,212,212)"> + port)</span></div><div><span style="color:rgb(212,212,212)">    mySerGPS = serial.Serial(port, </span><span style="color:rgb(156,220,254)">baudrate</span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(181,206,168)">115200</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(156,220,254)">timeout</span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(181,206,168)">1</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(156,220,254)">rtscts</span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(86,156,214)">True</span><span style="color:rgb(212,212,212)">, </span><span style="color:rgb(156,220,254)">dsrdtr</span><span style="color:rgb(212,212,212)">=</span><span style="color:rgb(86,156,214)">True</span><span style="color:rgb(212,212,212)">)</span></div><div><span style="color:rgb(212,212,212)">    AT(mySerGPS, </span><span style="color:rgb(206,145,120)">'AT+CFUN=1,1'</span><span style="color:rgb(212,212,212)">)    </span></div><div><span style="color:rgb(212,212,212)">    mySerGPS.close()                      </span></div><div><span style="color:rgb(212,212,212)">    sleep(</span><span style="color:rgb(181,206,168)">30</span><span style="color:rgb(212,212,212)">)</span></div></div></div><div><br></div><div><br></div><div>Can someone help me?</div><div><br></div><div>Thanks</div><div><br></div><div>Marco Salatin<br></div><div><br></div><div><br></div><br></div>
</div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><p style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><b style="margin:0px;padding:0px;border:0px;font-family:'Open Sans';font-size:14px;font-stretch:inherit;line-height:18.5px;vertical-align:baseline;color:rgb(102,102,102)">Marco Salatin<br></b><span style="color:rgb(102,102,102);font-family:'Open Sans';font-size:14px;line-height:18.5px">T. +39 388 1947558</span></p><p style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="color:rgb(102,102,102);font-family:'Open Sans';font-size:14px;line-height:18.5px">skype: marco.salatin</span></p><p style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="color:rgb(102,102,102);font-family:'Open Sans';font-size:14px;line-height:18.5px"><a href="mailto:marco.salatin@gmail.com" target="_blank">marco.salatin@gmail.com</a></span><br style="color:rgb(102,102,102);font-family:'Open Sans';font-size:14px;line-height:18.5px"><span style="color:rgb(102,102,102);font-family:'Open Sans';font-size:14px;line-height:18.5px">Sito web: <a href="http://www.salatin.eu" target="_blank">www.salatin.eu</a></span></p><div style="font-size:12.8px"><p><font color="#333333"><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black">Ai sensi del D.Lgs. 196/2003 si precisa che le informazioni contenute in questo messaggio sono riservate ed a uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La invito ad eliminarlo senza copiarlo e a non inoltrarlo a terzi, dandomene gentilmente comunicazione. </span><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black" lang="EN-GB">Grazie.</span><span style="color:rgb(31,73,125)" lang="EN-US"></span><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black" lang="EN-GB"><br>Pursuant to Legislative Decree No. 196/2003, you are hereby informed that this message contains confidential information intended only for the use of the addressee. If you are not the addressee, and have received this message by mistake, please delete it and immediately notify us. You may not copy or disseminate this message to anyone. </span><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black">Thank you.</span></font></p><div><font color="#333333"><span style="font-size:7.5pt;font-family:Arial,sans-serif;color:black"><br></span></font></div></div></div></div></div></div></div></div></div></div>