Total Pageviews

Showing posts with label webserver. Show all posts
Showing posts with label webserver. Show all posts

Sunday, August 26, 2018

WebServer with ESP32

   I buy an Geekcreit® ESP32-DevKit development board and I want to test quickly, so I use information from article ESP32 Web Server – Arduino IDE writted by Rui Santos.
    I discover that development boar has 2 built-in leds, one at GPIO0 and one at GPIO27 (while om net is mentioned just GPIO27), so I change the sketch to use this leds and to invert logical level because leds are connected thru resistors at +3,3V not GND.
   Changed sketch is ESP32_WebServer.ino and you can upload in ESP32 development board after follow steps from article Installing the ESP32 Board in Arduino IDE (Windows instructions).
   After upload my sketch, in serial monitor it appear IP adress for local WebServer
   First, both leds are off
but after you push virtual button from webserver named GPIO0 led will lit (upper button)
and after push botton button (GPIO27) apropriate led will lit
 To have just GPIO27 led lit, must pust on GPIO0 button
   I made Web Server with red ESP32 board from Banggood movie where is presented how WebSwever control the two leds

Friday, December 9, 2016

WeMos D1 board (with ESP8266) as Web Switch Control with autoreconnect to wi-fi network

    I tested an (retired now) WeMos D1 development board made with ESP8266EX microcontroller. About this board I found some info at https://www.wemos.cc/product
   For easy use as other Arduino boards, is ok to see this picture:
    Last project with this board is a Web Switch Control.
    For upload a sketch like in any Arduino board must use newish Arduino IDE software from https://www.arduino.cc/en/Main/Software to have this situation:
   For this, must go to FILES -> PREFERENCES
(see detailed data in article Placa NodeMcu v.0.9 programata in Arduino IDE).
    After that in TOOLS -> BOARD->BOARDS MANAGER you will see

and than
   Now, Arduino IDE software is ready for verify/compile and upload the sketch.
   First, I tested a sketch found at ESP8266 Community Forum in post named GARAGE DOOR OPENER EXAMPLE V2 (SEE POST #2). This sketch is writted by JoseAngel
   This sketch made a webserver using AJAX style (static page and just some datas is changes).
   My sketch led_controlled_from_webpage.ino has some change line, but I use same password (1234), and my led is at GPIO5 (D15/SCL) and GND (I not put 220-470 ohms resistor limiter, but is more good to put). I use 8087 port, but you can change to 80.
   I made WeMos board control a led using protected webpage using Ajax movie when you can how it use and control the led:
   After I tested about one mounth, I see some problemes, when wi-fi router is disconnected and reconnect.. so, I study but I give a tip from a collaborator, Mircea Craciun, who indicate my another post from ESP8266 forum.

   Now, my sketch led_controlled_from_webpage_auto.ino made autocreconnect in wi-fi network if apear some problemes.
   I put an LED for wi-fi error at  GPIO12 (D12/MISO) and GND.
   At first start, after restart or if link between router and WeMos is broken, second led blink until link with wi-fi is ok. You can see in ESP8266 Switch control with autoreconnect to wi-fi network movie how WeMos D1 board is working.
   At http://www.esp8266.com/wiki/doku.php?id=arduino-docs I found how I can use EEPROM memory from ESP8266EX microcontroller for store the state of led (ON or OFF) and number of good clicks (just for see how work the system).
   Last sketch, led_controlled_from_webpage_auto_eeprom.ino, has this feature with stored data in EEPROM. You can see that in ESP8266 Switch control with autoreconnect to wi-fi network (2) movie


   
Bibliography: