Skip to content

Alert Pusher#437

Merged
je-foster merged 23 commits intoOpen-Acidification:alertsfrom
je-foster:info
Sep 15, 2023
Merged

Alert Pusher#437
je-foster merged 23 commits intoOpen-Acidification:alertsfrom
je-foster:info

Conversation

@je-foster
Copy link
Contributor

New features:

  • When installing TankController software, the user can specify a log file name into which "alerts" will be saved on the SD card.
  • Every minute, the software makes a new entry into the log file that includes the mean temperature over the last minute, the standard deviation in temperature readings over the last minute, the target temperature, the current pH, and the target pH.
  • Whenever a change is made to the EEPROM data, or new settings are received from the pH probe, the software makes a new entry into the log file that includes the pH probe slope data and a dump of all EEPROM data.
  • Whenever new data is written into the log file on the SD card, the singleton instance of AlertPusher is flagged to request, via HEAD request from oap.cs.wallawalla.edu, the size of the server's file by the same name as the local log file.
  • When the instance of AlertPusher receives a reply and determines that the server's log file has less data than the local log file, it will send a POST request with the next ~300 bytes from the local file, which the server will append to its log file. The AlertPusher instance will follow this up with a HEAD request for the server's new log file size. This process continues until the server's file size matches the local file size.

There is more that needs to be done before this can be merged with the main branch:

  • Although the ultoa() function works on the Arduino, our testing suite does not recognize this function. This issue currently prevents tests from running.
  • The AlertPusher class needs tests.
  • There is a blocking issue with AlertPusher that is causing delays of 1 to 2 seconds whenever HEAD and POST requests are sent to oap.cs.wallawalla.edu. This is due (in whole or in part) to the Ethernet library's connect() function blocking until it receives a reply (or timeout).

@je-foster je-foster merged commit 4510ea5 into Open-Acidification:alerts Sep 15, 2023
jgfoster pushed a commit to jgfoster/TankController that referenced this pull request Mar 12, 2024
* DataLogger calls writeInfoToLog() every 60s

* DataLogger sends an info string to SD_TC

* DataLogger sends warning strings to SD_TC

* Writes to EEPROM trigger DataLogger warnings

* Include EEPROM values in DataLogger warnings

* SD_TC writes alerts to SD card

* Duplicate EEPROM writes don't warn DataLogger

* New slope from PHProbe triggers DataLogger warning

* thermal mean and std dev, more columns in alerts.

* Alert filename in TankController.ino

* Resolve EEPROM nan printing issues

* Construct SD_TC without Ethernet_TC

* WIP AlertPusher works but blocks, lacks tests

* Changes related to alert file
jgfoster added a commit that referenced this pull request Feb 5, 2025
* Alert Pusher (#437)

* DataLogger calls writeInfoToLog() every 60s

* DataLogger sends an info string to SD_TC

* DataLogger sends warning strings to SD_TC

* Writes to EEPROM trigger DataLogger warnings

* Include EEPROM values in DataLogger warnings

* SD_TC writes alerts to SD card

* Duplicate EEPROM writes don't warn DataLogger

* New slope from PHProbe triggers DataLogger warning

* thermal mean and std dev, more columns in alerts.

* Alert filename in TankController.ino

* Resolve EEPROM nan printing issues

* Construct SD_TC without Ethernet_TC

* WIP AlertPusher works but blocks, lacks tests

* Changes related to alert file

* Tests run again (#438)

* DataLogger calls writeInfoToLog() every 60s

* DataLogger sends an info string to SD_TC

* Reformat info string

* DataLogger sends warning strings to SD_TC

* Writes to EEPROM trigger DataLogger warnings

* Include EEPROM values in DataLogger warnings

* SD_TC writes alerts to SD card

* Duplicate EEPROM writes don't warn DataLogger

* New slope from PHProbe triggers DataLogger warning

* thermal mean and std dev, more columns in alerts.

* Alert filename in TankController.ino

* WIP AlertPusher

* Remove maximum size for logFileName

* Add maximum size for logFileName

* SD_TC::getAlert()

* WIP AlertPusher

* Resolve EEPROM nan printing issues

* WIP tests

* Construct SD_TC without Ethernet_TC

* WIP AlertPusher somewhat functional

* WIP AlertPusher works but blocks, lacks tests

* Changes related to alert file

* Tests run again

* Simplify lint rules file.

* Lint issues.

* AlertPusherTest now passes.

* DataLoggerTest now passes.

* PHProbeTest.cpp now passes.

* SDTest.cpp now passes, along with all others!

* The stdev seems to be different on my local runs from that on the GitHub action.

* WIP on defer network when bubbler is on.

* Disable Arduino-CI tests (for now).

* Start on event log.

* Newline at end of file.

* Formatting.

* Rename event log to remote log.

* Change formatting.

* Edits to get things to compile.

* More formatting (Arduino CI tests are disabled).

* More formatting changes.

* Formatting.

* More formatting.

* Revert code removed from PHProbe.cpp.

* Change code order to match main.

* Update ThermalProbeTest.cpp from main.

* Move PORT from Ethernet_TC.h to AlertPusher.cpp.

* Bump versions.

* Update libraries; add `flutter.js.map` files to avoid client errors.

* Change for deprecated Flutter function.

* Consolidate all the setup into the `instance()` method.

* Update Flutter version.

* Add debugging to JSONBuilderTest.cpp to see how far it gets.

* Further debugging of JSONBuilderTest. Don't expect float to be exactly zero.

* Show test class in some tests.

* Fix formatting.

* More formatting.

* Work on RemoteLogPusherTest (it passed, but others fail now).

* SDTest and PushingBoxTest now pass.

* All tests pass locally.

* Enable device controller test.

* Fix codacy issue (it found a bug!).

* Fix Codacy issue (bug).

* Switch default to hide loop delay for easier testing.

* Formatting.

* Tests now pass.

* Update Makefile to make it easier to compare with main.

* Refactor Makefile.

* Use PHControl::instance()->loop()

* Add files for RemoteLogPusher.

* Continuing small changes.

* Most of the way back with tests passing.

* - Update Makefile to match alerts.
- Use tabs instead of spaces in Makefile.
- Fix format error.

* Use tabs instead of spaces in Makefile.

* A few more things from the alerts branch.

* Update a few tests to match alerts.

* Upgrade libraries.

* Bring alerts branch closer to january branch.

* - Add RemoteLogPusher code.
- Remove duplicates from Makefile.

* Import changes from january branch to alerts branch.

* Restore some commented-out test code.

* All tests pass with RemoteLogPusher!

* Codacy issues.

* Upgrade library versions.

* * Update Flutter version
* Add documentation about network and architecture

* WIP: almost there! Only two failiing tests.

* Remove post-commit script.

* WIP: All tests pass.

* no message

* Still pass

* Still pass.

* Tests pass!

* Fixes for formatting and failing tests.

* Fix one of two failing tests.

* Tests should pass now!

* Restore code lost in last merge.

* Remove tests of removed functionality.

---------

Co-authored-by: John Foster <109112235+je-foster@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant