Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serial to TCP bridge, TCPStart and TCPBaudRate #8702

Merged
merged 1 commit into from
Jun 15, 2020

Conversation

s-hadinger
Copy link
Collaborator

Description:

Add a new feature: Serial to TCP bridge (similar to esp-link). This allows to remotely communicate to a MCU through ESP8266. Needs #define USE_TCP_BRIDGE

It adds 2 GPIO types: TCP Tx (208) and TCP Rx (209) and can work with hardware or software serial.

Commands:

  • TCPBaudRate <x>: sets the baudrate for serial (only 8N1 mode), min 1200, max 115200 by 1200 increments.
  • TCPStart <port>: listens to port <port>. This features supports 2 parallel TCP connexions, which can be useful if you need a terminal + a specific protocol (like XMODEM). The 3rd connection will disconnect an previous connection. The number of parallel connections is a compile-time option.
  • TCPStart 0 or TCPStart: shuts down the TCP server and disconnects any existing connection.

For security reasons, the TCP bridge is not started at boot, and requires an explicit TCPStart command (can be automated with Rules).

Size impact:

  • Flash: +1.3kb
  • Ram: +64 bytes

Checklist:

  • The pull request is done against the latest dev branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR.
  • The code change is tested and works on core ESP8266 V.2.7.1
  • The code change is tested and works on core ESP32 V.1.12.2
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@s-hadinger
Copy link
Collaborator Author

@arendst I'm not sure why compilation fails (mDNS), but it seems unrelated to this PR.

@TheChatty
Copy link
Contributor

With no configured GPIO:

  • issueing "tcpbaudrate " causes an exception & reboot
  • issueing "tcpstart " causes a command error

How can I make it work with hardware serial (no configured GPIOs) thus allowing "serialsend" etc. simultaneously?

@ayavilevich
Copy link
Contributor

I couldn't find any mention of this feature in the docs. Is this intentional? To be added later?

@s-hadinger
Copy link
Collaborator Author

You are right, it's missing in the doc. You are more than welcome to provide a doc Pull Request with the missing parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants