ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By nickagian
#68425 I have just flashed the example / demonstration of the server.

After booting the ESP12E, I see the AP that has been created and I connect my laptop to it. So far so good.

Then I try to connect with Chrome to http://192.168.4.1/wifi but all I get is
404 file not found
.

The board print on the UART a lot of messages, and amongst them I found more than once
Call espFsInit first!
and
/index.tpl not found. 404!
Redirecting to hostname url http://esp8266.nonet/
.

It seems as if the espFsInit is not called, but looking at the user_init function I see that it is indeed called.

Code: Select all//Main routine. Initialize stdout, the I/O, filesystem and the webserver and we're done.
void ICACHE_FLASH_ATTR user_init(void)
{
   os_printf("\nSystem started\n");
   stdoutInit();
//   ioInit();
   wifi_station_disconnect();
   wifi_set_opmode(0x3); //reset to AP+STA mode
   captdnsInit();

   // 0x40200000 is the base address for spi flash memory mapping, ESPFS_POS is the position
   // where image is written in flash that is defined in Makefile.
#ifdef ESPFS_POS
   espFsInit((void*)(0x40200000 + ESPFS_POS));
#else
   espFsInit((void*)(webpages_espfs_start));
#endif
   httpdInit(builtInUrls, 80);
#ifdef SHOW_HEAP_USE
   os_timer_disarm(&prHeapTimer);
   os_timer_setfn(&prHeapTimer, prHeapTimerCb, NULL);
   os_timer_arm(&prHeapTimer, 3000, 1);
#endif
   os_timer_disarm(&websockTimer);
   os_timer_setfn(&websockTimer, websockTimerCb, NULL);
   os_timer_arm(&websockTimer, 1000, 1);
   os_printf("\nReady\n");
}


Does anyone have idea what might be wrong?

SOLVED: The problem was that the espFsInit returns an error code and does not complete successfully. Meaning that the file system is not correctly created. I guess I have to figure out why is this happening.