hhs utility
hhsUtility.h
Go to the documentation of this file.
1 /*
2  * Description:
3  *
4  */
10 // Version: 2022-01-09.
11 
12 #include "Adafruit_MQTT.h"
13 #include "Adafruit_MQTT_Client.h"
14 #include <Ticker.h> // To be used with lwTicker callback routine
15 #include <ESP8266WiFi.h>
16 #include <WiFiClient.h> // OTA
17 #include <ESP8266HTTPUpdateServer.h> // OTA
18 #include <ESP8266mDNS.h> // OTA
19 #include <ESP8266WebServer.h>
20 
29 String formatBytes(size_t bytes); // convert sizes in bytes to KB and MB
30 
40 void printFloat(float value, int places);
41 
50 boolean isNumeric(String str);
51 
67 int errorState(int state, int ledRed, int ledGreen);
68 
76 void keypressWait(void);
77 
86 void ICACHE_RAM_ATTR lwdtcb(void);
87 
95 void lwdtFeedInit(void);
96 
103 void lwdtFeed(void);
104 
105 
114 int getBootDevice(void);
115 
128 int startWiFi(IPAddress _ip, IPAddress _dns, IPAddress _gateway, IPAddress _subnet, char *_ssid, char *_password, char *_host);
129 
136 void showWiFiStatus( int i );
137 
147 bool doWifiConnect(char *_ssid, char *_password );
148 
155 int MQTT_connect(Adafruit_MQTT_Client *_mqtt);
void showWiFiStatus(int i)
Utility function Display WiFi status in clear text.
Definition: hhsUtility.cpp:312
boolean isNumeric(String str)
Utility function Checks if a string is numeric. Original code found here: http://tripsintech....
Definition: hhsUtility.cpp:105
int getBootDevice(void)
Utility function See https://www.sigmdel.ca/michel/program/esp8266/arduino/watchdogs2_en....
Definition: hhsUtility.cpp:256
void lwdtFeedInit(void)
Utility function Initializes the loop watchdog interrupt routine. To be used in setup() at the end.
Definition: hhsUtility.cpp:244
void printFloat(float value, int places)
Utility function: Prints value with places of decimal places determine by precision.
Definition: hhsUtility.cpp:39
bool doWifiConnect(char *_ssid, char *_password)
Utility function Tries to reconnect the WiFi connection Software found here: https://github....
Definition: hhsUtility.cpp:346
void ICACHE_RAM_ATTR lwdtcb(void)
Utility function lwdTicker callback routine Code found here: https://www.sigmdel.ca/michel/program/es...
Definition: hhsUtility.cpp:226
String formatBytes(size_t bytes)
Utility function Original code found here: https://tttapa.github.io/ESP8266/Chap16%20-%20Data%20Loggi...
Definition: hhsUtility.cpp:20
int MQTT_connect(Adafruit_MQTT_Client *_mqtt)
Utility function Function to connect and reconnect as necessary to the MQTT server.
Definition: hhsUtility.cpp:373
void keypressWait(void)
Utility function Halt the program and wait for "key press" at the serial port. For DEBUG purpose only...
Definition: hhsUtility.cpp:219
void lwdtFeed(void)
Utility function Resets the loop watchdog counter also known as "kicking the watchdog".
Definition: hhsUtility.cpp:250
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 t...
Definition: hhsUtility.cpp:122
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.
Definition: hhsUtility.cpp:269