Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Documents/Debugging/Case.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documents/Debugging/Comment_issue.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documents/Debugging/Function.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documents/Debugging/Print.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Documents/SG_Firmware_API_v82.doc
Binary file not shown.
Binary file added Documents/Tables_SG_20_v06.xlsx
Binary file not shown.
Binary file added Documents/Ui_Description_v3.doc
Binary file not shown.
Empty file added Errors.txt
Empty file.
288 changes: 230 additions & 58 deletions OpenSprinkler.cpp

Large diffs are not rendered by default.

15 changes: 13 additions & 2 deletions OpenSprinkler.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,22 @@ struct HTTPStationData {
struct ConStatus {
byte enabled:1; // operation enable (when set, controller operation is enabled)
byte rain_delayed:1; // rain delay bit (when set, rain delay is applied)
byte rain_sensed:1; // rain sensor bit (when set, it indicates that rain is detected)
byte rain_sensed:1; // rain sensor bit (when set, it indicates that rain is detected)
// @tcsaba:soil sensor inputs status flags
byte dry_soil_1 : 1; // soil sensor 1 bit (when set, the soil needs irrigation)
byte dry_soil_2 : 1; // soil sensor 2 bit (when set, the soil needs irrigation)
byte program_busy:1; // HIGH means a program is being executed currently
byte has_curr_sense:1; // HIGH means the controller has a current sensing pin
byte has_sd:1; // HIGH means a microSD card is detected
byte safe_reboot:1; // HIGH means a safe reboot has been marked
byte has_hwmac:1; // has hardware MAC chip
byte req_ntpsync:1; // request ntpsync
byte req_network:1; // request check network
byte req_network:1; // request check network
byte display_board:3; // the board that is being displayed onto the lcd
byte network_fails:3; // number of network fails
//@tcsaba:additional levels for internet connection checking and fault detection
byte netw_adapter_fail : 1; // HIGH when network adapter can't started
byte internet_fail : 1; // HIGH when no internet connection (IP:8.8.8.8 have no ping response)
byte mas:8; // master station index
byte mas2:8; // master2 station index
};
Expand Down Expand Up @@ -138,6 +144,8 @@ class OpenSprinkler {
// first byte-> master controller, second byte-> ext. board 1, and so on

// variables for time keeping
static ulong s1sensor_lasttime; // @tcsaba: time when the last soilsensor1 reading is recorded
static ulong s2sensor_lasttime; // @tcsaba: time when the last soilsensor2 reading is recorded
static ulong sensor_lasttime; // time when the last sensor reading is recorded
static ulong flowcount_time_ms;// time stamp when new flow sensor click is received (in milliseconds)
static ulong flowcount_rt; // flow count (for computing real-time flow rate)
Expand All @@ -147,6 +155,7 @@ class OpenSprinkler {
static ulong checkwt_lasttime; // time when weather was checked
static ulong checkwt_success_lasttime; // time when weather check was successful
static byte weather_update_flag;
static uint16_t current_offset; // @tcsaba: current offset value when no station on
// member functions
// -- setup
static void update_dev(); // update software for Linux instances
Expand Down Expand Up @@ -185,6 +194,8 @@ class OpenSprinkler {
static void raindelay_start(); // start raindelay
static void raindelay_stop(); // stop rain delay
static void rainsensor_status();// update rainsensor status

static void soilsensor_status();// @tcsaba: update soilsensor status
static bool programswitch_status(ulong); // get program switch status
#if defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__)
static uint16_t read_current(); // read current sensing value
Expand Down
Loading