Go to the source code of this file.
|
| String | formatBytes (size_t bytes) |
| | Utility function Original code found here: https://tttapa.github.io/ESP8266/Chap16%20-%20Data%20Logging.html Converts bytes to KB and MB. More...
|
| |
| void | printFloat (float value, int places) |
| | Utility function: Prints value with places of decimal places determine by precision. More...
|
| |
| boolean | isNumeric (String str) |
| | Utility function Checks if a string is numeric. Original code found here: http://tripsintech.com/arduino-isnumeric-function/. More...
|
| |
| int | errorState (int state, int ledRed, int ledGreen) |
| | Utility function Visual error indication via LED at pin D2 This is a dead end. You will need to fix the error and reset the device. Alocated states: State 1: No WiFi connection available State 2: Could not connect to MQTT broker // State 3: No temperature sensor found. // 200/600: Refrigerator, Temp measure State 4: Not possible to start SPIFFS. // 600/200: Refrigerator State 5: Could not transmit data to emoncms. // Refrigerator. More...
|
| |
| void | keypressWait (void) |
| | Utility function Halt the program and wait for "key press" at the serial port. For DEBUG purpose only. More...
|
| |
| void ICACHE_RAM_ATTR | lwdtcb (void) |
| | Utility function lwdTicker callback routine Code found here: https://www.sigmdel.ca/michel/program/esp8266/arduino/watchdogs2_en.html. More...
|
| |
| void | lwdtFeedInit (void) |
| | Utility function Initializes the loop watchdog interrupt routine. To be used in setup() at the end. More...
|
| |
| void | lwdtFeed (void) |
| | Utility function Resets the loop watchdog counter also known as "kicking the watchdog". More...
|
| |
| int | getBootDevice (void) |
| | Utility function See https://www.sigmdel.ca/michel/program/esp8266/arduino/watchdogs2_en.html for documentation
More...
|
| |
| int | startWiFi (IPAddress _ip, IPAddress _dns, IPAddress _gateway, IPAddress _subnet, char *_ssid, char *_password, char *_host) |
| | Utility function Starts everything related to WiFi and Internet connections. More...
|
| |
| void | showWiFiStatus (int i) |
| | Utility function Display WiFi status in clear text. More...
|
| |
| bool | doWifiConnect (char *_ssid, char *_password) |
| | Utility function Tries to reconnect the WiFi connection Software found here: https://github.com/esp8266/Arduino/issues/4060. More...
|
| |
| int | MQTT_connect (Adafruit_MQTT_Client *_mqtt) |
| | Utility function Function to connect and reconnect as necessary to the MQTT server. More...
|
| |
◆ DEBUG
◆ LWD_TIMEOUT
| #define LWD_TIMEOUT 15*1000 |
◆ doWifiConnect()
| bool doWifiConnect |
( |
char * |
_ssid, |
|
|
char * |
_password |
|
) |
| |
◆ errorState()
| int errorState |
( |
int |
state, |
|
|
int |
ledRed, |
|
|
int |
ledGreen |
|
) |
| |
Utility function Visual error indication via LED at pin D2 This is a dead end. You will need to fix the error and reset the device. Alocated states: State 1: No WiFi connection available State 2: Could not connect to MQTT broker // State 3: No temperature sensor found. // 200/600: Refrigerator, Temp measure State 4: Not possible to start SPIFFS. // 600/200: Refrigerator State 5: Could not transmit data to emoncms. // Refrigerator.
- Parameters
-
| [in] | int | state Error |
| [in] | int | ledRed |
| [in] | int | ledGreen |
- Returns
- true or false. Is the errorstate defined.
Definition at line 122 of file hhsUtility.cpp.
◆ formatBytes()
| String formatBytes |
( |
size_t |
bytes | ) |
|
◆ getBootDevice()
| int getBootDevice |
( |
void |
| ) |
|
◆ isNumeric()
| boolean isNumeric |
( |
String |
str | ) |
|
◆ keypressWait()
| void keypressWait |
( |
void |
| ) |
|
Utility function Halt the program and wait for "key press" at the serial port. For DEBUG purpose only.
- Parameters
-
- Returns
- none
Definition at line 219 of file hhsUtility.cpp.
◆ lwdtcb()
| void ICACHE_RAM_ATTR lwdtcb |
( |
void |
| ) |
|
◆ lwdtFeed()
Utility function Resets the loop watchdog counter also known as "kicking the watchdog".
- Parameters
-
- Returns
- none
Definition at line 250 of file hhsUtility.cpp.
◆ lwdtFeedInit()
| void lwdtFeedInit |
( |
void |
| ) |
|
Utility function Initializes the loop watchdog interrupt routine. To be used in setup() at the end.
- Parameters
-
- Returns
- none
Definition at line 244 of file hhsUtility.cpp.
◆ MQTT_connect()
| int MQTT_connect |
( |
Adafruit_MQTT_Client * |
_mqtt | ) |
|
Utility function Function to connect and reconnect as necessary to the MQTT server.
- Parameters
-
| [in] | Adafruit_MQTT_Client | MQTT client to reconnect. |
- Returns
- success or failure.
Definition at line 373 of file hhsUtility.cpp.
◆ printFloat()
| void printFloat |
( |
float |
value, |
|
|
int |
places |
|
) |
| |
Utility function: Prints value with places of decimal places determine by precision.
- Parameters
-
Definition at line 39 of file hhsUtility.cpp.
◆ showWiFiStatus()
| void showWiFiStatus |
( |
int |
i | ) |
|
Utility function Display WiFi status in clear text.
- Parameters
-
| [in] | | | indicating the WiFi status to display in text. |
- Returns
- none
Definition at line 312 of file hhsUtility.cpp.
◆ startWiFi()
| int startWiFi |
( |
IPAddress |
_ip, |
|
|
IPAddress |
_dns, |
|
|
IPAddress |
_gateway, |
|
|
IPAddress |
_subnet, |
|
|
char * |
_ssid, |
|
|
char * |
_password, |
|
|
char * |
_host |
|
) |
| |
Utility function Starts everything related to WiFi and Internet connections.
- Parameters
-
| [in] | IPAddress | _ip Static IP address of the device |
| [in] | IPAddress | _dns DNS IP address |
| [in] | IPAddress | _gateway Gateway IP address |
| [in] | IPAddress | _subnet Subnet. |
| [in] | char | *_ssid WiFi SSID |
| [in] | char | *_password WiFi password |
| [in] | char | *_host Unique host name of the device. |
- Returns
- success or failure
Definition at line 269 of file hhsUtility.cpp.
◆ lwdTicker
◆ lwdTime
| unsigned long lwdTime = 0 |
◆ lwdTimeout