Giter Site home page Giter Site logo

holgerlembke / serialtcp Goto Github PK

View Code? Open in Web Editor NEW
17.0 2.0 3.0 38 KB

send debug data to serial port and via tcp connection to a listener (made for esp8266/esp32)

PowerShell 10.84% C++ 83.26% Shell 5.90%
arduino serial ota remote udp tcp serialmonitor

serialtcp's Introduction

include

  #include <serialTCP.h>

serialUDP

send debug data to serial port and via udp packets to a listener (made for esp8266/esp32)

Using it is simple: after establishing the wifi-connection call

  SerialUDP.begin(115200,"1.2.3.4",1111);  
  SerialUDP.println("Test");

listener

made for powershell

Usage: load the function, than call it.

 . .\listen.ps1
  udplisten -p 1111 -ip 1.2.3.4

With multiples sender active, the shell will be flodded with messages. Use

 . .\listen.ps1
  udplisten -p 1111 -ip 1.2.3.4 -client 5.6.7.8

to focus on one sender.

serialTCP

send debug data to serial port and via tcp connection to a listener (made for esp8266/esp32)

Using it is simple: after establishing the wifi-connection call

  SerialTCP.begin(115200,"1.2.3.4",1111);  
  SerialTCP.println("Test");

listener

made for powershell

In case you need to set the execution policy before:

Set-ExecutionPolicy unrestricted -Scope CurrentUser

Usage: load the function, than call it.

 . .\listen.ps1
 tcplisten -p 1111 -ip 1.2.3.4

listener alternatives

socat (SOcket CAT) can listen natively on an UDP port. There are windows binaries, but probably the easier way is to use socat within the linux subsystem of Windows 10. Just turn on the Windows Feature Windows Subsystem for Linux, download DEBIAN from the Microsoft Store, log in and install & use socat.

For the unpracticed:

  sudo apt-get update
  sudo apt-get install socat
  socat - udp-listen:1111

(There is an extra space...)

Thanks go to H. R. for pointing out socat.

Suspend and Resume

In case you want to suspend sending messages it is safe to call

  SerialUDP.end();

or

  SerialTCP.end();

To resume services, simply call

  SerialUDP.begin();

or

  SerialTCP.begin();

serialtcp's People

Contributors

fow0ryl avatar holgerlembke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

serialtcp's Issues

Case incompatibility

Hallo Holger,
working on my first ESP32 project I downloaded actual version (as a zip file) with ESP32 support. After adding it to the Arduino IDE (on linux, what else?) it didn't work. Since native C is case sensitive, and so is linux, the files serialtcp.h and serialtcp.cpp cannot be found.
My solution was to rename them to serialTCP.h and serialTCP.cpp.
It would be nice if you can change the filenames for best compatibility ...
LG
Henning

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.