Priority Work Items - crestlinesoaring/ArduinoWeatherStation GitHub Wiki

Hi all, this is the list of tasks which need to be implemented, with priority top down.

Set RTC remotely via Telnet or HTTP (if possible at all)
HW Simulation Mode
Wind Gust Calculation
Add 'E' in 'USNB' string
Camera Power Control
Batch Data Saving
Batch Data Transmission
Interrupt Driven
Ping Before Transmission
Self Test
Non-Blocking i2c
Automated Remote Update
Temperature Emergency Shutoff
Soft Pboot

Set RTC remotely via Telnet or HTTP

Remotely (via Telnet or HTTP) change and set time and date of the RTC.

HW Simulation Mode

Let the program run wihthout peripherals.
Substitue a value instead of a measurement.
F.I. INA219 current and voltage measuerement functions get substituded with 12V , 1A

Wind Gust Calculation

Something is wrong with the current gust reporting.
We sometimes report gusts in excess of 70mph, though we don't measure those speeds.
Please search for "gust" in the main program.

Add 'E' in 'USNB' string

When "U" is turned on, please add the "E" character (for "Ethernet card on") to peripherals list which are turned on.
This is part of the uploaded string.

Camera Power Control

We are trying out several different cameras, all of which (except the 360) consume more power than the current HD cameras. After several experiments we decided to stream the video via youtube, facebook had issues with high megapixel streams, though they are working on that. We are going to replace the two HD cameras with 5Mpixel soon. Since they consume more power, we need to refine their power management so that they use the camera battery after solar goes dark.

Batch Data Saving

SaS is the Save portion of Save and Send. During low power(rain/fog) times or nights, data should still be collected each minute and should be saved up to several hours. Lance came up with a nice compression which saves much space, meanwhile a 2Mbit EEPROM was added to the RTC, allowing for days of data storage.

Please see https://github.com/crestlinesoaring/ArduinoWeatherStation/wiki/SaS-(Save-and-Send).

Batch Data Transmissions

SaS is the Send portion of Save and Send. This routine gets called for sending saved data after each boot. It sends all accumulated data until empty. Data can be from nights or during power saving modes (rain/fog).

Please see https://github.com/crestlinesoaring/ArduinoWeatherStation/wiki/SaS-(Save-and-Send).

Interrupt Driven

Change program from loop based to (each minute) interrupt driven.
Interrupt turns on sensors, takes a snapshot of data, saves that data, turns off sensors and goes back to sleep.
Pboot in Brain3 will deliver the minute interrupt to M.
Also, instead of the current Voltage averaging loops, use INA's internal sampling and averaging.

Ping Before Transmission

Some "Ping" checking should be done before starting transmissions.
In case no ping replies, when LZ or internet in general is down, abort pings and that transmission after 20 seconds.
All data will be saved and tried to be retransmitted next time.

Self Test

Check all peripherals (i2c handshakes and valid reported data from sensors) and the pins of vane and speed after each reboot.
Right now, several separate programs have to be flashed just to check some specific peripherals.
For production, it would be great if there would be a stripped down WX program with more thorough self tests.

Non-Blocking i2c

use non-blocking i2c and several (soft) i2c routines.
Right now (Aug 2018), if power to the sensors is low, the program gets stuck and never recovers, even if voltage goes up again.
Sometimes, if INA's current (A) is too high, it blocks the whole i2c bus.
Please use a separate (soft) i2c busses for the RTC and 2Mbit EEPROM . RTC is very important for turning on U etc.
Use the internal i2c bus for other internal stuff, but use non-blocking library.
Use a separate (soft) i2c bus only for the external sensors/stuff.

Automated Remote Update

Try out an automated remote update, maybe while one of us are around the MWX.
Just to see if/how it might work...
During day, start pinging MWX from MarshPi.
Issue the remote reset.
Time of no replies to pings should be just a few seconds, after which the TFTP can be started.
M will continue after 10 seconds if not receiving any TFTP update.

Temperature Emergency Shutoff

Hibernation (P0, see wiki) mode if temperature goes above 50C
low power mode P1 if temperature is above 40C
reduce CC if temperature goes above 35C (like 350mA?)

Soft-Pboot.

Since Rel2 and Rel4 and U won't be under the Pboot control anymore, they must be turned off/on by the M each 12/24 hours.

[CB] [CB] [CB] [CB] [CB] [CB] [CB] [CB] [CB] [CB] [CB] [CB] Once CameraBox [CB] is installed:

[CB]3) Add external BME for external temperature etc.
The plan is now to add external BME to BB once the Shield is installed.
External BME will then be placed between BB and its Shield.

[CB]4) Sense/record the radar/alarm
Cameras will be hardwired to the intrusion radar to turn on, and that incident should be recorded by timestamp.
If something happened, the timestamps make checking the camera footage much easier.

[CB]5) Speed display (Ken?)
Briefly display the max and min speed (during the last 5 minutes with 7 segments + dots) and the actual speed.
Not sure how this should be, still open.
[CB] [CB] [CB] [CB] [CB] [CB] [CB] [CB]

DONE DONE DONE DONE DONE DONE DONE DONE DONE

A) Power management, Done, using an "L" algorithm works beautifully.
Cameras are powered on if 13.9V is detected from solar for the last consecutive 10 minutes, and turned off if Battery powers cameras for 10 minutes.

Most urgent is a scheme to power the cameras up if conditions (time of day, battery status, good, strong sunshine) allow for it.
Right now, we would need to manually remotely turn them on each hour (they get turned off by Pboot each hour).
Please see [CB] below.

Done, [CB]2) turn on/off cameras
by time and/or WX condition? See also power management.

[CB]1) DONE state after Pboot.
All 12V peripherals (except U) will be turned off during a reset or Pboot!!
Note, in Brain3 a 28 second delay was added to the camera drivers, so if they were on, they'll stay on until after Pboot. They stay off if they were off before Pboot.
Pboot was not designed to be each hour and cannot keep track of the on/off state of the peripherals (U, Cameras, speed display etc) during/after the 5V hourly Pboots.
The M holds and controls the on/off state of those peripherals, and must save them and reapply them after a Pboot (like with the U and Eth currently).
Note:
Cameras can be turned on by the hard wired intrusion radar directly.

E) DONE add temperature emergency power down
Hibernation mode (P0, see wiki) if internal temperature goes above 50C to avoid runaway situation
Low power mode (P1) if temperature is above 40C
Reduce CC if temperature goes above 35C (like 350mA?) [how? via CC's NTC?]

G) DONE Move BME's "degrees in Celsius" (thank you Lance for the BME's C!) into RTC temp slot, use current BME C for your F?
This is just for internal temperature until the CameraBox is hooked up.
Or please put BME C right into it's designated ("internal temp") spot.
I think this is done already, thank you, Lance!

F) DONE Extend morning "on" time to 1h before sunrise again.

C) DONE but untested - prepare/setup remote updates through AJX/MarshPi https://github.com/codebndr/Ariadne-Bootloader setup TFTP so it won't serve/upload the program anymore after it did that once successfully.

E) DONE but untested and suboptimal - add remote resetting through a simple web server After TFTP is prepared for updates, we need to initiate a remote reset to give the bootloader the chance to download the new program via TFTP. details https://github.com/codebndr/Ariadne-Bootloader

P) DONE - Cosmetics serial string formatting

Q) DONE - multiply current by two, I won't have time to calibrate and do all that stuff. *2 is good enough.