Вт июн 06, 2023 03:11:32
Чт июн 15, 2023 02:19:42
Чт июн 15, 2023 05:11:31
Чт июн 15, 2023 09:06:42
Чт июн 15, 2023 10:08:47
Чт июн 15, 2023 13:21:15
Чт июн 15, 2023 18:02:41
Сб июл 01, 2023 22:56:42
Сб сен 02, 2023 17:56:37
8N1, 74880 baud
https://arduino.esp8266.com/stable/package_esp8266com_index.json
//******************************************************************************
// WiFiUartTransparentBridge
// Version 1.1.0
// Note
// This sketch is based on "WiFiTelnetToSerial - Example Transparent UART to Telnet Server for esp8266"
// modified by log4x4 at logx4x4@gmail.com
// 2023
//******************************************************************************
#include <ESP8266WiFi.h>
//uncomment (or comment if you wish to use DYNAMIC IP) if you wish to use STATIC IP
#define STATIC_IP_ADDR
//SSID, password, network port and baudrate
const char* ssid = "yournetworkname";
const char* password = "yourpass";
const int networkport = 23;
const int baudrate = 9600;
//name of your device for customising the text strings
const char* devicename = "V7-65/2";
WiFiServer localServer(networkport);
WiFiClient localClient;
//fill your WiFi network static options here
#ifdef STATIC_IP_ADDR
IPAddress staticIP(192,168,100,65);
IPAddress gateway(192,168,100,1);
IPAddress subnet(255,255,255,0);
#endif
void setup()
{
Serial.begin(baudrate, SERIAL_7N2); //mode selection, refer more to: https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/
WiFi.begin(ssid, password);
#ifdef STATIC_IP_ADDR
WiFi.config(staticIP, gateway, subnet);
#endif
Serial.print("\nConnecting to "); Serial.println(ssid);
uint8_t i = 0;
while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500);
if(i == 21)
{
Serial.print("Could not connect to"); Serial.println(ssid);
while(1) delay(500);
}
//start UART and the server
localServer.begin();
localServer.setNoDelay(true);
Serial.print("Ready! Use UART-WiFi Bridge ");
Serial.print(WiFi.localIP());
Serial.print(" on port ");
Serial.print(networkport);
Serial.print(" to connect to your ");
Serial.println(devicename);
}
void loop()
{
//check if there are any new clients
if (localServer.hasClient())
{
if (!localClient.connected())
{
if(localClient) localClient.stop();
localClient = localServer.available();
localClient.write("Welcome to "); //my added string
localClient.write(devicename);
}
}
//check a client for data
if (localClient && localClient.connected())
{
if(localClient.available())
{
size_t len = localClient.available();
uint8_t sbuf[len];
localClient.readBytes(sbuf, len);
Serial.write(sbuf, len);
}
}
//check UART for data
if(Serial.available())
{
size_t len = Serial.available();
uint8_t sbuf[len];
Serial.readBytes(sbuf, len);
if (localClient && localClient.connected())
{
localClient.write(sbuf, len);
}
}
}
telnet 192.168.100.65 23
1 - RX
2 - TX
3 - GND
4 - GND
5 - +5V
Вс сен 03, 2023 20:46:22
Average 29C, kOhm
0.33214
Average 40C, kOhm
0.33239
Difference, kOhm
+0.00025
Difference, %
+0.07473
Вс сен 03, 2023 21:13:30
Вс сен 03, 2023 22:31:52
Пн сен 04, 2023 22:14:11
Ср сен 06, 2023 19:34:40
Чт сен 07, 2023 00:08:24
Сб сен 09, 2023 10:14:09
Сб сен 09, 2023 23:39:09
! - очистка буфера, при отправке восклицательного знака вольтметр ругается ERR54 (Неправильные программные данные)
T - проведение тестов, тоже ошибка ERR54
X1 - пуск, тоже ERR54 (Но тут не уверен, может что-то вводить надо до этого)
//******************************************************************************
// WiFiUartTransparentBridge
// Version 1.1.0
// Note
// This sketch is based on "WiFiTelnetToSerial - Example Transparent UART to Telnet Server for esp8266"
// modified by log4x4 at logx4x4@gmail.com
// 2023
//******************************************************************************
#include <ESP8266WiFi.h>
//uncomment (or comment if you wish to use DYNAMIC IP) if you wish to use STATIC IP
#define STATIC_IP_ADDR
//SSID, password, network port and baudrate
const char* ssid = "yournetworkname";
const char* password = "yourpass";
const int networkport = 23;
const int baudrate = 9600;
//name of your device for customising the text strings
const char* devicename = "V7-65/2";
WiFiServer localServer(networkport);
WiFiClient localClient;
//fill your WiFi network static options here
#ifdef STATIC_IP_ADDR
IPAddress staticIP(192,168,100,65);
IPAddress gateway(192,168,100,1);
IPAddress subnet(255,255,255,0);
#endif
//setup WiFi and serial communication parameters, please change the serial mode here, values for serial options are hardcoded in Arduino headers
void setup()
{
Serial.begin(baudrate, SERIAL_7E1); //mode selection, refer more to: https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/
WiFi.begin(ssid, password);
#ifdef STATIC_IP_ADDR
WiFi.config(staticIP, gateway, subnet);
#endif
Serial.print("\nConnecting to "); Serial.println(ssid);
uint8_t i = 0;
while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500);
if(i == 21)
{
Serial.print("Could not connect to"); Serial.println(ssid);
while(1) delay(500);
}
//start UART and the server
localServer.begin();
localServer.setNoDelay(true);
Serial.print("Ready! Use UART-WiFi Bridge ");
Serial.print(WiFi.localIP());
Serial.print(" on port ");
Serial.print(networkport);
Serial.print(" to connect to your ");
Serial.println(devicename);
}
void loop()
{
//check if there are any new clients
if (localServer.hasClient())
{
if (!localClient.connected())
{
if(localClient) localClient.stop();
localClient = localServer.available();
localClient.write("Welcome to "); //my added string
localClient.write(devicename);
localClient.write("\n");
}
}
//check a client for data
if (localClient && localClient.connected())
{
if(localClient.available())
{
size_t len = localClient.available();
uint8_t sbuf[len];
localClient.readBytes(sbuf, len);
Serial.write(sbuf, len);
}
}
//check UART for data
if(Serial.available())
{
size_t len = Serial.available();
uint8_t sbuf[len];
Serial.readBytes(sbuf, len);
if (localClient && localClient.connected())
{
localClient.write(sbuf, len);
}
}
}
Пн сен 11, 2023 19:36:53
Пн сен 11, 2023 20:14:53
Пн сен 11, 2023 20:31:15