Coder Social home page Coder Social logo

esp8266-uart-to-uart-bridge's Introduction

ESP8266-UART-to-UART-Bridge

Transparent UART to UART Bridge using ESP8266.

Before

Microprocessor-1 Microprocessor-2
UART
TX RX
RX TX
GND GND

Using WiFi

Many similar apps have been released, but they often use AP mode servers and STA mode clients.
In this case, it is necessary to start the AP mode server first.
If the STA mode client is started first, it will fail to connect to the AP.
This project runs both nodes in STA mode.
The IP address of the other side can be found using mDNS.
Therefore, we don't need to worry about the boot order of ESP8266.

Microprocessor-1 ESP8266-1 ROUTER ESP8266-2 Microprocessor-2
UART WiFi WiFi UART
TX RX TX RX
RX TX RX TX
GND GND GND GND

slide1

Using ESPNOW

This project uses ESPNOW broadcast to find the MAC address of the other side.
There is no need to register the MAC address of the other side.
We don't need to worry about the boot order of ESP8266.

Microprocessor-1 ESP8266-1 ESP8266-2 Microprocessor-2
UART ESPNOW UART
TX RX TX RX
RX TX RX TX
GND GND GND GND

slide3

How to use WiFi

Edit Your SSID & Password.
Edit UART boudrate.
Flash sketch to ESP8266-1.
Flash same sketch to ESP8266-2.
Connect Microprocessor-1 to ESP8266-1 via UART.
Connect Microprocessor-2 to ESP8266-2 via UART.
Send data from Microprocessor-1 to ESP8266-1.
Receive data from ESP8266-2 to Microprocessor-2.

You can use ESP8266 as a dedicated WiFi router.
esp_wifi_repeater
https://github.com/martin-ger/esp_wifi_repeater

Microprocessor-1 ESP8266-1 ESP8266-3(esp_wifi_repeater) ESP8266-2 Microprocessor-2
UART WiFi WiFi UART
TX RX TX RX
RX TX RX TX
GND GND GND GND

slide2

How to use ESPNOW

Edit UART boudrate.
Flash sketch to ESP8266-1.
Flash same sketch to ESP8266-2.
Connect Microprocessor-1 to ESP8266-1 via UART.
Connect Microprocessor-2 to ESP8266-2 via UART.
Send data from Microprocessor-1 to ESP8266-1.
Receive data from ESP8266-2 to Microprocessor-2.

How to disable ESP8266 boot messages

ESP8266 boot rom writes a log to the UART when booting like this:
This message can cause unexpected trouble.

ets Jan  8 2014,rst cause 1, boot mode:(3,7)

load 0x40100000, len 24236, room 16
tail 12
chksum 0xb7
ho 0 tail 12 room 4
load 0x3ffe8000, len 3008, room 12
tail 4
chksum 0x2c
load 0x3ffe8bc0, len 4816, room 4
tail 12
chksum 0x46
csum 0x46

Swap UART

UART can be swapped by adding the following one line:

void setup() {
	Serial.swap();   

TX / RX changes to the following when UART is swapped.

GPIO15(TXD)   --- RX
GPIO13(RXD)   --- TX

It doesn't help because the boot messages appear before the main module starts.

Add a circuit

If the following circuit is added, All messages does not reach RX port of the other side.
I used 1N5819 Schottky Barrier Plastic Rectifier.

UART_BOOT_MESSAGE

To start transmission, set the GPIO polarity to OUTPUT and the level to LOW.
This method works pretty reliably.

void setup() {
	pinMode(GPIO, OUTPUT);
	digitalWrite(GPIO, LOW);
	Serial.begin(115200);

NOTE:GPIO15 is pulled down and cannot be used for this.

esp8266-uart-to-uart-bridge's People

Contributors

nopnop2002 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

esp8266-uart-to-uart-bridge's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.