How to setup pppos for TTGO T-Call

  1. My goal is: to change the default UART1 pins and set them according to my need.

  2. My actions are: I have tried to replace the use of UART with GPIO’s but isn’t working, as few functions depend on the UART function.

  3. The result I see is:
    mgos_pppos_uart_disp Command timed out: ATH
    mgos_pppos_uart_disp Connecting (UART1, APN ‘imis’)…
    mgos_net_on_change_c PPP: disconnected
    mgos_net_on_change_c PPP: connecting
    mgos_pppos_uart_disp Command timed out: ATH
    mgos_pppos_uart_disp Connecting (UART1, APN ‘imis’)…
    mgos_net_on_change_c PPP: disconnected

  4. My expectation & question is: henceforth i expect that you suggest me some code or function for changing UART default pins or show me a way how can i reconfigure those things.?

1 Like

If you need to setup the UART pins for the ppos library, have a look here.

LE.
My working settings for TTGO T-Call:

  - ["pppos.uart_no", 1]
  - ["pppos.rx_gpio", 26]
  - ["pppos.tx_gpio", 27]
  - ["pppos.rst_gpio", 5]
  - ["sim.pwr.ctrl", "i", 23, {}]
  - ["sim.pwr.on", "i", 4, {}]

sim.pwr.ctrl and sim.pwr.on are handled by the application.

1 Like

@nliviu You are correct. But i am trying that same configuration fo pppos.rx_gpio and pppos.tx_gpio, setting them up and trying to run the firmware, but i found the same issue of not not connecting the network of APN. while you are correct about these PIN settings, i found it difficult as it didn’t gave any acknowledgment in turn. I would acknowledge you if you guide me MORE in that direction. if you have any reference document or example, that would help me understand.

The board schematics(page 2) follows the power supply hardware design recommended by SIMCom(pages 20 and 21).

You must first activate the power supply for the SIM800L (set GPIO 23, sim.pwr.ctrl in my mos.yml, to 1) than apply a zero for at least 1200ms on GPIO 4 (sim.pwr.on in my mos.yml) and after this period of time call mgos_pppos_connect(0);.

Forgot another setting in mos.yml

  - ["pppos.connect_on_startup", false]

This was much needy to me. It really help me understood where i was lacking foots. I would request you if you can share with me your application code (TTGO T-CALL code). Your suggestion has much been needful.

mos.yml

config_schema:
  - ["debug.level", 2]
  - ["pppos.enable", true]
  - ["pppos.connect_on_startup", false]
  - ["pppos.uart_no", 1]
  - ["pppos.rx_gpio", 26]
  - ["pppos.tx_gpio", 27]
  - ["pppos.rst_gpio", 5]

  - ["modem.power.ctrl", "i", 23, {title: "Enable SIM800L's power supply GPIO"}]
  - ["modem.power.on.pin", "i", 4, {title: "Power on the SIM800L GPIO."}]
  - ["modem.power.on.interval", "i", 1200, {title: "Power on interval."}]

static void modem_power_on_timer_cb(void *arg) {
  int power_on = (int) arg;
  mgos_gpio_setup_output(power_on, true);

  mgos_pppos_connect(0);
}

static void modem_start(void) {
  int power_ctrl = mgos_sys_config_get_modem_power_ctrl();
  if (power_ctrl > 0) {
    mgos_gpio_setup_output(power_ctrl, true);
    LOG(LL_INFO, ("%s - set power_ctrl on", __FUNCTION__));
    int power_on = mgos_sys_config_get_modem_power_on_pin();
    mgos_gpio_setup_output(power_on, false);
    mgos_set_timer(mgos_sys_config_get_modem_power_on_interval(), 0,
                   modem_power_on_timer_cb, (void *) power_on);
  }
}

Add a call to modem_start in mgos_app_init.

1 Like

I found that the settings in mos.yml are not applied ie when I use mos config-get only the uart_no is returned but all the pin data is not there in the config, so I presume the defaults are overwriting my custom config.

Hey @rufura, we have solved the issues and it’s much appreciated to @nliviu for his help.

you can have a look on our code, we have made it open.

@nliviu Thank you for your help. we gotta came to learn new things.

Hi Jacob,
I saw the code you have shared, and can’t help but notice

static void modem_power_on_timer_cb(void *arg) {
int power_on = (int) arg;
mgos_gpio_setup_output(power_on, true);
mgos_pppos_connect(0);
}
static void modem_start(void) {
int power_ctrl = mgos_sys_config_get_modem_power_ctrl();
if (power_ctrl > 0) {
mgos_gpio_setup_output(power_ctrl, true);
LOG(LL_INFO, ("%s - set power_ctrl on", FUNCTION));
int power_on = mgos_sys_config_get_modem_power_on_pin();
mgos_gpio_setup_output(power_on, false);
mgos_set_timer(mgos_sys_config_get_modem_power_on_interval(), 0,
modem_power_on_timer_cb, (void *) power_on);
}
}

or mgos_app_init file was not present in your code. Can you tell me where you implement this part to your code? Thank you