Skip to main content
Visitor II
March 15, 2023
Solved

Using PPP to connect Modem GPRS

  • March 15, 2023
  • 16 replies
  • 7469 views

Is possible to install ppp tools to connect internet using a GPRS modem ?

We need pppd/chat and kernel support to get network interface, but I can't found them on OpenStLinux resources.

    This topic has been closed for replies.
    Best answer by Jean-Marc B

    Hi @JPrad.2​ 

    The OpenSTLinux Package Repository offers several PPP packages:

    root@stm32mp1:~# apt-cache search ppp
    perl-module-devel-ppport - perl module devel-ppport
    ppp - Point-to-Point Protocol (PPP) support
    ppp-doc - Point-to-Point Protocol (PPP) support - Documentation files
    ppp-l2tp - Plugin for PPP for l2tp support
    ppp-minconn - Plugin for PPP to set a delay before the idle timeout applies
    ppp-oa - Plugin for PPP for PPP-over-ATM support
    ppp-oe - Plugin for PPP for PPP-over-Ethernet support
    ppp-password - Plugin for PPP to get passwords via a pipe
    ppp-radius - Plugin for PPP for RADIUS support
    ppp-tools - Additional tools for the PPP package
    ppp-winbind - Plugin for PPP to authenticate against Samba or Windows
    fetchmail - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP
    fetchmail-doc - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - Documentation files
    fetchmail-locale-ca - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - ca translations
    fetchmail-locale-cs - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - cs translations
    fetchmail-locale-da - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - da translations
    fetchmail-locale-de - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - de translations
    fetchmail-locale-en-gb - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - en_GB translations
    fetchmail-locale-eo - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - eo translations
    fetchmail-locale-es - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - es translations
    fetchmail-locale-fr - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - fr translations
    fetchmail-locale-id - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - id translations
    fetchmail-locale-it - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - it translations
    fetchmail-locale-ja - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - ja translations
    fetchmail-locale-nl - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - nl translations
    fetchmail-locale-pl - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - pl translations
    fetchmail-locale-ro - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - ro translations
    fetchmail-locale-ru - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - ru translations
    fetchmail-locale-sq - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - sq translations
    fetchmail-locale-sr - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - sr translations
    fetchmail-locale-sv - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - sv translations
    fetchmail-locale-vi - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - vi translations
    fetchmail-locale-zh-cn - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP - zh_CN translations
    fetchmail-python - Fetchmail retrieves mail from remote mail servers and forwards it via SMTP
    ippool - An IP address pool manager
    ippool-doc - An IP address pool manager - Documentation files
    ippool-test - An IP address pool manager
    iptraf-ng - A console-based network monitoring utility
    iptraf-ng-doc - A console-based network monitoring utility - Documentation files
    ppp-dialin - Enables PPP dial-in through a serial connection
    rp-pppoe - A user-mode PPPoE client and server suite for Linux
    rp-pppoe-doc - A user-mode PPPoE client and server suite for Linux - Documentation files
    rp-pppoe-relay - A user-mode PPPoE client and server suite for Linux
    rp-pppoe-server - A user-mode PPPoE client and server suite for Linux
    rp-pppoe-sniff - A user-mode PPPoE client and server suite for Linux
    webmin-module-ppp-client - Webmin module for ppp-client

    To install the packages you need, just type the commands:

    root@stm32mp1:~# apt-get update
    root@stm32mp1:~# apt-get install <the packages to install>

    Best regards,

    --JM

    16 replies

    JPrad.2Author
    Visitor II
    March 20, 2023

    Hi again,

    Finally I have added ppp support to my BSP image.

    ppp and its drivers has been added as modules (not built int)

    After menuconfig execution, I've compiled modules and installed on my board.

    (uImage has not been updated)

    On system booting I can verify /dev/ppp exists (Mandatory to manage ppp)

    So, I can restart my target and try to connect internet using a GPRS modem.

    I prepare /etc/ppp/peers and etc/chatscripts to validate connection.

    On execute system answer:

    root@stm32mp1:/etc/ppp/peers# pon fona

    Couldn't open the /dev/ppp device: No such device or address

    /usr/sbin/pppd: Please load the ppp_generic kernel module.

    I ensure driver exists on its location

    root@stm32mp1:/lib/modules/5.15.24/kernel/drivers/net/ppp# ls

    bsd_comp.ko ppp_async.ko ppp_deflate.ko ppp_generic.ko ppp_mppe.ko ppp_synctty.ko pppox.ko pptp.ko

    I try to load using modprobe:

    root@stm32mp1:/etc/ppp/peers# modprobe ppp_generic

    modprobe: ERROR: could not insert 'ppp_generic': Exec format error

    I change to modules folder and try to load it:

    root@stm32mp1:/lib/modules/5.15.24/kernel/drivers/net/ppp# modprobe ppp_generic.ko

    modprobe: FATAL: Module ppp_generic.ko not found in directory /lib/modules/5.15.24

    Why ppp_generic can't be loaded ?

    Updating modules with menuconfig, is mandatoy to update uImage file on /boot ?

    ST Employee
    March 20, 2023

    Hi @JPrad.2​ 

    Yes, you need to update uImage in /boot and all the kernel modules. From your PC:

    PC $> scp <path>/arch/arm/boot/uImage root@<board IP @>:/boot
    PC $> scp -r <path>/install_artifact/lib/modules/* root@<board IP @>:/lib/modules

    Then from your board:

    root@stm32mp: ~# /sbin/depmod -a
    root@stm32mp: ~# sync
    root@stm32mp: ~# reboot

    Finally, load your modules once the board is rebooted.

    Best regards,

    --JM

    JPrad.2Author
    Visitor II
    March 21, 2023

    Hi,

    Making process (uImage+Modules) on DK2 demo board ppp works.

    Now, I'm trying to apply on my board..

    1.- if we copied uImage+ Module the booting process does not end never. It remains on below sequence (running always command in bold font). Network configuration never ends.

    [ OK ] Stopped Network Configuration.

         Starting Network Configuration...

    [**  ] (2 of 3) A start job is running for…k Name Resolution (23s / 1min 43s)

    [  **] (3 of 3) A start job is running for…ton configuration (33s / no limit)

    [  44.407822] Time out check galcore device expired

    [ OK ] Finished Check if the gpu … correct weston configuration.

    [  ***] (2 of 2) A start job is running for…me Resolution (1min 5s / 1min 43s)

    2.- If we copied only new modules (all new menuconfig ppp options has been added as modules) then

    system boot is good, but not execution of ppp.

    root@stm32mp1:/etc/ppp/peers# pon fona

    [ 616.701662] slhc: version magic '5.15.24 preempt mod_unload modversions ARMv7 p2v8 ' should be '5.15.24 SMP preempt mod_unload ARMv7 p2v8 '

    Couldn't open the /dev/ppp device: No such device or address

    /usr/sbin/pppd: Please load the ppp_generic kernel module.

    We supose that exist a relationship betwwen kernel and kernel modules, but we can understand the message

    [ 616.701662] slhc: version magic '5.15.24 preempt mod_unload modversions ARMv7 p2v8 ' should be '5.15.24 SMP preempt mod_unload ARMv7 p2v8 '

    Our current linux version is

    Linux stm32mp1 5.15.24 #108 SMP PREEMPT Mon Oct 17 12:22:15 UTC 2022 armv7l armv7l armv7l GNU/Linux

    3.- To manage hardward differences we modified uBoot and dtbs.

    When we generate new uImage + ppp modules, is necessary make some modification during kernel generation using our custom uBoot/dtbs, or hardware is not related to uImage generation ?

    ST Employee
    March 21, 2023

    Hi @JPrad.2​ 

    First of all, I see that your demo is running fine with a STM32MP DK2 board.

    About your following points with your own board:

    1/ network configuration: I have no clue why the systemd-network service is not starting correctly. Does your board differ from DK2 at network level?

    2/ it seems to me the compilations of the kernel from one side and the modules from the other side are run with two different configurations as SMP is missing (CONFIG_SMP) in modules while expected by the kernel.

    3/ yes dtb files should be also updated in the /boot directory.

    Best regards,

    --JM

    JPrad.2Author
    Visitor II
    March 21, 2023

    Hi,

    To make modules compatibles with our kernel version (SMP) we want to set CONFIG_SMP enabled to get an SMP kernel, but I can't find option at menuconfig.

    If we execute 'cat .config' we can see the flag and value.

    CONFIG_BROKEN_ON_SMP=y

    CONFIG_HAVE_SMP=y

    # CONFIG_SMP is not set

    CONFIG_GENERIC_SMP_IDLE_THREAD=y

    # CONFIG_VIDEO_VP27SMPX is not set

    How can we proceed to enable CONFIG_SMP ?

    In menuconfig, finding using /SMP we get:

    Symbol: SMP [=n]                                                              │  

     │ Type : bool                                                                │  

     │ Defined at arch/arm/Kconfig:1126                                                      │  

     │  Prompt: Symmetric Multi-Processing                                                    │  

     │  Depends on: (CPU_V6K [=n] || CPU_V7 [=y]) && HAVE_SMP [=y] && (MMU [=y] || ARM_MPU [=n])                         │  

     │  Location:                                                                │  

     │ (1) -> Kernel Features                                                           │  

     │ Selects: IRQ_WORK [=y]   

    We apreciate your answer.

    ST Employee
    March 21, 2023

    Hi @JPrad.2​ 

    when running bitbake -c menuconfig virtual/kernel, I see the entry «Symmeric Multi-Processing» from the sub-menu «Kernel Features».

    Best regards,

    --JM

    JPrad.2Author
    Visitor II
    March 21, 2023

    Hi,

    related to network question about network differences between dk2 and our own board.

    We're using the PHY KSZ8061RNDW-TR

    So, we add built-in modules for Mikrel and Microchip.

    The result is the same (running network configuration job forever)

    [***  ] (2 of 2) A start job is running for…e Resolution (3min 31s / 4min 39s)

    [**  ] (1 of 2) A start job is running for…onfiguration (3min 35s / 4min 30s)

    Must we add some additional module to manage the PHY ?

    JPrad.2Author
    Visitor II
    March 22, 2023

    Hi,

    Finally I have got an image with ppp modules added.

    (Network problem has been solved modifying PHY driver).

    So, I can restart my target and try to connect internet using a GPRS modem (main goal)

    To validate ppp connection I need to debug it. ppp register debug information at var/log/syslog.

    On image, var/log/syslog seems to be disabled.

    How can I enable syslog ?

    ST Employee
    March 22, 2023

    Hi @JPrad.2​ 

    I am glad you finally got your image.

    About syslog, the configuration is done through the recipe busibox.

    From what I see, syslog messages are sent by default to /var/log/messages.

    Could you check if ppp debug information is available in this file?

    Best regards

    --JM

    JPrad.2Author
    Visitor II
    March 23, 2023

    Sure!

    I could debug ppp on yesterday and my modem was connected to internet successfully and network interface ppp0 was created.

    I've tested internet connections and it works fine!

    Lot of thanks for your excellent support!

    ST Employee
    March 23, 2023

    Hi @JPrad.2​ 

    Thumbs up!

    Best regards,

    --JM

    In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'