Published using Google Docs
AusOcean Rig Configuration Guide
Updated automatically every 5 minutes

AusOcean Rig Configuration Guide

Revised: 3rd June 2022

Author(s): Saxon Nelson-Milton <saxon@ausocean.org>
             Breeze <
Breeze@ausocean.org>


Copyright

Copyright © The Australian Ocean Laboratory Limited (AusOcean) 2020 .

The information contained herein is licensed under a Creative Commons Attribution 3.0 Australia License.

Notice

AusOcean rigs are maritime infrastructure and must be deployed at sea only with approvals from relevant regulatory authorities. Typically a Notice to Mariners (NTM) will be issued to advise mariners of the rig’s location and flashing light sequence.

If you are constructing a rig as part of the Network Blue program, please contact us as AusOcean handles all regulatory approvals.

AusOcean is not liable for any losses, damages, costs and/or other consequences resulting directly or indirectly from using or relying on the information in this document.


Table of contents

1.0 Introduction

2.0 ESP Setup

Materials

Method

3.0 Netreceiver Device Registration

4.0 Device Variables

5.0 Sensor Configuration

6.0 Actuator Configuration

1.0 Introduction

The following guide details the process of flashing the rig control code onto the ESP8266 HUZZAH board, registering the ESP onto netreceiver/vidgrind and configuring for a basic variable and sensor set.

NOTE: this is a very high level overview of netreceiver registration/configuration processes. For a more detailed overview of netreceiver see the netreceiver help page here. It is recommended that this be read to have a better understanding of what’s happening here.

2.0 ESP Setup

Solder header pins to the ESP8266 HUZZAH as in this photo. The following instructions detail the process of uploading the AusOcean netsender software to the ESP8266 HUZZAH microcontroller using an FTDI and arduino IDE:

Tip: This is also known as ‘flashing’ the ESP

Materials

Method

  1. Download the arduino IDE from here. Note that there are different versions for different OS.
  2. If on windows, you’ll need to run the downloaded executable (likely exe or msi format, see here). If on linux, extract downloaded zip and run install script (see here).
  3. If using Windows, right click on the arduino desktop icon then hit run as administrator.
    (Linux OS only) Run the arduino IDE in sudo mode by opening a terminal window and typing the command and pressing enter:

sudo arduino

  1. So that we can upload to the ESP, we’ll need to get the board package. Using the arduino preferences UI (File->Preferences). Enter the following URL into the “Additional Board Managers URLs” field:

http://arduino.esp8266.com/stable/package_esp8266com_index.json

Click OK.

  1. Now head to the Boards Manager UI (Tools->Board->Boards Manager). In the search bar, type “esp”. An ESP8266 entry should be there; hover over the entry and click the install button that appears. Once installation has completed, close the boards manager UI.
  2. Exit and restart as an administrator (see step 3).
    Or restart the arduino IDE in sudo mode. (Linux OS only)
  3. Insert the FTDI into the ESP8266 so that the ground pins (labelled GND) are connected. Connect the FTDI to your computer with the USB to micro USB cable.
  4. Now select the “Adafruit Feather HUZZAH ESP8266” from the boards selection list (Tools->Board->ESP8266 boards).
  5. Ensure CPU frequency is set to 80MHz (Tools->CPU Frequency).
  6. Ensure 115200 baud upload is selected (Tools->Upload Speed). This may be lowered if problems are experienced.
  7. Select the matching COM/serial port for your FTDI (Tools->Port). Note: there will generally only be one option, however if there’s two you’ll just have to try both
  8. We’ll start with a simple blink test program to make sure everything is set up fine. Enter the following code into a new file and save:
  1. void setup() {
  2.  pinMode(0, OUTPUT);
  3. }
  4.  
  5. void loop() {
  6.  digitalWrite(0, HIGH);
  7.  delay(500);
  8.  digitalWrite(0, LOW);
  9.  delay(500);
  10. }

Once the code is entered press the tick up on the top left and save as a new file. Ensure the code looks exactly as above, remove any additional characters.

  1. We now need to put the board into bootloader mode. While holding down the GPIO0 button on the FTDI, press the RESET button for 1 second, release and then release the GPIO0 button. The red LED should now be dimly lit. This indicates that the board is in bootloader mode.
  2. Upload the program using the upload button. (the -> button next to the tick) then hit save Note: If you receive a serial port error see step 11 to change the matching COM/serial port for your FTDI.0
  3. If successful, the final message should be “Hard resetting via RTS pin…”. Hit the RESET button on the ESP and the program should begin.
  4. Now we’ll put the temp-netsender software onto the ESP. Download the ausocean iot repository (https://bitbucket.org/ausocean/iot/downloads/).
  5. Open your PC directory and find the repository in your downloads. Right click on the repository and hit extract. A new file should appear in your downloads.
  6. Open Arduino again and hit (File-> Open-> Downloads-> ausocean-iot-fcdba2b70482-> arduino-> temp-netsender-> temp-netsender.ino)
  7. Now we need to add the netsender library. Add two files to the sketch (Sketch->Add File…); /iot/arduino/netsender/netsender.h and /iot/arduino/netsender/netsender.cpp.
  8. We will need to install the “OneWire” and “DallasTemperature” libraries. Go to the library manager (Sketch->Include Libraries->Manage Libraries), and search for “OneWire”. Find the library named “OneWire” in the list of results and hit install. Then search for “DallasTemperature” and find the library named “DallasTemperature” and hit install. Note: there are other variariations of “OneWire” and “DallasTemperature” choose the versions that state exactly their names without additional information.
  9. Click the temp-netsender tab.
  10. Upload the program by repeating steps 13 to 15.
  11. Press ctrl+shift+m to open the monitor console. (ensure in the bottom right corner that 115200 baud is selected) The ESP should output its MAC address along with some other information such as AlarmPin, SensePin, PowerPin. Note the MAC address; we’ll use this to register this ESP on netreceiver.
  12. The ESP can now be configured to connect to the netreceiver service.

3.0 Netreceiver Device Registration

You will need to have a netreceiver site registered, and a google account for which has write permissions to the site to configure and control your rig. Talk to someone from AusOcean to get this set up. Once this is all ready proceed with the following steps:

  1. Go to http://netreceiver.appspot.com. You may be asked for credentials at this stage or the next. Provide google account credentials that are registered with your netreceiver site.
  2. Click on the “Sites” tab, select your site and then hit the gear button to go to the “Settings” page where we will add the ESP device.

  1. The following table describes the meaning of the fields in the device registration zone.

Field

Description

ID

This is an informal identification for the device (for people). This can be anything of your choosing.

MAC

This is the MAC address of the device we wish to register. This is what netreceiver will use to ID devices. In the case of the ESP, this is what we noted down during the ESP flashing process.

WiFi SSID,key

This is the SSID and password of the wifi access point we’d like the ESP to connect to after the initial “netreceiver,netsender” hotspot connection has occurred. This corresponds to the rig’s router SSID

Inputs

These are sensor inputs to the ESP. These may be real or software defined.

Default is:

A0,X10,X11,X12,X13,X50,X51,X60

Outputs

Output pins for the ESP. Control Navlight etc.

Default:

D14,X14,D15,D16,D0, D12, D13

Mon period

Monitoring period, i.e. how often ESP checks back in with netreceiver.

Default: 60

Act period

The action period. How often ESP does things.

Default: 60

Type

The type of device e.g. esp, pi (Optional)

Ver

Software version. (Optional)

Key

The device key. This is generated once the device is added.

Fill out the fields of the device according to your needs and then hit “Add”. An example device addition is shown below.

Once the page refreshes you should see your device appear in the devices list with a generated key.

  1. Power your ESP either through using a rig controller board/PCB or connected to the FTDI interface cable.
  2. For first time net connection, you will need to provide a hotspot with SSID: netreceiver and Pass: netsender (you could use your phone for this). The ESP will default to this hotspot if it cannot connect to the specified hotspot defined in the device registration on netreceiver. Ensure the access point you have defined in the device registration is on and available; once the ESP has achieved a first communication with netreceiver through the “netreceiver” hotspot, it will communicate with the new one from then on.
  3. Let’s check that the ESP is talking to netreceiver. Hit the Monitor tab. You will see something like the following. The important part is the green status icon and tick to indicate that the device is configured.

4.0 Device Variables

Device variables are used to control complex behaviours of the rig including alarm conditions (in the case of poor rig voltage or loss of net conn) and characteristics of nav light sequence. Here will define a standard variable list and their values.

Variable Name

Description

AlarmNetwork

Number of network failures required to go into temporary alarm state.

Standard: 10

AlarmPeriod

Duration of temporary alarm in seconds.

Standard: 5

AlarmVoltage

Start continuous alarm if A0 drops to this value.

Standard: 825 (~24.0V)

AlarmRecoveryVoltage

Stop alarm when A0 rises above this value.

Standard: 840 (~24.4V)

AutoRestart

Amount of time minutes in alarmed state before we automatically power cycle the router.

Standard: 10

Pulses

Number of nav light flashes (pulses).

Standard: 3

PulseWidth

Pulse width in seconds (2s means 1s on, 1s off).

Standard: 2

PulseCycle

Pulse repeat cycle in seconds.

Standard: 30

PowerPin

GPIO pin that controls the peripheral (camera, speaker etc) relay power pin.

Standard: 14

Power

Value sent to PowerPin.

Standard: false, off

The following instructions detail the process of adding these variables.

  1. Go to the “Settings” page of your rig site. You will add variable to the “Variables” interface.

  1. Select the appropriate device using the first drop down in the “Name” field.

  1. Then type (or select) the appropriate variable name next to this.

  1. In the “Value” field type the value we wish to set this variable to. Press the “Add” button. Repeat this process for all variables in the variable description table above. You should get something like this:

5.0 Sensor Configuration

Here the process of configuring the default sensor layout is explained. Netreceiver “Sensors” take raw pin values and transform them into useful measurements, including binary data. Netreceiver provides built in functions to make this easy. The following table details these functions.

Name

Args

fn(x)

none

x

scale

a

a * x

linear

a,b

a * x + b

quadratic

a,b,c

a * x2 + b * x + c

custom

fn

fn(x)

Here we add sensors to monitor battery voltage (voltage divider), sea surface temp (DS18B20), mast temp and mast humidity (DHT22). More details regarding electrical wiring and connections for these sensors can be found in the Rig PCB Guide and Rig Electrical Systems Guide.

Now we’ll go through the instructions to perform this configuration:

  1. Navigate to the “Settings” page. We’ll be adding sensors into the “Sensors” interface.

  1. Using similar principles to the variable addition process, add the following sensors:

  1. Go to the “Monitor” page and check that you have something similar to the following. Confirm the sensors are giving reasonable values; if they are not, try power cycling the ESP and refreshing the page a few times until status is green again.

6.0 Actuator Configuration

Actuators are used to control device outputs such as the navlight and peripheral power controls; they are set using variables as discussed previously. We can also use crons to control these variables and therefore schedule changing of the variables values e.g. turn on navlight for nighttime and turn off for daytime. Here we look at the set up of nav light control and peripheral power control for an underwater camera (or underwater speaker module). The following table provides descriptions of standard actuators:

Variable

Output Pin

Description

Power

D14

Controls peripheral power (true=on,false=off)

SuppressLight

X14

Suppresses the nav light when true.

Here are some steps for adding the actuators and some accompanying crons.

  1. Navigate to the “Settings” page for the site.
  2. Add the following actuators under the “Actuators” section.

The Australian Ocean Laboratory Limited (AusOcean)