Open-Source Professional-Grade Aquacontroller

New Update: MQTT Pub/Sub API is working! (Thingsboard running on the remote client).
I don't plan on putting a substantial amount of work into the Thingsboard platform, nor am I particularly enamored with it. Hopefully someday someone will make their own web platform for aquaria that implements an MQTT Pub/Sub API.

fZVPaeaL8j.gif
 
New Update - After 24 hours of non-stop operation, 15,000 MQTT messages for 13 continuously monitored parameters, and one reef aquarium that has been neglected for water changes, it looks like things are coming along...

(and don't worry, neither the pH probe nor the thermometer is calibrated. I definitely don't run my tank at a pH of 9!)

OJcO6OoB4b.gif
 
New dashboard!

Running solid for 48h now. I'm actually surprised with how few "edge-case" (power loss and recovery, etc.) problems I've had to deal with. Everyone is seemingly getting along nicely.

Would anyone like to pre-order a pre-run evaluation unit? I'm about tapped out on budget but I would love to build it in an actual electrical enclosure and not screwed into my bookcase cabinet.
chrome_Gbdff5FSh2.png
 
New dashboard!

Running solid for 48h now. I'm actually surprised with how few "edge-case" (power loss and recovery, etc.) problems I've had to deal with. Everyone is seemingly getting along nicely.

Would anyone like to pre-order a pre-run evaluation unit? I'm about tapped out on budget but I would love to build it in an actual electrical enclosure and not screwed into my bookcase cabinet.
chrome_Gbdff5FSh2.png
Looking good :-)
 
New Update!


Really liking how easy thingsboard integration was. Backend integration was NOT something I was looking forward to. Still, the MQTT API is pretty universal, so integrating it into another platform like ReefPi wouldn't be too difficult.

Added the "P1-08SIM" module as an onboard master control switchboard and I've actually liked it a lot more than I thought.

Added the Chronos.h library back in for the scheduling alarms
Moved all of the IO declarations into their own file (IO.h)
Now with schedulers in place for lights, dosers, autofeeders
Weird little "hello world" application in the ATO task that pulses the front LED indicator a specific number of times
New task in place for autofeeders (hasn't been compiled, much less tested). Same for dosers.
New task for "power equipment"
Now logging levels can be set on an individual task basis! (i.e. log verbose on a new program while only warning and above on the others)
Now Thingsboard Telemetry and RPC's are in two separate tasks.
New task for lights
Added the IO Mapping file
chrome_LXVtBxyjcI.png
chrome_qlSSaDCxuH.png
 
Official V1.0 Release!

Demo Video-

Link to Repo.-
https://github.com/JohnnyG89/SeaDragon

Updates:
Put the Physical IO declarations and alarms (output scheduler) into "IO.h"
Pre-compile Macro for whether or not to use the PubSub.h library directly (prgMQTT, prgRPC) or use the ThingsBoard Wrapper (Thingsboard.h). Use one or the other.
Each task with network comms has its own EthernetClient() instance
Global "Fault Word" for transferring, recording machine faults
Put the IO modules into their own structure to make it easier to make functions for common functionality
Hourly alarms for the powerhead and wavemaker
Autofeeders and equipment now have their own tasks. (prgATO was replaced by prgEquipment)
2x SIM input modules for hard-button control
Re-initialization of hardware if power is lost
Raw, smooth, and scaled calculators for the analog sensors (pH, 2x Temp)
Lights now have their own task.
prgMQTT - sample and send telemetry values in chunks
prgRPC - catch RPC calls and manage the commensurate IO
New pre-compile macro's so you're not including tons of objects that aren't being used in your current configuration (i.e. including both prgMQTT/prgRPC and prgThingsBoard_Telemetry/prgThingsBoard_RPC will eat up all of the SRAM!)
StorageManager and CommManager are now wrapped into "program.ino" bc you can only fit so many tabs in the Arduino IDE before it gets clunky.
Some memory optimizations
Powerhead/wavemaker control
200 samples for smoothing average for analog sensors
Separate MQTT clients and topics for telemetry and RPC management
 
Official V1.0 Release!

Demo Video-

Link to Repo.-
https://github.com/JohnnyG89/SeaDragon

Updates:
Put the Physical IO declarations and alarms (output scheduler) into "IO.h"
Pre-compile Macro for whether or not to use the PubSub.h library directly (prgMQTT, prgRPC) or use the ThingsBoard Wrapper (Thingsboard.h). Use one or the other.
Each task with network comms has its own EthernetClient() instance
Global "Fault Word" for transferring, recording machine faults
Put the IO modules into their own structure to make it easier to make functions for common functionality
Hourly alarms for the powerhead and wavemaker
Autofeeders and equipment now have their own tasks. (prgATO was replaced by prgEquipment)
2x SIM input modules for hard-button control
Re-initialization of hardware if power is lost
Raw, smooth, and scaled calculators for the analog sensors (pH, 2x Temp)
Lights now have their own task.
prgMQTT - sample and send telemetry values in chunks
prgRPC - catch RPC calls and manage the commensurate IO
New pre-compile macro's so you're not including tons of objects that aren't being used in your current configuration (i.e. including both prgMQTT/prgRPC and prgThingsBoard_Telemetry/prgThingsBoard_RPC will eat up all of the SRAM!)
StorageManager and CommManager are now wrapped into "program.ino" bc you can only fit so many tabs in the Arduino IDE before it gets clunky.
Some memory optimizations
Powerhead/wavemaker control
200 samples for smoothing average for analog sensors
Separate MQTT clients and topics for telemetry and RPC management
Nice, have you settled on the MQTT schema to rpc mapping ? I’ll be embarking on something similar for reef-pi
 
Nice, have you settled on the MQTT schema to rpc mapping ? I’ll be embarking on something similar for reef-pi

Yeah, I did just a basic method for the buttons, i.e. to turn on a skimmer, you'd subscribe to sd_api and receive the method sd/pmp/skm/1/in/_Manual and the value for the button (true/false). You'd reply to sd/pmp/skm/1/out/_Manual with the value of the button. Check out the repo., I put the MQTT uplink/downlink instructions under /src/Thingsboard.
 
So basically, reading an MQTT message be like:
===
const JsonObject &data = doc.template as<JsonObject>();

const char* methodName = data["msg"]["method"];
const char* params = data["msg"]["params"];
bool setState = strcmp(params, "true") == 0;
if (strcmp(methodName, "sd/btn/pmp/skm/1/ctrl/_Remote") == 0) {
ioSkimmer.ctrl._Remote = setState;
}
===

There's an Arduino library called "ThingsBoard.h" that wraps a lot of this up, but it was designed for local-local communication only. It's still in the project, it's controlled by the "_USE_THINGSBOARD" precompile macro.
 
And for sending telemetry, you'd send a JSON array (ArduinoJSON.h) of values like {"pmp/skm/1/_out":true} to notify the server that the last state of the skimmer output was true. I've been generally able to fit ~30 Telemetry items in a single MQTT message, and sending messages to shiftr.io at ~4x per second. The Thingsboard PE Cloud server filters those messages directly from shiftr.io and forwards them to the correct "Device"[sic].
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top