Pppos on u-blox modem

If you are asking a question, please follow this template:

  1. My goal is: try to use pppos on 3 modem U-blox
  2. My actions are: find the step to get work
  3. The result I see is: still not have
  4. My expectation & question is:
    I am seeing the project
    Mongoose OS Documentation (mongoose-os.com)
    Do you have the main source code example to call this lib ?
    Not clear to me the sequence to follow
    Here is my source code
    #include “mgos.h”
    #include “mgos_pppos.h”

enum mgos_app_init_result mgos_app_init(void) {

Where i include the config data (apn, user, etc) to start the PPP and how i use the mqtt together ?


“PPPoS” is jargon for just PPP.
The “oS” stands for “over serial” to somehow distinguish it from the “oE” (over Ethernet).

The very same doc you linked is telling you that your apn, username, etc. belong to the config file: mos.yml; this example is not very verbose on that regard. Try a few quick start examples first, then see this example.
Your PPP should start automagically when you configure - ["pppos.enable", true] (and the proper UART and pins) in your mos.yml

If it doesn’t…
The whole procedure is just finding the proper AT commands to setup your modem, if needed, might just work out of the box, and the proper “dial” AT command to put your modem in PPP mode, which should be fairly standard and just work out of the box.
If you search this forum you’ll find responses (some by me) already given to other people, who may be using other modules but you’ll have to RTM anyway to find your proper AT commands for setup.

MQTT runs on top of TCP, which runs on top of IP, which runs on top of PPP. Once you setup your PPP connection your MQTT will work just the same as if you were using WiFi (or Ethernet) as this is handled by the TCP/IP stack (lwIP). Any example will do, and there are many of them around

Thank you so much to anwer with a big and excelent e-mail text!
Getting progress here! You help me a lot!

How can i change the
pppos/mgos_pppos.c at master · mongoose-os-libs/pppos (github.com)
source code to remove some AT commands and compile again ?
Looks that file is remotely! Is it dowloaded locally to edit ?

You shouldn’t have to change that unless there is a bug and you want to contribute a fix. Most commands are harmless.
If you are following the tutorials and running mos build then your local sources are packed and sent to Cesanta where they get compiled and linked with precompiled libraries. With most libraries you can override them with a local copy but that is a bit involved, there are some examples around, too.

Check the log to see what is that command that is failing (the one returning ‘ERROR’)

Looks that the problem is in some config on SARA G350, because works nice in the LISA U200.

do you know that if that stack pppos auto-connect if i power off and power on the modem ? or disconnect and connect again the antenna ?

If you power off the modem PPP will eventually timeout and the OS try to reconnect. I personally don’t know, you can follow the source code. It should, but I haven’t checked.
If you disconnect the antenna your module should issue and error and the OS try to reconnect… again, you’ll have to try. This condition would be detected sooner if the module issues an error.


Thanks for all you help!

I glad you in the BLOG!

n~ao falo português mais comprendo.


do you know if there is some option on PPPos to define to wait limit to a AT command asnwer ?

tryng to find why works on modem u200, g450, but not on G350.

on G350, after send a AT+COPS=0, looks that there is delay that is bigger that the Mongoose can wait.


PS: good portuguese!
PS: PPPos on Moongoose is one of more stable embedded ppp implementation that i have seen! Better than Nuttx, Mbed, Zephyr and ESP-IDF :slight_smile:

Sources here, looks long enough to me

look the code
if (!ok) {
/* Auto mode */
LOG(LL_INFO, (“Automatic operator selection”));
add_cmd(pd, NULL, COPS_AUTO_TIMEOUT, “AT+COPS=0”);

maybe updgranding the COPS_AUTO_TIMEOUT should solve problem of G350…
because make manually the AT+COPS=0 on TERATERM i can see a long delay before get the OK

i will compile local and test!


define “long time”, COPS_AUTO_TIMEOUT = 600 seconds; that is 10 minutes if I didn’t miss something.
What is it that you are observing ?

hi scanprile!

I had comment this lines and all working perfeclty working on SARA G350 now!


Very cool!

About the Mongoose, the user must to pay if use the remote services ? How is politics about payment ? It´s monthly or yearly ? Not sure about when to pay them!

thanks again about your help! Doing blog!

The fact that you commented it out and now it works doesn’t mean there is something wrong in there… if you pinpoint the issue you can submit a pull request to Github; if you give data someone will try to help in fixing.

Mongoose-OS is Apache licensed and you can get a commercial license if you like/need the extra features, check the licensing page as I’m not related to Cesanta.

I was reading the source code and there is a comment about Sara g350, then looks that was already tested exaustly on it.
Maybe should be a hardware problem in my g350. Because after AT+COPS=0 freeze the MODEM.
Btw, I posted on GitHub a issue

Thanks for all your help Scaprile!