ESP8266 Webserver Project

Moderator: Sprite_tm

User avatar
By Israel Lot
#16620 Try disabling the debug output on serial by changing this
Code: Select all#define DEVELOP_VERSION
//#define FULL_VERSION_FOR_USER

to
Code: Select all//#define DEVELOP_VERSION
#define FULL_VERSION_FOR_USER


And check your power source, I've had similar problems when pushing too many packets in a not so stable power line.
User avatar
By Patriko
#16672 Hi!

I'm trying to add a bit of authorization to esp_gnix, porting it from esphttpd but I stuck on a variable connData->cgiArg (from esphttpd). Due the other structure of processing request in esp_gnix I couldn't find any replacement. Should I re-implement it from scratch or there is any simpler way?

Please take a look:

Code: Select all   if (connData->conn==NULL) {
      //Connection aborted. Clean up.
      return HTTPD_CGI_DONE;
   }
User avatar
By jgoewert
#17980 I am trying to build, but I think I am missing a path setup. I don't do much cross compiler building or building on Linux, so I'm not sure what I need to add exactly.

I am going to assume it is looking for headers that are in /opt/Espressif/ESP8266_SDK/include, but the recursive include at the bottom of the Makefile doesn't really give a way to include this path.

Code: Select allmake[1]: Entering directory '/home/pi/esp-ginx/app'
make[2]: Entering directory '/home/pi/esp-ginx/app/user'
DEPEND: xtensa-lx106-elf-gcc -M -Os -Os -ffunction-sections -fno-jump-tables -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -D__ets__ -DICACHE_FLASH -DLWIP_OPEN_SRC -DPBUF_RSV_FOR_WLAN -DEBUF_LWIP -I include -I ./ -I ../../include/ets -I ../libc -I ../platform -I ../http -I ../dns -I ../ -I ../include -I ./ -I ../../include -I ../../include/eagle user_main.c
In file included from ../libc/c_string.h:10:0,
                 from user_main.c:12:
../../include/osapi.h:8:20: fatal error: string.h: No such file or directory
 #include <string.h>
                    ^
compilation terminated.
xtensa-lx106-elf-gcc -Os -Os -ffunction-sections -fno-jump-tables -g -O2 -Wpointer-arith -Wundef -Werror -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals   -D__ets__ -DICACHE_FLASH -DLWIP_OPEN_SRC -DPBUF_RSV_FOR_WLAN -DEBUF_LWIP   -I include -I ./ -I ../../include/ets -I ../libc -I ../platform -I ../http -I ../dns -I ../ -I ../include -I ./ -I ../../include -I ../../include/eagle  -o .output/eagle/debug/obj/user_main.o -c user_main.c
In file included from ../libc/c_string.h:10:0,
                 from user_main.c:12:
../../include/osapi.h:8:20: fatal error: string.h: No such file or directory
 #include <string.h>
                    ^
compilation terminated.
../../Makefile:198: recipe for target '.output/eagle/debug/obj/user_main.o' failed
make[2]: *** [.output/eagle/debug/obj/user_main.o] Error 1
make[2]: Leaving directory '/home/pi/esp-ginx/app/user'
../Makefile:184: recipe for target '.subdirs' failed
make[1]: *** [.subdirs] Error 2
make[1]: Leaving directory '/home/pi/esp-ginx/app'
Makefile:184: recipe for target '.subdirs' failed
make: *** [.subdirs] Error 2
User avatar
By piperpilot
#18773 Nice job...I got this compiled pretty easily and running. A couple of things that are strange, or maybe I'm using it wrong:

1. When connecting to the device on an iPhone with mobile Safari or chrome, the buttons on the orange bar at the top are not visible and nothing happens when you click on the discovered networks.

2. After connecting to an access point, I want to connect to the web server via the new IP address that is attached...but there is a redirect that tries to go to smart.relay.com which obviously doesn't exist in DNS. I want the client to connect to IP and not to a bound name...how do I change this?

EDIT: OK, I found a post by @jcferreira that explained how to unbind the hostname...that works, but then the config page doesn't come back up automagically on connect...my use case is as follows:

When the end user gets my device, they take it out of the box, plug it in and scan for the wifi network. They connect to it with their phone/tablet/computer and tell it to connect to their home wifi network. From there, they would access the webpage of the device via IP address. Accessing by IP is obviously not ideal, but I can't think of any other way to provide local access to the web server on the device to see the sensor info. Looking forward to digging into this more and integrating it with my solution!