Re: [Freedombox-discuss] Plinth v0.10.0 released and ppp issue SOLVED!

2016-09-12 Thread Sunil Mohan Adapa
On 09/06/2016 12:56 AM, A. F. Cano wrote:

>> Once network manager has support, having Plinth manage this from web
>> interface is a matter of writing some web forms for configuration input
>> and status display.
> 
> After digging into nm-settings (man nm-settings) I had to set these to
> duplicate the ppp configuration in /etc/ppp/peers/cell:
> 
> $ sudo nmcli con modify "ppp" cdma.username qnc
> $ sudo nmcli con modify "ppp" cdma.password qnc
> $ sudo nmcli con modify "ppp" ppp.refuse-chap true
> $ sudo nmcli con modify "ppp" ppp.crtscts true
> $ sudo nmcli con modify "ppp" ppp.lcp-echo-interval 65535
> $ sudo nmcli con modify "ppp" ppp.lcp-echo-failure 4
> $ sudo nmcli con modify "ppp" ppp.baud 115200
> 
> I'm not sure all of these are absolutely necessary, particularly the
> baud since the connection is a usb connection, but that's what has
> worked for years.  Per nm-settings, there are quite a few cdma.*, ppp.*,
> gsm.*, etc... options.  That could make for a quite lengthy web form.
> At the very least the above options seem so be sufficient to make ppp
> work, at least on my cdma device.

Thanks you for the comprehensive report.  This is should help us get
started with mobile broadband connections in FreedomBox.

network-manager GUI programs use a common database of mobile broadband
network providers[1][2][3].  This database provides all the information
needed to configure a mobile internet connection easily without asking
the user for overly technical information. This is available as a
separate package in Debian[4] for easy usage.  During the initial type
selection page, we can have 'Mobile Broadband' as an option and later
request for 'Country' and 'Provider' (with type) and let the user select.

I have created a separate issue to track the progress[5].  Could you try
removing all the ppp specific settings and see if your are still able to
connect?  You can edit the /etc/NetworkManager/ connection file directly
for ease.  This will tell use that we don't have to bother with ppp
settings which I hope is the case.

Links:

1)
https://git.gnome.org/browse/mobile-broadband-provider-info/tree/serviceproviders.xml

2)
https://wiki.gnome.org/Projects/NetworkManager/MobileBroadband/ServiceProviders
3)
https://blogs.gnome.org/dcbw/2009/06/22/mobile-broadband-assistant-makes-it-easy/
4)
https://packages.debian.org/search?keywords=mobile-broadband-provider-info
5) https://github.com/freedombox/Plinth/issues/602

-- 
Sunil



signature.asc
Description: OpenPGP digital signature
___
Freedombox-discuss mailing list
Freedombox-discuss@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss

Re: [Freedombox-discuss] Plinth v0.10.0 released and ppp issue SOLVED!

2016-09-05 Thread A. F. Cano
On Mon, Aug 29, 2016 at 01:08:30AM +0530, Sunil Mohan Adapa wrote:
> ...
> We need to understand if network manager has support for this kind of
> device.  The best way check is to plug the device into a desktop system
> and get it working with network manager.  Network manager community
> might help with this.  It already has support for many types of phones

With help from the networkmanager-list (@gnome.org) I got NM to handle
ppp.

> ...

I had originally set up the ppp connection like this:

$ sudo nmcli con add con-name "ppp" ifname "ppp0" type cdma
$ sudo nmcli con modify "ppp" connection.zone external

But the ifname option caused confusion for NetworkManager.

$ sudo nmcli con up ppp
Error: Connection activation failed: No suitable device found for this
connection.

$ sudo nmcli con up ppp ifname ttyACM0
Error: device 'ttyACM0' not compatible with connection 'ppp'.

$ sudo nmcli con up ppp ifname ppp0
Error: device 'ppp0' not compatible with connection 'ppp'.

In the end, I had to clear the interface-name:

$ sudo nmcli connection modify ppp connection.interface-name ""

as that restricts the connection to 'ifname "ppp0"' and

$ nmcli dev
DEVICE   TYPE  STATE CONNECTION
enp1s0   ethernet  connected FreedomBox WAN
enp3s0   ethernet  connected FreedomBox LAN enp3s0 
ttyACM0  cdma  disconnected  --
enp2s0   ethernet  unavailable   --
lo   loopback  unmanaged --   

reports ttyACM0.  Thanks Thomas! (of the networkmanager-list).

So the proper way to set up a ppp connection is without the ifname
option:

$ sudo nmcli con add con-name "ppp" type cdma
$ sudo nmcli con modify "ppp" connection.zone external

> Once network manager has support, having Plinth manage this from web
> interface is a matter of writing some web forms for configuration input
> and status display.

After digging into nm-settings (man nm-settings) I had to set these to
duplicate the ppp configuration in /etc/ppp/peers/cell:

$ sudo nmcli con modify "ppp" cdma.username qnc
$ sudo nmcli con modify "ppp" cdma.password qnc
$ sudo nmcli con modify "ppp" ppp.refuse-chap true
$ sudo nmcli con modify "ppp" ppp.crtscts true
$ sudo nmcli con modify "ppp" ppp.lcp-echo-interval 65535
$ sudo nmcli con modify "ppp" ppp.lcp-echo-failure 4
$ sudo nmcli con modify "ppp" ppp.baud 115200

I'm not sure all of these are absolutely necessary, particularly the
baud since the connection is a usb connection, but that's what has
worked for years.  Per nm-settings, there are quite a few cdma.*, ppp.*,
gsm.*, etc... options.  That could make for a quite lengthy web form.
At the very least the above options seem so be sufficient to make ppp
work, at least on my cdma device.

> >...
> 
> If and when network manager supports type of connection, it can be
> trusted to handle these tasks of starting and managing process and
> handling errors.  Chances are that it will do it well.

Correct.  This is the full log of NetworkManager handling the ppp
connection successfully after the phone is plugged into the usb cable:

As before, the kernel detection of the usb device:

Sep  4 22:58:35 fbx kernel: [ 2698.111804] usb 4-1: new full-speed USB
device number 3 using ohci-pci
Sep  4 22:58:35 fbx kernel: [ 2698.278969] usb 4-1: New USB device
found, idVendor=22b8, idProduct=2a62
Sep  4 22:58:35 fbx kernel: [ 2698.278986] usb 4-1: New USB device
strings: Mfr=1, Product=2, SerialNumber=0
Sep  4 22:58:35 fbx kernel: [ 2698.278994] usb 4-1: Product: Motorola
E815
Sep  4 22:58:35 fbx kernel: [ 2698.279002] usb 4-1: Manufacturer:
Motorola, Inc.
Sep  4 22:58:35 fbx kernel: [ 2698.283664] cdc_acm 4-1:1.0: ttyACM0: USB
ACM device

Now, NM detects the device:

Sep  4 22:58:51 fbx NetworkManager[1223]:   [1473044331.5151]
manager: (ttyACM0): new Broadband device
(/org/freedesktop/NetworkManager/Devices/6)
Sep  4 22:58:51 fbx NetworkManager[1223]:   [1473044331.5172]
device (ttyACM0): state change: unmanaged -> unavailable (reason
'managed') [10 20 2]
Sep  4 22:58:51 fbx NetworkManager[1223]:   [1473044331.5188]
device (ttyACM0): modem state 'enabling'
Sep  4 22:58:51 fbx NetworkManager[1223]:   [1473044331.5194]
(ttyACM0): failed to retrieve SIM object: No SIM object available
Sep  4 22:58:51 fbx NetworkManager[1223]:   [1473044331.5207]
device (ttyACM0): state change: unavailable -> disconnected (reason
'none') [20 30 0]

And now, the connection gets activated:

Sep  4 23:00:42 fbx NetworkManager[1223]:   [147302.8932]
device (ttyACM0): Activation: starting connection 'ppp'
(f2cc6f30-1726-42c2-b580-3ac8a98a21ec)
Sep  4 23:00:42 fbx NetworkManager[1223]:   [147302.8954]
audit: op="connection-activate"
uuid="f2cc6f30-1726-42c2-b580-3ac8a98a21ec" name="ppp" pid=3587 uid=0
result="success"
Sep  4 23:00:42 fbx NetworkManager[1223]:   [147302.8971]
device (ttyACM0): state change: disconnected -> prepare (reason 'none')
[30 40 0]
Sep  4 23:00:42 fbx NetworkManager[1223]:   [147302.

Re: [Freedombox-discuss] Plinth v0.10.0 released

2016-08-28 Thread Sunil Mohan Adapa
On 08/29/2016 12:21 AM, A. F. Cano wrote:[...]
>  how-can-i-help: Unable to resolve your $HOME directory - cannot
>  continue.
>  Log ended: 2016-08-28  00:06:08
>
> So it looks like removing the packages themselves is actually working,
> but "resolve your $HOME directory" is what is returning the error code
> that is causing the error messages in the web page log.

Thank you for the investigation and detailed report.

how-can-i-help is a trigger that is run after all the operations to show
potential contributors the list of Debian packages looking for help.
This error should not have any consequences to the operation of FreedomBox.

[...]
> So, how can I make network manager handle ppp automatically?  And
> what needs to be done so that plinth displays the status of the ppp
> connection properly, and it can be activated/deactivated from the web
> interface?
>

We need to understand if network manager has support for this kind of
device.  The best way check is to plug the device into a desktop system
and get it working with network manager.  Network manager community
might help with this.  It already has support for many types of phones
and networks.  If it can be configured that way, looking at the
connection file in /etc/NetworkManager/system-connections/ will tell us
all we need to know about the connection.  This connection file can be
transfered (perhaps with some modifications) to your FreedomBox to make
network-manager manage the connection.

Once network manager has support, having Plinth manage this from web
interface is a matter of writing some web forms for configuration input
and status display.

> Thanks for any hints.  While "sudo pon cell" works from ssh, it would be
> nice if netwrok manager could handle the starts and restarts
> automatically.

If and when network manager supports type of connection, it can be
trusted to handle these tasks of starting and managing process and
handling errors.  Chances are that it will do it well.

-- 
Sunil



signature.asc
Description: OpenPGP digital signature
___
Freedombox-discuss mailing list
Freedombox-discuss@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss

Re: [Freedombox-discuss] Plinth v0.10.0 released

2016-08-28 Thread A. F. Cano
On Sat, Aug 27, 2016 at 09:05:58AM -0400, James Valleroy wrote:
> Hi all,
> 
> Plinth v0.10.0 has been released, and is now available in Debian testing.

Thank you!

> For those running v0.9, if "Automatic Upgrades" are enabled in Plinth,
> then it should be upgraded soon (or may have already).

I was probably running something even older (uptime said 72 days) since
I had turned off automatic upgrades due to the no ssh access bug
previously discussed.

In any case, the upgrade apparently happened but when I next tried to
use the freedombox nothing went through (traceroute from internal
machines stopped at the freedombox, other attempts at connection got
"no route to host").  Luckily after a reboot things went back to normal
but there was this in the unattended upgrades log:

2016-08-28 00:03:55,386 ERROR Installing the upgrades failed!
2016-08-28 00:03:55,387 ERROR error message: 'installArchives() failed'
2016-08-28 00:03:55,389 ERROR dpkg returned a error! See
'/var/log/unattended-upgrades/unattended-upgrades-dpkg.log' for details

Checking that, I see this:

how-can-i-help: Unable to resolve your $HOME directory - cannot
continue.
Log ended: 2016-08-28  00:06:08

These are the last lines.

In the unattended upgrades web page there is also this:

2016-08-28 00:04:05,586 INFO Packages that are auto removed: 'gdebi-core
gir1.2-packagekitglib-1.0 libglib2.0-bin libgstreamer1.0-0
libpackagekit-glib2-18 libprocps5 packagekit packagekit-tools
python3-debian'
2016-08-28 00:06:08,892 ERROR Auto-removing the packages failed!
2016-08-28 00:06:08,893 ERROR Error message: 'installArchives() failed'
2016-08-28 00:06:08,893 ERROR dpkg returned an error! See
'/var/log/unattended-upgrades/unattended-upgrades-dpkg.log' for details

But in the referenced file there is this:

Removing packagekit-tools (1.1.1-1) ...
Removing packagekit (1.1.1-1) ...
Removing gdebi-core (0.9.5.7) ...
Removing gir1.2-packagekitglib-1.0 (1.1.1-1) ...
Removing libglib2.0-bin (2.48.1-2) ...
Removing libgstreamer1.0-0:amd64 (1.8.3-1) ...
Removing libpackagekit-glib2-18:amd64 (1.1.1-1) ...
Removing libprocps5:amd64 (2:3.3.11-3) ...
Removing python3-debian (0.1.29) ...
Processing triggers for dbus (1.10.10-1) ...
Processing triggers for libc-bin (2.23-4) ...
[master 89bf647] committing changes in /etc after apt run
 2 files changed, 2 insertions(+), 2 deletions(-)
 how-can-i-help: Unable to resolve your $HOME directory - cannot
 continue.
 Log ended: 2016-08-28  00:06:08

So it looks like removing the packages themselves is actually working,
but "resolve your $HOME directory" is what is returning the error code
that is causing the error messages in the web page log.

> ...
>   * Networks: Added basic support for configuring batman-adv mesh
> networking.
>   * Networks: Fixed incorrect access for retrieving DNS entries.

Related to Networks...

I use ppp to connect to the internet via a usb interface.  Per previous
advice, I had to do this:

$ sudo nmcli con add con-name "ppp" ifname "ppp0" type cdma
$ sudo nmcli con modify "ppp" connection.zone external

to set up the connection via ssh, but the "Network Connections" tab
shows the ppp connection as permanently inactive.  Obviously the network
manager and/or plinth do now know about certain details of ppp.  I need
to run "sudo pon cell" from ssh in order to establish a connection.
This usually requires entering the password for sudo.

I've been looking into how to make the network manager aware of ppp
and/or what configuration files I need to alter to let it know that
"sudo pon cell" needs to be run when the phone is detected, which it is:

Aug 28 13:14:47 fbx NetworkManager[1317]:   [1472404487.1431]
manager: (ttyACM0): new Broadband device
(/org/freedesktop/NetworkManager/Devices/4)
Aug 28 13:14:47 fbx NetworkManager[1317]:   [1472404487.1457]
device (ttyACM0): state change: unmanaged -> unavailable (reason
'managed') [10 20 2]
Aug 28 13:14:47 fbx NetworkManager[1317]:   [1472404487.1479]
device (ttyACM0): modem state 'enabling'
Aug 28 13:14:47 fbx NetworkManager[1317]:   [1472404487.1487]
(ttyACM0): failed to retrieve SIM object: No SIM object available
Aug 28 13:14:47 fbx NetworkManager[1317]:   [1472404487.1501]
device (ttyACM0): state change: unavailable -> disconnected (reason
'none') [20 30 0]

But I haven't found exactly what I need to do.  The "No SIM object
available" is no surprise since this is not a GSM phone.  What is
worrisome is the last line.  Does anyone know why network manager is
saying "unavailabe" and "disconnected"?

If I do "sudo pon cell" manually (from ssh) the connection gets
established, but the first time I do this after plugging in the phone
into the usb port it fails.  I have to do it a second time, only in this
case.  When the phone has been connected and a ppp connection
established previously, it works on the first try.  The bottom line is
that "sudo pon cell" can fail and connections can be interrupted by "LCP
terminated by peer", so the network manager should

[Freedombox-discuss] Plinth v0.10.0 released

2016-08-27 Thread James Valleroy
Hi all,

Plinth v0.10.0 has been released, and is now available in Debian testing.

For those running v0.9, if "Automatic Upgrades" are enabled in Plinth,
then it should be upgraded soon (or may have already).

Note: There is an issue when using the "Upgrade now" button in Plinth to
upgrade Plinth itself [1]. To upgrade smoothly, I recommend using
"Automatic Upgrades" instead.

Currently the SIP Server (repro) and Bookmarks (Shaarli) are not
available in Debian testing.

Summary of changes since v0.9.4:

  * Updated Plinth to support Django 1.10.
  * Added a page to display recent status log from Plinth. It is
accessible from the 500 error page.
  * Tor: Added options to toggle relay and bridge relay modes.
  * Radicale: Added access rights control.
  * Ikiwiki: Updated suggested packages.
  * Users and Groups: Fixed editing users without SSH keys.
  * Networks: Added basic support for configuring batman-adv mesh
networking.
  * Networks: Fixed incorrect access for retrieving DNS entries.
  * New languages:
  o Persian (50% translated)
  o Indonesian (not started, contributions needed)
  * New modules added to Plinth:
  o Disks: Shows free space of mounted partitions, and allows
expanding the root partition.
  o Security: Controls login restrictions.
  o Snapshots: Manages Btrfs snapshots.

The full change log is available in the Plinth repository [2].

Thanks to all who contributed to this release!

[1] https://github.com/freedombox/Plinth/issues/562
[2] https://github.com/freedombox/Plinth/blob/master/CHANGELOG.md

--
James



signature.asc
Description: OpenPGP digital signature
___
Freedombox-discuss mailing list
Freedombox-discuss@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/freedombox-discuss