Re: is anyone actually still using WiMAX

2015-02-19 Thread Stuart Longland
On 16/02/15 11:44, Glen Turner wrote:
> On Friday, Stuart Longland wrote:
> 
>> Probably worth pointing out, here in Australia there's been a move to
>> get better Internet coverage in rural areas using fixed-wireless broadband.
>>
>> There's talk of that being based on "WiMAX 2", so there could be more
>> demand for WiMAX support in Linux in the future.
> 
> That fixed wireless NBN service will be terminated by NBNCo and
> presented to the customer via ethernet.

Ahh okay, so NBNCo's problem not the customer's.  Well that solves that
problem then. :-)

-- 
 _ ___ Stuart Longland - Systems Engineer
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: is anyone actually still using WiMAX

2015-02-12 Thread Stuart Longland
On 11/02/15 11:27, Michael Biebl wrote:
> Am 10.02.2015 um 15:53 schrieb Dan Winship:
>> While taking cheap potshots at WiMAX during devconf.cz, we started
>> wonder whether anyone would care (or even notice) if we dropped support
>> for it in NM 1.2, given that:
>>
>> […]
>>
>> Of course this would not affect people using WiMAX via external hotspots
>> (assuming such people and hotspots still exist).
> 
> Debian (and Ubuntu) never enabled WiMAX support in our packages. I don't
> have plans to enable it in our Debian packages either.
> So from my PoV, feel free to drop WiMAX support.

Probably worth pointing out, here in Australia there's been a move to
get better Internet coverage in rural areas using fixed-wireless broadband.

There's talk of that being based on "WiMAX 2", so there could be more
demand for WiMAX support in Linux in the future.
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au


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


Re: Mobile broadband on an embedded 3G modem

2014-10-17 Thread Stuart Longland
On 17/10/14 18:47, Aleksander Morgado wrote:
> Also, if the tty is from a physical serial port (i.e. no USB), you'll
> likely need to tag the port in udev with the
> ID_MM_PLATFORM_DRIVER_PROBE flag as well. ModemManager doesn't
> automatically probe physical serial ports.

Ahh, that's probably the bit I'm missing.  I did mention it was wired to
a UART not USB and I wouldn't expect ModemManager to just probe any
random serial port (and good thing it doesn't: one is RS-485 connected
to Modbus).

I was looking around for a configuration file that would tell
NetworkManager/ModemManager about the device: I guess the udev
configuration would be a good place to start then. :-)

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au


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


Mobile broadband on an embedded 3G modem

2014-10-16 Thread Stuart Longland
Hi all,

We're trying to get a 3G modem connection going on an embedded device.
The modem is a MultiTech SocketModem MTSMC-H5-IP and it appears on
/dev/ttyAPP3 (i.e. hardware UART port on the SoC).

If I run `screen /dev/ttyAPP3 115200`, I can interact with the modem, it
all works.  The challenge, is getting NetworkManager 0.9.10.0 to talk to
this modem.

When I run `nmtui`, no option for adding the mobile broadband connection
appears, I suspect because NetworkManager doesn't know the 3G dongle
exists.  How do I tell it where to look?

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Accessing NetworkManager from a daemon

2014-08-30 Thread Stuart Longland
On 29/08/14 18:20, Stuart Longland wrote:
> On 29/08/14 01:34, Dan Williams wrote:
>> Polkit is about access control though, and if you don't care about that,
>> you can tell Polkit to allow all your accesses.  But the problem you're
>> having is that you don't even get that far, because NM is checking if
>> you have a session first.  Can you check if you have ConsoleKit or
>> systemd session tracking enabled?  If you get a hit for this, you have
>> systemd enabled
> 
> Indeed, I run your command and get:
>> stuartl@sjl-lxc-debian:~$ ldd /usr/sbin/NetworkManager | grep systemd-login
>> libsystemd-login.so.0 => /lib/i386-linux-gnu/libsystemd-login.so.0 
>> (0xf7387000)

Okay, so I've now tried a different approach.  Rather than trying to
bend Polkit/ConsoleKit/NetworkManager to my will in talking directly to
www-data, I've done something that's perhaps a little kludgy, but then
again, perhaps not.

I've written a DBus service which is launched from the Django manage.py
script.  It listens for requests from www-data to update connections and
acts on them.

So when I create a connection, the web application writes to the
database, then sends a DBus message to the agent telling it what ID it
just created.  The agent picks this up, generates the configuration dict
and feeds NetworkManager with it.

That's where it's "kludgy".  The flip side is that if the configuration
changes, I can pick up on the signals NetworkManager emits to update the
Django model.  I haven't done this as yet, but seeing as I've got the
potential there I might as well.

The DBus service runs as 'root', and is launched by dbus-activation so
there's no issues with talking to NetworkManager, and I'm now able to
add and delete network connections from the web UI.

If people on the list here are interested in such a module for Django to
control NetworkManager, let me know and I'll see what I can organise.

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au


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


Re: Accessing NetworkManager from a daemon

2014-08-29 Thread Stuart Longland
On 29/08/14 01:34, Dan Williams wrote:
> Polkit is about access control though, and if you don't care about that,
> you can tell Polkit to allow all your accesses.  But the problem you're
> having is that you don't even get that far, because NM is checking if
> you have a session first.  Can you check if you have ConsoleKit or
> systemd session tracking enabled?  If you get a hit for this, you have
> systemd enabled

Indeed, I run your command and get:
> stuartl@sjl-lxc-debian:~$ ldd /usr/sbin/NetworkManager | grep systemd-login
> libsystemd-login.so.0 => /lib/i386-linux-gnu/libsystemd-login.so.0 
> (0xf7387000)

so Debian do distribute NetworkManager with systemd session tracking
enabled.  This is just the stock Debian binary: from the 'sid'
distribution (because the one in 'wheezy' refuses to look at my LXC
container's Ethernet devices).

If I can sort out the session issue, then it's feasible that in our
application, we install a suitable policy file that tells Polkit to
allow www-data to access NetworkManager.  There's examples of doing this
for the netdev group, so it's conceivable to do the same thing for
www-data as well.

Polkit documentation mentions the existence of a text agent, for the
purpose of running such operations via SSH.  Not sure if it's possible
to wrap a mod_wsgi process inside one of these however, so I'm looking
to see if I can make use of PolkitAgentTextListener.

I have asked about it here:
http://lists.freedesktop.org/archives/polkit-devel/2014-August/000407.html

I'll admit I'm still very green with regards to Polkit, ConsoleKit and
all these other things.  As I understand it, I basically have to write
my own "agent" for the web user, which means this has become more of a
Polkit question than a NetworkManager one.  At least now I know where to
start asking further questions.

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au


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


Re: Accessing NetworkManager from a daemon

2014-08-27 Thread Stuart Longland
Hi Thomas, Dan,
On 28/08/14 06:24, Dan Williams wrote:
> At the moment, session tracking means you can't easily talk to NM if you
> are (a) not root and (b) don't have a session via ConsoleKit or Polkit.
> That's something we want to change, and that's being tracked and
> actively worked on in this bug:
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=686997
> 
> But like Thomas says, you can get around this for now if you rebuild NM
> with --with-session-tracking=no.

Many thanks, I was kinda hoping there was just a setting in
NetworkManager's configuration that would turn that off or permit select
users rather than having to recompile.

By the sounds of things in the short term at least, I need to sweet-talk
polkit into giving me access.

My research has lead me as far as PolkitAgentTextListener:
http://www.freedesktop.org/software/polkit/docs/0.105/PolkitAgentTextListener.html

Unfortunately I've seen absolutely 0 on how to access this from within
Python, so I shall enquire on the polkit lists and find out if I'm on
the right track and how to tickle it the right way.

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Accessing NetworkManager from a daemon

2014-08-26 Thread Stuart Longland
Hi all,
On 25/08/14 13:36, Stuart Longland wrote:
> Today I thought I'd roll this into my company's administration panel
> software which is built on Django and runs within Apache under mod_wsgi.
> 
> When I try to get the settings of an existing connection (via
> GetSettings), I get the following:
> 
> org.freedesktop.NetworkManager.Settings.PermissionDenied: No session
> found for uid 33 (unknown)

I've heard nothing, so I can only assume I haven't provided some detail.
 Sadly, searching for the above error leads me right back to this post,
thanks to the wonder that is the dreaded Google echo.

My code is based on the python-dbus examples and is running under the
Apache www-data user.  Calling GetSettings on a settings object seems to
trigger this.

The following are the package versions I am using:
> stuartl@sjl-lxc-debian:~$ dpkg -l python-dbus
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ NameVersion  Architecture Description
> +++-===---===
> ii  python-dbus 1.2.0-2+b3   i386 simple 
> interprocess messaging system (Python interf
> stuartl@sjl-lxc-debian:~$ dpkg -l network-manager
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ NameVersion  Architecture Description
> +++-===---===
> ii  network-manager 0.9.10.0-1.1 i386 network 
> management framework (daemon and userspace 

The error message in my previous post, is what I get told.  Research
seems to suggest it's a polkit issue, in that the www-data user doesn't
appear as a logged-in user.

This is going to be a headless appliance, there will be *no* "logged in"
user in the traditional sense, rather someone will be logging in via a
web UI to change settings, including the network configuration.

Thus, I need to either disable the polkit integration, or convince it
that it's okay for www-data to talk to NetworkManager.

Is there someone who can provide some pointers as to where to go or
shall I have to dump NetworkManager for something else?

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Accessing NetworkManager from a daemon

2014-08-24 Thread Stuart Longland
Hi all,

I'm starting to get places with a web UI for NetworkManager.  If I run
my Django application from the command line myself as a user, I can
create and edit connections.  Things are a little on the clunky side at
the moment but I expect to polish this up soon.

Today I thought I'd roll this into my company's administration panel
software which is built on Django and runs within Apache under mod_wsgi.

When I try to get the settings of an existing connection (via
GetSettings), I get the following:

org.freedesktop.NetworkManager.Settings.PermissionDenied: No session
found for uid 33 (unknown)

UID 33 is in this case, www-data.  What must I do to allow www-data to
interact with NetworkManager?

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Creating NetworkManager connections via DBus API

2014-07-07 Thread Stuart Longland
On 08/07/14 07:56, Dan Williams wrote:
>> and so the 'connection' bit would be mandatory, and you might have *one*
>> > each of the other setting types?
> The "type" setting (eg 803-3-ethernet, 802-11-wireless, gsm, cdma,
> bluetooth, etc) is required too.  The 'type' setting and the
> 'connection' setting are the only required ones.  Usually you'd lock the
> connection to a MAC address with the "type" setting, or it would contain
> stuff like MTU, SSID, and other hardware-specific stuff, so you can't
> really leave it out.

Okay, so there's a setting called "type" too, that I presume is distinct
from the "connection" setting's "type" attribute.  i.e. the minimum
required:

{'connection': {...},
 'type': {...},
 ...}

Where do I find information on this "type" setting?  Doing a search for
"type setting" on
https://developer.gnome.org/NetworkManager/0.9/ref-settings.html shows
no matches.

> IPv4 and IPv6 are optional if you want automatic (DHCP, PPP/WWAN, etc)
> addressing, but obviously if you want static you have to specify one or
> both.

Ahh so a minimal one might give a 'connection' object, whose 'interface'
attribute references one of the physical network ports, and it'll just
configure the network via DHCP.
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Creating NetworkManager connections via DBus API

2014-07-07 Thread Stuart Longland
Hi Dan,
On 08/07/14 02:55, Dan Williams wrote:
> As thomas already mentioned, these should be covered in the API
> documentation that he linked.  Note that IPv4 addresses are arrays of
> uint32 (address/prefix/optional gateway) and IPv4 routes are too
> (network/prefix/next-hop/metric).  The address/network/next-hop IP
> address members are network-byte-order.  So the code in Python to push
> that into the dict that can be sent over D-Bus is something like this,
> taken from:
[...]
> this is mainly because Python doesn't have strongly-typed variables, but
> D-Bus does, so you have to tell Python what the mapping is between the
> Python types and the D-Bus types.

Yep, just experimenting with python-networkmanager, it seems this is one
of the details it looks after: IP addresses are translated to strings,
endianness is taken care of, etc.  Dicts are plain Python dicts.

Just looking at the documentation there though, am I correct in assuming
that to set up a simple connection, you would have a dict of the form:

{'connection': { global connection settings },
 'ipv4': { IPv4 address settings },
 'ipv6': { IPv6 address settings },
}

and so the 'connection' bit would be mandatory, and you might have *one*
each of the other setting types?

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au


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


Re: Creating NetworkManager connections via DBus API

2014-07-05 Thread Stuart Longland
Hi Thomas,
On 05/07/14 00:40, Thomas Haller wrote:
> On Fri, 2014-07-04 at 11:51 +1000, Stuart Longland wrote:
>> Hi Dan,
>> On 04/07/14 10:51, Dan Williams wrote:
>>> On Fri, 2014-07-04 at 09:18 +1000, Stuart Longland wrote:
>> What I'm curious about is what sorts of keys and values are expected in
>> that dict of dicts?  At a basic level I need to be able to set IP
>> addresses, static routes, DNS servers, domain and DNS search order.
> 
> Did you see https://wiki.gnome.org/Projects/NetworkManager/Developers ?
> especially
> https://developer.gnome.org/NetworkManager/0.9/ref-settings.html
> (or try `man nm-settings` if you have the manual pages installed)

Ahh no, I didn't see that, and it seems I wasn't asking Google the right
question. :-)

Is there any reason why those aren't mentioned under the "Development
Resources" on

https://wiki.gnome.org/action/show/Projects/NetworkManager?action=show&redirect=NetworkManager
?

>> Probably host name too (not sure if that's doable in NetworkManager).
> 
> SaveHostname , see
> https://developer.gnome.org/NetworkManager/0.9/spec.html

Brilliant.  Thanks. :-)
Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au


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


Re: Creating NetworkManager connections via DBus API

2014-07-03 Thread Stuart Longland
Hi Dan,
On 04/07/14 10:51, Dan Williams wrote:
> On Fri, 2014-07-04 at 09:18 +1000, Stuart Longland wrote:
>> But how do I encode my address settings in a Settings.Connection object?
>>  Where do I find a list of the settings and their possible values?
> There's actually a bunch of Python examples here:
> 
> http://cgit.freedesktop.org/NetworkManager/NetworkManager/tree/examples/python
> 
> that use both plain dbus and Python GObject introspection.  The GObject
> introspection ones are similar to python-networkmanager actually.  I'm
> not sure how python-networkmanager accepts a new connection to add, but
> perhaps the examples give you an idea how to do that?

Ahh okay, that's handy.  I'll have a dig through those and see what I
can uncover.

> I'd expect it to
> be a normal "dict of dicts" like the examples above show which is then
> passed to org.freedesktop.NetworkManager.Settings.AddConnection().

It does appear that way, I tried pulling the information out for my
Ethernet connection and got:
> In [9]: conn.GetSettings()
> Out[9]: 
> {u'bridge': {u'interface-name': u'br0', u'stp': False},
>  u'connection': {u'id': u'Bridge Ethernet',
>   u'type': u'bridge',
>   u'uuid': u'357c4dcf-2600-45fa-8687-05f4c2cb82b4',
>   u'zone': u'work'},
>  u'ipv4': {u'addresses': [],
>   u'dns': [],
>   u'may-fail': False,
>   u'method': u'auto',
>   u'routes': []},
>  u'ipv6': {u'addresses': [], u'dns': [], u'method': u'auto', u'routes': []}}

It seems NetworkManager doesn't much like my hand-configured bridge
(won't see its IP address), but that's a side issue.

What I'm curious about is what sorts of keys and values are expected in
that dict of dicts?  At a basic level I need to be able to set IP
addresses, static routes, DNS servers, domain and DNS search order.

Probably host name too (not sure if that's doable in NetworkManager).

At least that will be the starting point.  The devices in question we're
setting up will be headless boxes, basically appliances, intended to
poll energy meters in an energy management system and pump the data
elsewhere.

So mostly wired access, there's a couple of places where we have a
bridges and OpenVPN for technical support on some sites and I envisage
some possibly needing cellular 3G support.

No one has approached us with the need for WIFI support, but I bet
someone will some day, thus it'd be useful to know how that's configured
too.

Is there some documentation as to how these various network types are
specified as dict objects to NetworkManager?

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list


Creating NetworkManager connections via DBus API

2014-07-03 Thread Stuart Longland
Hi all,

I'm in the process of writing a web frontend for a small Linux-based
appliance, thus am in need of a tool for configuring the network interfaces.

NetworkManager seems to be a good fit in that it supports a wide variety
of networks and runs as a daemon which is then accessed by unprivileged
users.  The web front-end software we're writing is based on Django, and
I'm creating a collection of models which will represent the
configuration of the network interface.  There's a nice Python library;
python-networkmanager which provides an abstraction ontop of DBus so
accessing NetworkManager isn't too painful.

https://pythonhosted.org/python-networkmanager/

So my task now, is knowing the name of a network device, its intended IP
address, routes, DNS configuration, etc, is to figure out how to tell
NetworkManager about it and get it to connect.

Now, there's a DBus spec which describes the objects here:
https://developer.gnome.org/NetworkManager/unstable/spec.html

Great.  By the looks of things, I create a
org.freedesktop.NetworkManager.Settings.Connection object, then hand
that to org.freedesktop.NetworkManager's ActivateConnection method.

But how do I encode my address settings in a Settings.Connection object?
 Where do I find a list of the settings and their possible values?

Regards,
-- 
Stuart Longland
Systems Engineer
 _ ___
\  /|_) |   T: +61 7 3535 9619
 \/ | \ | 38b Douglas StreetF: +61 7 3535 9699
   SYSTEMSMilton QLD 4064   http://www.vrt.com.au
___
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list