Re: NetworkManager dispatchers

2016-03-03 Thread Ali Nematollahi
So I did some more work and Here is what I found, which still doesn't make
any sense.

When I checked the "bearer" info with mmcli:
Bearer '/org/freedesktop/ModemManager1/Bearer/0'
  -
  Status |   connected: 'no'
 |   suspended: 'no'
 |   interface: 'unknown'
 |  IP timeout: '20'
  -
  Properties | apn: 'm2minternet.apn'
 | roaming: 'allowed'
 | IP type: 'none'
 |user: 'none'
 |password: 'none'
 |  number: 'none'
 | Rm protocol: 'unknown'
  -
  IPv4 configuration |   method: 'unknown'
  -
  IPv6 configuration |   method: 'unknown'



so I did a simple-connect AGAIN:
mmcli -m 0 --simple-connect="apn=m2minternet.apn"
NetworkManager[2887]:   (ttyUSB2): modem state changed, 'registered'
--> 'connecting' (reason: user-requested)
NetworkManager[2887]:   (ttyUSB2): modem state changed, 'connecting'
--> 'connected' (reason: user-requested)
successfully connected the modem
root~# mmcli -b /org/freedesktop/ModemManager1/Bearer/1
Bearer '/org/freedesktop/ModemManager1/Bearer/1'
  -
  Status |   connected: 'yes'
 |   suspended: 'no'
 |   interface: 'ttyUSB3'
 |  IP timeout: '20'
  -
  Properties | apn: 'm2minternet.apn'
 | roaming: 'allowed'
 | IP type: 'none'
 |user: 'none'
 |password: 'none'
 |  number: 'none'
 | Rm protocol: 'unknown'
  -
  IPv4 configuration |   method: 'ppp'
 |  address: 'unknown'
 |   prefix: '0'
 |  gateway: 'unknown'
 |  DNS: none
  -
  IPv6 configuration |   method: 'unknown'

Good sign! But
nmcli con up ppp
NetworkManager[2887]:   (ttyUSB2): Activation: starting connection
'ppp' (94e24340-490b-4f96-91bb-c5511a2a5f50)
NetworkManager[2887]:   (ttyUSB2): device state change: disconnected
-> prepare (reason 'none') [30 40 0]
NetworkManager[2887]:   NetworkManager state is now CONNECTING
NetworkManager[2887]:   (ttyUSB2): Failed to connect 'ppp':
Connection requested IPv4 but IPv4 is unsuported by the modem.
NetworkManager[2887]:   (ttyUSB2): device state change: prepare ->
failed (reason 'modem-init-failed') [40 120 28]
NetworkManager[2887]:   NetworkManager state is now DISCONNECTED
NetworkManager[2887]:   (ttyUSB2): Activation: failed for connection
'ppp'
NetworkManager[2887]:   (ttyUSB2): modem state changed, 'connected'
--> 'disconnecting' (reason: user-requested)
NetworkManager[2887]:   (ttyUSB2): device state change: failed ->
disconnected (reason 'none') [120 30 0]
Error: Connection activation failed: Active connection could not be
attached to the device
root~# NetworkManager[2887]:   (ttyUSB2): modem state changed,
'disconnecting' --> 'registered' (reason: user-requested)

root~# mmcli -b /org/freedesktop/ModemManager1/Bearer/1
Bearer '/org/freedesktop/ModemManager1/Bearer/1'
  -
  Status |   connected: 'no'
 |   suspended: 'no'
 |   interface: 'unknown'
 |  IP timeout: '20'
  -
  Properties | apn: 'm2minternet.apn'
 | roaming: 'allowed'
 | IP type: 'none'
 |user: 'none'
 |password: 'none'
 |  number: 'none'
 | Rm protocol: 'unknown'
  -
  IPv4 configuration |   method: 'unknown'
  -
  IPv6 configuration |   method: 'unknown'


So after a con up, the modem lost its connection it looks like!!! but why?

I'm really out of ideas now. I don't know how to progress further :(



On Thu, Mar 3, 2016 at 4:49 PM, Ali Nematollahi  wrote:

> I made a progress. I enabled debugging and I saw the NM was complaining
> about dual-stack:
>
> NetworkManager[4883]:   Loaded device plugin: NMWwanFactory
> (/usr/local/lib/NetworkManager/libnm-device-plugin-wwan.so)
> NetworkManager[4883]:   Loaded device plugin: NMAtmManager
> (/usr/local/lib/NetworkManager/libnm-device-plugin-adsl.so)
> NetworkManager[4883]:   WiFi enabled by radio killswitch; enabled by
> state file
> NetworkManager[4883]:   WWAN enabled by radio killswitch; enabled by
> state file
> NetworkManager[4883]:   WiMAX enabled by radio killswitch; enabled
> by state file
> NetworkManager[4883]:   Networking is enabled by state file
> NetworkManager[4883]:   (eth0): link connected
> NetworkMana

Re: NetworkManager dispatchers

2016-03-03 Thread Ali Nematollahi
I made a progress. I enabled debugging and I saw the NM was complaining
about dual-stack:

NetworkManager[4883]:   Loaded device plugin: NMWwanFactory
(/usr/local/lib/NetworkManager/libnm-device-plugin-wwan.so)
NetworkManager[4883]:   Loaded device plugin: NMAtmManager
(/usr/local/lib/NetworkManager/libnm-device-plugin-adsl.so)
NetworkManager[4883]:   WiFi enabled by radio killswitch; enabled by
state file
NetworkManager[4883]:   WWAN enabled by radio killswitch; enabled by
state file
NetworkManager[4883]:   WiMAX enabled by radio killswitch; enabled by
state file
NetworkManager[4883]:   Networking is enabled by state file
NetworkManager[4883]:   (eth0): link connected
NetworkManager[4883]:   (eth0): new Ethernet device (carrier: ON,
driver: 'cpsw', ifindex: 4)
NetworkManager[4883]:   (lo): link connected
NetworkManager[4883]:   (lo): new Generic device (carrier: ON,
driver: 'unknown', ifindex: 1)
NetworkManager[4883]:   (can0): new Generic device (carrier: UNKNOWN,
driver: 'c_can_platform', ifindex: 2)
NetworkManager[4883]:   (can1): new Generic device (carrier: UNKNOWN,
driver: 'c_can_platform', ifindex: 3)
NetworkManager[4883]:   startup complete
NetworkManager[4883]:   ModemManager available in the bus
NetworkManager[4883]:   (ttyUSB2): new Broadband device (carrier:
UNKNOWN, driver: 'option1', ifindex: 0)
NetworkManager[4883]:   (ttyUSB2): device state change: unmanaged ->
unavailable (reason 'managed') [10 20 2]
NetworkManager[4883]:   (ttyUSB2): modem state 'registered'
NetworkManager[4883]:   (ttyUSB2): device state change: unavailable
-> disconnected (reason 'none') [20 30 0]
NetworkManager[4883]:   Auto-activating connection 'ppp'.
NetworkManager[4883]:   (ttyUSB2): Activation: starting connection
'ppp' (94e24340-490b-4f96-91bb-c5511a2a5f50)
NetworkManager[4883]:   (ttyUSB2): device state change: disconnected
-> prepare (reason 'none') [30 40 0]
NetworkManager[4883]:   NetworkManager state is now CONNECTING
NetworkManager[4883]:   (ttyUSB2): Failed to connect 'ppp':
Connection requested both IPv4 and IPv6 but dual-stack addressing is
unsupported by the modem.
NetworkManager[4883]:   (ttyUSB2): device state change: prepare ->
failed (reason 'modem-init-failed') [40 120 28]
NetworkManager[4883]:   NetworkManager state is now DISCONNECTED
NetworkManager[4883]:   (ttyUSB2): Activation: failed for connection
'ppp'
NetworkManager[4883]:   (ttyUSB2): device state change: failed ->
disconnected (reason 'none') [120 30 0]


I set the ipv6 method to ignore:

[connection]
id=ppp
uuid=94e24340-490b-4f96-91bb-c5511a2a5f50
type=gsm
interface-name=ttyUSB2
permissions=
secondaries=

[gsm]
apn=internet.com
number=*99#

[ipv4]
dns-search=
method=auto

[ipv6]
method=ignore


and this is what I get on startup now:
NetworkManager[5146]:   keyfile: new connection
/usr/local/etc/NetworkManager/system-connections/ppp
(94e24340-490b-4f96-91bb-c5511a2a5f50,"ppp")
NetworkManager[5146]:   get unmanaged devices count: 1
NetworkManager[5146]:   monitoring kernel firmware directory
'/lib/firmware'.
NetworkManager[5146]:   Loaded device plugin: NMVxlanFactory
(internal)
NetworkManager[5146]:   Loaded device plugin: NMVlanFactory (internal)
NetworkManager[5146]:   Loaded device plugin: NMVethFactory (internal)
NetworkManager[5146]:   Loaded device plugin: NMTunFactory (internal)
NetworkManager[5146]:   Loaded device plugin: NMMacvlanFactory
(internal)
NetworkManager[5146]:   Loaded device plugin: NMInfinibandFactory
(internal)
NetworkManager[5146]:   Loaded device plugin: NMGreFactory (internal)
NetworkManager[5146]:   Loaded device plugin: NMEthernetFactory
(internal)
NetworkManager[5146]:   Loaded device plugin: NMBridgeFactory
(internal)
NetworkManager[5146]:   Loaded device plugin: NMBondFactory (internal)
NetworkManager[5146]:   Loaded device plugin: NMWifiFactory
(/usr/local/lib/NetworkManager/libnm-device-plugin-wifi.so)
NetworkManager[5146]:   (/libnm-device-plugin-bluetooth.so): failed
to load plugin:
/usr/local/lib/NetworkManager/libnm-device-plugin-bluetooth.so: undefined
symbol: g_clear_pointer
NetworkManager[5146]:   Loaded device plugin: NMWwanFactory
(/usr/local/lib/NetworkManager/libnm-device-plugin-wwan.so)
NetworkManager[5146]:   Loaded device plugin: NMAtmManager
(/usr/local/lib/NetworkManager/libnm-device-plugin-adsl.so)
NetworkManager[5146]:   WiFi enabled by radio killswitch; enabled by
state file
NetworkManager[5146]:   WWAN enabled by radio killswitch; enabled by
state file
NetworkManager[5146]:   WiMAX enabled by radio killswitch; enabled by
state file
NetworkManager[5146]:   Networking is enabled by state file
NetworkManager[5146]:   (eth0): link connected
NetworkManager[5146]:   (eth0): new Ethernet device (carrier: ON,
driver: 'cpsw', ifindex: 4)
NetworkManager[5146]:   (lo): link connected
NetworkManager[5146]:   (lo): new Generic device (carrier: ON,
driver: 'unknown', ifindex: 1)
NetworkManager[5146]:   (can0): new Generic device (carrier: UNKNOWN,
driver: 'c_can_platform', ifindex: 2)
NetworkManag

Re: nm-pppd-plugin does not start

2016-03-03 Thread Aleksander Morgado
On Fri, Mar 4, 2016 at 12:28 AM, Aleksander Morgado
 wrote:
>
>> QUESTIONS:
>> =
>> 1) What is missing in my set-up?
>
> I think you're missing

... 

I think you're basically missing the NM "gsm" connection that you
should activate through NM (e.g. with nmcli), and I'd also try to use
that modem in a newer MM directly in Ubuntu to see if avoiding all the
other integration issues you can make it work with NDISDUP+WWAN.

-- 
Aleksander
https://aleksander.es
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: nm-pppd-plugin does not start

2016-03-03 Thread Aleksander Morgado
Hey,

>
> Background:
> =
> I'm trying to integrate Huawei 3131 modem, VID=21d1. Original PID=14fe that
> switches to PID=1506.
>
> I'm working on am335x based embedded board running yocto/linux-ti-staging
> based Linux with 4.1 kernel. NM version is 0.9.8.10 and MM version 1.4.2.
> Board is using systemd.
>
> Base problem is that most likely modem firmware is broken so that it claims
> supporting ndisdup, but in fact it does not. This revealed when I first
> tried using connman/ofono. Connection went up to stage where connection was
> opened wtih  AT^NDISDUP=1,1. Following  AT^DHCP? returned only OK without
> any connection details.
>

Did connman/ofono run a DHCP client on the interface?

> However my desktop machine - Ubuntu 14.04 opens connection quite smoothly.
> It has NM version 0.9.8.8 and MM version 1.0.0. Somehow it does not care
> about this ndisdup problem, but instead opens connection using ppp - no
> problem at all.
>

Despite the fact that is using PPP instead of the WWAN iface :)

> Main difference found from sysfs is that Ubuntu opens only /dev/ttyUSB0
> /dev/ttyUSB2  /dev/ttyUSB3 devices for this modem whereas am335x board opens
> /dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2 /dev/cdc-wdm0 and /net/wwan0
>
> if I execute following command after plugging in modem:
> nmcli d
> Ubuntu provides:
> ttyUSB3gsm   disconnected
>
> am335x board do not provide  have this line
>
> If I execute following command on am335x board:
> mmcli -m 0 --simple-connect="apn=internet"
>
> Everything seems going well, solid blue led swithes on, but there is no
> interface brought up.

You're connecting the modem through MM; while you want to connect the
modem through NM (NM will talk to MM internally). MM will not bring up
any interface or configure IP details on the interface; that's NM
doing it for you when you activate a "gsm" connection type.

> If I start modem connection from nm app on Ubuntu, ppp connection starts and
> it is brought to interfaces. From logs it seems that it also is using
> simple-connect method.
>

NM calls the simple connect in MM; that's regardless of what
connection type MM will be using afterwards. NM always runs simple
connect; you shouldn't run it manually.

> If I use udev rules to ignore cdc-wdm0 and net/wwan0 on am335x board,
> simple-connect proceeds up tp "all done", but no ppp is started an in fact
> now even the led is not having solid blue. However, if I start pppd manually
> at this point, connection is established quite well.

Ideally you should use NDISDUP+WWAN; very very likely you can use them
an you're losing some other thing. If using NDISDUP+WWAN, you won't
see NM creating a ppp0 interface, you'll just see NM trying to run a
DHCP client on the WWAN interface once ModemManager has decided the
WWAN is read for that (once the NDISDUP command has finished).

Have you tried to use the modem with a newer ModemManager in the same
Ubuntu setup? MM 1.0.0 and MM 1.4.x are totally compatible API wise.
I'd really try it.

> I have tried to reproduce Ubuntu settings.
> 1) /etc/NetworkManager/NetworkManager.conf with following contents:
> [main]
> plugins=keyfile
> dns=dnsmasq
>
> 2) /etc/NetworkManager/system-connections/Operator with following contents:
> [connection]
> id=Operator
> uuid=b9cbaa78-8856-4c82-915b-702048ab3b85
> type=gsm
> permissions=user:root:;
> autoconnect=true
> timestamp=0
>
> [gsm]
> number=*99#
> apn=internet
>
> [ipv4]
> method=auto
>
> [serial]
> baud=115200
>
> Differences bitween Ubuntu and am335x board:
> 1) Note that Ubuntu uses upstart and am335x board systemd.

This shouldn't be any issue.

> 2) Ubuntu lists one line for each of files in
> /etc/NetworkManager/system-connections folder whereas am335x seems ignoring
> these settings.
>

I think you may be missing the step to create a "gsm" connection and
activate it through NM.

> net/ppp0
> ---
> Ubuntu:
> ModemManager[22598]:  [1456479663.774029] [mm-manager.c:270]
> device_added(): (net/ppp0): could not get port's parent device
>

Normal.

> am335x: no reference for net/ppp0
>

You don't see any reference to the ppp0 interface because it is only
created on-the-fly when needed; in your yocto build we try to use
NDISDUP and WWAN, no PPP involved.

> NM in Ubuntu starts reports reporting ppp with following lines:
> NetworkManager[22606]:  pppd started with pid 23181
> Plugin /usr/lib/x86_64-linux-gnu/pppd/2.4.5/nm-pppd-plugin.so loaded.
> ** Message: nm-ppp-plugin: (plugin_init): initializing
> ** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial
> connection'
> Using interface ppp0
> Connect: ppp0 <--> /dev/ttyUSB0
>
> all PPP messages from am335x
> plugins/huawei/mm-plugin-huawei.c:543] grab_port(): (tty/ttyUSB0) Port
> flagged as PPP
>

Yes, as said, that is because Ubuntu is using the legacy PPP method in
the Huawei modem. The interface is created on the fly by pppd when NM
starts it. Note that MM does nothing of this.

> src/mm-port-serial-at.c:440] de

Re: NetworkManager dispatchers

2016-03-03 Thread Ali Nematollahi
Thanks Dan!
I removed the connections and restarted NM and did what you suggested and
here is what I get now:
nmcli con add type gsm con-name ppp ifname ttyUSB2 apn internet.com
Connection 'ppp' (94e24340-490b-4f96-91bb-c5511a2a5f50) successfully added.

root/usr/local/etc/NetworkManager/system-connections# nmcli con up ppp
Error: Connection activation failed: Active connection removed before it
was initialized
root/usr/local/etc/NetworkManager/system-connections# nmcli con up ppp
Error: Connection activation failed: Active connection could not be
attached to the device


I wonder what that means...hmmm


Thanks a lot for your help!

On Thu, Mar 3, 2016 at 2:25 PM, Dan Williams  wrote:

> On Thu, 2016-03-03 at 13:58 -0800, Ali Nematollahi wrote:
> > Okay so I was able to get MM 1.4.12 and NM 1.0.10 compiled and
> > deployed on
> > my unit, which I must admit wasn't easy. 0.9.4 was a lot easier, I
> > had to
> > do a whole lot of re-linking and stuff to get 1.0.10 set up and
> > running.
> > Good news is it is up and running!
> >
> >
> > I got my 3g up and running and it's all good. Now trying to get NM to
> > start
> > a PPP on it but I'm hitting the wall again.
> > I've read a lot of documents on setting up devices but none that go
> > deep
> > into setting up GSM and PPP, which is sad. Here is what I have done
> > so far:
> >
> > - with NMCLI:
> > nmcli con add type gsm con-name ppp ifname ppp0 apn internet.com
> > Connection 'ppp' (af71d0c7-bbbd-4d4e-941e-a2581dc86a2e) successfully
> > added.
> >
> > root/usr/local/etc/NetworkManager/system-connections# nmcli con up
> > ppp
> > Error: Connection activation failed: No suitable device found for
> > this
> > connection.
> >
> > some useful outputs:
> > root/usr/local/etc/NetworkManager/system-connections# nmcli con
> > NAME   UUID  TYPE  DEVICE
> > pppaf71d0c7-bbbd-4d4e-941e-a2581dc86a2e  gsm   --
> > radio  f6547503-d831-4cc2-bd3c-a958e645552a  gsm   --
> > root/usr/local/etc/NetworkManager/system-connections# nmcli dev
> > DEVICE   TYPE  STATE CONNECTION
> > ttyUSB2  gsm   disconnected  --
> > eth0 ethernet  unmanaged --
> > lo   loopback  unmanaged --
> > root/usr/local/etc/NetworkManager/system-connections# mmcli -L
> >
> > Found 1 modems:
> > /org/freedesktop/ModemManager1/Modem/0 [Cinterion] PHS8-USA
> >
> >
> > I added another entry to the ppp connection and called it radio:
> > cat radio
> > [connection]
> > id=radio
> > uuid=f6547503-d831-4cc2-bd3c-a958e645552a
> > type=gsm
> > #interface-name=ppp0
> > interface-name=wwan0
>
> The interface part is likely your problem.  interface-name is the name
> of the NetworkManager control port, which in your case would be ttyUSB2
> (as reported by 'nmcli dev').  Data ports (like ppp0) are transient,
> they come and go, so locking the connection profile to a specific
> device needs to happen with the control interface name.
>
> If you change that to ttyUSB2 or even just remove it entirely, what
> happens?
>
> Dan
>
> > permissions=
> > secondaries=
> >
> > [gsm]
> > apn=m2minternet.apn
> > number=*99#
> >
> > [ipv4]
> > dns-search=
> > method=auto
> >
> > [ipv6]
> > dns-search=
> > method=auto
> >
> > [serial]
> > baud=115200
> >
> >
> > nmcli con up radio ifname ppp0
> > Error: device 'ppp0' not compatible with connection 'radio'.
> >
> >
> > Can someone tell me what I'm not doing right? I want to have my PPP0
> > interface come up everytime the radio is connected. When I do it
> > manually
> > through pppd call it works beautifully but I can't get it to work
> > with
> > NMCLI. Any ideas why not?
> >
> >
> > Thanks
> >
> >
> >
> >
> >
> > On Tue, Mar 1, 2016 at 7:38 AM, Dan Williams  wrote:
> >
> > >
> > > On Mon, 2016-02-29 at 17:40 -0800, Ali Nematollahi wrote:
> > > >
> > > > Thanks! I've looked at nmcli radio but there is no good
> > > > documentation
> > > > I
> > > > could find for the version I am using. All of the documentation
> > > > is
> > > > for
> > > > newer version and don't apply.
> > > Yeah, you say later you're using NM 0.9.4, which is extremely old
> > > (23-
> > > Mar-2012) and I'm not surprised some stuff would be different...
> > >
> > > >
> > > > First of all, when I do:
> > > >
> > > > nmcli nm wwan
> > > > WWAN
> > > > disabled
> > > >
> > > > Then I do:
> > > >  nmcli nm wwan on
> > > > nmcli nm wwan
> > > > WWAN
> > > > disabled
> > > >
> > > > nmcli nm status
> > > > RUNNING STATE   WIFI-HARDWARE   WIFI   WWAN-
> > > > HARDWARE
> > > > WWAN
> > > > running connected   enabled enabledenable
> > > > d
> > > > disabled
> > > What's in /var/lib/NetworkManager/NetworkManager.state ?
> > >
> > > Can you turn on NM log debugging (might be an nmcli command for
> > > that)
> > > and see what NM prints out when you do "nmcli nm wwan on"?
> > >
> > > Dan
> > >
> > > >
> > > > I was reading on google somewhere that I need a config file
> > > > in: /etc/NetworkManager/system-connect

Re: NetworkManager dispatchers

2016-03-03 Thread Dan Williams
On Thu, 2016-03-03 at 13:58 -0800, Ali Nematollahi wrote:
> Okay so I was able to get MM 1.4.12 and NM 1.0.10 compiled and
> deployed on
> my unit, which I must admit wasn't easy. 0.9.4 was a lot easier, I
> had to
> do a whole lot of re-linking and stuff to get 1.0.10 set up and
> running.
> Good news is it is up and running!
> 
> 
> I got my 3g up and running and it's all good. Now trying to get NM to
> start
> a PPP on it but I'm hitting the wall again.
> I've read a lot of documents on setting up devices but none that go
> deep
> into setting up GSM and PPP, which is sad. Here is what I have done
> so far:
> 
> - with NMCLI:
> nmcli con add type gsm con-name ppp ifname ppp0 apn internet.com
> Connection 'ppp' (af71d0c7-bbbd-4d4e-941e-a2581dc86a2e) successfully
> added.
> 
> root/usr/local/etc/NetworkManager/system-connections# nmcli con up
> ppp
> Error: Connection activation failed: No suitable device found for
> this
> connection.
> 
> some useful outputs:
> root/usr/local/etc/NetworkManager/system-connections# nmcli con
> NAME   UUID  TYPE  DEVICE
> pppaf71d0c7-bbbd-4d4e-941e-a2581dc86a2e  gsm   --
> radio  f6547503-d831-4cc2-bd3c-a958e645552a  gsm   --
> root/usr/local/etc/NetworkManager/system-connections# nmcli dev
> DEVICE   TYPE  STATE CONNECTION
> ttyUSB2  gsm   disconnected  --
> eth0 ethernet  unmanaged --
> lo   loopback  unmanaged --
> root/usr/local/etc/NetworkManager/system-connections# mmcli -L
> 
> Found 1 modems:
> /org/freedesktop/ModemManager1/Modem/0 [Cinterion] PHS8-USA
> 
> 
> I added another entry to the ppp connection and called it radio:
> cat radio
> [connection]
> id=radio
> uuid=f6547503-d831-4cc2-bd3c-a958e645552a
> type=gsm
> #interface-name=ppp0
> interface-name=wwan0

The interface part is likely your problem.  interface-name is the name
of the NetworkManager control port, which in your case would be ttyUSB2
(as reported by 'nmcli dev').  Data ports (like ppp0) are transient,
they come and go, so locking the connection profile to a specific
device needs to happen with the control interface name.

If you change that to ttyUSB2 or even just remove it entirely, what
happens?

Dan

> permissions=
> secondaries=
> 
> [gsm]
> apn=m2minternet.apn
> number=*99#
> 
> [ipv4]
> dns-search=
> method=auto
> 
> [ipv6]
> dns-search=
> method=auto
> 
> [serial]
> baud=115200
> 
> 
> nmcli con up radio ifname ppp0
> Error: device 'ppp0' not compatible with connection 'radio'.
> 
> 
> Can someone tell me what I'm not doing right? I want to have my PPP0
> interface come up everytime the radio is connected. When I do it
> manually
> through pppd call it works beautifully but I can't get it to work
> with
> NMCLI. Any ideas why not?
> 
> 
> Thanks
> 
> 
> 
> 
> 
> On Tue, Mar 1, 2016 at 7:38 AM, Dan Williams  wrote:
> 
> > 
> > On Mon, 2016-02-29 at 17:40 -0800, Ali Nematollahi wrote:
> > > 
> > > Thanks! I've looked at nmcli radio but there is no good
> > > documentation
> > > I
> > > could find for the version I am using. All of the documentation
> > > is
> > > for
> > > newer version and don't apply.
> > Yeah, you say later you're using NM 0.9.4, which is extremely old
> > (23-
> > Mar-2012) and I'm not surprised some stuff would be different...
> > 
> > > 
> > > First of all, when I do:
> > > 
> > > nmcli nm wwan
> > > WWAN
> > > disabled
> > > 
> > > Then I do:
> > >  nmcli nm wwan on
> > > nmcli nm wwan
> > > WWAN
> > > disabled
> > > 
> > > nmcli nm status
> > > RUNNING STATE   WIFI-HARDWARE   WIFI   WWAN-
> > > HARDWARE
> > > WWAN
> > > running connected   enabled enabledenable
> > > d
> > > disabled
> > What's in /var/lib/NetworkManager/NetworkManager.state ?
> > 
> > Can you turn on NM log debugging (might be an nmcli command for
> > that)
> > and see what NM prints out when you do "nmcli nm wwan on"?
> > 
> > Dan
> > 
> > > 
> > > I was reading on google somewhere that I need a config file
> > > in: /etc/NetworkManager/system-connections/
> > > so I put one in:
> > > 
> > > cat /etc/NetworkManager/system-connections/radio
> > > [connection]
> > > id=MyWwanConnection
> > > type=gsm
> > > 
> > > [ipv4]
> > > method=auto
> > > 
> > > [gsm]
> > > number=*99#
> > > apn=mnet.bell.ca.ioe
> > > 
> > > 
> > > restarted NM, did the same thing, no difference.
> > > 
> > > Any documentation for 0.9.4.0 that I can use to figure this out?
> > > Can
> > > someone help me with setting up the radio connections? I'm having
> > > no
> > > luck.
> > > 
> > > Thanks
> > > 
> > > 
> > > 
> > > On Fri, Feb 26, 2016 at 2:22 PM, Dan Williams 
> > > wrote:
> > > 
> > > > 
> > > > 
> > > > On Fri, 2016-02-26 at 10:50 -0800, Ali Nematollahi wrote:
> > > > > 
> > > > > 
> > > > > Thanks!
> > > > > 
> > > > > How to I enable "service called NetworkManager-dispatcher or
> > > > > nm-dispatcher"? When I search for "dispatcher" in my
> > > > > filesystem
> > > > > only
> > > > > these
> > > > > come up

Re: NetworkManager dispatchers

2016-03-03 Thread Ali Nematollahi
Okay so I was able to get MM 1.4.12 and NM 1.0.10 compiled and deployed on
my unit, which I must admit wasn't easy. 0.9.4 was a lot easier, I had to
do a whole lot of re-linking and stuff to get 1.0.10 set up and running.
Good news is it is up and running!


I got my 3g up and running and it's all good. Now trying to get NM to start
a PPP on it but I'm hitting the wall again.
I've read a lot of documents on setting up devices but none that go deep
into setting up GSM and PPP, which is sad. Here is what I have done so far:

- with NMCLI:
nmcli con add type gsm con-name ppp ifname ppp0 apn internet.com
Connection 'ppp' (af71d0c7-bbbd-4d4e-941e-a2581dc86a2e) successfully added.

root/usr/local/etc/NetworkManager/system-connections# nmcli con up ppp
Error: Connection activation failed: No suitable device found for this
connection.

some useful outputs:
root/usr/local/etc/NetworkManager/system-connections# nmcli con
NAME   UUID  TYPE  DEVICE
pppaf71d0c7-bbbd-4d4e-941e-a2581dc86a2e  gsm   --
radio  f6547503-d831-4cc2-bd3c-a958e645552a  gsm   --
root/usr/local/etc/NetworkManager/system-connections# nmcli dev
DEVICE   TYPE  STATE CONNECTION
ttyUSB2  gsm   disconnected  --
eth0 ethernet  unmanaged --
lo   loopback  unmanaged --
root/usr/local/etc/NetworkManager/system-connections# mmcli -L

Found 1 modems:
/org/freedesktop/ModemManager1/Modem/0 [Cinterion] PHS8-USA


I added another entry to the ppp connection and called it radio:
cat radio
[connection]
id=radio
uuid=f6547503-d831-4cc2-bd3c-a958e645552a
type=gsm
#interface-name=ppp0
interface-name=wwan0
permissions=
secondaries=

[gsm]
apn=m2minternet.apn
number=*99#

[ipv4]
dns-search=
method=auto

[ipv6]
dns-search=
method=auto

[serial]
baud=115200


nmcli con up radio ifname ppp0
Error: device 'ppp0' not compatible with connection 'radio'.


Can someone tell me what I'm not doing right? I want to have my PPP0
interface come up everytime the radio is connected. When I do it manually
through pppd call it works beautifully but I can't get it to work with
NMCLI. Any ideas why not?


Thanks





On Tue, Mar 1, 2016 at 7:38 AM, Dan Williams  wrote:

> On Mon, 2016-02-29 at 17:40 -0800, Ali Nematollahi wrote:
> > Thanks! I've looked at nmcli radio but there is no good documentation
> > I
> > could find for the version I am using. All of the documentation is
> > for
> > newer version and don't apply.
>
> Yeah, you say later you're using NM 0.9.4, which is extremely old (23-
> Mar-2012) and I'm not surprised some stuff would be different...
>
> > First of all, when I do:
> >
> > nmcli nm wwan
> > WWAN
> > disabled
> >
> > Then I do:
> >  nmcli nm wwan on
> > nmcli nm wwan
> > WWAN
> > disabled
> >
> > nmcli nm status
> > RUNNING STATE   WIFI-HARDWARE   WIFI   WWAN-
> > HARDWARE
> > WWAN
> > running connected   enabled enabledenabled
> > disabled
>
> What's in /var/lib/NetworkManager/NetworkManager.state ?
>
> Can you turn on NM log debugging (might be an nmcli command for that)
> and see what NM prints out when you do "nmcli nm wwan on"?
>
> Dan
>
> > I was reading on google somewhere that I need a config file
> > in: /etc/NetworkManager/system-connections/
> > so I put one in:
> >
> > cat /etc/NetworkManager/system-connections/radio
> > [connection]
> > id=MyWwanConnection
> > type=gsm
> >
> > [ipv4]
> > method=auto
> >
> > [gsm]
> > number=*99#
> > apn=mnet.bell.ca.ioe
> >
> >
> > restarted NM, did the same thing, no difference.
> >
> > Any documentation for 0.9.4.0 that I can use to figure this out? Can
> > someone help me with setting up the radio connections? I'm having no
> > luck.
> >
> > Thanks
> >
> >
> >
> > On Fri, Feb 26, 2016 at 2:22 PM, Dan Williams 
> > wrote:
> >
> > >
> > > On Fri, 2016-02-26 at 10:50 -0800, Ali Nematollahi wrote:
> > > >
> > > > Thanks!
> > > >
> > > > How to I enable "service called NetworkManager-dispatcher or
> > > > nm-dispatcher"? When I search for "dispatcher" in my filesystem
> > > > only
> > > > these
> > > > come up:
> > > > /etc/NetworkManager/dispatcher.d
> > > > /etc/dbus-1/system.d/nm-dispatcher.conf
> > > > /usr/share/dbus-1/system-
> > > > services/org.freedesktop.nm_dispatcher.service
> > > > /usr/lib/NetworkManager/nm-dispatcher.action
> > > > /usr/sbin/usb_modeswitch_dispatcher
> > > >
> > > >
> > > > Starting MM as a service makes perfect sense.
> > > > The question is however, how do I find out when to say "enable"
> > > > the
> > > > modem,
> > > > or to do a simple-connect? I was planning on using the
> > > > dispatchers
> > > > for all
> > > > of that, to automate all of those. So basically:
> > > NetworkManager will take care of that, if 'wwan' radios are
> > > enabled.
> > >  See 'nmcli radio'.  As long as 'nmcli radio' reports WWAN enabled,
> > > and
> > > as long as your machine has no airplane switch for WWAN (or if it
> > > does
> > > the switch enables the WWAN), NetworkManager will enable the mo

Re: Backport th/supplicant-manager-fix-ref-count-rh1298007 to 1.0?

2016-03-03 Thread Thomas Haller
On Wed, 2016-03-02 at 16:12 +0100, Thomas Haller wrote:
> On Sat, 2016-02-27 at 10:06 -0600, Dan Williams wrote:
> > 
> > Thomas,
> > 
> > Do you think it's worth backporting th/supplicant-manager-fix-ref-
> > count-rh1298007 to nm-1-0?  I was just looking at https://bugzilla.
> > re
> > dh
> > at.com/show_bug.cgi?id=1241198 and maybe that branch fixes the bug
> > there.  The only other plausible reason would be memory corruption.
> >  But 1.0 would benefit from that fix too.  What do you think?
> > 
> 
> Hi Dan,
> 
> See https://bugzilla.redhat.com/show_bug.cgi?id=1298007#c19
> 
> There is already a workaround for the crash on nm-1-0 [1].
> 
> I only noticed that later, and already did the backport. Don't know
> we
> want to merge it though(?!). See th/supplicant-manager-fix-ref-count-
> rh1298007-nm-1-0 branch.


backports merged to nm-1-0:

https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=1fe054d31905935f2d034042b15217b7b411f46a

I did not backport
https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=1264fc210822ec80408fe7d8451297fedee70881
because it was complicated and didn't seem necessary.



Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


nm-pppd-plugin does not start

2016-03-03 Thread matti kaasinen
Hi,

For the firstly, sorry about long story..

Background:
=
I'm trying to integrate Huawei 3131 modem, VID=21d1. Original PID=14fe that
switches to PID=1506.

I'm working on am335x based embedded board running yocto/linux-ti-staging
based Linux with 4.1 kernel. NM version is 0.9.8.10 and MM version 1.4.2.
Board is using systemd.

Base problem is that most likely modem firmware is broken so that it claims
supporting ndisdup, but in fact it does not. This revealed when I first
tried using connman/ofono. Connection went up to stage where connection was
opened wtih  AT^NDISDUP=1,1. Following  AT^DHCP? returned only OK without
any connection details.

However my desktop machine - Ubuntu 14.04 opens connection quite smoothly.
It has NM version 0.9.8.8 and MM version 1.0.0. Somehow it does not care
about this ndisdup problem, but instead opens connection using ppp - no
problem at all.

Main difference found from sysfs is that Ubuntu opens only /dev/ttyUSB0
/dev/ttyUSB2  /dev/ttyUSB3 devices for this modem whereas am335x board
opens
/dev/ttyUSB0  /dev/ttyUSB1  /dev/ttyUSB2 /dev/cdc-wdm0 and /net/wwan0

if I execute following command after plugging in modem:
nmcli d
Ubuntu provides:
ttyUSB3gsm   disconnected

am335x board do not provide  have this line

If I execute following command on am335x board:
mmcli -m 0 --simple-connect="apn=internet"

Everything seems going well, solid blue led swithes on, but there is no
interface brought up.
If I start modem connection from nm app on Ubuntu, ppp connection starts
and it is brought to interfaces. From logs it seems that it also is using
simple-connect method.

If I use udev rules to ignore cdc-wdm0 and net/wwan0 on am335x board,
simple-connect proceeds up tp "all done", but no ppp is started an in fact
now even the led is not having solid blue. However, if I start pppd
manually at this point, connection is established quite well.
I have tried to reproduce Ubuntu settings.
1) /etc/NetworkManager/NetworkManager.conf with following contents:
[main]
plugins=keyfile
dns=dnsmasq

2) /etc/NetworkManager/system-connections/Operator with following contents:
[connection]
id=Operator
uuid=b9cbaa78-8856-4c82-915b-702048ab3b85
type=gsm
permissions=user:root:;
autoconnect=true
timestamp=0

[gsm]
number=*99#
apn=internet

[ipv4]
method=auto

[serial]
baud=115200

Differences bitween Ubuntu and am335x board:
1) Note that Ubuntu uses upstart and am335x board systemd.
2) Ubuntu lists one line for each of files in
/etc/NetworkManager/system-connections folder whereas am335x seems ignoring
these settings.

net/ppp0
---
Ubuntu:
ModemManager[22598]:  [1456479663.774029] [mm-manager.c:270]
device_added(): (net/ppp0): could not get port's parent device

am335x: no reference for net/ppp0

NM in Ubuntu starts reports reporting ppp with following lines:
NetworkManager[22606]:  pppd started with pid 23181
Plugin /usr/lib/x86_64-linux-gnu/pppd/2.4.5/nm-pppd-plugin.so loaded.
** Message: nm-ppp-plugin: (plugin_init): initializing
** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial
connection'
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0

all PPP messages from am335x
plugins/huawei/mm-plugin-huawei.c:543] grab_port(): (tty/ttyUSB0) Port
flagged as PPP

src/mm-port-serial-at.c:440] debug_log(): (ttyUSB2): <-- '+CGDCONT:
(1-11),"IP",,,(0-2),(0-3)+CGDCONT: (1-11),"IPV6",,,(0-2),
(0-3)+CGDCONT: (1-11),"IPV4V6",,,(0-2),(0-3)+CGDCONT:
(1-11),"PPP",,,(0-2),(0-3)OK'

src/mm-modem-helpers.c:783] mm_3gpp_parse_cgdcont_test_response():
Unhandled PDP type in CGDCONT=? reply: 'PPP'

QUESTIONS:
=
1) What is missing in my set-up?
2) net/ppp0. What is required to get am335x MM creating ppp0 interface like
Ubuntu does?
3) It is told in the MM package that there is no need starting on boot -
dbus will start on demand. What event does this as MM does not start at all
if service is not enabled by default

thanks,
Matti
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: [PATCH 1/1] import: ignore file encoding for ovpn configuration file

2016-03-03 Thread Thomas Haller
On Wed, 2016-03-02 at 14:37 -0600, Dan Williams wrote:
> On Wed, 2016-03-02 at 12:53 +0100, Thomas Haller wrote:
> > 
> > Openvpn treats ovpn files as ASCII configuration file and
> > does not care about a specific certain encoding. As such,
> > only encodings that are an extension of ASCII can work at
> > all (like iso8859-* or utf8).
> > 
> > We should not try to handle configuration files that cannot even
> > be handled by openvpn itself.
> > 
> > As regular options must be ASCII-compatbile, the encoding only
> > matters for filenames and inline-blobs.
> > 
> > Openvpn itself doesn't care about encoding of filenames and passes
> > them directly to the system functions (open, access). The same is
> > true
> > for glib, which expects paths in "GLib file encoding".
> > Nowaways, most Linux filesystems use utf8 encoding for paths.
> > Therefore,
> > if we would know the encoding of the file, we probably would want
> > to
> > convert the paths to utf8. However, how do we guess the right
> > encoding?
> > And what if the user *really* meant what is written in the
> > configuration
> > file? Note, that openvpn doesn't support escape sequences like
> > "\344",
> > thus, if the user really wanted to specify such a character, he is
> > only
> > able to do so if we don't mess with the encoding.
> > 
> > Inline blobs usually are ASCII/base64 encoded. If they happen to be
> > in a
> > different encoding, we still want to preserve the original blob and
> > not guess and convert encodings.
> > 
> > The only sane option is ignoring the encoding and pretend it is
> > ASCII compatible. Who writes non-utf8 configuration files anyway?
> > 
> We have to make sure string data we pass through D-Bus (like in the
> connection properties) is UTF-8 though.  So it doesn't need to be
> converted or validated at some point, or dbus will kick the
> editor/whatever off the bus when it tries to send the invalid data to
> NM.
> 


very good point.

So, this is going to be a bit larger work.
Let's move discussion to bug
https://bugzilla.gnome.org/show_bug.cgi?id=763039


Please review th/utf8safe-bgo763039


Thomas

signature.asc
Description: This is a digitally signed message part
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list