Statistics: Posted by jkoperwas — Fri Feb 17, 2023 11:54 pm — Replies 0 — Views 62196
Statistics: Posted by Rob — Thu Feb 09, 2023 3:15 pm — Replies 0 — Views 56994
Statistics: Posted by s56ffb — Sun Jan 01, 2023 11:07 pm — Replies 0 — Views 12060
Statistics: Posted by Green BMS — Thu Dec 29, 2022 9:30 pm — Replies 0 — Views 52547
qz]Install ESP8266 gcc. See
https://docs.espressif.com/projects/esp ... setup.html
Fetch ESP8266_NONOS_SDK from https://github.com/espressif/ESP8266_NONOS_SDK
Point environment variable ESP_SDK to the SDK directory.
Install esptool.
Statistics: Posted by s56ffb — Wed Dec 21, 2022 3:51 pm — Replies 0 — Views 12029
Install ESP8266 gcc. See https://docs.espressif.com/projects/esp ... setup.html
Fetch ESP8266_NONOS_SDK from https://github.com/espressif/ESP8266_NONOS_SDK
Point environment variable ESP_SDK to the SDK directory.
Install esptool.
Statistics: Posted by s56ffb — Sun Dec 18, 2022 7:10 pm — Replies 0 — Views 12223
qz]Install ESP8266 gcc. See https://docs.espressif.com/projects/esp ... setup.html
Fetch ESP8266_NONOS_SDK from https://github.com/espressif/ESP8266_NONOS_SDK
Point environment variable ESP_SDK to the SDK directory.
Install esptool.
Statistics: Posted by s56ffb — Sun Dec 18, 2022 5:58 pm — Replies 0 — Views 12018
Statistics: Posted by mhh.2000 — Sat Dec 17, 2022 10:18 am — Replies 0 — Views 9698
Statistics: Posted by DonP — Fri Dec 02, 2022 3:06 pm — Replies 0 — Views 12193
Statistics: Posted by xjxlui — Wed Nov 30, 2022 11:29 am — Replies 0 — Views 9735
Statistics: Posted by Breixo — Tue Nov 15, 2022 9:10 pm — Replies 0 — Views 9897
Statistics: Posted by Ronak Jain — Mon Nov 14, 2022 6:08 pm — Replies 0 — Views 12275
Statistics: Posted by MehdiSoheili — Sun Nov 13, 2022 8:19 am — Replies 0 — Views 12125
Statistics: Posted by johnxue — Wed Oct 19, 2022 12:54 am — Replies 0 — Views 12030
Statistics: Posted by Just — Fri Sep 16, 2022 9:20 am — Replies 0 — Views 12382
Statistics: Posted by 315002181huang — Fri Jul 01, 2022 3:36 pm — Replies 0 — Views 9835
Statistics: Posted by 315002181huang — Fri Jul 01, 2022 3:31 pm — Replies 0 — Views 9811
Statistics: Posted by 315002181huang — Fri Jul 01, 2022 3:16 pm — Replies 0 — Views 9760
Statistics: Posted by gailu — Fri May 27, 2022 12:13 pm — Replies 1 — Views 5623
Statistics: Posted by David-OLW — Fri Apr 29, 2022 10:48 pm — Replies 0 — Views 12240
Statistics: Posted by andrea05256 — Tue Mar 29, 2022 1:34 am — Replies 0 — Views 9530
Code:
esp_now_add_peer(mac,role,channel,key,size)
Statistics: Posted by dvpe — Fri Mar 04, 2022 6:11 pm — Replies 0 — Views 12092
Code:
ets Jan 8 2013,rst cause:0, boot mode:(3,0)
unknown reset
ets_main.c
Code:
vTaskDelay(5000 / portTICK_PERIOD_MS);
esp_deep_sleep(30000000);
Code:
ets Jan 8 2013,rst cause:0, boot mode:(3,0)
unknown reset
ets_main.c
Statistics: Posted by cubic — Wed Feb 16, 2022 2:45 pm — Replies 0 — Views 11995
Statistics: Posted by yingzezigai — Tue Feb 15, 2022 4:43 pm — Replies 0 — Views 12232
Statistics: Posted by banach87 — Sun Jan 16, 2022 1:18 am — Replies 0 — Views 12109
Code:
brlrl
ready
Statistics: Posted by stark2k — Tue Jan 11, 2022 7:45 am — Replies 0 — Views 12112
Statistics: Posted by toxicjv — Mon Dec 13, 2021 7:59 pm — Replies 1 — Views 10315
Code:
#include "user_interface.h"
#include "espconn.h"
#include "osapi.h"
#include "driver/uart.h"
#include "mem.h"
#define SSID "<your SSID>"
#define PW "<your Password>"
#define HOST "ws"
#define dbg(f, ...) os_printf(f, ## __VA_ARGS__)
static os_timer_t ptimer;
// This PAGE only sends a one time page.
const char* PAGE = "<!DOCTYPE html><html><head><title>Native Server Test</title> <meta name='viewport' content='width=device-width, initial-scale=1'></head><body> <h1>Welcome to my Native Server Test</h1></body></html>";
// This PAGE sends back a page that keeps reloading, so we can check for errors and/or memory leaks.
// const char* PAGE = "<!DOCTYPE html><html><head><title>Native Server Test</title> <meta name='viewport' content='width=device-width, initial-scale=1'><script>window.addEventListener('load',()=>{ setTimeout(()=>{location.reload();},500);},false);</script></head><body> <h1>Welcome to my Native Server Test</h1></body></html>";
ICACHE_FLASH_ATTR void printIfErr(s8 esp, const char* msg)
{
if (esp)
os_printf("ERR - %s = %d\n", msg, esp);
}
ICACHE_FLASH_ATTR void hack(const char* msg)
{
static u32 last = 0;
u32 now = system_get_time();
if (msg)
os_printf("%s=%uus ", msg, now - last);
last = now;
}
ICACHE_FLASH_ATTR void onDisconnect(void* c)
{
hack("onDisconnect");
}
ICACHE_FLASH_ATTR void doDisconnect(void* c)
{
hack("doDisconnect");
struct espconn* conn = (struct espconn*)c;
// ******** THIS IS WHERE I THINK THE PROBLEM IS ******************
// In SDK <= 2.1.0 espconn_disconnect
// * does disconnect
// * does call espconn_regist_disconcb callback
// * does allow new connection after the first 5
// In SDK > 2.1.0 espconn_disconnect
// * does NOT disconnect
// * does NOT call espconn_regist_disconcb callback
// * does NOT allow new connection after the first 5
printIfErr(espconn_disconnect(conn), "disconnect");
}
ICACHE_FLASH_ATTR void onSent(void* c)
{
hack("onSent");
struct espconn* conn = (struct espconn*)c;
os_timer_disarm(&ptimer);
os_timer_setfn(&ptimer, (os_timer_func_t *)doDisconnect, conn);
os_timer_arm(&ptimer, 5, 0);
}
ICACHE_FLASH_ATTR void onReceive(void* c, char* buf, u16 length)
{
hack("onReceive");
struct espconn* conn = (struct espconn*)c;
// Print out the request just to make sure its what we think it is.
static char buffer[1024];
os_memcpy(buffer, buf, length);
*(buffer + length) = 0;
// os_printf(buffer);
os_sprintf(buffer, "HTTP/1.1 200 OK\r\n"
"Server: InqPortal/5.0\r\n"
"Content-Length: %d\r\n"
"Content-type: text/html\r\n"
"Pragma: no-cache\r\n\r\n%s", strlen(PAGE), PAGE);
printIfErr(espconn_send(conn, (u8*)buffer, strlen(buffer)), "send");
}
ICACHE_FLASH_ATTR void onConnection(void* c)
{
hack(NULL);
static u32 cnt = 0;
os_printf("\n%3u ", ++cnt);
struct espconn* conn = (struct espconn*)c;
espconn_regist_recvcb(conn, onReceive);
espconn_regist_sentcb(conn, onSent);
espconn_regist_disconcb(conn, onDisconnect);
}
ICACHE_FLASH_ATTR void startServer()
{
// Setup and start web server listener
LOCAL struct espconn listen;
LOCAL esp_tcp tcp;
os_memset(&listen, 0, sizeof(struct espconn));
listen.type = ESPCONN_TCP;
listen.state = ESPCONN_NONE;
listen.proto.tcp = &tcp;
listen.proto.tcp->local_port = 80;
espconn_regist_connectcb(&listen, onConnection);
printIfErr(espconn_accept(&listen), "listen");
}
ICACHE_FLASH_ATTR void chkAP(void* arg)
{
if (wifi_station_get_connect_status() != STATION_GOT_IP)
{
os_printf(".");
return;
}
os_timer_disarm(&ptimer);
struct ip_info info;
wifi_get_ip_info(STATION_IF, &info);
// This is just cook-book Station connection stuff.
dbg("\n\nSDK version: %s\n", system_get_sdk_version());
os_printf("\nBrowse to (http://%s/index.html) or (http://" IPSTR
"/index.html)\n",
HOST, IP2STR(&(info.ip)));
}
ICACHE_FLASH_ATTR void startStation()
{
os_printf("\nConnecting to your router");
struct station_config sc;
os_memset(&sc, 0, sizeof(struct station_config));
sc.bssid_set = 0;
os_memcpy(&sc.ssid, SSID, 32);
os_memcpy(&sc.password, PW, 64);
wifi_station_set_config_current(&sc);
wifi_station_set_hostname(HOST);
wifi_station_connect();
os_timer_disarm(&ptimer);
os_timer_setfn(&ptimer, (os_timer_func_t *)chkAP, NULL);
os_timer_arm(&ptimer, 1000, 1);
}
ICACHE_FLASH_ATTR void startSoftAP()
{
// Start up the communications Host/Station and Client/Soft
// ssid - Not NULL terminated in code - Can be 32 characters coming in!
// Password length must be blank OR >= 8! Truncated if >= 64 characters.
// Address
wifi_softap_dhcps_stop();
struct ip_info info;
os_memset(&info, 0, sizeof(struct ip_info));
// Don't set Gateway since we can't offer Internet / DNS
// We're hardcoding our InqPortal server to always be 10.10.10.10.
IP4_ADDR(&info.ip, 10, 10, 10, 10);
IP4_ADDR(&info.gw, 10, 10, 10, 10);
IP4_ADDR(&info.netmask, 255, 255, 255, 0);
wifi_set_ip_info(SOFTAP_IF, &info);
// Start up the DHCP server.
wifi_softap_dhcps_start();
struct softap_config cfg;
os_memset((u8*)&cfg, 0, sizeof(struct softap_config));
os_sprintf((char*)cfg.ssid, "%s-%X",
"ESP8266", system_get_chip_id());
cfg.ssid_len = strlen((char*)cfg.ssid);
// Password is null terminated (no length) specified. Use this filling.
os_sprintf((char*)cfg.password, "");
cfg.channel = 1;
cfg.authmode = AUTH_OPEN;
cfg.ssid_hidden = 0;
cfg.max_connection = 4; // Note: default 4, max 4
cfg.beacon_interval = 100; // Note: support 100 ~ 60000 ms, default 100
wifi_softap_set_config(&cfg);
wifi_set_sleep_type(NONE_SLEEP_T);
}
ICACHE_FLASH_ATTR void user_init(void)
{
uart_init(BIT_RATE_115200, BIT_RATE_115200);
wifi_set_opmode(STATIONAP_MODE);
startSoftAP();
startStation();
startServer();
os_printf("Ready\n");
}
ICACHE_FLASH_ATTR uint32 user_rf_cal_sector_set(void)
{
enum flash_size_map size_map = system_get_flash_size_map();
uint32 rf_cal_sec = 0;
switch (size_map) {
case FLASH_SIZE_4M_MAP_256_256:
rf_cal_sec = 128 - 5;
break;
case FLASH_SIZE_8M_MAP_512_512:
rf_cal_sec = 256 - 5;
break;
case FLASH_SIZE_16M_MAP_512_512:
case FLASH_SIZE_16M_MAP_1024_1024:
rf_cal_sec = 512 - 5;
break;
case FLASH_SIZE_32M_MAP_512_512:
case FLASH_SIZE_32M_MAP_1024_1024:
rf_cal_sec = 1024 - 5;
break;
case FLASH_SIZE_64M_MAP_1024_1024:
rf_cal_sec = 2048 - 5;
break;
case FLASH_SIZE_128M_MAP_1024_1024:
rf_cal_sec = 4096 - 5;
break;
default:
rf_cal_sec = 0;
break;
}
return rf_cal_sec;
}
Statistics: Posted by Inquisitor — Mon Nov 29, 2021 12:52 am — Replies 13 — Views 36512
Statistics: Posted by 315002181huang — Fri Nov 26, 2021 7:10 pm — Replies 2 — Views 10551
Statistics: Posted by 18665955254 — Thu Nov 25, 2021 9:10 am — Replies 1 — Views 105431
Code:
uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
{
enum flash_size_map size_map = system_get_flash_size_map();
uint32 rf_cal_sec = 0;
switch (size_map) {
case FLASH_SIZE_4M_MAP_256_256:
rf_cal_sec = 128 - 5;
break;
case FLASH_SIZE_8M_MAP_512_512:
rf_cal_sec = 256 - 5;
break;
case FLASH_SIZE_16M_MAP_512_512:
case FLASH_SIZE_16M_MAP_1024_1024:
rf_cal_sec = 512 - 5;
break;
case FLASH_SIZE_32M_MAP_512_512:
case FLASH_SIZE_32M_MAP_1024_1024:
rf_cal_sec = 1024 - 5;
break;
case FLASH_SIZE_64M_MAP_1024_1024:
rf_cal_sec = 2048 - 5;
break;
case FLASH_SIZE_128M_MAP_1024_1024:
rf_cal_sec = 4096 - 5;
break;
default:
rf_cal_sec = 0;
break;
}
return rf_cal_sec;
}
Code:
uint32_t user_rf_cal_sector_set(void)
{
spoof_init_data = true;
return flashchip->chip_size/SPI_FLASH_SEC_SIZE - 4;
}
Statistics: Posted by Inquisitor — Sun Nov 14, 2021 2:05 am — Replies 0 — Views 38015
Statistics: Posted by Tsingtao — Tue Nov 02, 2021 2:29 pm — Replies 0 — Views 47222
Code:
#include <user_interface.h>
#include <espconn.h>
#define SSID "InqMakers-Guest"
#define PW "Inquisitive"
#define HOST "wp"
void setup()
{
Serial.begin(115200);
while(!Serial) { Serial.print("."); delay(100); }
delay(2000);
// This is just cook-book Station connection stuff.
setupWiFi();
// Setup and start web server listener
static espconn listen;
os_memset(&listen, 0, sizeof(espconn));
listen.type = ESPCONN_TCP;
listen.state = ESPCONN_NONE;
listen.proto.tcp = new esp_tcp();
listen.proto.tcp->local_port = 80;
espconn_regist_connectcb(&listen, onConnection);
// This appears to be an error handler. Haven't seen it hit yet.
espconn_regist_reconcb(&listen, onError);
printIfErr(espconn_accept(&listen), "listen");
Serial.println("Ready");
}
espconn* dis = NULL;
u32 last;
void loop()
{
// The only thing we do in the loop is do the final disconnect since
// we can't do it in the onSent() callback.
if (dis)
{
u32 now = micros();
Serial.printf("disconnect = %u us\n", now - last);
last = now;
s8 rtn;
if ((rtn = espconn_disconnect(dis)))
{
Serial.printf("ERR - disconnect = %d\n", rtn);
if ((rtn = espconn_abort(dis)))
Serial.printf("ERR - abort = %d\n", rtn);
}
if ((rtn = espconn_delete(dis)))
Serial.printf("ERR - delete = %d\n", rtn);
dis = NULL;
}
}
void onConnection(void* c)
{
espconn* conn = reinterpret_cast<espconn*>(c);
// Incoming connection
last = micros();
Serial.printf("\nonConnection\n");
espconn_regist_recvcb(conn, onReceive);
espconn_regist_sentcb(conn, onSent);
espconn_regist_disconcb(conn, onDisconnect);
espconn_set_opt(conn, ESPCONN_REUSEADDR | ESPCONN_NODELAY);
// We'll use our own buffer instead of their 2920 buffer
espconn_clear_opt(conn, ESPCONN_COPY);
}
void onError(void* conn, s8 err)
{
Serial.printf("ERR=%d\n", err);
}
void onReceive(void* c, char* buf, u16 length)
{
espconn* conn = reinterpret_cast<espconn*>(c);
u32 now = micros();
Serial.printf("onReceive = %u us\n", now - last);
last = now;
static char buffer[536];
// Print out the request just to make sure its what we think it is.
memcpy(buffer, buf, length);
*(buffer + length) = 0;
// Serial.print(buffer);
// We don't care what's in there since we'll send back a 404 anyway.
sprintf(buffer, "HTTP/1.1 404 Not Found\r\nServer: InqPortal/5.0\r\n",
"Content-type: text/html\r\nPragma: no-cache\r\n\r\n");
printIfErr(espconn_send(conn, (u8*)buffer, strlen(buffer)), "send");
now = micros();
Serial.printf("sent = %u us\n", now - last);
last = now;
}
void onSent(void* c)
{
u32 now = micros();
Serial.printf("onSent = %u us\n", now - last);
last = now;
// Manual says we can't call disconnect in callback. We'll use
// cheap way of just letting the loop() do it.
dis = reinterpret_cast<espconn*>(c);
;
}
void onDisconnect(void* c)
{
Serial.printf("onDisconnect \n");
}
void printIfErr(s8 esp, const char* msg)
{
if (esp)
Serial.printf("ERR - %s = %d\n", msg, esp);
}
void setupWiFi()
{
Serial.print("Connecting to your router");
wifi_set_opmode(STATION_MODE);
station_config sc;
os_memset(&sc, 0, sizeof(station_config));
sc.bssid_set = 0;
os_memcpy(&sc.ssid, SSID, 32);
os_memcpy(&sc.password, PW, 64);
wifi_station_set_config_current(&sc);
wifi_station_set_hostname(HOST);
wifi_station_connect();
while (wifi_station_get_connect_status() != STATION_GOT_IP)
{
Serial.print(".");
delay(1000);
}
ip_info info;
wifi_get_ip_info(STATION_IF, &info);
Serial.printf("\nBrowse to (http://%s/index.html) or (http://" IPSTR
"/index.html)\n",
HOST, IP2STR(&(info.ip)));
}
Statistics: Posted by Inquisitor — Mon Nov 01, 2021 10:12 pm — Replies 2 — Views 7901
Statistics: Posted by howchee — Fri Oct 15, 2021 11:51 am — Replies 1 — Views 27273
Statistics: Posted by jozles — Wed Oct 13, 2021 9:17 pm — Replies 3 — Views 11750
Statistics: Posted by maverickchongo — Wed Oct 06, 2021 4:06 am — Replies 4 — Views 15382
Statistics: Posted by Inquisitor — Tue Sep 28, 2021 3:03 pm — Replies 2 — Views 8134
Statistics: Posted by Inquisitor — Mon Sep 27, 2021 10:10 pm — Replies 2 — Views 10174
Statistics: Posted by thierryc49 — Sat Aug 28, 2021 3:48 am — Replies 0 — Views 36384
Statistics: Posted by lucyelectric — Mon Aug 09, 2021 5:03 pm — Replies 1 — Views 5440
Statistics: Posted by miklstel — Mon Aug 09, 2021 6:52 am — Replies 1 — Views 6567
Code:
LD build/main.elf
/opt/xtensa-lx106-elf-gcc/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: address 0x4028b92c of /home/dlut/GIT/esp8266_rtos_tamplate/build/main.elf section `.flash.rodata' is not within region `iram0_2_seg'
/opt/xtensa-lx106-elf-gcc/bin/../lib/gcc/xtensa-lx106-elf/8.4.0/../../../../xtensa-lx106-elf/bin/ld: address 0x4028b92c of /home/dlut/GIT/esp8266_rtos_tamplate/build/main.elf section `.flash.rodata' is not within region `iram0_2_seg'
collect2: error: ld returned 1 exit status
make: *** [/home/dlut/esp/ESP8266_RTOS_SDK/make/project.mk:510: /home/dlut/GIT/esp8266_rtos_tamplate/build/main.elf] Error 1
Code:
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000
ota_0, 0, ota_0, 0x10000, 0x78000
ota_1, 0, ota_1, 0x88000, 0x78000
Code:
❯ ls -la build/main.bin
-rw-r--r-- 1 dlut users 457120 Aug 3 10:26 build/main.bin
Statistics: Posted by dlut — Tue Aug 03, 2021 5:22 pm — Replies 1 — Views 5433
Code:
AT+PING="172.16.1.128"
+119
OK
Statistics: Posted by jenya7 — Tue Jun 29, 2021 7:25 pm — Replies 1 — Views 11027
Statistics: Posted by jenya7 — Tue Jun 29, 2021 2:28 pm — Replies 1 — Views 5982
Statistics: Posted by zrover — Wed Jun 09, 2021 4:27 pm — Replies 1 — Views 7525