Menu

Device keeps calling for INITLoader instead of APP

martinl
Joined
2021-06-09 13:21:40
Posts
9

Device keeps calling for INITLoader instead of APP

Hey, i'm new to this platform, i followed this video: #225 How-to Manage your ESP32 and ESP8266 over the Air (IOTappstory.com)

I've got a project with an app and a device (a ESP32) connected to that project, but the device wont call for the app, it keeps calling for INITLoader app

Uploaded my code to Pastebin

Am i doing something wrong? If so, help me please

Logs:

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Hi Martin,

Welcome to IAS. My initial reaction is: The INITLoader is calling home as expected. But when it downloads your test-app-100 it is not able to finish / successfully install this app. It failed or crashes and after rebooting retries to download install. Most often this is caused by a bad wifi connection or an incompatible app.

Please post your serial output so we can further investigate.

UPDATED REACTION ABOVE: removed "without studying your code" as the code has nothing to do with the current fail.

martinl
Joined
2021-06-09 13:21:40
Posts
9

Here's the serial output: 


 Connecting to WiFi AP
 .
 WiFi connected

 IP Address: 192.168.1.110
 Device MAC: 24:6F:28:AF:20:14
 MDNS responder started: http://initloader-692.local
*-------------------------------------------------------------------------*
 Calling Home

 Checking for App(Sketch) updates from: https://iotappstory.com/ota/updates
 Downloading... Installing.....abort() was called at PC 0x401735cd on core 1

ELF file SHA256: 0000000000000000

Backtrace: 0x400887d8:0x3ffb1400 0x40088a55:0x3ffb1420 0x401735cd:0x3ffb1440 0x400879ea:0x3ffb1460 0x40173469:0x3ffb1480 0x400df679:0x3ffb14a0 0x400df10d:0x3ffb14c0 0x400df2c1:0x3ffb14e0 0x400d4a84:0x3ffb1500 0x400d2677:0x3ffb1520 0x400d33c2:0x3ffb1d60 0x400d34a8:0x3ffb1ea0 0x400d368a:0x3ffb1ec0 0x400d12f7:0x3ffb1f70 0x400e0e96:0x3ffb1fb0 0x40089a66:0x3ffb1fd0

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Thanks. This confirms it fails when installing. Which board and IDE are you using?

martinl
Joined
2021-06-09 13:21:40
Posts
9

Arduino IDE, ESP32 Dev Module

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Please set the tools > debug level: Verbose
And repost your serial output. (maby in pastbin as it will be a lot of lines)

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Oh and  (I'm probably too late with this)
remove or comment out the following to prevent erase and having to setup wifi again...

  IAS.onFirstBoot([]() {
//    IAS.eraseEEPROM('F');   //<-- comment out line 97
martinl
Joined
2021-06-09 13:21:40
Posts
9

Sorry for not answering yesterday, if i did nothing wrong, here's the serial output: Pastebin

martinl
Joined
2021-06-09 13:21:40
Posts
9

And about the line 97, there's no 

IAS.onFirstBoot([]() {
    IAS.eraseEEPROM('F');

but there's 

  IAS.begin();                          // Run IOTAppStory
martinl
Joined
2021-06-09 13:21:40
Posts
9

By the way, my code uses my own library that uses eeprom (a lot), could there be any problems with that?

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

Hi Martin,

No problem. I'll look at your pastbin later.

As for line 97 this is for the IASloader. Your current issue is installing and not your own code. But yes eeprom could be an issue later on. I'll help you when we are there... And we have a wiki page about eeprom. 

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to martinl (View post):

Sorry for not answering yesterday, if i did nothing wrong, here's the serial output: Pastebin

Hi Martin,

I had a look at your serial output. But 1 it does not look like you turned debugging on. 2 your device went into config mode so you could setup wifi. What we want to see is your device calling home.

May I suggest a different route. Instead of following the video. Use the new DirectLoader.

  1. Control Panel
  2. Devices
  3. Add device +
  4. Choose Directloader options and follow the directions on that page.
martinl
Joined
2021-06-09 13:21:40
Posts
9

I tried using the DirectLoader, the device was added and it downloaded only once the project.

The app has a bluetooth part so if it works correctly i can see the device on bluetooth. The device won't appear on BT list.

I'm pretty new to the arduino platform (less that 2 months coding) so i don't really know how to get debug code and can't find any web to explain, just telling me that Serial.println() is my debug friend, so i just set the debug to Verbose and restarted the ESP32. 

By the way, here's the new serial output: Pastebin

Onno Dirkzwager
Joined
2016-06-04 21:36:48
Posts
64

In response to martinl (View post):

I tried using the DirectLoader, the device was added and it downloaded only once the project. The...

I'm not sure what's happening / you are doing. According to your logs, you downloaded an app. But you did not show that this confirmed (next call: no updates necessary)

And in your pastbin you show: 

  1. Request error!
  2. Code : 409
  3. Message : Hash not found!

Which indicates that you could not add your device to our service.

I think you might be missing something and that a voice chat could help you much faster... Are you available on Tuesday evening for a chat?

martinl
Joined
2021-06-09 13:21:40
Posts
9

From Monday to Thursday i can talk until 17.30 CEST and after 18.45 CEST, so just tell me when you are available and the platform that you would like to use