GithubHelp home page GithubHelp logo

pvvx / esp8266web Goto Github PK

View Code? Open in Web Editor NEW
245.0 245.0 92.0 17.09 MB

Small web server on ESP8266

License: The Unlicense

Makefile 1.87% HTML 15.73% JavaScript 3.86% CSS 1.36% C 72.59% C++ 1.32% Batchfile 0.39% Python 2.13% Objective-C 0.33% PHP 0.02% Assembly 0.36% Roff 0.04%

esp8266web's People

Contributors

pvvx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266web's Issues

I2S subsytem does not work - a fatal exception!

The initialization code of I2S subsystem causes an exception 28/29.
Fatal exception (28):
epc1=0x40230bd7, epc2=0x00000000, epc3=0x00000000, excvaddr=0x02190000, depc=0x00000000

`rom_i2c_writeReg_Mask(i2c_bbpll, i2c_bbpll_hostid, i2c_bbpll_en_audio_clock_out,
i2c_bbpll_en_audio_clock_out_msb, i2c_bbpll_en_audio_clock_out_lsb, 1);

CLEAR_PERI_REG_MASK(I2SCONF, I2S_I2S_RESET_MASK); // <- exception here

SET_PERI_REG_MASK(I2SCONF, I2S_I2S_RESET_MASK);
CLEAR_PERI_REG_MASK(I2SCONF, I2S_I2S_RESET_MASK);

WRITE_PERI_REG(I2SCONF, (READ_PERI_REG(I2SCONF) & 0xf0000fff)|
(((26&I2S_BCK_DIV_NUM )<<I2S_BCK_DIV_NUM_S)|
((5&I2S_CLKM_DIV_NUM)<<I2S_CLKM_DIV_NUM_S)|
((1&I2S_BITS_MOD) << I2S_BITS_MOD_S ) ) );

PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_I2SO_BCK);
SET_PERI_REG_MASK(I2SCONF, I2S_I2S_TX_START);`

Not able to set RS485 Configurations

Hi,

Thank you very much for your development work, I am trying to establish a MODBUS connection from Wifi network, I am not able to set Modbus Settings, like baud, parity, Pin RD_ENABLE of configuration web page, always gets ? in text fields.
However settings like device ID, Modbus TCP port works well, I can change these values.
How to solve this issue?
I have attached a screen shot.

Thanks,

modbus settings

Write to SPI memory locations ...

Hi pvvx

I want to say thank you for this great piece of work. It's awesome! ... but also it's complicated.
Perhaps you can give me a hand, i want to write to SPI to save some data.
I use spi_flash_erase and spi_flash_write but nothing gets written... Is there some protection in place?

Thks in advance,

Horacio

переименовать директории

опять директории с верхним регистром,
Нужно

    app/main/Include/
    app/user/Include/

заменить на

    app/main/include/
    app/user/include/

иначе не собирается под линуксом.
спасибо.

111 Connection refused ...

Hi Victor,

thks for your last reply. Now I am trying to access webserver from external IP address. Did port forwarding in my router but still get error: 111 connection refused.
What is the problem ??

Cheers,

Horacio

What are the reason to downgrade to SDK 1.4.1?

As I can see, you turned back to SDK 1.4.1. What are real reasons of this?

In russian:
Я вижу, что вы вернулись обратно к SDK 1.4.1. Каковы настоящие причины этого?

ImportError: No module named serial

Hi
Thankyou for great project. I have make in elipse and show error

Traceback (most recent call last):
File "C:\Espressif\examples\esp8266web-master\esptool.py", line 22, in
import serial
ImportError: No module named serial
C:/Espressif/examples/esp8266web-master/Makefile:224: recipe for target 'FlashAll' failed
mingw32-make.exe: *** [FlashAll] Error 1

how do fix it ?
Thankyou

i have problem with WiFiClientSecure :(

hi
i am thanks for your help to peaple for publishin your good project
in this code i want give data from google Sheet and send data in telegram bot,
i use this project to give data from google sheet:
https://github.com/lorol/Googlesheet_DHT_simple
and use this project for recive and send data from telegram robat:
https://github.com/witnessmenow/Universal-Arduino-Telegram-Bot
i use esp8266
i merge two above project but i cant compile because i give error , because two project use WiFiClientSecure.h library , and same client :(

i changed the client name , and code ha been compiled, but in serial monitor , program crashed
i changed "HTTPSRedirect* client= nullptr;" to "HTTPSRedirect* test= nullptr;" and change every client in the code to test,
i also change below code, in the next change

WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client);

to :

WiFiClientSecure test;
UniversalTelegramBot bot(BOTtoken, test);

and you can see my Serial monitor in both time:

Starting ...
Connecting to hooshmandsazan3
.

WiFi connected

Exception (29):
epc1=0x4000e1cc epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000204 depc=0x00000000

ctx: cont 
sp: 3fff0fd0 end: 3fff18e0 offset: 01a0

>>>stack>>>
3fff1170:  00410000 3fffb59c 3fffb75c 40224e3f  
3fff1180:  3fffb63c 3fffb87c 00000081 40225aa1  

i add Serial.println() in the code for debugging
this is my code:

#include <ESP8266WiFi.h>
#include <ArduinoJson.h>
#include "HTTPSRedirect.h"




//======================From Telegram===============================
#include <WiFiClientSecure.h>
#include <UniversalTelegramBot.h>

#define BOTtoken "339475786:AAH7IjXu51xPom_sMx8IRnvQbcTD5FfO2Wc"  // your Bot Token (Get from Botfather)
WiFiClientSecure client;
UniversalTelegramBot bot(BOTtoken, client);

int Bot_mtbs = 1000; //mean time between scan messages
long Bot_lasttime;   //last time messages' scan has been done
bool Start = false;

const int ledPin = 2;
int ledStatus = 0;

void handleNewMessages(int numNewMessages) {
  //Serial.println(F("handleNewMessages"));
  //Serial.println(String(numNewMessages));

  for (int i=0; i<numNewMessages; i++) {
    String chat_id = String(bot.messages[i].chat_id);
    String text = bot.messages[i].text;

    String from_name = bot.messages[i].from_name;
    if (from_name == "") from_name = "Guest";

    if (text == "/ledon") {
      digitalWrite(ledPin, HIGH);   // turn the LED on (HIGH is the voltage level)
      ledStatus = 1;
      bot.sendMessage(chat_id, "Led is ON", "");
    }

    if (text == "/ledoff") {
      ledStatus = 0;
      digitalWrite(ledPin, LOW);    // turn the LED off (LOW is the voltage level)
      bot.sendMessage(chat_id, "Led is OFF", "");
    }

    if (text == "/status") {
      if(ledStatus){
        bot.sendMessage(chat_id, "Led is ON", "");
      } else {
        bot.sendMessage(chat_id, "Led is OFF", "");
      }
    }

    if (text == "/start") {
      String welcome = "Welcome to Universal Arduino Telegram Bot library, " + from_name + ".\n";
      welcome += "This is Flash Led Bot example.\n\n";
      welcome += "/ledon : to switch the Led ON\n";
      welcome += "/ledoff : to switch the Led OFF\n";
      welcome += "/status : Returns current status of LED\n";
      bot.sendMessage(chat_id, welcome, "Markdown");
    }
  }
}
//***************************************************************************




#define WRITE_INTERVAL_MINITES 1

#define MAX_CONNECT 200 //reuse 2 times same clent
#define MAX_ERROR 100 //restart everything

const char *ssid =  "sajjad";
const char *pass =  "1q2w3e4r5t6y";

const char* host = "script.google.com";
const int httpsPort = 443;

int seconds = (WRITE_INTERVAL_MINITES * 60) - 20; // schedule first sending to TS in 20 sec after start

char *GScriptId = "AKfycbxRzkMt87iyiyU9EDY6REoRDpl5C9oHdjVyCSF6A4QN7jkNMGHD";   // Put your  GScriptId   here

// Access to Google Spreadsheet
String url = String("/macros/s/") + GScriptId + "/exec?";


HTTPSRedirect* test = nullptr;


float hum;
float tem;

void setup() {
  Serial.begin(115200);
  Serial.println();
  delay(200);
  Serial.println(F("Starting ..."));

  delay(200);
 
  Serial.print("Connecting to ");
  Serial.println(ssid);
  WiFi.mode(WIFI_STA);
  if (WiFi.status() != WL_CONNECTED) WiFi.begin(ssid, pass);
  
  while (WiFi.status() != WL_CONNECTED) {
    delay(500); 
    Serial.println(F("."));
  }
  Serial.println("");
  Serial.println("WiFi connected");
  pinMode(ledPin, OUTPUT); // initialize digital ledPin as an output.
  delay(10);
  digitalWrite(ledPin, LOW); // initialize pin as off
}

void loop() {
  Serial.println("1");
  
  //==============================From telegram=========================================
  if (millis() > Bot_lasttime + Bot_mtbs)  {
    Serial.println("2");
    int numNewMessages = bot.getUpdates(bot.last_message_received + 1);
    
    while(numNewMessages) {
      Serial.println("3");
      Serial.println("got response");
      handleNewMessages(numNewMessages);
      numNewMessages = bot.getUpdates(bot.last_message_received + 1);
    }
    Serial.println("4");
    Bot_lasttime = millis();
  }
  //***********************************************************************
  Serial.println("5");
  static int error_count = 0;
  static int connect_count = 0;
  static bool flag = false;

  if (!flag){
    Serial.println("6");
    test = new HTTPSRedirect(httpsPort);
    flag = true;
    test->setPrintResponseBody(true); // or false and use String getResponseBody();
    Serial.println("6a");
    test->setContentTypeHeader("application/json");  
    Serial.println("6b");
    if (!test->connected()) test->connect(host, httpsPort);
    Serial.println("6c");
    ++connect_count;
    Serial.println("6d");
  }

   // 30 sec after writing 
  

    if (test != nullptr){
      Serial.println("7");
      if (!test->connected()){
        test->connect(host, httpsPort);
      }
    }
    else{
      Serial.println(F("Error2 creating client object!"));
      error_count = -10;
      Serial.println("7a");
    }
    Serial.println("7b");
    Serial.println(F("========================="));
    if (test->GET(url + String("readrow=last"), host)){
      Serial.println("8");
      DynamicJsonBuffer jsonBuffer;
      JsonObject& json = jsonBuffer.parseObject(test->getResponseBody());
      //json.printTo(Serial);
      String Timestamp = json["values"][0];
      int MaxT0        = json["values"][1];
      int minT0        = json["values"][2];
      String Con0      = json["values"][3];
      int Hu0          = json["values"][4];
      String WS0       = json["values"][5];
      String WD0       = json["values"][6];

      int MaxT1        = json["values"][7];
      int minT1        = json["values"][8];
      String Con1      = json["values"][9];
      int Hu1          = json["values"][10];
      String WS1       = json["values"][11];
      String WD1       = json["values"][12];

      int MaxT2        = json["values"][13];
      int minT2        = json["values"][14];
      String Con2      = json["values"][15];
      int Hu2          = json["values"][16];
      String WS2       = json["values"][17];
      String WD2       = json["values"][18];

      int MaxT3        = json["values"][19];
      int minT3        = json["values"][20];
      String Con3      = json["values"][21];
      int Hu3          = json["values"][22];
      String WS3       = json["values"][23];
      String WD3       = json["values"][24];
      
      float TEMP       = json["values"][25];
      float Hu         = json["values"][26];
      
      Serial.println(Timestamp);
      Serial.println(MaxT0);
      Serial.println(minT0);
      Serial.println(Con0);
      Serial.println(Hu0);
      Serial.println(WS0);
      Serial.println(WD0);

      Serial.println("");
      Serial.println(MaxT1);
      Serial.println(minT1);
      Serial.println(Con1);
      Serial.println(Hu1);
      Serial.println(WS1);
      Serial.println(WD1);

      Serial.println("");
      Serial.println(MaxT2);
      Serial.println(minT2);
      Serial.println(Con2);
      Serial.println(Hu2);
      Serial.println(WS2);
      Serial.println(WD2);

      Serial.println("");
      Serial.println(MaxT3);
      Serial.println(minT3);
      Serial.println(Con3);
      Serial.println(Hu3);
      Serial.println(WS3);
      Serial.println(WD3);

      Serial.println("");
      Serial.println(TEMP);
      Serial.println(Hu);      
      ++connect_count;
    } else {
      Serial.println("9");
      ++error_count;
      Serial.println(F("GET Last row val failed!"));
      seconds = 10; // stage again in 10 sec
    }


   if (error_count > MAX_ERROR){
    Serial.println("10");
     Serial.println(F("Errors > MAX_ERROR...")); 
     //delete client;
     //client = nullptr;
     //connect_count = -1;
     //error_count = 0;
     //flag = false;
     ESP.restart(); 
   }

   if (connect_count > MAX_CONNECT){
      Serial.println("11");
      Serial.println(F("Connects > MAX_CONNECT... rebuild"));
      connect_count = -1;
      flag = false;
      delete test;
     
      //return;  //where?
   }
   
   seconds++;
   delay(1000); //1 sec loop
}

when the code arive to "6b" program go to hang,
when arive to :
if (!test->connected()) test->connect(host, httpsPort);
this is my output:

Starting ...
Connecting to sajjad
.
.
.
.
.
.
.
.

WiFi connected
1
2
4
5
6
6a
6b

Exception (29):
epc1=0x4000dfd9 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: cont 
sp: 3fff1000 end: 3fff1850 offset: 01a0

>>>stack>>>
3fff11a0:  3fff073c 000011c9 000011c9 4022ab8c  
3fff11b0:  3fff1584 00000012 00000003 00000000  

Hardware

Hardware: NodeMcu Lua WIFI Board Based on ESP8266 CP2102 Module (ESP-12E)

Description

Problem description

Settings in IDE

Module: Adafruit HUZZAH esp8266
Flash Size: 4MB(3MB SPIFFS)
CPU Frequency: 80Mhz
Upload Using: SERIAL 115200

please help me please :(

Share and re-use of esp8266web code

Hi pvvx,
First I wanted to say you did an excellent work of reverse engineering the closed ESP SDK. Well done!
I would like to re-use parts of your code on my projects, for example the lwip, adc etc.
A good way would be using git submodules.

However, currently your repository is not friendly for sharing with other projects as submodules:

  • Folders are not self contained. For exapmle, lwip is in one directory but it requires eagle_lwip_if.c from app/main to work correctly. Ideally I would like a single directory to contain all networking code so I could use it in my project as a submodule.
  • Comments are written in russian :(

Another option for me is to just to copy your files to my project. But if I do that I will not be able to contribute back if I make any changes/additions, and it will become harder for me to get in sync when you make changes.

Ideally, I think the best thing is to have an "open-sdk" which is a project by itself, and "esp8266web" is one project that uses it. Myself I'm not interested in the web server code, for example.

This is just a suggestion. Even if you do nothing with it, I still think you did a great job so far!

Amir

What ADC is being used

It seems like you are not using the inbuilt ADC of the ESP module. Could you please let me know which module it is?

Баг с DEF_WIFI_AUTH_MODE, 0.6.4

#define DEF_WIFI_AUTH_MODE AUTH_OPEN // AUTH_WPA_PSK, AUTH_WPA2_PSK, AUTH_WPA_WPA2_PSK

при смене
#define DEF_WIFI_AUTH_MODE AUTH_OPEN
на любой из
AUTH_WPA_PSK, AUTH_WPA2_PSK, AUTH_WPA_WPA2_PSK

Прошивка начинает игнорировать DEF_WIFI_AUTH_MODE и WIFI_AP_NAME, запустается в режиме AUTH_OPEN с именем точки типа "ESP_mac"

На версии 0.5.9 этого бага нет. Второй день ковыряюсь, не пойму что не так, @pvvx помогите пожалуйста

SAR ADC

Hi I'm trying to reuse your ADC implementation in one of my programs where I need fast ADC (running @150kHz)

I'm almost done adapting the code to my environment (arduino/esp8266 based) but still struggling to find what would be the correct implementation for :

void rom_i2c_writeReg_Mask(uint32 block, uint32 host_id, uint32 reg_add, uint32 Msb, uint32 Lsb, uint32 indata);

Which fails to link with my SDK...(using 1.5.1) - do you have an implementation of this that I could use ?

I also don't seem to find this in the lst file...

Esp8266web on nodemcu amica r2

I have flashed esp8266web on nodemcu amica r2 40mhzcflash speed, dio flash mode, 32m flash size, but all I get is a continuos stream of exceptions.

Is this platform supported?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.