Developing comunication via PPP using nRF9151-DK, modem is not able to registrate to L4 of network

Hi everybody,

                     I have problem with my nrf9151-DK and attemp to create PPP communication.

First of all, I have to say that I am a beginner in this matter. I haven't come across PPP yet, I'm just trying to develop my first app. Therefore, I may not understand some things correctly and some of my reasoning may sound strange.
I would like to present my idea of ​​an application that I am developing. The idea is to use the modem in PPP mode. With the help of a modem in PPP mode, I would like to establish communication with a TCP server, i.e. my ARM core in nrf9151 would have the role of a TCP client. I definitely don't want to use PPP as is used in the vast majority of cases where the connection between the application microcontroller and the modem is established, I want to have a connection directly between the ARM core and the modem (so all within one device, so nrf-9151).

When I was looking for an example to learn with PPP, I wanted to get the cellular_modem example working. Unfortunately, I couldn't get the nrf9151 to work this example because apparently I don't have access to the hardware (I have misconfigured hardware). From the available configuration files, it seems that my board is not compatible with the application.
 
My build configuration:


Compared to the basic prj.conf, I also added the APN configuration to the project. My prj.conf looks like this:
CONFIG_POSIX_API=y
CONFIG_MODEM_CELLULAR_APN="iot.1nce.net"
CONFIG_MODEM_CELLULAR=y
# Networking
CONFIG_NETWORKING=y
CONFIG_NET_NATIVE=y
CONFIG_NET_L2_PPP=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_CONTEXT_RCVTIMEO=y

# DNS
CONFIG_DNS_RESOLVER=y
CONFIG_NET_L2_PPP_OPTION_DNS_USE=y

# Network management
CONFIG_NET_MGMT=y
CONFIG_NET_MGMT_EVENT=y
CONFIG_NET_CONNECTION_MANAGER=y

# Modem driver
CONFIG_MODEM=y
CONFIG_PM_DEVICE=y
CONFIG_MODEM_CELLULAR=y

# Statistics
CONFIG_MODEM_STATS=y
CONFIG_SHELL=y

# Testing
CONFIG_MODEM_AT_SHELL=y
CONFIG_PM_DEVICE_SHELL=y
CONFIG_SHELL_WILDCARD=n

# Logging
CONFIG_LOG=y
CONFIG_MODEM_MODULES_LOG_LEVEL_DBG=y
# For extra verbosity
#CONFIG_MODEM_CMUX_LOG_LEVEL_DBG=y
#CONFIG_LOG_BUFFER_SIZE=65536
How do I understand PPP (and I don't know if it's correct?)
Step 1: Put the modem into PPP mode. As written in the PPP documentation, PPP mode can only be configured when CMUX is used, when one channel is created for AT commands and another channel for PPP.

Step 2: Connect the modem to the APN of the data provider. Based on which carrier I have the SIM from, I enter the APN and try to register the device to the network. I want to use the LTE network if possible.
Thanks to the fact that I connect to the APN of the data provider, with the help of the DNS server I get my IP address in the network of the data provider, with the help of which I will then be able to compile a packet for TCP.
Communication using PPP works on the basis of HDLC packets, which I have to create and pass to the modem. The point is that the data that I want to send to the TCP server, and it doesn't matter if it is data that comes to me via some communication interface or is created directly in the ARM core, I must first convert it to a TCP packet and insert it into an HDLC packet. Am I not wrong?


Step 3: I will switch the modem to PPP, which will make it transparent and, thanks to this, the data will pass through it directly to the network.
As far as I understood, in PPP mode the modem behaves as transparent, i.e. it is not necessary to transfer data to it with the help of AT commands but directly in packets. HDLC packets are used. The idea of ​​communication is that a packet is created from the data that I want to send based on the protocol that I use (TCP or UDP), and this packet is inserted into an HDLC packet. The HDLC packet is then sent via the modem. On the other hand, in the case of receiving an HDLC packet, data is extracted from the packet, which is subsequently sent to the next block (function), which extracts data from the packet of the given protocol, and then the data is inserted into a buffer, from where it is further transferred to a UART/TWI communication interface, etc.
Thanks to the fact that the data must be converted into packets and stored in some kind of buffer, I see a place where I could insert my own data in the correct format in order to create a TCP packet and then an HDLC packet. So I could leave the hardware communication interface out of the process. I would like to learn more about PPP communication based on the lower layers.


I definitely don't want someone to develop the app for me. I just want to advise some useful examples and links where I can learn how to work with PPP and how to achieve what I want. I will be glad for reasonable help and support.

Best Regards

Jaroslav

Parents
  • Hi Jaroslav,

    Your screenshot of the VS Code build configuration shows that you used NCS v2.9.0 and Toolchain v2.8.0. Before building, you should change either NCS version or Toolchain version so that both are of the same version. Do you want to use v2.8.0 or v2.9.0 of NCS/Toolchain?

    The samples that you could look at and which have support for PPP are modem shellserial LTE modem and Zephyr cellular modem. Is Zephyr cellular modem the sample which you want to use?

    Best regards,
    Dejan


  • Hi Dejan,

    Now, i have know, where problem is. If I wanna build cellular_modem example, it doesnť work, cause this example works with EXTERNAL modem. This modem is conected via UART2, but if i don't have any external modem connected to my nrf9151-DK, it means that I am not able to run taht example correctly a connect modem to L4.

    But serial_lte_modem example works with INTERNAL modem.

    So this is why it doesn't work.

    So, now i mowed to serial_lte_modem and iI am trying to create PPP communication.

    Best Regards

    Jaroslav

Reply
  • Hi Dejan,

    Now, i have know, where problem is. If I wanna build cellular_modem example, it doesnť work, cause this example works with EXTERNAL modem. This modem is conected via UART2, but if i don't have any external modem connected to my nrf9151-DK, it means that I am not able to run taht example correctly a connect modem to L4.

    But serial_lte_modem example works with INTERNAL modem.

    So this is why it doesn't work.

    So, now i mowed to serial_lte_modem and iI am trying to create PPP communication.

    Best Regards

    Jaroslav

Children
Related