Download and update Infrastructure for IOT devices, currenlty the ESP8266. You will need an account at IOTAppStory.com
Wiki pages: https://iotappstory.com/wiki
Tells IAS the name of the application, its version, compilation date and what
digital input is the force-update/reset button. Note: the EEPROM size and number of firmware variables are limited to 1024 and 12 respectively. If additional resources are needed beyond these limits EEPROM_SIZE
and MAXNUMEXTRAFIELDS
can be defined / modified in IOTAppStory.h
.
#define APPNAME my_app
#define VERSION V1.0.0
#define COMPDATE __DATE__ __TIME__
#define MODE_BUTTON D3
#include <IOTAppStory.h>
IOTAppStory IAS(APPNAME, VERSION, COMPDATE, MODEBUTTON);
setup () { ... }
loop () { ... }
Set if sending debug over serial is enabled and, if so, at what speed to send data.
Sets various options to influence how begin()
sets things up. All calls to
this function must be done before calling begin()
.
Setting to true
will make the device do an update-check immediately after
calling begin()
.
Set the device hostname. This is important as devices by default has APPNAME as
hostname (set by the IOTAppStory
constructor), which can lead to all sorts of
networking issues.
Examples of setting it:
#define APPNAME my_awesome_app
IOTAppStory(APPNAME, ...);
begin () {
// C++-style appname + mac
IAS.preSetConfig(APPNAME"_" + WiFi.macAddress());
// C-style w. sprintf (ex. "ESP_DEF123")
char hostString[16] = {0};
sprintf(hostString, "ESP_%06X", ESP.getChipId());
IAS.preSetConfig(hostString, false);
// Now start it up
IAS.start();
}
Set the WiFi credentials without going through the captive portal.
As the two above; sets WiFi credentials and boardName.
preSetConfig(string ssid, string password, string boardName, string url1, string url2, bool automaticUpdate)
As above + set urls for contacting IOTAppStory.com. Generally not needed.
These fields are added to the config wifimanager and saved to eeprom. Updated values are returned to the original variable.
char* LEDpin = "D4";
setup () {
IAS.addField(LEDpin, "ledpin", "ledPin", 2);
IAS.begin();
}
loop () {
IAS.buttonLoop();
// dPinConv() converts pin-name to appropriate number
pinMode(IAS.dPinConv(LEDpin), OUTPUT);
}
Set up IAS and start all dependent services.
If bootstat
is true, the code will keep track of number of boots and print
contents of RTC memory.
If ea
is true, the entire EEPROM (including wifi credentials and IAS activation code) will be
erased.
If ee
is true and ea
is false, some of the EEPROM ( excluding wifi credentials and IAS activation code) will be
erased.
If ee
is flase and ea
is false (or excluded), none of the EEPROM (including wifi credentials and IAS activation code) will be
erased.
Checks if the button is depressed and what mode to enter when once it is
released. Call in loop()
.
Calls IOTAppStory.com to check for updates. OK to call every ~5 minutes in development, but production setups should call at most every two hours.
If spiffs
is true, the call also checks if there is a new filesystem image to
download.
See addField()
For Wifi AP management we forked and modified the WifiManager from kentaylor which in its turn was a fork from tzapu
Thanks to msiebuhr for this readme file.
And thankyou to all of you who made a pull request