Re: How to probe a modem exposing virtual ports (GSM 07.10 muxed ports)

2024-04-09 Thread Garfield Watkins
Is there any other workaround you can suggest ? I really do need these 
virtual terminals exposed by the multiplexer.


On 4/9/24 11:24, Aleksander Morgado wrote:

Hey


No unfortunately they are not.  They (the psuedo terminals) are created by 
opening /dev/ptmx which creates a terminal(s) in /dev/pts/ . These are not 
enumerated in any way. Oh well... let me try your suggestion and see if it 
works.


If the ptys don't have an entry in sysfs, not even as virtual devices,
then the no-udev path won't work either


Re: How to probe a modem exposing virtual ports (GSM 07.10 muxed ports)

2024-04-09 Thread Garfield Watkins
No unfortunately they are not.  They (the psuedo terminals) are created 
by opening /dev/ptmx which creates a terminal(s) in /dev/pts/ . These 
are not enumerated in any way. Oh well... let me try your suggestion and 
see if it works.


On 4/9/24 11:05, Aleksander Morgado wrote:

On Tue, Apr 2, 2024 at 3:43 PM Garfield Watkins
  wrote:

Unfortunately there doesn't seem to be a way for to write a udev rule against a 
pseudo terminal...


Are they not notified via udev really?

You could also try to set it up with ModemManager not running with
udev support (--test-no-udev) and then report the ports manually with
mmcli (--report-kernel-event).


Re: How to probe a modem exposing virtual ports (GSM 07.10 muxed ports)

2024-04-02 Thread Garfield Watkins
Unfortunately there doesn't seem to be a way for to write a udev rule 
against a pseudo terminal...


On 3/8/24 11:31, Aleksander Morgado wrote:

Hey Garfield,


I have a situation where I have a ublox modem, the LISA u200, wired up using 
its SPI bus as the communication channel. On the DTE side is a raspberry pi SBC 
with a custom spi platform driver that exposes a tty device for modem. This 
driver is not capable of multiplexing and exposing multiple virtual channels.

To overcome this I have a user mode daemon that performs this function by 
connection to the single tty port exposed by the spi driver and in turn creating 5 
pseudo tty's (/dev/ptty1 -> /dev/ptty5) to interact with. These are actually 
links to /dev/pts/1 to /dev/pts/5.

I want the ublox plugin to manage this device but there seems to be no way to 
filter/grab those ports.


You should be able to add the ID_MM_PHYSDEV_UID udev tags for all
those pseudo TTYs, so that ModemManager can "bind" all those ports
together to the same modem object, see
https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ModemManager-Common-udev-tags.html#ID-MM-PHYSDEV-UID:CAPS


How to probe a modem exposing virtual ports (GSM 07.10 muxed ports)

2024-03-06 Thread Garfield Watkins

Hi

I have a situation where I have a ublox modem, the LISA u200, wired up 
using its SPI bus as the communication channel. On the DTE side is a 
raspberry pi SBC with a custom spi platform driver that exposes a tty 
device for modem. This driver is not capable of multiplexing and 
exposing multiple virtual channels.


To overcome this I have a user mode daemon that performs this function 
by connection to the single tty port exposed by the spi driver and in 
turn creating 5 pseudo tty's (/dev/ptty1 -> /dev/ptty5) to interact 
with. These are actually links to /dev/pts/1 to /dev/pts/5.


I want the ublox plugin to manage this device but there seems to be no 
way to filter/grab those ports.


Regards


Re: No IP address for a successful connection on LTE modem

2024-03-05 Thread Garfield Watkins

Spot on!
This was exactly the problem!

Thank you.

On 3/3/24 10:07, Aleksander Morgado wrote:

On Wed, Feb 14, 2024 at 11:21 AM Garfield Watkins
  wrote:

I think what confused me is that without the ModemManager i.e. using just 
cgact=1,1 to manually connect, i suddenly got an ip address assigned to the 
network interface provided by the modem. I thought it was NetworkManager 
running its dhcp client on that interface after getting a dhcp discover ? from 
the modem ? (i'm not too sure about how dhcp goes about its business)

Anyway i have now tried to use Network Manager to setup and connect but now am 
getting the following message:

modem-broadband[ttyUSB0]: failed to connect 'meig': Connection requested both 
IPv4 and IPv6 but dual-stack addressing is unsupported by the modem.

and disabling ipv6 I get:

  failed to connect 'meig': Connection requested IPv4 but IPv4 is unsupported 
by the modem.

Any idea where to start debugging that ?


The "SupportedIpFamilies" property in the Modem interface is probably
being reported empty?


Re: No IP address for a successful connection on LTE modem

2024-02-14 Thread Garfield Watkins
I think what confused me is that without the ModemManager i.e. using 
just cgact=1,1 to manually connect, i suddenly got an ip address 
assigned to the network interface provided by the modem. I thought it 
was NetworkManager running its dhcp client on that interface after 
getting a dhcp discover ? from the modem ? (i'm not too sure about how 
dhcp goes about its business)


Anyway i have now tried to use Network Manager to setup and connect but 
now am getting the following message:


modem-broadband[ttyUSB0]: failed to connect 'meig': Connection requested 
both IPv4 and IPv6 but dual-stack addressing is unsupported by the modem.


and disabling ipv6 I get:

 failed to connect 'meig': Connection requested IPv4 but IPv4 is 
unsupported by the modem.


Any idea where to start debugging that ?


On 2/14/24 11:24, Aleksander Morgado wrote:

Hey!

On Tue, Feb 13, 2024 at 1:49 PM Garfield Watkins
  wrote:

Did you connect the modem using NetworkManager (e.g. using nmcli) or
did you connect the modem using mmcli?

I see where you are going with this. It seems I expected more of the 
interaction between the ModemManager and Network Manager . To answer your 
question, no I have only used mmcli. Let me try the process with nmcli.


:) NM only processes the connections that have been started via NM.
There's a fundamental reason for that, which is that all the
network-specific routing is done at NM level, MM knows nothing about
it. In order for NM to know how to route traffic to through the LTE
connection, it needs to use its own connection settings.


Re: No IP address for a successful connection on LTE modem

2024-02-13 Thread Garfield Watkins

Did you connect the modem using NetworkManager (e.g. using nmcli) or
did you connect the modem using mmcli?
I see where you are going with this. It seems I expected more of the 
interaction between the ModemManager and Network Manager . To answer 
your question, no I have only used mmcli. Let me try the process with nmcli.



On 2/13/24 14:43, Aleksander Morgado wrote:

Hey,

On Tue, Feb 13, 2024 at 1:18 PM Garfield Watkins
  wrote:

Bearer 0 is the initial default bearer.

Bearer 1 is the connected bearer

Output from  mmcli -b 1 is:

  -
  General|path: /org/freedesktop/ModemManager1/Bearer/1
 |type: default
  -
  Status |   connected: yes
 |   suspended: no
 | multiplexed: no
 |   interface: enp0s20f0u2
 |  ip timeout: 20
 |  profile id: 1
  -
  Properties | apn: internet
 | roaming: allowed
 | ip type: ipv4
  -
  IPv4 configuration |  method: dhcp
 |  prefix: 0
  -
  Statistics |  start date: 2024-02-13T12:08:31Z
 |attempts: 1

Please note ModemManager is not responsible for running the DHCP
client in the net interface, so if your plugin is reporting "dhcp" IP
method in the connected bearer settings (in your get_ip_config_3gpp()
method), then whoever is the network management layer on top of
ModemManager would be the one in charge of running DHCP client.

I have NetworkManager running. I was under the assumption that it would 
automatically run its dhcp client on the interface. It seems to do this when I 
manually issue AT+CGACT=1,1. Its only when running under ModemManager that 
nothing seems to happen, in fact I have tried to run dhclient enp0s20f0u2 and 
only then do i get an ip address.


Did you connect the modem using NetworkManager (e.g. using nmcli) or
did you connect the modem using mmcli?


Re: No IP address for a successful connection on LTE modem

2024-02-13 Thread Garfield Watkins

Bearer 0 is the initial default bearer.

Bearer 1 is the connected bearer

Output from mmcli -b 1 is:

 -
 General    |    path: /org/freedesktop/ModemManager1/Bearer/1
|    type: default
 -
 Status |   connected: yes
|   suspended: no
| multiplexed: no
|   interface: enp0s20f0u2
|  ip timeout: 20
|  profile id: 1
 -
 Properties | apn: internet
| roaming: allowed
| ip type: ipv4
 -
 IPv4 configuration |  method: dhcp
|  prefix: 0
 -
 Statistics |  start date: 2024-02-13T12:08:31Z
|    attempts: 1


Please note ModemManager is not responsible for running the DHCP
client in the net interface, so if your plugin is reporting "dhcp" IP
method in the connected bearer settings (in your get_ip_config_3gpp()
method), then whoever is the network management layer on top of
ModemManager would be the one in charge of running DHCP client.
I have NetworkManager running. I was under the assumption that it would 
automatically run its dhcp client on the interface. It seems to do this 
when I manually issue AT+CGACT=1,1. Its only when running under 
ModemManager that nothing seems to happen, in fact I have tried to run 
dhclient enp0s20f0u2 and only then do i get an ip address.



On 2/13/24 14:00, Aleksander Morgado wrote:

Hey,

On Mon, Feb 12, 2024 at 9:37 AM Garfield Watkins
  wrote:

I have created a plugin for an LTE modem. This modem exposes 1 AT command port 
(e.g. ttyUSB0) and one ethernet port via usb (cdc_ether).

When the modem is inserted via USB, the kernel enumerates some serial 
ports(ttyUSB0 -> ttyUSB7) and a network interface (enp0s20f0u1)

The modem establishes a default bearer on network registration and to establish 
a data network connection I need to create a pdp context (AT+CGDCONT) with an 
APN and thereafter activate it with AT+CGACT=1,1

The modem, which is configured in router mode responds by activating its 
internal dhcp server causing network managers dhcp client to work its magic and 
eventually configure the ethernet port with all the info it needs (gateways, 
dns servers, ip address etc).


This same process is essentially performed by my plugin and yet no IP address 
get assigned to the ethernet adapter exposed by the modem.

Why could this be happening ?

My plugin, specifically the bearer interface implements the folloiwing:

broadband_bearer_class->dial_3gpp = dial_3gpp;
broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;
broadband_bearer_class->disconnect_3gpp = disconnect_3gpp;
broadband_bearer_class->disconnect_3gpp_finish = disconnect_3gpp_finish;
broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;
broadband_bearer_class->get_ip_config_3gpp_finish = get_ip_config_3gpp_finish;

Please note ModemManager is not responsible for running the DHCP
client in the net interface, so if your plugin is reporting "dhcp" IP
method in the connected bearer settings (in your get_ip_config_3gpp()
method), then whoever is the network management layer on top of
ModemManager would be the one in charge of running DHCP client.

What's the output of "mmcli -b 0" (assuming 0 is the connected bearer
object) once you perform the modem connection?


No IP address for a successful connection on LTE modem

2024-02-12 Thread Garfield Watkins

Sorry, last message was in html format

I have created a plugin for an LTE modem. This modem exposes 1 AT 
command port (e.g. ttyUSB0) and one ethernet port via usb (cdc_ether).


When the modem is inserted via USB, the kernel enumerates some serial 
ports(ttyUSB0 -> ttyUSB7) and a network interface (enp0s20f0u1)


The modem establishes a default bearer on network registration and to 
establish a data network connection I need to create a pdp context 
(AT+CGDCONT) with an APN and thereafter activate it with AT+CGACT=1,1


The modem, which is configured in router mode responds by activating its 
internal dhcp server causing network managers dhcp client to work its 
magic and eventually configure the ethernet port with all the info it 
needs (gateways, dns servers, ip address etc).



This same process is essentially performed by my plugin and yet no IP 
address get assigned to the ethernet adapter exposed by the modem.


Why could this be happening ?

My plugin, specifically the bearer interface implements the folloiwing:

broadband_bearer_class->dial_3gpp = dial_3gpp;
broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;
broadband_bearer_class->disconnect_3gpp = disconnect_3gpp;
broadband_bearer_class->disconnect_3gpp_finish = disconnect_3gpp_finish;
broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;
broadband_bearer_class->get_ip_config_3gpp_finish = 
get_ip_config_3gpp_finish;

Regards






No IP address for a successful connection on LTE modem

2024-02-12 Thread Garfield Watkins


  
  
I have created a plugin for an LTE modem. This modem exposes 1 AT
  command port (e.g. ttyUSB0) and one ethernet port via usb
  (cdc_ether). 

When the modem is inserted via USB, the kernel enumerates some
  serial ports(ttyUSB0 -> ttyUSB7) and a network interface
  (enp0s20f0u1)

The modem establishes a default bearer on network registration
  and to establish a data network connection I need to create a pdp
  context (AT+CGDCONT) with an APN and thereafter activate it with
  AT+CGACT=1,1
The modem, which is configured in router mode responds by
  activating its internal dhcp server causing network managers dhcp
  client to work its magic and eventually configure the ethernet
  port with all the info it needs (gateways, dns servers, ip address
  etc). 



This same process is essentially performed by my plugin and yet
  no IP address get assigned to the ethernet adapter exposed by the
  modem.
Why could this be happening ?
My plugin, specifically the bearer interface implements the
  folloiwing:

broadband_bearer_class->dial_3gpp = dial_3gpp;broadband_bearer_class->dial_3gpp_finish = dial_3gpp_finish;broadband_bearer_class->disconnect_3gpp = disconnect_3gpp;broadband_bearer_class->disconnect_3gpp_finish = disconnect_3gpp_finish;broadband_bearer_class->get_ip_config_3gpp = get_ip_config_3gpp;broadband_bearer_class->get_ip_config_3gpp_finish = get_ip_config_3gpp_finish;
Regards