Slight problem using the ESP8266  - Page 1
Forum section: electronics / projects

author: bitwise_
author_rank: Contributor
timestamp: July 04, 2025, 11:13:50 am
content: Hi all,I am having a bit of trouble with the ESP8266. It is running some code for a simple "telnet" server and the problem is when the ESP sends out data to the clients, often enough garbage characters are received instead of the correct ones...This is the code it is running:Code:#include <ESP8266WiFi.h>#include <WiFiClient.h>#include <ESP8266WebServer.h>#include <ESP8266HTTPClient.h>#include <LittleFS.h>// WiFi credentials (insert your SSID and password)const char* ssid = "";const char* password = "";// Serial settingsuint16_t baud = 38400; // Change if needed// Telnet settingsconst int MAX_CLIENTS = 3;WiFiServer server(51515);WiFiClient serverClients;// Buffer size#define SERIAL_BUFFER_SIZE 64#define BURST_DELAY_US 100 // 100 microseconds between burstsvoid setup() {Serial.setRxBufferSize(1024);Serial.begin(38400, SERIAL_8O2);WiFi.mode(WIFI_STA);WiFi.begin(ssid, password);while (WiFi.status() != WL_CONNECTED) {delay(500);Serial.print(".");}Serial.println("\nWiFi connected");server.begin();server.setNoDelay(true); // Disable Nagle to reduce latency}void loop() {// Accept new Telnet clientsif (server.hasClient()) {WiFiClient newClient = server.available();bool added = false;for (int i = 0; i < MAX_CLIENTS; i++) {if (!serverClients || !serverClients.connected()) {if (serverClients) serverClients.stop();serverClients = newClient;added = true;break;}}if (!added) {newClient.stop(); // All slots full}}// Telnet → Serialfor (uint8_t i = 0; i < MAX_CLIENTS; i++) {if (serverClients && serverClients.connected() && serverClients.available()) {while (serverClients.available()) {char c = serverClients.read();if (c != '\r') {if (Serial.availableForWrite() > 0) {Serial.write(c);Serial.flush(); // Wait for TX completedelayMicroseconds(BURST_DELAY_US); // Delay per byte}}}}}// Serial → Telnet (buffered)static uint8_t buffer;int len = 0;while (Serial.available() && len < SERIAL_BUFFER_SIZE) {buffer[len++] = Serial.read();}if (len > 0) {for (int i = 0; i < MAX_CLIENTS; i++) {if (serverClients && serverClients.connected()) {serverClients.write(buffer, len);delayMicroseconds(BURST_DELAY_US); // Delay per burst}}}yield(); // Feed the watchdog}And this is an example output data with the garbage chars:Code:127f 32 30 30 30 30 46 44 31 35 45 34 45 37 46 44 33 20000FD15E4E7FD3128f 45 46 41 30 35 30 30 44 41 46 41 30 35 30 30 32 EFA0500DAFA05002129f 42 30 32 30 30 46 44 33 39 32 41 44 37 46 44 44 B0200FD392AD7FDD12af 38 31 31 46 44 37 41 46 44 72 45 30 41 30 30 30 811FD7AFD2E0A00012bf 30 30 30 46 44 44 38 41 45 46 44 46 31 46 44 33 000FDD8AEFDF1FD312cf 38 32 37 46 44 46 31 45 34 45 37 46 44 34 33 32 827FDF1E4E7FD43212df 38 46 44 34 34 30 32 30 30 46 41 46 35 46 46 32 8FD440200FAF5FF212ef 41 33 38 30 30 30 30 31 31 46 44 37 37 46 41 46 A38000011FD77FAF12ff 35 46 46 46 44 34 33 32 37 30 41 45 30 30 43 46 5FFFD43270AE00CF130f 41 46 35 46 46 32 41 33 38 30 30 30 30 44 37 31 AF5FF2A380000D71131f 31 46 44 32 45 30 30 30 30 30 30 30 30 42 30 46 1FD2E00000000B0F132f 44 37 46 45 34 43 30 30 30 30 30 43 36 43 46 30 D7FE4C00000C6CF0133f 44 46 41 46 35 46 46 32 41 33 38 30 30 30 30 31 DFAF5FF2A3800001134f 31 46 44 37 44 46 41 46 35 46 46 46 44 34 33 32 1FD7DFAF5FFFD432135f 37 46 41 46 37 46 46 44 37 44 41 46 41 46 35 46 7FAF7FFD7DAFAF5F136f 46 32 41 33 38 30 30 30 30 45 37 35 41 45 34 33 F2A380000E75AE43137f 32 41 37 30 30 33 38 30 30 30 30 44 44 30 37 38 2A700380000DD078138f 35 30 43 35 31 30 31 30 30 30 41 38 37 30 44 46 50C5101000A870DF139f 39 30 39 46 38 30 30 30 30 46 41 30 35 30 30 32 909F80000FA0500213af 42 30 32 30 30 30 37 45 33 30 44 32 41 30 37 45 B020007E30D2A07E13bf 33 30 44 46 39 30 39 44 37 44 38 44 44 33 30 30 30DF909D7D8DD30013cf 37 30 35 30 45 32 46 31 39 30 30 30 35 30 33 32 7050E2F19000503213df 34 31 39 30 30 30 35 30 33 45 41 30 37 30 35 30 419000503���csss��l�gFV 32 46 31 39 30 30 30 35 30 33 32 34 31 39 30 E2F190005032419013ff 30 30 35 30 33 45 35 45 34 30 39 44 41 44 38 41 00503E5E409DAD8A140f 37 30 30 46 44 41 34 30 34 37 34 31 46 31 46 30 700FDA404741F1F0141f 45 32 33 45 35 44 38 41 37 30 30 46 44 38 37 30 E23E5D8A700FD870142f 46 37 34 31 46 31 46 30 45 45 35 45 37 30 39 33 F741F1F0EE5E7093143f 30 33 31 33 32 33 33 33 34 33 35 33 36 33 37 33 0313233343536373144f 38 33 39 34 31 34 32 34 33 34 34 34 35 34 36 46 839414243444546F145f 39 30 39 46 38 30 30 30 30 46 41 30 35 30 30 32 909F80000FA05002146f 41 33 38 30 30 30 30 46 44 41 42 44 38 30 37 34 A380000FDABD8074147f 36 30 45 35 31 30 32 30 30 46 39 30 39 46 38 30 60E510200F909F80148f 30 30 30 46 41 30 35 30 30 46 44 32 41 31 45 42 000FA0500FD2A1EB149f 39 30 30 43 36 35 44 30 45 32 33 31 39 30 30 30 900C65D0E231900014af 35 30 33 37 39 30 41 34 45 30 45 46 39 30 39 46 503790A4E0EF909F14bf 38 30 30 30 30 35 32 30 35 30 30 35 32 30 32 30 800005205005202014cf 30 46 41 46 41 46 46 44 41 46 44 32 45 30 30 30 0FAFAFFDAFD2E00014df 30 30 30 30 30 45 37 46 44 34 33 46 41 30 35 30 00000E7FD43FA05014ef 30 32 41 33 38 30 30 30 30 44 37 31 31 46 44 32 02A380000D711FD214ff 45 30 30 30 30 30 30 30 30 42 30 46 44 37 33 45 E00000000B0FD73E150f 34 43 30 30 30 30 30 43 36 41 45 30 45 46 44 32 4C00000C6AE0EFD2151f 45 32 44 30 30 30 30 30 30 44 44 30 37 38 35 30 E2D000000DD07850152f 43 35 31 30 31 30 30 46 41 30 35 30 30 44 41 46 C510100FA0500DAF153f 41 30 35 30 30 32 41 33 38 30 30 30 30 46 44 39 A05002A380000FD9154f 37 45 37 46 44 34 33 30 41 44 39 30 45 46 41 30(7E7FD430AD90EFA0155f 35 30 30 32 41 33 38 30 30 30 30 44 37 31 31 46 5002A380000D711F156f 44 32 45 30 30 30 30 30 30 30 30 42 30 46 44 37 D2E00000000B0FD7157f 31 45 34 43 30 30 30 30 30 43 36 44 39 30 45 46 1E4C00000C6D90EF158f 44 32 45 33 30 30 30 30 30 30 30 44 44 30 37 38 D2E30000000DD078159f 35 30 43 35 31 30 31 30 30 46 39 30 39 30 41 44 50C510100F9090AD15af 39 30 45 46 41 30 35 30 30 32 41 33 38 30 30 30 90EFA05002A3800015bf 30 44 37 31 31 46 44 32 45 30 30 30 30 30 30 30 0D711FD2E000000015cf 30 42 30 46 44 37 46 45 34 43 30 30 30 30 30 43 0B0FD7FE4C00000C15df 36 36 36 30 46 46 41 46 43 46 46 44 37 44 41 46 6660FFAFCFFD7DAF15ef 41 46 41 46 46 32 41 33 38 30 30 30 30 45 37 35 AFAFF2A380000E7515ff 41 45 34 44 41 46 44 32 45 33 30 30 30 30 30 30 AE4DAFD2E3000000160f 30 44 37 31 31 46 41 30 35 30 30 32 41 33 38 30 0D711FA05002A380161f 30 30 30 44 37 46 44 44 38 31 31 46 44 37 41 46 000D7FDD811FD7AF162f 44 32 45 30 41 30 30 30 30 30 30 46 44 44 38 41 D2E0A000000FDD8A163f 45 31 31 46 44 46 31 46 44 33 38 32 37 46 44 46 E11FDF1FD3827FDF164f 31 45 34 35 36 45 34 45 37 46 44 33 45"46 41 30 1E456E4E7FD3EFA0165f 35 30 30 44 41 46 41 30 35 30 30 32 41 33 38 30 500DAFA05002A380166f 30 30 30 44 37 46 44 44 38 31 31 46 44 37 41 46 000D7FDD811FD7AF167f 44 32 45 30 41 30 30 30 30 30 30 46 44 44 38 41 D2E0A000000FDD8A168f 45 46 44 46 31 46 44 33 38 32 37 46 44 46 31 45 EFDF1FD3827FDF1E169f 34 45 37 46 44 34 33 46 41 46 41 46 46 32 41 33 4E7FD43FAFAFF2A316af 38 30 30 30 30 31 31 46 44 37 37 46 41 46 41 46 8000011FD77FAFAF16bf 46 46 44 34 33 32 37 30 41 44 39 30 45 46 41 46 FFD43270AD90EFAF16cf 41 46 46 32 41 33 38 30 30 30 30 44 37 31 31 46 AFF2A380000D711F16df 44 32 45 30 30 30 30 30 30 30 30 42 30 46 44 37 D2E00000000B0FD716ef 46 45 34 43 30 30 30 30 30 43 36 41 45 30 46 46 FE4C00000C6AE0FF16ff 41 46 41 46 46 32 41 33 38 30 30 30 30 31 31 46 AFAFF2A38000011F170f 44 37 44 46 41 46 41 46 46 46 44 34 33 32 37 46 D7DFAFAFFFD4327F171f 41 46 43 46 46 44 37 44 41 46 41 46 41 46 46 32 AFCFFD7DAFAFAFF2172f 41 33 38 30 30 30 30 45 37 35 41 45 34 33 32 41 A380000E75AE432A173f 37 30 30 33 38 30 30 30 30 44 44 30 37 38 35 30 700380000DD07850174f 43 35 31 30 31 30 30 30 41 36 36 30 46 46 39 30 C5101000A660FF90175f 39 46 38 30 30 30 30 35 32 30 35 30 30 35 32 30 9F80000520500520176f 32 30 30 46 41 46 41 46 46 44 41 46 44 32 45 30 200FAFAFFDAFD2E0177f 30 30 30 30 30 30 30 45 37 46 44 34 33 46 41 30 0000000E7FD43FA0178f 35 30 30 32 41 33 38 30 30 30 30 44 37 31 31 46 5002A380000D711F179f 44 32 45 30 30 30 30 30 30 30 30 42 30 46 44 37 D2E00000000B0FD717af 31 45 34 43 30 30 30 30 30 43 36 46 31 30 46 46 1E4C00000C6F10FF17bf 44 32 45 33 30 30 30 30 30`30 30 44 44 30 37 38 D2E30000000DD07817cf 35 30 43 35 31 30 31 30 30 46 39 30 39 30 41 46 50C510100F9090AF17df 31 30 46 46 41 30 35 30 30 32 41 33 38 30 30 30 10FFA05002A3800017ef 30 44 37 31 31 46 44 32 45 30 30 30 30 30 30 30 0D711FD2E000000017ff 30 42 30 46 44 38 31 45 34 43 30 30 30 30 30 43 0B0FD81E4C00000C180f 36 37 45 31 30 46 41 46 43 46 46 44 37 44 41 46 67E10FAFCFFD7DAF181f 41 46 41 46 46 32 41 33 38 30 30 30 30 45 37 35 AFAFF2A380000E75182f 41 45 34 44 41 46 44 32 45 33 30 30 30 30 30 30 AE4DAFD2E3000000183f 30 44 37 31 31 46 41 30 35 30 30 32 41 33 38 30 0D711FA05002A380184f 30 30 30 �4 37 46 44 44 38 31 31 46 44 37 41 46 000D7FDD811FD7AF185f 44 32 45 30 41 30 30 30 30 30 30 46 44 44 38 41 D2E0A000000FDD8A186f 45 31 31 46 44 46 31 46 44 33 38 32 37 46 44 46 E11FDF1FD3827FDF187f 31 45 34 35 36 45 34 45 37 46 44 33 45 46 41 30 1E456E4E7FD3EFA0188f 35 30 30 44 41 46 41 30 35 30 30 32 41 33 38 30 500DAFA05002A380189f 30 30 30 44 37 46 44 44 38 31 31 46 44 37 41 46 000D7FDD811FD7AF18af 44 32 45 30 41 30 30 30 30 30 30 46 44 44 38 41 D2E0A000000FDD8A18bf 45 46 44 46 31 46 44 33 38 32 37 46 44 46 31 45 EFDF1FD3827FDF1E18cf 34 45 37 46 44 34 33 46 41 46 41 46 46 32 41 33 4E7FD43FAFAFF2A318df 38 30 30 30 30 31 31 46 44 37 37 46 41 46 41 46 8000011FD77FAFAF18ef 46 46 44 34 33 32 37 30 41 46 31 30 46 46 41 46 FFD43270AF10FFAF18ff 41 46 46 32 41 33 38 30 30 30 30 44 37 31 31 46 AFF2A380000D711F190f 44 32 45 30 30 30 30 30 30 30 30 42 30 46"44 37 D2E00000000B0FD7191f 46 45 34 43 30 30 30 30 30 43 36 43 36 31 30 46 FE4C00000C6C610F192f 41 46 41 46 46 32 41 33 38 30 30 30 30 31 31 46 AFAFF2A38000011F193f 44 37 44 46 41 46 41 46 46 46 44 34 33 32 37 46 D7DFAFAFFFD4327F194f 41 46 43 46 46 44 37 44 41 46 41 46 41 46 46 32 AFCFFD7DAFAFAFF2195f 41 33 38 30 30 30 30 45 37 35 41 45 34 33 32 41 A3800�0E75AE432A196f 37 30 30 33 38 30 30 30 30 44 44 30 37 38 35 30 700380000DD07850197f 43 35 31 30 31 30 30 30 41 37 45 31 30 46 39 30 C5101000A7E10F90198f 39 46 38 30 30 30 30 46 41 30 35 30 30 32 41 44 9F80000FA05002AD199f 44 33 30 30 37 45 45 31 30 32 46 31 39 30 30 30 D3007EE102F1900019af 35 30 33 32 34 31 39 30 30 30 35 30 33 45 41 30 5032419000503EA019bf 37 45 45 31 30 32 46 31 39 30 30 30 35 30 33 32 7EE102F19000503219cf 34 31 39 30 30 30 35 30 33 46 39 30 39 44 41 44 419000503F909DAD19df 38 41 37 30 30 46 44 41 34 30 34 37 34 31 46 30 8A700FDA404741F019ef 38 31 31 32 33 45 35 44 38 41 37 30 30 46 44 38 81123E5D8A700FD819ff 37 30 46 37 34 31 46 30 38 31 31 45 35 45 37 30 70F741F0811E5E701a0f 39 33 30 33 31 33 32 33 33 33 34 33 35 33 36 33 93031323334353631a1f 37 33 38 33 39 34 31 34 32 34 33 34 34 34 35 34 73839414243444541a2f 36 46 39 30 39 46 38 30 30 30 30 35 32 30 32 30 6F909F80000520201a3f 30 46 38 30 38 30 30 46 41 46 39 46 46 30 37 36 0F80800FAF9FF0761a4f 45 31 31 30 37 35 45 31 31 37 45 46 44 34 45 31 E11075E117EFD4E11a5f 32 46 44 39 39 33 42 30 42 31 32 35 39 33 38 30 2FD993B0B12593801a6f 30 30 30 46 36 42 39 30 30 43 36 34 46 31 31 36 000F6B900C64F1161a7f 46 33 30 32 32 30 30 32 41 41`43 31 31 32 38 35 F3022002AAC112851a8f 34 33 39 36 33 30 32 30 30 30 41 33 39 31 31 31 4396302000A391111a9f 32 46 39 46 41 46 46 46 46 34 33 46 41 46 46 46 2F9FAFFFF43FAFFF1aaf 46 32 41 33 38 30 30 30 30 46 39 30 39 44 41 33 F2A380000F909DA31abf 38 30 30 30 30 42 44 30 30 43 36 36 43 31 31 37 80000BD00C66C1171acf 39 37 38 30 41 36 32 31 31 45 37 30 39 44 41 31 9780A6211E709DA11adf 39 30 31 30 35 30 33 42 39 30 30 43 36 36 46 31 9010503B900C66F11aef 31 37 36 31 42 43 36 39 42 31 31 37 36 30 41 43 1761BC69B11760AC1aff 36 30 36 31 32 37 36 30 44 43 36 30 36 31 32 37 60612760DC6061271b0f 36 35 43 43 36 43 37 31 31 37 36 30 38 43 36 39 65CC6C7117608C691b1f 37 31 31 31 41 33 45 37 39 30 41 36 46 31 31 37 7111A3E790A6F1171b2f 46 30 41 36 46 31 31 31 39 30 31 30 35 30 33 42 F0A6F1119010503B1b3f 39 30 30 43 36 39 42 31 31 37 36 35 42 43 37 36 900C69B11765BC761b4f 46 31 31 31 39 30 31 30 35 30 33 42 39 30 30 43 F1119010503B900C1b5f 36 41 39 31 31 37 36 34 34 43 36 42 46 31 31 37 6A9117644C6BF1171b6f 36 34 33 43 36 43 33 31 31 30 41 36 46 31 31 37 643C6C3110A6F1171b7f 46 30 41 36 46 31 31 37 39 30 41 36 46 31 31 31 F0A6F11790A6F1111b8f 39 30 31 30 35 30 33 42 39 30 30 43 36 43 37 31 9010503B900C6C711b9f 31 37 36 36 45 43 36 46 31 31 31 37 36 37 32 43 1766EC6F1117672C1baf 36 46 38 31 31 37 36 33 30 43 36 46 46 31 31 37 6F8117630C6FF1171bbf 36 35 43 43 36 45 41 31 31 31 41 33 45 37 39 30 65CC6EA111A3E7901bcf 41 36 46 31 31 31 39 35 43 33 45 37 39 30 41 36 A6F11195C3E790A61bdf 46 31 31 31 39 30 41 33 45 37 39 30 41 36 46 31 F11190A3E790A6F11bef 31 31 39 30 44 33 45 37 39 30 41 36 46 31 31 31 1190D3E790A6F1111bff 39 30 30 33 45 37 39 30 41 36 46 31 31 31 39 30 9003E790A6F111901c0f 30 33 45 45 37 30 39 30 31 30 30 30 41 30 30 36 03EE70901000A0061c1f 34 30 30 45 38 30 33 31 30 32 37 41 30 38 36 30 400E8031027a08601c2f 31 30 30 34 30 34 32 30 46 30 30 38 30 39 36 39 10040420F00809691c3f 38 30 30 30 30 45 31 46 35 30 35 30 30 43 41 39 80000E1F50500CA91c4f 41 33 42 46 39 30 39 30 30 30 30 34 35 36 45 37 A3BF9090000456E71c5f 34 36 35 37 32 32 30 36 31 32 30 36 45 37 35 36 465722061206E7561c6f 44 36 32 36 35 37 32 32 30 37 34 36 46 32 30 36 D62657220746F2061c7f 36 36 39 36 45 36 34 32 30 36 31 36 43 36 43 32 6696E6420616C6C21c8f 30 37 30 37 32 36 39 36 44 36 35 32 30 36 45 37 07072696D65206E71c9f 35 36 44 36 32 36 35 37 32 37 33 32 30 37 35 37 56D62657273207571caf 30 32 30 37 34 36 46 32 30 36 39 37 34 33 41 32 020746F2069743A21cbf 30 30 30 35 30 37 32 36 39 36 44 36 35 32 30 36 0005072696D652061ccf 45 37 35 36 44 36 32 36 35 37 32 37 33 32 30 36 E756D626572732061cdf 31 37 32 36 35 33 41 32 30 30 41 30 30 32 35 36 172653A200A002561cef 34 30 41 30 30 35 35 36 45 36 35 37 38 37 30 36 40A00556E65787061cff 35 36 33 37 34 36 35 36 34 32 30 36 36 36 46 37 56374656420666F71d0f 32 36 44 36 31 37 34 32 30 36 39 36 45 32 30 37 26D617420696E2071d1f 30 37 32 36 39 36 45 37 34 36 36 32 45 30 30 34 072696E74662E0041d2f 35 37 32 37 32 36 46 37 32 33 41 32 30 35 35 36 572726F723A205561d3f 45 36 42 36 45 36 46 37 37 36 45 32 30 36 31 37 E6B6E6F776E206171d4f 32 36 37 37 35 36 44 36 35 36 45 37 34 32 30 37 267756D656E742071d5f 34 37 39 37 30 36 35 32 45 30 41 30 30 42 38 31 47970652E0A00B811d6f 32 30 30 00 00 00 00 00 00 00 00 00 00 00 00 00 200.............1d7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1d8f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1d9f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1daf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1dbf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1dcf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1ddf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1def 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1dff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e1f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e2f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e4f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e5f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e6f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .........�......1e7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e8f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1e9f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1eaf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1ebf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1ecf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1edf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1eef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1eff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f0f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f1f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f2f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f4f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1v5f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f6f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 �...............1f7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1f8f 00 00 00 00 00 00 00 00 00 00 00 00 00$00 00 00 ................1f9f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1faf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1fbf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1fcf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1fdf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1fef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................1fff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................200f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................201f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................202f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................203f 00 00 00(00 00 00 00 00 00 00 00 00 00 00 00 00 ................204f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................205f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................206f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................207f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................208f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................209f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................20af 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................20bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................20cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................20df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................20ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................20ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................210f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................211f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................212f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................213f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................214f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................215f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................216f 00 00 00 00 00 00 00 00 00 00 �0 00 00 00 00 00 ................217f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................218f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................219f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................21af 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................21bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................21cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................21df 00 00 00 00 00 00 00 00 00 00 0� 00 00 00 00 00 ................21ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................21ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................220f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................221f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................222f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................223f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................224f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................225f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................226f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................227f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................228f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................229f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................22af 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................22bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................22cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................22df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................22ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................22ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................230f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................231f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................232f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00�00 ................233f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................234f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................235f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................236f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................237f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................238f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................239f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................23af 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................23bf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................23cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................23df 00 00 00 00 00 00(00 00 00 00 00 00 00 00 00 00 ................23ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................23ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................240f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................241f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................242f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................243f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................244f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................245f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................246f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................247f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................248f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................249f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................24af 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................24bf 00 00 00 00 00 00 00 00 20 00 00 00 00 00 00 00 ................24cf 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................24df 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................24ef 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00The ESP8266 is connected to a 16550 UART and is being powered from 5V. The UART operates with 5V. I read that the ESP is tolerant of 5V inputs, and the UART has a VIH min of 2V and the esp is sending 3.3V data.So from what I understand I should not need any level shifters here right? I think there might be something wrong with my code. I am not knowlegeable in that type of code and I hacked it together.You can connect to my project if you telnet into it via this site:https://youfiles.herokuapp.com/telnetclient/The hostname is sol-1.org, and the port is 51515.If you use the command: xxd bin/primesyou will see a printout of data with the type of problem I am talking about.Would you please have a look to see what might be wrong? Thanks in advance to anyone who could spend a few minutes on this.

author: xvr
author_rank: Frequent Contributor
timestamp: July 04, 2025, 12:38:06 pm
content: Quotexxd command prints binary data in form of hex dump (pure ASCII text). This is exactly that was shown in your 'example output data with the garbage chars'What is wrong with it?I see - this is a couple screens down.Data on hex pane seems valid (pure hex symbols).May be telnet client inserts some control symbols during sending data (it could)?

author: Peabody
author_rank: Super Contributor
timestamp: July 04, 2025, 01:37:34 pm
content: Are you sure your yield() is executed often enough?

author: bitwise_
author_rank: Contributor
timestamp: July 04, 2025, 02:29:46 pm
content: Quote from: Peabody on July 04, 2025, 01:37:34 pmNopeI got not much idea what I am doing there. I thought maybe someone can spot an obvious a fatal error in my code....

author: bitwise_
author_rank: Contributor
timestamp: July 04, 2025, 02:30:51 pm
content: Quote from: xvr on July 04, 2025, 12:38:06 pmThe issue seems to be receiving only. I don't think I ever had an error when sending data into the ESP. But when the ESp sends data out, then there are errors...The telnet client is set to passive mode, I dont think it sends extra...

author: xvr
author_rank: Frequent Contributor
timestamp: July 04, 2025, 06:14:54 pm
content: May be output level from ESP is not enough for 16550? It could be less than 3.3V. Check it with oscilloscope. You can also write test program that sends just predefined stream of symbols (to exclude possible problems with TCP/IP stack) - will UART receive correct sequence?

author: bitwise_
author_rank: Contributor
timestamp: July 04, 2025, 08:42:02 pm
content: Quote from: xvr on July 04, 2025, 06:14:54 pmThe UART has a VIH of 2V, so according to that the ~3.3 output from ESP should be enough for a logic high...

author: xvr
author_rank: Frequent Contributor
timestamp: July 04, 2025, 09:07:31 pm
content: QuoteShould, but can? Personally, I had a problem interfacing CH340 with ESP32. According to the specification, CH340 should provide sufficient levels for both low and high voltage for ESP, but in reality it gave a slightly higher logic 0 (0.8 V instead of 0.7 as stated in the specification). ESP after that worked very unstable (works today, and stops working tomorrow)Electronics is a science of contacts.Check the levels.

author: bitwise_
author_rank: Contributor
timestamp: July 05, 2025, 11:04:47 am
content: Ok thanks a lot for the suggestion. I will look into a way of doing that and will let you know.

author: Peabody
author_rank: Super Contributor
timestamp: July 05, 2025, 02:23:35 pm
content: Is BURST_DELAY_US in your code involved in the transmission? If so is there any larger value for it which makes the errors disappear? I really have no idea what's going on in your code, but just wonder if possibly the UART is being overrun from time to time. Speaking of which, where is the code that initializes the UART and responds to its interrupts, etc.? Is it in one of the libraries? Sorry to be so dense, but I guess I don't understand what your telnet server is actually doing.