Code Monkey home page Code Monkey logo

esp-library's Introduction

Wifi & OTA update manager for IOT devices (ESP8266 and ESP32). ESP8266's need at least 1MB flash. You will need a free account at IOTAppStory.com

Latest stable release 2.0.2

https://github.com/iotappstory/ESP-Library/releases/latest

Arduino IDE arduino-library-badge


Prerequisites

ESP8266 specific

ESP32 specific

ESP8266 and ESP32


IAS WIKI

https://iotappstory.com/wiki/arduino-esp

Contributions and thanks

Thankyou to all of you who made a pull request

Donation

Consider supporting IOTAppStory.com by contributing to its development.
Donate

esp-library's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp-library's Issues

IASLoader - login fails - if WiFi ssid contains "-"

IASLoader - login fails - if WiFi ssid contains "-", even the WiFi credentials are correct.

After I changed WiFi ssid name to name that didnt have "-" character it worked.

Used esp32 (TTGO LoRa32-OLED-V1).

No Update on StartUp

First of all, thank you for realising this great Project! =)

Since I have some devices "in the field" somewhere without WiFi, I want them only to update when I tell them to, for example via a Pin or Touchpad.

I already set:
IAS.preSetAutoUpdate(false);
IAS.setCallHome(false);
IAS.preSetAutoConfig(false);

But they still want to update when they are powered up. That takes away valueable seconds of battery time.
So is there an easy way to tell them not to Update on StartUp? If not, could you please add this function to the library?

Thanks in advance!
Markus

Error: Max. callhome / min / device reached! and magic Byte 0xE9 error

Hi, I really like this project, thanks very much for making this happen!

My IOTAppstory logs and serial output keep showing"Error: Max. callhome / min / device reached!"

And I have this error message in Serial: " Error: Header did not start with magic byte 0xE9"

Any help would be very much appreciated!

=======================================

My setup:

Hard: NodeMcu Clone Amica ESP12E 4mb, no pins connected, power supply 5Vdc with 2Amp available.
Firm: NodeMCU Version 0.9, SDK Firmware - 2.2.0 08/062018
Core: ESP arduino communitity core - 2.4.2
IDE: Arduino/Windows 64 1.8.5
IDE config, and debug settings:
Board NodeMCU v0.9
Flash size: 4M (1M SPIFFS)
Debug Port:Disabled
Debug Level: non
lwlp Variant: Version 1.4 higher bandwidth
VTables: Flash
CPU: 80MHz
Upload: 115200
Erase Flash: only Sketch
Programmer: AVRISP mkll

libraries: IOTAppStory.h 2.0.0
ESP-Library-2.0.1 Latest commit 7e9ed22 on Jul 24
ESPAsyncTCP-master Latest commit 7e9ed22 on Jul 24
ESPAsyncWebServer-master Latest commit 7e9ed22 on Jul 24

sketch: IASBlink V1.0.2

Serial Output:

_EEPROM Configuration found
-------------------------------------------------------------------------
Start INITLoader v1.2.0
-------------------------------------------------------------------------
Mode select button: GPIO0
Boardname: initloader-151
Update on boot: 0
-------------------------------------------------------------------------
rtcMem
bootTimes since powerup: 3
boardMode: N
-------------------------------------------------------------------------
Connecting to WiFi AP
.....
WiFi connected

Device MAC: 68:C6:3A:C2:D3:97
Device IP Address: 192.168.88.244
MDNS responder started: http://initloader-151.local

To use mDNS Install host software:

Calling Home

Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp8266-v2.0.1.php
Download & Process update...[httpUpdate] Header read fin.

[httpUpdate] Server header:

[httpUpdate] - code: 200
[httpUpdate] - len: 5011
[httpUpdate] - MD5: 4821c161e617223cf5c9103e1412855d
[httpUpdate] ESP8266 info:

[httpUpdate] - free Space: 2748416
[httpUpdate] - current Sketch Size: 395392
[httpUpdate] - current version: 1.2.0_

Error: Header did not start with magic byte 0xE9
Reboot necessary!

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
vbb28d4a3
~ld

Error: Received Content-Length header is 0 Reboot necessary!

I’m using version 1.0.6 of the iotappstory library and 2.4.1 of the esp library. The IASLoader and IASBlink programs build successfully for my wemos D1 mini. I’ve uploaded the IASBlink program to IOTAppStory and loaded IASLoader to my D1 mini. When the D1 calls home to get an updated app, I get the following message repeated over and over. I checked the IAS logs and it show the request for the new app, but it never downloads and runs. Does anyone have any advice on how to correct this? Thanks!
-dave


Start INITLoader v1.2.0

Mode select button: GPIO0
Boardname: initloader-494
Update on boot: 0

rtcMem
bootTimes since powerup: 2
boardMode: N

Connecting to WiFi AP
.....
WiFi connected

Device MAC: Xxxxxxxxxx
Device IP Address: 192.168.1.166
MDNS responder started: http://initloader-494.local

To use mDNS Install host software:

For Linux, install Avahi (http://avahi.org/)
For Windows, install Bonjour (https://commaster.net/content/how-resolve-multicast-dns-windows)
For Mac OSX and iOS support is built in through Bonjour already

Calling Home

Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp8266-v2.0.1.php
Download & Process update... Error: Received Content-Length header is 0 Reboot necessary!

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v614f7c32
~ld

Configuration mode overcome

Hello! Thanks for this great library.
I was wondering if there is a way to prevent putting my esp into a configuration mode with AP on 192.168.0.1 in case of temporary wifi loss?
If call home procedure did not reach home I don't actually need to stop my sketch and put the ESP in a configuration mode, I just want to try to call home next time.

Device Mac not recognized under Arduino 1.0.6

Hi ,
I read and saw Andreas' video about the IOTAppstore, the idea is simply brilliant.

I made hours of tests in vain in the last two days, and always get the following message in logs:
"500 ESP MAC not configured for updates". In other words, the IOPAppStory doesnt see my project, or doesnt recognize my device. Am I right?
At the moment of execution, does the ESP contact the IOTAppStory site (via WIFI, since it has a connection)? Is the connection synchronous (http type) or is there a queue in place (MQTT type)?

I tried to compile with the version 2.0.0 (under branch developer under https://github.com/iotappstory/ESP-Library/tree/develop), by manually replacing the Master library by the new library. It compiles and loads well, but same result.
I would be greatful if anyone can respond.
Many thanks, Felix

Compatability with Wemos (Lolin) OLED shield v2.1.0

Hi,
First thanks to Christiaan Broeders for the help so far. I have run into the following issue when using Lolin OLED shield.

I am not using a button shield, as the OLED has buttons on it already (although they maybe need a LOLIN_I2C_BUTTON.h library to run). I can fit a button shield if you think it will help, but I heard in one of Andreas video that these integrated buttons are ok?

This is the shield, as you can see it already has buttons on it, and is 64 x 48
https://wiki.wemos.cc/products:d1_mini_shields:oled_shield

The OLED library I have on another project which works correctly:
https://github.com/theiothing/Adafruit_SSD1306-esp8266-64x48

This is the code used (commented out the chipId part as suggested:
https://codeshare.io/aV4VRR

Wemos D1 mini being used:
https://wiki.wemos.cc/products:d1:d1_mini

RESULTS:

Total blank black screen on OLED, nothing shows.

Serial monitor displays the following:
15:37:35.958 ->
15:37:35.958 ->
15:37:35.958 -> ⸮⸮2⸮
15:37:36.395 -> ets Jan 8 2013,rst cause:2, boot mode:(1,6)
15:37:36.395 ->
15:37:44.733 ->
15:37:44.733 -> ets Jan 8 2013,rst cause:4, boot mode:(1,6)
15:37:44.733 ->
15:37:44.733 -> wdt reset

Receiving Update Failed. Error (-103): Forbidden (403)

Hi,
I set up my board and attempt to update OTA but instead of fetching the new software I'm getting this.

 Calling Home
 Current App: IASBlink V1.0.0

 Checking for App(Sketch) updates from: iotappstory.com/ota/esp8266-v1.php
 Update Failed. Error (-103): Forbidden (403)
 Checking for App(Sketch) updates from: iotappstory.com/ota/esp8266-v1.php
 Update Failed. Error (-103): Forbidden (403)

 Checking for SPIFFS updates from: iotappstory.com/ota/esp8266-v1.php
 Update Failed. Error (-103): Forbidden (403)
 Checking for SPIFFS updates from: iotappstory.com/ota/esp8266-v1.php
 Update Failed. Error (-103): Forbidden (403)

 Returning from IOTAppStory.com
*-------------------------------------------------------------------------*
* button changed *

Can anybody help me fix this?

WLAN password field too short

The config variable "password" is defined as char password[STRUCT_CHAR_ARRAY_SIZE]; in IOTAppStory.h and STRUCT_CHAR_ARRAY_SIZE is set to 50 there while WPA2 passwords can be up to 63 characters long.
Please define STRUCT_PASSWORD_SIZE = 64 and then use that length for the password.

Disable the AP creation for a non IOTappStory project

Hello,

First of all, congratulation for all this great work !
It works great for me!

But when I do a little project on an ESP8266 that doesn't require IOTappStory, my device still creates an access point that leads to nowhere.

How can I disable this function, please?

Thank you for your help.

Problems with Download & Process update procedure

Hello!

Suddenly updates stop working properly.
Usually, after successfull downloading of a new firmware my esp32 reboots with it.
But yesterday I've got the following:

*-------------------------------------------------------------------------*
 Calling Home

 Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp32-v1.php
 Download & Process update...
 Checking for SPIFFS updates from: https://iotappstory.com/ota/esp32-v1.php
 Not Selected

 Returning from IOTAppStory.com
*-------------------------------------------------------------------------*

and the sketch debug messeges show that the firmware was not really updated.

If I reboot ESP manually it does not see any firmware updates:

*-------------------------------------------------------------------------*
 Calling Home

 Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp32-v1.php
 No updates necessary!

 Checking for SPIFFS updates from: https://iotappstory.com/ota/esp32-v1.php
 Not Selected

 Returning from IOTAppStory.com
*-------------------------------------------------------------------------*

What could be the cause for such a behavior?

v2 Beta: App keeps starting in config mode, not showing parameters on config page

I tried writing a very small app today on the v2 library and control panel which I received an invite for.
After loading the IASLoader.ino from the v2 library I was able to connect to my Wifi, link the device to my IAS account and setup a project with the app I uploaded.

The device seems to have downloaded the app successfully, since the status page of the device now displays the app and project name.

However there are 2 problems:

  • I don't get to see the parameters I configured in my app using the addField() functions
  • When I exit the configuration mode, the firmware seems to go into WDT reset. I checked and the library is calling ESP.restart() and if I remember correctly that should not result in a WDT reset

This is my apps source code:

#define COMPDATE __DATE__ __TIME__
#define MODEBUTTON D3                                       // Button pin on the esp for selecting modes. D3 for the Wemos!

#include <ESP8266WiFi.h>
WiFiClient nsClient;

#include <PubSubClient.h>
PubSubClient MQTTClient(nsClient);

#include <IOTAppStory.h>                                    // IotAppStory.com library
IOTAppStory IAS(COMPDATE, MODEBUTTON);                      // Initialize IotAppStory

//MQTT Stuff
char* cMQTTServer = "";
char* cMQTTTopicPrefix = "";
char* cMQTTServerPort = "1883";
String strMQTTTopicPrefix;
unsigned long lLastMQTTConnectAttempt;
#define MQTT_CONNECT_INTERVAL 1000

//IAS Params
char* cCallHomeInterval = "86400";

//Bell params
bool bBellPressed = false;
bool bBellPressSent = false;

void setup() {
   Serial.begin(115200);

   //IAS Stuff
   IAS.preSetDeviceName("Doorbell");
   IAS.addField(cMQTTServer, "MQTTServeraddress", 16);
   IAS.addField(cMQTTServerPort, "MQTT Server port", 6);
   IAS.addField(cMQTTTopicPrefix, "MQTT topic prefix", 100);
   IAS.addField(cCallHomeInterval, "Call home interval (seconds)", 6);
   IAS.begin('P');
   IAS.setCallHome(true);
   IAS.setCallHomeInterval(atoi(cCallHomeInterval));
   IAS.callHome();

   MQTTClient = PubSubClient(cMQTTServer, atoi(cMQTTServerPort), nsClient);
   strMQTTTopicPrefix = String(cMQTTTopicPrefix);

   //Make sure MQTT Topic prefix starts and ends with a slash
   if (!strMQTTTopicPrefix.startsWith("/"))
   {
      strMQTTTopicPrefix = "/" + strMQTTTopicPrefix;
   }
   if (!strMQTTTopicPrefix.endsWith("/"))
   {
      strMQTTTopicPrefix = strMQTTTopicPrefix + "/";
   }

   MQTTConnect();

   Serial.printf("Doorbell pressed!");
   //The doorbell button will also reset the ESP from deepsleep, so we set bellPressed to true hardcoded
   bBellPressed = true;
}

void loop() {
   IAS.buttonLoop();
   MQTTClient.loop();
   if (bBellPressed) {
      if (!bBellPressSent) {
         GotoNormalSleep();
      }
   }
}

bool MQTTConnect() {
   if (!MQTTClient.connected()
      && millis() - lLastMQTTConnectAttempt > MQTT_CONNECT_INTERVAL)
   {
      lLastMQTTConnectAttempt = millis();
      if (MQTTClient.connect(String("ESP-" + ESP.getChipId()).c_str()))
      {
         return true;
      }
      else
      {
         Serial.printf("failed, rc=%i, try again in 1 second\r\n", MQTTClient.state());
         return false;
      }
   }
}

void GotoNormalSleep() {
   unsigned long ulSleepTime = atoi(cCallHomeInterval) * 1000;
   Serial.printf("Going to sleep for %lu seconds...\r\n", ulSleepTime / 1000000);
   yield();
   ESP.deepSleep(ulSleepTime, WAKE_RF_DEFAULT);
}

This is the serial output I get from the ESP:

*-------------------------------------------------------------------------*
 Start INITLoader v1.2.0
*-------------------------------------------------------------------------*
 Mode select button: GPIO0
 Boardname: initloader-968
 Update on boot: 0
*-------------------------------------------------------------------------*
 rtcMem
 bootTimes since powerup: 5
 boardMode: C
*-------------------------------------------------------------------------*
 Connecting to WiFi AP
 .....
 WiFi connected

 Device MAC: XX:XX:XX:XX:XX:XX
 Device IP Address: 192.168.x.x
 MDNS responder started: http://initloader-968.local

 To use mDNS Install host software:
 - For Linux, install Avahi (http://avahi.org/)
 - For Windows, install Bonjour (https://commaster.net/content/how-resolve-multicast-dns-windows)
 - For Mac OSX and iOS support is built in through Bonjour already
*-------------------------------------------------------------------------*




 C O N F I G U R A T I O N   M O D E
 STA mode. Open 192.168.x.x
 Exit config

Soft WDT reset

ctx: cont 
sp: 3fff2250 end: 3fff27e0 offset: 01b0

>>>stack>>>
3fff2400:  3fff16b8 000004e2 000004e2 4010020c  
3fff2410:  3fff5824 00000006 3fff5394 4010068c  
3fff2420:  000000ff 00000006 3fff5394 4020f810  
3fff2430:  a96d7c28 5d7a579a 1492b4f6 402060e3  
3fff2440:  3fff5824 00000006 3fff5394 4020723a  
3fff2450:  00000000 3fff574c 00000006 402214f0  
3fff2460:  00000100 3fff574c 3fff5829 40222110  
3fff2470:  00000001 00000014 9a44c18d cb9a9834  
3fff2480:  535cdd7f 140cccdf 98f32f84 3fff5829  
3fff2490:  00000004 00000000 3fff574c 402215b0  
3fff24a0:  00000004 00000000 3fff574c 40222587  
3fff24b0:  3fff5704 72a7e918 e5ca54fc 3fff5394  
3fff24c0:  00000000 600011f0 3fff561c 3fff5394  
3fff24d0:  00000000 00000004 00000004 40206ad8  
3fff24e0:  00000021 00001221 00000064 4020fa50  
3fff24f0:  00000050 00000000 00000031 3fff5829  
3fff2500:  3fff5829 00000004 3fff574c 3fff5829  
3fff2510:  00000004 00000004 3fff574c 40221ef0  
3fff2520:  00000061 3fff5829 3fff574c 402222cc  
3fff2530:  0000000f 3fff585c 3fff574c 401004d8  
3fff2540:  3fff2590 0000000e 00000010 00000000  
3fff2550:  00000000 3fff53cc 3fff574c 01000000  
3fff2560:  3fff2590 3fff531c 3fff574c 40222058  
3fff2570:  000001bb 3fff531c 3fff5374 3fff3cf4  
3fff2580:  0000a9ca 3fff531c 3fff5374 40206f95  
3fff2590:  3fff5374 00000000 3fff5394 40206586  
3fff25a0:  3fff5394 00000000 3fff26a4 00000000  
3fff25b0:  000001bb 3fff5374 3fff3cf4 00000000  
3fff25c0:  000001bb 3fff5374 3fff3cf4 4020731d  
3fff25d0:  3ffea3e8 c7c12e25 3ffea3e8 c7c12e25  
3fff25e0:  3fff16f8 00000000 3fff2670 40209e50  
3fff25f0:  00000000 3fff16d8 3fff262c 4010068c  
3fff2600:  3fff1111 00000000 3fff2670 4020a620  
3fff2610:  3fff10d8 3fff16d8 3fff2670 402031f0  
3fff2620:  00000000 00000000 00000000 00000000  
3fff2630:  3ffe9814 00000470 00000470 4010020c  
3fff2640:  3fff16f8 3ffe8e24 3fff26e0 3fff12d8  
3fff2650:  3fff16f8 3ffe8e24 3fff10d8 4020a6ce  
3fff2660:  3fff16f8 3ffe8e24 3fff10d8 40203276  
3fff2670:  3fff49a4 3fff5374 3fff3cf4 0000000f  
3fff2680:  0000000f 000001bb 3f011f40 3fff547c  
3fff2690:  0000001f 00000016 3fff5234 0000000f  
3fff26a0:  00000005 3fff54a4 0000016f 00000166  
3fff26b0:  3fff5334 0000001f 0000000f 3fff535c  
3fff26c0:  0000000f 00000000 00000000 00000000  
3fff26d0:  00000000 ffffffff 3fff1600 00000000  
3fff26e0:  00000000 00000000 00000000 3fff52e4  
3fff26f0:  0000002f 0000002d 3fff16f8 4020e65c  
3fff2700:  3fff16f8 3fff1448 3fff10d8 40204c6d  
3fff2710:  3fff3ba4 0f0aa8c0 40202930 4020fcd8  
3fff2720:  3fff1448 3fff16f8 3fff16f8 4020e5e8  
3fff2730:  3fff1448 3fff16f8 3fff1601 4020e60c  
3fff2740:  00000001 3fff11b3 3fff3d0c 40202d30  
3fff2750:  00000000 00000000 00000000 4024eda0  
3fff2760:  3fff12d8 3fff16f8 3fff10d8 40204d8c  
3fff2770:  00000000 00000000 00000000 4020f810  
3fff2780:  00000046 00000000 3fff10d8 402022df  
3fff2790:  3fff27b0 3fff10cc 3fff10d8 3fff17b8  
3fff27a0:  3fffdad0 00000000 3fff10d8 40202413  
3fff27b0:  3fff3a14 00000000 402022b4 40202218  
3fff27c0:  feefeffe 00000000 3fff17b1 4020fa1c  
3fff27d0:  feefeffe feefeffe 3fff17c0 4010070c  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
vf6d232f1
~ld






*-------------------------------------------------------------------------*
 Start INITLoader v1.2.0
*-------------------------------------------------------------------------*
 Mode select button: GPIO0
 Boardname: initloader-968
 Update on boot: 0
*-------------------------------------------------------------------------*
 rtcMem
 bootTimes since powerup: 6
 boardMode: C
*-------------------------------------------------------------------------*
 Connecting to WiFi AP
 .....
 WiFi connected

 Device MAC: XX:XX:XX:XX:XX:XX
 Device IP Address: 192.168.x.x
 MDNS responder started: http://initloader-968.local

 To use mDNS Install host software:
 - For Linux, install Avahi (http://avahi.org/)
 - For Windows, install Bonjour (https://commaster.net/content/how-resolve-multicast-dns-windows)
 - For Mac OSX and iOS support is built in through Bonjour already
*-------------------------------------------------------------------------*




 C O N F I G U R A T I O N   M O D E
 STA mode. Open 192.168.x.x

One backslash too much escaping HTML code

One backslash too much in HTTP_WIFI_FORM[] and should be removed (errors compiling):

const char HTTP_WIFI_FORM[] PROGMEM = "<div id=\"po\"><div id=\"m\"></div></div><div id=\"cnt\"><h1>WIFI CONNECTION</h1><table>{r}</table><br><br><label>SSID</label><input id=\"s\" name=\"s\" maxlength=50 placeholder=\"SSID\"><label>Password</label><input id=\"p\" name=\"p\" maxlength=50 placeholder=\"password\"><br><br><button class=\"btn\" onclick=\"ld('\wsa')\">Save</button></div>";

onclick=\"ld('\wsa')\" should be onclick=\"ld('wsa')\"

Problems registering/activating new device today 28/2/19

Hey.
Firstly, Thank-you, this is a fantastic project, Its helping me a great deal in my IOT dev.

Platform/environment:
NodeMCU 0,9 12E
Core - 2.4.2 (Int), Arduino- 2.4.1
IDE:Arduino/Windows 64 1.8.5
IOTAPPSTORY: 2.0.0
INITLoader V1.2.0

I have a few devices all registered without issues, today no, I am having no luck at all!

Each time I fill in a device name and board type and Next, nothing happens :/
I can access the wifi scan pages ok, so I know my device is connected to the wifi and I have checked that the wifi is online.

Tried already:

  1. Erased and re-flashed, ESP and uploaded un-edited INITLoader V1.2.0
  2. Web config page, (re) register device different Windows browsers, various names and NodeMCU types
  3. Web config on Android devices as per 2

What am I doing wrong?

Patrick

Error: Unknown device. Please activate in config first!

I am having difficulty getting my modules recognized with the new library

These modules worked fine under 1.0.6

I have installed the 1.1.0 library and re-ran the 1.1.0 IASLoader sketch. Re-entered Wifi credentials fine and activated with a new activation code. On reboot I get the error message in the subject line

If I enter configuration mode by holding the GPIO 0 low the configuration web page loads fine. Accessing on a PC using Chrome and the using the local IP address. All buttons work except for the IOTAppstory button (which goes gray and stays gray). Serial debug message *WM: [HTTP] GET... failed, try again

Can't connect to configuration AP after another is configured

I'v configured my device at home without problem. I connected to the ap with my phone, accessed 192.168.4.1 and all went ok. But Now I carried the device to other place.

Checking the serial output I see it enteres configuration mode, but with the same phone I've configured it earlier I can't get the configuration page. Sometimes the AP is not listed. Sometimes the AP disappears when I'm connecting. Other times I can connect but it waits forever when trying to connect to 192.168.4.1. Other times it reports "ERR_ADDRESS_UNREACHABLE".

Any ideas?

...........
No Connection. Going into Configuration Mode
-------------------------------------------------------------------------
Entering config mode.
-------------------------------------------------------------------------

C O N F I G U R A T I O N M O D E
AP mode. Connect to Wifi AP "syncrolights"
And open 192.168.4.1

Making changes to app settings when no access to physical device

Is it possible to make changes to the app when I don't have physical access to the machine?
I have the VirginSoil_full demo loaded onto my device from the control panel. I can make changes when I put the device in config mode my holding the button down.

My question is: Is it possible to make changes to the settings from the control panel? For instance, the time between calls home.

On the device page in the control panel, when I click on edit next to my device, it takes me to a blank control panel page. Nothing is shown there. Using 2.0 library on a NodeMCU 1.0 12E

PlatformIO errors on pins the specific board is missing

Compiling on PlatformIO for the WeMos D1 R2 & mini the compiler errors on

#elif defined ESP8266_WEMOS_D1MINI || defined ESP8266_WEMOS_D1MINILITE || defined ESP8266_WEMOS_D1MINIPRO || defined ESP8266_NODEMCU || defined WIFINFO

		// DEBUG_PRINTLN("- Special ESP's -");
		if      (orgVal == "D0"  || orgVal == "16")   return D0;
		else if (orgVal == "D1"  || orgVal == "5")    return D1;
		else if (orgVal == "D2"  || orgVal == "4")    return D2;
		else if (orgVal == "D3"  || orgVal == "0")    return D3;
		else if (orgVal == "D4"  || orgVal == "2")    return D4;
		else if (orgVal == "D5"  || orgVal == "14")   return D5;
		else if (orgVal == "D6"  || orgVal == "12")   return D6;
		else if (orgVal == "D7"  || orgVal == "13")   return D7;
		else if (orgVal == "D8"  || orgVal == "15")   return D8;
		else if (orgVal == "D9"  || orgVal == "3")    return D9;
		else if (orgVal == "D10" || orgVal == "1")    return D10;
		else                                          return D0;

Lines 1003-1017
as D9 and D10 are not defined for this board. (but called RX and TX).

Not knowing the function of this code, maybe this is not a good solution, but I propose to consider return 3 and 1 in stead?

Spotty data-collection after IAS-migration

A small experience report;

I have some sensors collecting data (mostly temperatures with DS18B20's; see https://github.com/msiebuhr/esp8266-thermologger), which I've migrated to update over IAS, but now I get very little/spotty data back from the devices:

screen shot 2017-10-06 at 11 36 36

I don't quite know what exactly is wrong, just that I Prometheus doesn't like collecting data that well.

My working theory is that as IOTAppStory IAS(APPNAME, VERSION, COMPDATE, MODEBUTTON) implicitly sets the devices' hostname to APPNAME, causes things to go sideways as a few devices now have the same hostname on the local net. Playing with WiFi.hostname() doesn't seem to change much...

Another reason could be that I now have something in the loop() {}-function causing the async-things to fail somehow (see https://github.com/msiebuhr/esp8266-thermologger/blob/a26dda945f39fa8ef7c4469a99fb384a2596cdbb/esp8266-thermometer-ds18b20.ino#L160-L166)

Final theory is that I have both NodeMCU's and WeMos D1 mini's running the code (I usually use WeMos as compile target), and that might be difference enough to make things go wrong. But then some models should work, and they don't see any difference across device models.

callHome defaults SPIFFS

If manually invoked callHome, you can turn SPIFFS off:

IAS.callHome(false);

void IOTAppStory::callHome(bool spiffs /*= true*/) {

but the bool will default to be true, if called through the timer, after preSetAutoUpdate(true) or the button press. I would expect this to be configurable too?

this->callHome();
callHome();
callHome();

After 5 days of not calling home, can't get to check for updates

Here is my log output:

-------------------------------------------------------------------------
Calling Home

Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp8266-v2.0.1.php

Checking for SPIFFS updates from: https://iotappstory.com/ota/esp8266-v2.0.1.php

Returning from IOTAppStory.com
-------------------------------------------------------------------------

setup

  //IAS.begin();
  IAS.begin('P');                                     // Optional parameter: What to do with EEPROM on First boot of the app? 'F' Fully erase | 'P' Partial erase(default) | 'L' Leave intact

  IAS.setCallHome(true);                              // Set to true to enable calling home frequently (disabled by default)
  IAS.setCallHomeInterval(7200);                        // Call home interval in seconds, use 60s only for development. Please change it to at least 2 hours in production


  //-------- Your Setup starts from here ---------------
  yield();
  Blynk.config(auth);
  Blynk.connect(3333);  // timeout set to 10 seconds and then continue without Blynk
  while (Blynk.connect() == false) {
      Serial.println("Blynk Connecting");
    // Wait until connected
  }
  IAS.setCallHome(false);   

in my loop, I have a IAS.callHome(); command that I trigger with a blynk button.

Its been 5 days since I've attempted to call home. I know the code is running because the same button turns on an led, and in the log, it is calling home, but there doesn't seem to be a response. The blynk code has not disconnected for a few days, around the 12th its been connected since.

IOTAppStory::addField() crashes with heap variables

I have the feeling addField() somehow gets all confused if I use heap variables.

#define SENSIDX 2 // Number of sensors on bus - 1.
char* sensorNames[SENSIDX];
char* sensorLabels[SENSIDX];


  for(int index = 0; index <= SENSIDX; index++){
    sensorLabels[index] = (char*) malloc(15);
    sensorNames[index]  = (char*) malloc(16 + 1); // addField length parameter seems to be strlen not bytes

    sprintf(sensorLabels[index], "Sensor %d Name", index);
    strcpy(sensorNames[index], "Unnamed");

    IAS.addField(sensorNames[index], sensorLabels[index], 16, 'L');
  }

I suspect that the const for label is meant seriously?

Apart from the fact that I deeply dislike that solution. It also doesn't work. (Guru meditation)

const char* sensorLabels[] = {"Sensor 0", "Sensor 1", "Sensor 2"} ;

No mallocs and strcpy this time.

I'm no expert. But that looks const enough to me.

Is const char *fieldLabel indeed the problem here?

Can I perhaps mark it const and promise I won't change the value at runtime but initialise it dynamically?

Captive portal config and http(s) issues

Hello, apologies if someone has asked these questions or there are details somewhere in the documentation, I couldn't find anything. I posted this in Discord but no-one replied there so I have posted here also.

Is it possible to set the IAS configuration website to be a "captive portal" when the device is in AP mode? So that it behaves like WiFiManager and prompts for sign-in?

Also is there anyway to use HTTPS but to fall back to HTTP if that fails? Or is HTTP/HTTPS only a compile time option with the #define? Either that or to set HTTPS to retry without cert verification if it fails? Only if there isn't a way to fail-over then if the SSL certificate ever changes it will no longer be possible to update automatically (especially on ESP32 for which there is an embedded RootCA in the code) rendering the device stuck until it can be retrieved for manual re-programming

I know that the RootCA will last longer than the site cert but that is only relevant if any replacement/renewed site cert is issued against the same root and that isn't always the case with many providers - many providers start issuing against new root CAs significantly before the expiry of the old to ensure a smooth crossover and some large providers issue against a pool of roots to minimise the impact of having a revoke one.

One final question - is it possible to use IAS for a project build with the full ESP-IDF rather than in the Arduino IDE?

The project I'm intending for this will use an ESP32 and be built outside the Arduino environment as that doesn't yet support the required ESP-ADF. The project is intended for use by people with severe visual disability and so reliable remote updates with no user interaction are important.

Hopefully someone can help?

Document API calls

From browsing the examples, there are quite a few API-calls that aren't really explained unless one reads some (all?) of the example code quite carefully.

Some basic documentation in the README.md would be really nice!

IOTAPPStory.com server connection from Mweb Cape Town

Hi, I raised this issue earlier today and closed it thinking it as solved.
But no.
The site: https://iotappstory.com/cp times-out here for me in South Africa (Mweb)

Pinging iotappstory.com [37.46.193.199] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.

Ping statistics for 37.46.193.199:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

library to v. 2.1.0 RC 1.1 - No call home

On one of my projects i updated library to v. 2.1.0 RC 1.1.
Suddenly after update (via IOTAppStory).
My device stopped calling home. Does not appear in dashboard or Log.

This is probably related to:

IAS.setCallHome(true);
and
void IOTAppStory::setCallHome(bool callHome) {} // <----- deprecated left for compatibility. Remove with version 3.0.0

PS: Even restarting the device does not force it to call home!?
PS1: Another strange behavior is that Wi-Fi re-connect on disconnect does not work anymore ?!

Device name on config page not reflected in IAS::readConfig(configStruct)

After device set-up, the device name I entered during set-up is reflected in the config mode status page. IOTAppStory::readConfig(configStruct &config) returns a structure with deviceName set to the default "yourESP."

Example snippet:

configStruct IASConfig;
IAS.readConfig(IASConfig);
char topicBuffer[64];
sprintf_P(topicBuffer, PSTR("%s"), IASConfig.deviceName);
Serial.print(topicBuffer);

This code will print "yourESP", yet the Device Name on the config status page will show "Truck-Cab" (the name set during the initial device set-up).

My immediate goal is to use, in my code, the device name that I assigned on initial device setup

  1. Can I access that information for use in my code?
  2. Can the configuration mode be modified to allow editing of the assigned device name?
  3. Should the writeConfig method be storing the device name assigned at initial set-up?

I'm happy to make any necessary modifications to the IAS code, but I've been going through it for the last several hours, and can't find where the device name entered during set-up is stored, or where I could access that information to store it using the writeConfig method, or where I can modify the configuration pages. Any help, pointers, or direction would be appreciated.

No retry?

It seems when the lib doesn't find the preconfigured WiFi at startup, it goes to config mode and waits forever.
Shouldn't it retry every x minutes, or scan continuously and switch back to normal mode when the configure network appears again?

Exception (28) during WiFiManager Close operation

Using the IASLoader for v1.1.0, right after configuring the device on the WiFiManager, after choosing "Close" to close the WiFiManager the Wemos D1 Mini + OLED Shield generates an Exception and crashes. The dump message is generated bellow.
For some reason the App configuration (besides WiFi config) is not saved as noticed in the attempts to update Firmware.
One important thing is that during the IOTAppStory configuration in the WiFiManager portal, the App name in the web appears blank and so the dropdown options. I was not able to make it visible by any means. This may be the cause for the crash.

img_1534

[...]


*WM: AP IP address: 
*WM: 192.168.4.1
*WM: HTTP server started
*WM: Handle root
*WM: Server Close

Exception (28):
epc1=0x402385de epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000098 depc=0x00000000

ctx: cont 
sp: 3fff0fc0 end: 3fff17b0 offset: 01a0

>>>stack>>>
3fff1160:  40101be1 3ffee288 00000001 4021d016  
3fff1170:  402329f4 3fff2984 3fff30b4 3fff2bd4  
3fff1180:  3fff283a 00000000 00000000 0000011b  
3fff1190:  0000001a 018524b1 401021f2 00000100  
3fff11a0:  3fff283a 40104456 3fff2984 3fff2bd4  
3fff11b0:  00000036 3fff1c10 3fff2984 401043d1  
3fff11c0:  3fff2804 018524b1 00002200 4000050c  
3fff11d0:  3fffc278 40101f8c 3fffc200 3fff1c45  
3fff11e0:  3fff1c10 3fff1c10 3fff2804 4010453d  
3fff11f0:  40218e57 3fff2804 3fff283a 40218e60  
3fff1200:  00000008 3fff1a94 3fff12f0 08000000  
3fff1210:  60000200 08000000 08000000 3fff1a98  
3fff1220:  3fff1c45 00000003 3fff1c10 4021ec64  
3fff1230:  4025d400 00000020 003ff000 00000030  
3fff1240:  00000002 3fff2804 3fff12e8 4020cef2  
3fff1250:  00000000 00000000 00000000 3fff2848  
3fff1260:  3fff2804 3fff38e8 3fff1c10 4021eebc  
3fff1270:  3fff0000 3fff12e8 3fff1650 4020cf10  
3fff1280:  00000014 3fff38e8 3fff2804 4021f96c  
3fff1290:  ffffffff 00000000 3ffea971 00000008  
3fff12a0:  3fff38e4 000000ff 00000000 00000006  
3fff12b0:  3fff1b6c 00000000 00000000 401004d8  
3fff12c0:  00000000 4000422e 60000200 3fff1c10  
3fff12d0:  3fff38e4 3fff2874 3fff3894 4021f9ac  
3fff12e0:  3fff1c10 00000000 00000000 40218ef8  
3fff12f0:  3fff068c 000001c1 000001c1 4021f9d2  
3fff1300:  3fff1c10 00000000 00000000 402200d3  
3fff1310:  40106739 3fff2ae4 4025d400 4021d016  
3fff1320:  3fff1c10 00000001 3fff38e4 4021cc0c  
3fff1330:  00000b84 3fff38e8 3fff285c 3fff285c  
3fff1340:  00000000 00000000 3fff285c 00000000  
3fff1350:  00000000 00000004 3fff38e4 40218fd5  
3fff1360:  00000000 00000000 3fff38e4 4021975f  
3fff1370:  3fff068c 00000000 3fff3f1c 40219787  
3fff1380:  00000000 00000000 3fff2c9c 40203aef  
3fff1390:  4024d42e 00000000 3fff2c5c 40203ca0  
3fff13a0:  4024e5c3 00000001 3fff2c5c 4020d1fd  
3fff13b0:  3fff1db4 3fff0408 3fff2c5c 40206cdc  
3fff13c0:  00000001 3fff0408 3fff1650 402097de  
3fff13d0:  00000004 3fff26d8 00000004 00000000  
3fff13e0:  feefeffe feefeffe feefeffe 00000000  
3fff13f0:  3fff1410 00000000 3fff1650 3fff1410  
3fff1400:  3fff1410 00000000 3fff0098 402069e8  
3fff1410:  00000000 00000000 00000000 00000000  
3fff1420:  00000001 00000000 00000000 00000000  
3fff1430:  00000000 00000000 00000001 00000000  
3fff1440:  00000000 00000000 00000000 00000000  
3fff1450:  00000001 00000000 00000000 00000000  
3fff1460:  00000000 00000000 00000001 00000000  
3fff1470:  00000000 00000000 00000000 00000000  
3fff1480:  00000001 00000000 00000000 00000000  
3fff1490:  00000000 00000000 00000001 00000000  
3fff14a0:  00000000 00000000 00000000 00000000  
3fff14b0:  00000001 00000000 00000000 00000000  
3fff14c0:  00000000 00000000 00000001 00000000  
3fff14d0:  00000000 00000000 00000000 00000000  
3fff14e0:  00000001 00000000 00000000 00000000  
3fff14f0:  00000000 00000000 00000001 00000000  
3fff1500:  00000000 00000000 00000000 00000000  
3fff1510:  00000001 00000000 00000000 00000000  
3fff1520:  00000000 00000000 00000001 00000000  
3fff1530:  00000000 00000000 00000000 00000000  
3fff1540:  00000001 00000000 00000000 00000000  
3fff1550:  00000000 00000000 00000001 00000000  
3fff1560:  00000000 00000000 00000000 00000000  
3fff1570:  00000001 00000000 00000000 00000000  
3fff1580:  00000000 00000000 00000001 00000000  
3fff1590:  00000000 00000000 00000000 00000000  
3fff15a0:  00000001 00000000 00000000 00000000  
3fff15b0:  00000000 00000000 00000001 00000000  
3fff15c0:  00000000 00000000 00000000 00000000  
3fff15d0:  00000001 00000000 00000000 00000000  
3fff15e0:  00000000 00000000 00000001 00000000  
3fff15f0:  00000000 00000000 00000000 00000000  
3fff1600:  00000001 00000000 00000000 00000000  
3fff1610:  00000000 00000000 00000001 00000000  
3fff1620:  00000000 00000000 00000000 00000000  
3fff1630:  00000001 00000000 00000000 00000000  
3fff1640:  00000000 00000000 00000001 00000000  
3fff1650:  3fff00a4 3fff2c14 00000000 00000000  
3fff1660:  000668a0 00000000 00000a99 3ffe91bd  
3fff1670:  00000004 3fff26c4 3fff1674 3ffe9780  
3fff1680:  00000000 3ffe9780 00000000 3ffe9780  
3fff1690:  00000000 3ffe9780 00000000 3ffe9780  
3fff16a0:  00000000 3ffe9780 00000000 00000000  
3fff16b0:  ffffffff 00000001 3ffe9288 00000000  
3fff16c0:  01000035 00000000 00000000 00000067  
3fff16d0:  00000003 3fff0408 3fff06c8 4020ef4c  
3fff16e0:  a064a8c0 00ffffff 0164a8c0 4020efe8  
3fff16f0:  00000003 3fff0408 3fff0790 3fff0298  
3fff1700:  3fff1650 3fff1650 40210600 3fff0790  
3fff1710:  00000046 3fff06c8 3fff0098 00000001  
3fff1720:  00000046 3fff0298 3fff0098 40206a96  
3fff1730:  00000046 3fff0298 3fff0098 40206be5  
3fff1740:  3fffdad0 00000000 3fff0098 40202417  
3fff1750:  3fff1770 3fff0088 3fff0098 3fff0788  
3fff1760:  3fffdad0 00000000 3fff0098 402024fd  
3fff1770:  3fff233c 00000000 402023ec 4020238c  
3fff1780:  00000000 00000000 00000000 feefeffe  
3fff1790:  feefeffe 00000000 3fff0780 40210644  
3fff17a0:  feefeffe feefeffe 3fff0790 40100710  
<<<stack<<<

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)

load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v4ceabea9
~ld




 EEPROM Configuration found


*-------------------------------------------------------------------------*
 Start INITLoader V1.1.0
*-------------------------------------------------------------------------*
 Mode select button: GPIO0
Boardname: INITLoader_********
 Automatic update: 0
*-------------------------------------------------------------------------*
 rtcMem
 markerFlag: U
 bootTimes since powerup: 9
 boardMode: N
*-------------------------------------------------------------------------*
 Connecting to WiFi AP
 . 
 WiFi connected
[...]

 Calling Home
 Current App: INITLoader V1.1.0

 Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp8266-v2.php
 Error: Unknown device. Please activate in config first!

 Checking for App(Sketch) updates from: https://iotappstory.com/ota/esp8266-v2.php
 Error: Unknown device. Please activate in config first!

 Checking for SPIFFS updates from: https://iotappstory.com/ota/esp8266-v2.php
 Error: Unknown device. Please activate in config first!

 Checking for SPIFFS updates from: https://iotappstory.com/ota/esp8266-v2.php
 Error: Unknown device. Please activate in config first!

 Returning from IOTAppStory.com
*-------------------------------------------------------------------------*



                               ----------------   N O   A P P   L O A D E D   ----------------

----------------  P L E A S E  C R E A T E   P R O J E C T   O N   I O T A P P S T O R Y . C O M   ----------------

[...]

Dashboard - system status information - Feature request

Hey, I had an issue which turned out not to be on my side, it was fixed quickly and it is working great now.
However I spent 3 hrs trouble-shooting my NodeMCU project in my lab.
It would be really good to know when the server is having issues/uprades/outages etc.
Perhaps on the spare dash board window in the bottom right-hand side?
P

Feature request: Nextion Upload Support

I am quite often using Nextion Displays in Projects with the ESP32.
So when I want to update the firmware of the ESP, that often includes new firmware for the Touchscreen.
It is already possible to upload the new compiled .tft-File to the Display via the ESP using the NexUpload.h from the official Nextion Arduino Library (When the file is already stored on the hardware/SD-Card in your system).

It would be an awesome feature for future releases, if you could not only upload a new .bin file to the ESP but also upload a new .tft file to the Nextion via your Webservice =)

Values with double quotes in text areas not working properly

When I enter a value that includes double quotes into a text area field, the value is accepted and saved properly. However when I later enter configuration mode and select the setting tab the resulting page is blank. An example value is below. I see the same result for both one line and multi line values that include double quotes.

{ "name": "Test Module 1", "switch": [{ "name": "Test Switch 1", "pin": "D1", "led": ["D4"] }] }

2.1.0 Dependency on ESPNexUpload Library

When compiling the IASLoader example, I get the following error message:

In file included from /home/cbaker/Arduino/libraries/IOTAppStory-ESP/src/espressif/updateNextion.cpp:2:0:
/home/cbaker/Arduino/libraries/IOTAppStory-ESP/src/espressif/updateNextion.h:6:27: fatal error: ESPNexUpload.h: No such file or directory
  #include <ESPNexUpload.h>

This occurs in 2.1.0-RC1 and later. It does not occur in 2.0.2.
The ESPNexUpload library is not mentioned as one of the prerequisites.

Full compilation log for reference:
ESP-Library-2.1.0-RC2-1-g88f0289.txt

Wemos-IASLoader:90:70: error: 'chipId' is not captured

Arduino IDE 1.8.8
ESP-Library-2.0.1
Wemos D1 mini (genuine)

Getting the following error when verifying:

**C:\Program Files (x86)\Arduino\libraries\ESP-Library-2.0.1\examples\Wemos\Wemos-IASLoader\Wemos-IASLoader.ino: In lambda function:

Wemos-IASLoader:90:70: error: 'chipId' is not captured

dispTemplate_threeLineV2(F("Connect to"), F("Wi-Fi"), "xxxxx-" + chipId);

exit status 1
'chipId' is not captured**

DX not defined for many ESP8266 boards

dPIinConv expects that a series of data pin constants are defined (D0, D1, etc.) These constants are not defined for many board types (Generic ESP2866 Module, Adafruit HUZZAH ESP8266)

C:\Users\XXXXXX\Documents\Arduino\libraries\ESP8266-Library-master\src\IOTAppStory.cpp: In member function 'int IOTAppStory::dPinConv(String)':

C:\Users\XXXXXX\Documents\Arduino\libraries\ESP8266-Library-master\src\IOTAppStory.cpp:728:56: error: 'D0' was not declared in this scope

   if      (orgVal == "D0"  || orgVal == "16")   return D0;

This issue was also present in 1.0.6

The issue may lie in the Arduino ESP8266 library. Here is the pins_arduino.h file for the Adafruit board

/*
  pins_arduino.h - Pin definition functions for Arduino
  Part of ESP8266 core for Arduino - https://github.com/esp8266/Arduino
  Copyright (c) 2007 David A. Mellis
  Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015.
  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.
  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.
  You should have received a copy of the GNU Lesser General
  Public License along with this library; if not, write to the
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  Boston, MA  02111-1307  USA
  $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
*/

#ifndef Pins_Arduino_h
#define Pins_Arduino_h

#include "../generic/common.h"

#define PIN_WIRE_SDA (4)
#define PIN_WIRE_SCL (5)

static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;

static const uint8_t LED_BUILTIN = 0;
static const uint8_t BUILTIN_LED = 0;

#endif /* Pins_Arduino_h */

Enum for FieldType

char type;

I propose to replace the magic char with an enum for the fieldtype:

enum FieldType {
  textLine  = 'L',
  Textarea  = 'T',
  Number    = 'N',
  Checkbox  = 'C',
  Select    = 'S',
  Interval  = 'I',
  Pinnumber = 'P',
  timeZone  = 'Z'
};

Good idea?

PS: I am not expert enough to assess whether using a char-enum is the best solution (compared to ordinary enum + function to get char)

Re-configure

Is there any function call to force the device enter AP mode for re-configuring wifi even if it is already connected to one?

Documentation Suggestion - IAS.onFirstBoot and WiFi.onEvent

I see that there is an undocumented callback for IOTAppStory::onFirstBoot(THandlerFunction value). I am setting-up some EEPROM storage and find this callback very useful, and others may as well. I suggest adding it to the wiki.

Similarly, IOTAppStory uses the WiFi library, but does not appear to use WiFi.onEvent; please correct me if I am wrong. It might, perhaps, be useful to note that the callback is unused, and thus available for use in our applications.

Finally, I'm new to (and thus still learning) the github thing, so please let me know if there is a more appropriate way to make such suggestions.

Questions about Version 2.0

Hi Onno,
After brief testing of new version, I have some questions:

  1. Now in initial Wifi connection webpage we cannot select a network from list. Only typing from scratch. Old version was able to show a dropdown list of available networks. This was very convenient.
    Are you planning to make the same feature in ver. 2.0?
  2. After connection and redirection, new webpage asks us to enter the login+pwd for IOTAppstory account. Previous version (with access code generation) was safer. Now login and password must be told to each connected device - is this safe enough?

preset project name and app type

Hello, and it possible to define the characteristic directly in the code arduino preset without passes by the web page?
preset project name and app type ?
?
and it possible to increase the limitation of the 20 devices?
Thank you for your work. Your solution and just magic

Activation codes should be in code-font and properly spaced

It can be difficult to differentiate between I, l, 1 and a few other combinations due to the choice of font, ex:

screen shot 2017-10-06 at 11 53 29

This would be fixed by using a monospace/code font. Another option could be to avoid codes with ambiguous letters (one discussion with examples here: https://ux.stackexchange.com/questions/21076/are-there-numbers-and-letters-to-avoid-for-activation-codes-via-sms)

Also, when double-clicking the code (to mark the whole "word" for copy/pasting; I'm on a Mac), an extra space is included in front, which is rather hard to spot when entering into the devices' interface. Slight changes in markup can sometimes fix this; having a copy-to-clipboard button could be another way.

Dump and boot loop with new RC2

Hi @Onno-Dirkzwager,

There seems to be a dump and re-boot loop with RC2.

I made a test sketch on new device before i start using RC2 library.

So brand new device, brand new app.
I just used code snippets from my previous projects.

After flash -> Boot loop.

Dump seems to be caused by IAS.presetWifi(SSID, PASS) method.

Inside it i see EEPROM reference which in my opinion causes the dump because something is missing?! Data partition or something ??

If i remove the presetWifi everything works but no internet connection is available and device goes in config mode after few re-tries. This is intended as far i know :)

Didn't have time to check if it works when i put SSID and pass in config mode. I guess it will work.

BR,

IAS update Error: "500 ESP MAC not configured for updates"

Hi,
Unfortunately, I can't update the project in my NodeMCU board.

IASLoader compiles and loads fine, and everything goes as expected, until I want to make the OTA update of a sketch.

IAS logs say "500 ESP MAC not configured for updates" (please check at my IAS account "AlexKite").

I tried different versions of SDK with equal results.
Also tried different NodeMcu boards.

Please help to find the solution!


Current ESP SDK version: 2.4.1 (I deleted previous versions before installing new ones)
Current Arduino IDE version: 1.6.12.
My IAS account: "AlexKite"

Problem compiling with Latest stable release of Arduino core for ESP32

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:27: error: field 'call' has incomplete type 'tcpip_api_call'

 struct tcpip_api_call call;

                       ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: forward declaration of 'struct tcpip_api_call'

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_output(tcp_pcb*)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:291:65: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_output_api, (struct tcpip_api_call*)&msg);

                                                             ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:291:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_write(tcp_pcb*, const char*, size_t, uint8_t)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:307:64: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_write_api, (struct tcpip_api_call*)&msg);

                                                            ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:307:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_recved(tcp_pcb*, size_t)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:322:65: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_recved_api, (struct tcpip_api_call*)&msg);

                                                             ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:322:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_connect(tcp_pcb*, ip_addr_t*, uint16_t, tcp_connected_fn)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:338:66: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_connect_api, (struct tcpip_api_call*)&msg);

                                                              ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:338:66: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_close(tcp_pcb*)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:352:64: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_close_api, (struct tcpip_api_call*)&msg);

                                                            ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:352:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_abort(tcp_pcb*)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:367:64: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_abort_api, (struct tcpip_api_call*)&msg);

                                                            ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:367:64: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'esp_err_t _tcp_bind(tcp_pcb*, ip_addr_t*, uint16_t)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:382:63: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_bind_api, (struct tcpip_api_call*)&msg);

                                                           ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:382:63: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: In function 'tcp_pcb* _tcp_listen_with_backlog(tcp_pcb*, uint8_t)':

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:397:65: error: invalid conversion from 'err_t ()(tcpip_api_call) {aka signed char ()(tcpip_api_call)}' to 'tcpip_api_call_fn {aka signed char ()(tcpip_api_call_data)}' [-fpermissive]

 tcpip_api_call(_tcp_listen_api, (struct tcpip_api_call*)&msg);

                                                             ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:397:65: error: cannot convert 'tcpip_api_call*' to 'tcpip_api_call_data*' for argument '2' to 'err_t tcpip_api_call(tcpip_api_call_fn, tcpip_api_call_data*)'

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:259:12: note: class type 'tcpip_api_call' is incomplete

 struct tcpip_api_call call;

        ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp: At global scope:

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:624:6: error: prototype for 'void AsyncClient::_dns_found(ip_addr_t*)' does not match any in class 'AsyncClient'

void AsyncClient::_dns_found(ip_addr_t *ipaddr){

  ^

In file included from D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:24:0:

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.h:84:10: error: candidate is: void AsyncClient::_dns_found(_ip_addr*)

 void _dns_found(struct _ip_addr *ipaddr);

      ^

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:946:6: error: prototype for 'void AsyncClient::_s_dns_found(const char*, ip_addr_t*, void*)' does not match any in class 'AsyncClient'

void AsyncClient::_s_dns_found(const char * name, ip_addr_t * ipaddr, void * arg){

  ^

In file included from D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.cpp:24:0:

D:\Program Files\Arduino\libraries\AsyncTCP\src\AsyncTCP.h:164:17: error: candidate is: static void AsyncClient::_s_dns_found(const char*, _ip_addr*, void*)

 static void _s_dns_found(const char *name, struct _ip_addr *ipaddr, void *arg);

             ^

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.