ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By boseji
#7692
Sprite_tm wrote:
boseji wrote:I wonder if we can use the Heatshrink File system in some alternate manner to serve up json output.
Kindly let me know.


What do you mean? You can happily put bla.json files in the generated filesystem and the esphttpd server will gladly serve them up.

Thank a lot. I will try it out and post my ponderings. Actually my intention is to give updates to Rpi based server on what's happening with esp.

Warm Regards
Boseji
User avatar
By aignaciors
#8466 Hello everyone,

I'm using the esphttpd fw with some modifications for mqtt, but when i change the SSID of the ESP in AP+STA mode, the DHCP server just don't work and i can't to connect with other device in the ESP, the only way to fix is to restore the device to the original settings, anyone had this kind of problem?

Here is my init function:

void user_init(void)
{
stdoutInit();
ioInit();

//system_restore();

/****** Print Some inf. about ESP ******/

os_printf("\n\n");
os_printf("\nPrinting AP Settings:\n");
struct softap_config cfgESP;
while(!wifi_softap_get_config(&cfgESP));
os_printf("\nSSID:%s",cfgESP.ssid);
os_printf("\nPASSWORD:%s",cfgESP.password);
os_printf("\nCHANNEL:%d",cfgESP.channel);
os_printf("\nAuthentification:%d",cfgESP.authmode);
os_printf("\nSSID Hidden:%d",cfgESP.ssid_hidden);
os_printf("\nMax Connections:%d",cfgESP.max_connection);
os_printf("\n\n");

/****** Change SSID ******/
memset(cfgESP.ssid, 0, 32);
strcpy(cfgESP.ssid, WIFI_APSSID);
wifi_softap_set_config(&cfgESP);


/****** Init WS ******/
httpdInit(builtInUrls, 80);
os_printf("\nWebServer=Ready\n");

/****** MQTT polling to connect ******/
os_timer_disarm(&mqtt_timer);
os_timer_setfn(&mqtt_timer, (os_timer_func_t *)CheckForMQTT_cb, (void *)0);
os_timer_arm(&mqtt_timer, 500, 1);
os_printf("\nMQTT timer=Started\n");
}

Thanks.
You do not have the required permissions to view the files attached to this post.
User avatar
By martonmiklos
#8645 Hey Sprite_tm,

I have added support for gzipping the static css, js, html files, which helps both with saving flash space and both bandwidth if dealing with large static text files. The feature can be enabled/disabeld in the Makefile. If enabled it gzips the js/css/html files and the webserver code also sends the Content-Encoding: gzip header if enabled.

BTW. what version of esptool do you use?
The command line arguments in the Makefile does not seems to be the same what is used by this esptool:
https://github.com/themadinventor/esptool

Thank you for your work on esp-httpd, it is a very useful project for me!
You do not have the required permissions to view the files attached to this post.
User avatar
By IgorTr
#8679 HI.
First of all, Thank you very much making this webserver public. My beer is your beer :-)

Two questions:

1. Is it possible to disable UART debug messages ? As far as I understand, a lot of this messgaes come
from non-public libs, so it's not possible to make it slient at all... I need UART to communicate this host CPU,
and do not want to filter debug messaging on host side.

2.Is it possible to switch to STA mode only in case then wifi network is not reachable ? Do I need to implement this
in timer routine, or there is some more graceful method for that ?

Thanks.
Igor.