Чт янв 14, 2021 10:25:15
Чт янв 14, 2021 10:43:24
Чт янв 14, 2021 12:39:24
Чт янв 14, 2021 13:33:32
Чт янв 14, 2021 14:45:49
А оно будет прошиваться через штатный usb порт как ардуина? Без ничего дополнительного в виде программатора?
Ср июн 07, 2023 12:25:08
Ср июн 07, 2023 14:39:48
Ср июн 07, 2023 15:34:01
Ср июн 07, 2023 16:16:49
Пт июн 09, 2023 15:56:26
Пт июн 09, 2023 18:26:06
Вт июл 25, 2023 01:50:40
>Serial port baud rate: 115200 (default), can be modified to other values by AT command
>Serial communication format: 8N1
Вт июл 25, 2023 05:34:04
Вт июл 25, 2023 10:31:01
Пт июл 28, 2023 12:16:49
ART_ME писал(а):Я в таких случаях первым делом провожу лечение с помощью flash_download_tool.
Причем это касается не только ESP8266, но и ESP32.
Пт июл 28, 2023 18:36:21
Сб авг 05, 2023 16:15:19
Alexanders-iMac:~ alexander$ pip3 install esptool
Alexanders-iMac:~ alexander$ pip3 install setuptools
Alexanders-iMac:~ alexander$ sudo esptool.py --port /dev/cu.usbserial write_flash 0x00000 0x00000.bin 0x40000 0x40000.bin
Password:
esptool.py v4.6.2
Serial port /dev/cu.usbserial
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: 54:48:e6:49:4d:81
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00008fff...
Flash will be erased from 0x00040000 to 0x00065fff...
Compressed 34368 bytes to 24212...
Wrote 34368 bytes (24212 compressed) at 0x00000000 in 3.2 seconds (effective 87.2 kbit/s)...
Hash of data verified.
Compressed 155496 bytes to 114696...
Wrote 155496 bytes (114696 compressed) at 0x00040000 in 10.5 seconds (effective 118.3 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
ets Jan 8 2013,rst cause:2, boot mode:(3,6)
load 0x40100000, len 29756, room 16
tail 12
chksum 0xef
ho 0 tail 12 room 4
load 0x88888888, len -2004318072, room 12
flash read err, ets_unpack_flash_code
ets_main.c
sudo esptool.py --port /dev/cu.usbserial erase_flash
Password:
esptool.py v4.6.2
Serial port /dev/cu.usbserial
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Detecting chip type... ESP8266
Chip is ESP8285
Features: WiFi, Embedded Flash
Crystal is 26MHz
MAC: 54:48:e6:49:4d:81
Uploading stub...
Running stub...
Stub running...
Erasing flash (this may take a while)...
Chip erase completed successfully in 1.6s
Hard resetting via RTS pin...
Сб авг 05, 2023 16:49:45
Сб авг 05, 2023 21:59:14
/*
WiFiTelnetToSerial - Example Transparent UART to Telnet Server for esp8266
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
This file is part of the ESP8266WiFi library for Arduino environment.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <ESP8266WiFi.h>
#include <algorithm> // std::min
#ifndef STASSID
#define STASSID "V765"
#define STAPSK "password"
#endif
/*
SWAP_PINS:
0: use Serial1 for logging (legacy example)
1: configure Hardware Serial port on RX:GPIO13 TX:GPIO15
and use EspSoftwareSerial for logging on
standard Serial pins RX:GPIO3 and TX:GPIO1
*/
#define SWAP_PINS 0
/*
SERIAL_LOOPBACK
0: normal serial operations
1: RX-TX are internally connected (loopback)
*/
#define SERIAL_LOOPBACK 0
#define BAUD_SERIAL 115200
#define BAUD_LOGGER 115200
#define RXBUFFERSIZE 1024
////////////////////////////////////////////////////////////
#if SERIAL_LOOPBACK
#undef BAUD_SERIAL
#define BAUD_SERIAL 3000000
#include <esp8266_peri.h>
#endif
#if SWAP_PINS
#include <SoftwareSerial.h>
SoftwareSerial* logger = nullptr;
#else
#define logger (&Serial1)
#endif
#define STACK_PROTECTOR 512 // bytes
// how many clients should be able to telnet to this ESP8266
#define MAX_SRV_CLIENTS 2
const char* ssid = STASSID;
const char* password = STAPSK;
const int port = 23;
WiFiServer server(port);
WiFiClient serverClients[MAX_SRV_CLIENTS];
void setup() {
Serial.begin(BAUD_SERIAL);
Serial.setRxBufferSize(RXBUFFERSIZE);
#if SWAP_PINS
Serial.swap();
// Hardware serial is now on RX:GPIO13 TX:GPIO15
// use EspSoftwareSerial on regular RX(3)/TX(1) for logging
logger = new SoftwareSerial(3, 1);
logger->begin(BAUD_LOGGER);
logger->enableIntTx(false);
logger->println("\n\nUsing EspSoftwareSerial for logging");
#else
logger->begin(BAUD_LOGGER);
logger->println("\n\nUsing Serial1 for logging");
#endif
logger->println(ESP.getFullVersion());
logger->printf("Serial baud: %d (8n1: %d KB/s)\n", BAUD_SERIAL, BAUD_SERIAL * 8 / 10 / 1024);
logger->printf("Serial receive buffer size: %d bytes\n", RXBUFFERSIZE);
#if SERIAL_LOOPBACK
USC0(0) |= (1 << UCLBE); // incomplete HardwareSerial API
logger->println("Serial Internal Loopback enabled");
#endif
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
logger->print("\nConnecting to ");
logger->println(ssid);
while (WiFi.status() != WL_CONNECTED) {
logger->print('.');
delay(500);
}
logger->println();
logger->print("connected, address=");
logger->println(WiFi.localIP());
// start server
server.begin();
server.setNoDelay(true);
logger->print("Ready! Use 'telnet ");
logger->print(WiFi.localIP());
logger->printf(" %d' to connect\n", port);
}
void loop() {
// check if there are any new clients
if (server.hasClient()) {
// find free/disconnected spot
int i;
for (i = 0; i < MAX_SRV_CLIENTS; i++)
if (!serverClients[i]) { // equivalent to !serverClients[i].connected()
serverClients[i] = server.accept();
logger->print("New client: index ");
logger->print(i);
break;
}
// no free/disconnected spot so reject
if (i == MAX_SRV_CLIENTS) {
server.accept().println("busy");
// hints: server.accept() is a WiFiClient with short-term scope
// when out of scope, a WiFiClient will
// - flush() - all data will be sent
// - stop() - automatically too
logger->printf("server is busy with %d active connections\n", MAX_SRV_CLIENTS);
}
}
// check TCP clients for data
#if 1
// Incredibly, this code is faster than the buffered one below - #4620 is needed
// loopback/3000000baud average 348KB/s
for (int i = 0; i < MAX_SRV_CLIENTS; i++)
while (serverClients[i].available() && Serial.availableForWrite() > 0) {
// working char by char is not very efficient
Serial.write(serverClients[i].read());
}
#else
// loopback/3000000baud average: 312KB/s
for (int i = 0; i < MAX_SRV_CLIENTS; i++)
while (serverClients[i].available() && Serial.availableForWrite() > 0) {
size_t maxToSerial = std::min(serverClients[i].available(), Serial.availableForWrite());
maxToSerial = std::min(maxToSerial, (size_t)STACK_PROTECTOR);
uint8_t buf[maxToSerial];
size_t tcp_got = serverClients[i].read(buf, maxToSerial);
size_t serial_sent = Serial.write(buf, tcp_got);
if (serial_sent != maxToSerial) { logger->printf("len mismatch: available:%zd tcp-read:%zd serial-write:%zd\n", maxToSerial, tcp_got, serial_sent); }
}
#endif
// determine maximum output size "fair TCP use"
// client.availableForWrite() returns 0 when !client.connected()
int maxToTcp = 0;
for (int i = 0; i < MAX_SRV_CLIENTS; i++)
if (serverClients[i]) {
int afw = serverClients[i].availableForWrite();
if (afw) {
if (!maxToTcp) {
maxToTcp = afw;
} else {
maxToTcp = std::min(maxToTcp, afw);
}
} else {
// warn but ignore congested clients
logger->println("one client is congested");
}
}
// check UART for data
size_t len = std::min(Serial.available(), maxToTcp);
len = std::min(len, (size_t)STACK_PROTECTOR);
if (len) {
uint8_t sbuf[len];
int serial_got = Serial.readBytes(sbuf, len);
// push UART data to all connected telnet clients
for (int i = 0; i < MAX_SRV_CLIENTS; i++)
// if client.availableForWrite() was 0 (congested)
// and increased since then,
// ensure write space is sufficient:
if (serverClients[i].availableForWrite() >= serial_got) {
size_t tcp_sent = serverClients[i].write(sbuf, serial_got);
if (tcp_sent != len) { logger->printf("len mismatch: available:%zd serial-read:%zd tcp-write:%zd\n", len, serial_got, tcp_sent); }
}
}
}
ets Jan 8 2013,rst cause:2, boot mode:(3,7)
load 0x4010f000, len 3424, room 16
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8
tail 0
chksum 0x2b
csum 0x2b
v00045370
~ld
rf cal sector: 252
freq trace enable 0
rf[112] : 0⸮
Вс авг 06, 2023 05:37:39