• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    HTML
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

TCP Network to Serial Proxy using WebSocket for ESP8266

Transparent TCP Network to Serial Proxy using WebSocket for ESP8266

This is a pure transparent bridge between Wifi and serial using any ESP8266 device. It's very useful for debugging or talking to remote serial device that have no network connection.

I'm using it on WeMos target, you can find more information on WeMos on their site, it's really well documented. I now use WeMos boards instead of NodeMCU's one because they're just smaller, features remains the same, but I also suspect WeMos regulator far better quality than the one used on NodeMCU that are just fake of originals AMS117 3V3.

This project is mainly based on excellent @me-no-dev ESPAsyncWebServer library and great JQuery Terminal done by Jakub Jankiewicz.

Documentation

Once uploaded SPIFFS data (web page) you can connect with a browser to http://ip_of_esp8266 and start playing with it. The main index.htm web page include a full javascript terminal so you can type command and receive response.

The main web page can also be hosted anywhere and it's not mandatory to have it on the device (except if device and your computer have no access on Internet). I've published the fully fonctionnal WEB page from github so you can access it from here and then connect to your device on wich you flashed the firmware.

Some commands will be interpreted by the target (ESP8266) and not passed to serial, so you can interact with ESP8266 doing some variable stuff.

Test web page without ESP8266

You need to have nodejs and some dependencies installed.

webdev folder is the development folder to test and validate web pages. It's used to avoid flashing the device on each modification. All source files are located in this folder the ESP8266 data folder (containing web pages) is filled by a nodejs script launched from webdev folder. This repo contain in data lasted files so if you don't change any file, you can upload to SPIFFS as is.

To test web pages, go to a command line, go into webdev folder and issue a:
node web_server.js
then connect your browser to htpp://localhost:8080 you can them modidy and test source files such index.htm

Once all is okay issue a:
node create_spiffs.js
this will gzip file and put them into data folder, after that you can upload from Arduino IDE to device SPIFFS

See comments in both create_spiffs.js and web_server.js files, it's also indicated dependencies needed by nodejs.

Terminal Commands:

  • connect : connect do target device
  • help : show help

Commands once connected to remote device:

  • !close or CTRL-D : close connection
  • swap swap ESP8266 UART pin between GPIO1/GPIO3 with GPIO15/GPIO13
  • ping typing ping on terminal and ESP8266 will send back pong
  • ? or help show help
  • heap show ESP8266 free RAM
  • whoami show WebSocket client # we are
  • who show all WebSocket clients connected
  • fw show firmware date/time
  • baud n set ESP8266 serial baud rate to n (to be compatble with device driven)
  • reset p reset gpio pin number p
  • ls list SPIFFS files
  • read file execute SPIFFS file command

Every command in file startup.ini are executed in setup() you can chain with other files.

I'm using this sketch to drive Microchip RN2483 Lora module to test LoraWan, see the boards I used.

For example my startup.ini file contains command to read microchip RN2483 config file named rn2483.txt

startup.ini

# Startup config file executed once in setup()
# commands prefixed by ! are executed by ESP
# all others passed to serial module

# Chain with Microchip Lora rn2483 configuration
!read /rn2483.txt

rn2483 configuration file for my WeMos shield rn2483.txt

# Startup config file for Microchip RN2483
# commands prefixed by ! are executed by ESP all others passed to serial module
# !delay is not executed when connected via browser web terminal (websocket)
# See schematics here https://github.com/hallard/WeMos-RN2483

# Set ESP Module serial speed (RN2483 is 57600)
!baud 57600
!delay 100

# reset RN2483 module (reset pin connected to ESP GPIO15)
!reset 15
!delay 1000

# Light on the LED on GPIO0
sys set pindig GPIO0 1
!delay 250

# Light on the LED on GPIO10
sys set pindig GPIO10 1
!delay 250

By the way I integrated the excellent @me-no-dev SPIFFS Web editor so you can direct edit configuration files of SPIFFS going to http://ESP_IP/edit Your computer need to be connected to Internet (so may be your ESP8266 device) and authenticated for this feature, default login/pass are in the sketch (admin/admin)

See all in action
http://cdn.rawgit.com/hallard/WebSocketToSerial/master/webdev/index.htm

Known Issues/Missing Features:

  • More configuration features
  • Configuration file for SSID/PASSWORD and login/pass for http admin access

Dependencies

Misc

See news and other projects on my blog

More Repositories

1

WeMos-Lora

ESP8266 WeMos Shield for HopeRF RFM95 RFM96 RFM98 Lora module
217
star
2

Mini-LoRa

Arduino Mini Lora Battery/Sensors Board
172
star
3

LoRasPI

Raspberry PI Lora Gateway/Node for HopeRF RFM95 RFM96 RFM98 Modules
124
star
4

RadioHead

RadioHead Packet Radio library for embedded microprocessors
C++
124
star
5

NodeMCU-Gateway

NodeMCU ESP8266 RF Gateway and Display Board
113
star
6

ArduiPi_OLED

Common used OLED driver for Raspberry PI
C++
112
star
7

RAK831-Zero

Pi Zero RAK831 Adapter board
99
star
8

LibTeleinfo

Librairie Universelle Teleinformation (TIC)
C++
89
star
9

Battery-Voltage-Measure

Battery Voltage monitor with no current drain breakout board
68
star
10

RPI-Lora-Gateway

Raspberry PI Lora Gateway/Node for RFM92/95/96/98/69HCW Modules
Eagle
58
star
11

WeMos-TIC

WeMos ESP8266/ESP32 Teleinfo (TIC) Shield
48
star
12

Scan-I2C-WiFi

ESP8266 I2C Scanner with oled display, WS2812 RGB Led and OTA
C
42
star
13

teleinfo

Projets dédié à la téléinformation
Eagle
42
star
14

WeMos-RN2483

ESP8266 WeMos Shield for Microchip LORAWAN RN2483 or RN2903
Eagle
40
star
15

WeMos-Matrix-Shield

WeMos ESP32 ESP8266 RGB LED Matrix Shield
37
star
16

WeMos-Matrix-Shield-DMA

ESP32 DMA RGB LED Matrix Shield
35
star
17

Omega2-IO-Power

FTDI Power SPI I2C Shield for Onion Omega2
Eagle
34
star
18

LoRa-E5-Breakout

LoRa-E5 Breakout board
28
star
19

ArduiPi_SSD1306

ArduiPi Adafruit SSD1306 OLED Driver for Raspberry Pi and ArduiPi Board
C++
28
star
20

arduipi

ArduiPi is a shield for Raspberry Pi that brings Arduino low level extented I/O to Raspberry Pi
Arduino
24
star
21

WeMos-RFM69

WeMos RFM69 RF Gateway + IC2 Oled + ATSHA204
24
star
22

ULPNode

Ultra Low Power Arduino Wireless Sensor Node
Eagle
24
star
23

Pro-Mini-ICSP-FTDI

Arduino Pro Mini ICSP and FTDI Programming Board
Eagle
22
star
24

LoRa-E5-Tiny

LoRa-E5 Tiny cell coin STM32WL LoRaWAN board
20
star
25

LoLin32-Lora

ESP32 LoLin32 Lite Shield for RFM95 or RN2483 LoRa Modules
20
star
26

RAK3172-Breakout

STM32WL LoRaWAN Breakout board for RAK3172
19
star
27

WeMos-RFLink

ESP8266 WeMos Shield for RFLink + OLED
Eagle
18
star
28

remora_soft

Logiciel pour les cartes Fils Pilotes Wifi de type Remora
C++
18
star
29

LoLin32-Lite-Lora

ESP32 LoLin32 Lite Shield for RFM95 or RN2483 LoRa Modules
15
star
30

MAX31865-Breakout

MAX31865 PT100 PT1000 RTD temperature sensor breakout board
Eagle
15
star
31

WifInfo

Wifi Teleinfo Web Server
Eagle
15
star
32

LoraCHIP

C.H.I.P. Computer RN2483 or RFM95 Lora Shield
Eagle
14
star
33

WeMos-shield

Basic WeMos Shield with minimal features
Eagle
12
star
34

rgb-matrix-crypto-ticker

RGB Matrix Crypto Ticker
Python
12
star
35

cc2538-multi-connect

ZigBee CC2538 multiconnect PCB Breakout
10
star
36

Lora-Breakout

Hope RF Lora module RFM92 RFM95 RFM96 RFM98 Breakout Board to be used on NRF24L01 connector
Eagle
9
star
37

RFM69W-BreakOut

RFM69W with SD and Flash EEP Breakout Board
8
star
38

R-Divider-Breakout

Voltage divider breakout for 4 Channels ADS1015/ADS1115 ADC Board
Eagle
7
star
39

RFM12B-BreakOut

RFM12B with SD and Flash EEP Breakout Board
7
star
40

DAC-Shield

Arduino 0-10V DAC / ADC / RS485 / OLED Shield
Eagle
7
star
41

TH02

TH02 temperature and humidity sensor library
C++
6
star
42

ULPNode_Lib

Ultra Low Power Library
C++
5
star
43

RM1xx-Breakout

Laird LoRa/Bluetooth Low Energy Module breakout for RM1xx modules
Eagle
5
star
44

ULPNode_RF_Protocol

ULPNode RF protocol definition and utilities files
C++
5
star
45

DAC7565

TI DAC7565, DAC7564, DAC8164 and DAC8564 Arduino Library
C++
5
star
46

Arduino-Boards

Support for my Arduino compatible development boards
C
4
star
47

Particle2NodeMCU

Particle Spark or Photon to NodeMCU Adapter
Eagle
4
star
48

NRJMeter

Connected NRJ Metering device for Teleinfo and various counters
C++
4
star
49

Particle-Gateway

Particle (Spark) RF Gateway and Display Board
Eagle
4
star
50

Shelly-FTDI

Shelly FTDI programmer board
3
star
51

MicAmplifier

Universal Stereo MIC/Line amplifier for Audio processing with ADC
3
star
52

WeMos-rn2483-firmware

Wemos RN2483 Shield Firmware
HTML
3
star
53

RFPIGW

RFM12B RFM69 Raspberry Pi Gateway with OLED and OOK
2
star
54

NRF24-Breakout

NRF24L01 Breakout Board Socket
Eagle
2
star
55

1-Wire-Fil-Pilote

Carte 1-Wire Fil Pilote
2
star
56

teleinfo-test

Programme de test des modules téléinfo
Python
2
star
57

Denky-D4

Denky D4 WiFi Teleinfo
2
star
58

uTeleinfo

Micro Teleinfo USB Dongle
2
star
59

tinfo_replay

Script to replay teleinfo frames for testing
Python
1
star
60

ArduiLED

ArduiLED for driving addressable RGB LED Strip
1
star
61

Makerfabs-LvglWidgetsDemo

Makerfabs LvglWidgets Demo platformio
C
1
star