UART swapping on Modem Shell

Hello, 

I have two UART AT Command devices attached to by board. One for ESP-AT (compatible = "espressif,esp-at";) and the other is a SIM7080 module (compatible = "simcom,sim7080";). Both are working individually, however having both config parameters enabled, the sim7080 is initiated and the esp-at has this error message:

[00:00:15.040,000] <err> wifi_esp_at: Error registering modem context: -12

However I believe I can only have one UART shell at a time from this post -  Multiple Zephyr Shell instances over UART 

Luckily, I only need one at a time. If the ESP-AT cannot find a Wi-Fi network, switch to GSM on the SIM7080 module. 

I believe I cannot have them initiated in the configurations and have to initiate them in main. How would I go about this? 

The files in question are:

https://github.com/zephyrproject-rtos/zephyr/blob/21b9a1c8239637bbecd0b74381f3d8fb069a47b3/drivers/wifi/esp_at/esp.c#L4

https://github.com/zephyrproject-rtos/zephyr/blob/21b9a1c8239637bbecd0b74381f3d8fb069a47b3/drivers/modem/simcom-sim7080.c#L7

What would I need to call for this to be initiated in main?





Parents Reply
  • Hi 

    Sorry about that, I misread your issue.

    I can't find any reference to shell in these drivers, unless it is used by the higher layer protocols, so hopefully the shell limitation should not be relevant. 

    Most likely the -12 error originates here, and depends on the size of the MODEM_CONTEXT_MAX_NUM config. Could you try to set CONFIG_MODEM_CONTEXT_MAX_NUM to 2 in your prj.conf file and see if it solves the issue? 

    As shown here this configuration will default to 1. 

    Best regards
    Torbjørn

Children
Related