Network Manager From Source on Raspberry Pi

I have compiled and installed many packages from source but I must admit Network Manager (NM) threw me a curved ball that had me debugging for 3 days.

My Pi 3 with stretch allowed for installation of the ver 1.6 line of NM through standard apt-get. However when using standard NM and Modem Manager (MM) on the pi, I faced an issue with connective. The modem would either not connect or disconnect a while after successful connection. I decided to update NM as a last resort as I was unable to pin point any issues.

Firstly there was alot of libxxx-dev packages that are prerequisites, some of which I maneged to pull from my history:

sudo apt-get install gtk-doc-tools autopoint intltool gio-unix libglib2.0-dev libdbus-1-dev libdbus-glib-1-dev libudev libudev-dev gobject-introspection gobject-introspection-dev libgirepository1.0-dev libnl-3-dev uuid-dev libnss3-dev ppp-dev libjansson-dev curl-dev libcurl4-openssl-dev libndp-dev libreadline-dev python-gobject-2-dev python-gobject-dev libnm-dev libnm-dev libmm-dev libmm-glib-dev

I then downloaded the source for the 1.8 line and followed the following process:

./autogen.sh --prefix=/usr --sysconfdir=/etc --localstatedir=/var -enable-wifi --enable-ppp --with-modem-manager-1
make
sudo make install

Once this was complete I finally have a working copy of NM on v1.8

A dive into MQTT

Hi,

Its been awhile and that my fault, finding time and whatnot...

I have heard of MQTT and how it is a lightweight protocol that in/will revolutionize IoT communications and have recently had a use for such a mechanism.

I setup Mosquitto MQTT which is an open source MQTT server and it was pretty simple to start sending messages up to the server (called the MQTT broker) and between MQTT clients.

The issue I had was that all this information traversing through the broker was not recorded anywhere. This makes plotting historical data impossible. To achieve this functionality I wrote a crude (very crude) python script to persist MQTT messages to a mySQL database. The code for anyone interested will be located in my bitbucket account.

Raspberry PI + 3G Dongle

Oh the headache! I believe after a week of fiddling I've final got my head wrapped around this madness.

There are two primary issues that need to be taken care of when using a 3G dongle with a PI 1. A USB modem has schizophrenia! 2. Network connectivity is not "always" available.

So what do I mean "schizophrenia"? Simple, the modem actually wants to a usb cdrom/flash and assumes this personality by default in most cases. the command lsusb will list the current detected device. if it is not correct usb_mode_switch must be used to remind it that it should actually be a modem.

On point 2, sakis3g is a nifty tool to get you connected once you have figured out all of the "required" parameters. Its shortfall is that it never maintains the connection, i.e. if a connection is made and due to bad signal the connection is "lost" sakis3g runs like normal without ever telling you or attempting a reconnect. This is where UMTSkeeper comes in. This small yet feature packed tool maintains connectivity as well as logs network statistics! amongst other features that I have not played with.

Once you have all these 3 components working in harmony you should have a sweet "always" connected PI.