cmd/alignment-netsender: Collect additional LSM303 accelerometer sensor information and send to cloud

Issue #26 new
Alex Arends created an issue

We would like to collect accelerometer data from the LSM303 sensor being used to get compass readings. This will be useful to determine swell height and attitude of the rig. We will use the same LSM303 sensor and the same raspberry pi to both read from the sensor to do CPE alignment, and send accelerometer values, however, we currently don’t have functionality that can deal with two netsender clients working on a single piece of hardware. Problems arise with mac address requirements on the cloud and config files on the device.

It’s proposed that we extend the alignment-netsender client to also collect accelerometer data and then use the readPin callback to load into a binary pin that can be sent to the cloud and then parsed for the x, y, z accel values. Currently the compass structure works with a background process directly to get the values from the sensor, but perhaps instead we should have a general LSM303 struct that provides functionality for reading from a background process and obtain both compass and accelerometer readings. These values would then be available via methods e.g. Compass() and Accel(). The compass struct would then use this LSM303 layer to get it’s compass readings. We would then also create a struct called Accelerometer that uses this layer to get accel readings. An accelerometer struct value can be declared in the alignment-netsender main.go file and passed to the readPin function for access to the required values.

Modifications will have to be made to the current python background process to collect not only the compass data, but also the accelerometer data.