pvvx / esp8266web Goto Github PK
View Code? Open in Web Editor NEWSmall web server on ESP8266
License: The Unlicense
Small web server on ESP8266
License: The Unlicense
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);`
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,
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/
иначе не собирается под линуксом.
спасибо.
Hi, is there any way how to add oled display, thinkspeak or ds18b20 support?
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
As I can see, you turned back to SDK 1.4.1. What are real reasons of this?
In russian:
Я вижу, что вы вернулись обратно к SDK 1.4.1. Каковы настоящие причины этого?
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
Форум закрылся?
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: NodeMcu Lua WIFI Board Based on ESP8266 CP2102 Module (ESP-12E)
Problem description
Module: Adafruit HUZZAH esp8266
Flash Size: 4MB(3MB SPIFFS)
CPU Frequency: 80Mhz
Upload Using: SERIAL 115200
please help me please :(
Hi
Webserver of you is very stable.
Can you add httpclient for get or post url ?
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:
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
It seems like you are not using the inbuilt ADC of the ESP module. Could you please let me know which module it is?
Line 36 in 0de8a99
при смене
#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 помогите пожалуйста
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...
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.