Turn 3.5mm Jack on Raspberry Pi Running LineageOS 16

You will need an Android Terminal. You can turn on the default one in the developer settings. Need to turn on developer mode?

You will also need to enable root which can also be done in the Developer settings

Open up the terminal app and run

su
rpi3-audio-jack.sh

More info here

https://konstakang.com/devices/rpi3/LineageOS16.0/

LibreNMS update to Python 3

You may get the following alert in LibreNMS. Basically you need to install python 3 to keep things up to date.

Python 3 is required to run LibreNMS as of May, 2020. You need to install Python 3 to continue to receive updates. If you do not install Python 3 and required packages, LibreNMS will continue to function but stop receiving bug fixes and updates.

Install Python 3

Install Python 3 with yum, or apt if you are on a Debian based distro.

sudo yum install python3
sudo pip3 install -r /opt/librenms/requirements.txt

Verify LibreNMS is updated and working

Run the following commands to make sure that LibreNMS is working correctly and is up to date.

cd /opt/librenms
sudo ./validate.php
sudo ./daily.sh

Upgrade AirFiber 11 to 4.1 from SSH

https://help.ui.com/hc/en-us/articles/204977444-airFiber-Updating-the-Firmware

Quick list of commands

ssh ubnt@192.168.1.20  <- Replace with username and IP address
cd /tmp
wget http://dl.ui.com/firmwares/airfiber11X/v4.1.0/AF11.v4.1.0.bin
mv AF11.v4.1.0.bin fwupdate.bin
/sbin/fwupdate -m
  1. Upload the firmware using FTP or SCP to the /tmp directory
  2. Rename the file from AF11…bin to fwupdate.bin
  3. Start the upgrade with
/sbin/fwupdate -m

Wait for it to finish upgrading

Linux Screen – Create, Connect, Disconnect, Terminate Sessions

Screen is a handy tool that can help you run scripts on servers remotely without having to worry about the session getting terminated. It seems to operate kinda like a virtual console.

Create Screen Session

Create a new session with a specified name

screen -S SessionName

Example output below. Create session named testsession and print screen sessions.

[bob@localhost imapsync]$ screen -S testsession
[bob@localhost imapsync]$ screen -ls
There are screens on:
3313.testsession (Attached)
1 Sockets in /var/run/screen/S-bob.
[bob@localhost imapsync]$

Disconnect from Screen Session

You can disconnect from a screen session by hitting ctrl + a and then ctrl +d

“ctrl + a” then “ctrl + d”

List Screen Sessions

You can list the screen sessions with

screen -ls

Example

[bob@localhost imapsync]$ screen -ls
There are screens on:
3212.testsession (Detached)
2556.xap (Detached)

2 Sockets in /var/run/screen/S-bob.
[bob@localhost imapsync]$

Connect to screen Session

You can reconnect to a screen session with

screen -r testsession 

Terminate Screen Session

To terminate a screen session, connect to that session and then on a clear line hit ctrl + d

Same way as if you were closing a remote ssh connection.

VIM delete all lines not matching pattern

In Vi you can use the following command to search for a pattern and delete all those lines

:%g/pattern-to-search-for/d

To inverse the operation and delete all lines not matching the pattern, change g to v

:%v/pattern-to-search-for/d

LuminOx O2 Sensor on Arduino

The LuminOx Oxygen sensor seems to be a pretty decent O2 sensor and easy to get setup and running.

https://www.sstsensing.com/product/luminox-optical-oxygen-sensors-2/
PinDesignation
1Vs (+5V)
2GND (0V)
33.3V UART* Sensor Transmit
43.3V UART* Sensor Receive
 * 5V tolerant
Looks like it is 5V tolerant so you should not need a logic level shifter.

Wiring Up LuminOx O2 Sensor to Arduino

Fortunately wiring up the LuminOx O2 Sensor to an Arduino is super easy

In the code example below we will use pins 10 and 11 to communicate with the sensor. So you can wire it up as follows

sensor pin 1 -> 5V power
sensor pin 2 -> Ground
sensor pin 3 -> pin 10
sensor pin 4 -> pin 11

Arduino Code for LuminOx O2 Sensor

Should be able to just copy and past the code into the arduino editor and upload it.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX (O2 Pin 3), TX (O2 Pin 4)

void setup() {
  Serial.begin(9600);
  mySerial.begin(9600);
}

void loop() {
 if (mySerial.available())  {
    Serial.write(mySerial.read());
    }
}

Open up the serial console to view the sensor output

LuminOx O2 Sensor Output

Helpful links
Datasheet: https://www.sstsensing.com/product/luminox-optical-oxygen-sensors-2/
Arduino forum: https://forum.arduino.cc/index.php?topic=601622.15

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.

Sketch uses 444 bytes (1%) of program storage space. Maximum is 32256 bytes.

Arduino upload error

Looks like this can randomly happen. Things to try to resolve the problem

  1. Unplug USB cable for a little bit
  2. Restart Arduino IDE
  3. Reboot computer

More information here

https://arduino.stackexchange.com/questions/23620/problem-uploading-to-arduino-uno