Skip to content

tools/serial: add support for socat as riot terminal#11034

Merged
kaspar030 merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/tools/serial_socat
Feb 20, 2019
Merged

tools/serial: add support for socat as riot terminal#11034
kaspar030 merged 1 commit intoRIOT-OS:masterfrom
aabadie:pr/tools/serial_socat

Conversation

@aabadie
Copy link
Contributor

@aabadie aabadie commented Feb 20, 2019

Contribution description

This PR provides support for socat as an alternative RIOT terminal tool. It was inspired by #11003.

The good thing with socat is that it allows redirecting the serial port to anything: the current shell, a TCP server, etc. The default behaviour is to redirect to the current shell like other tools. But it's possible to provide the SOCAT_OUTPUT variable with custom output parameters.

Testing procedure

  • Just build and flash any application for a given board with a shell
  • Open the terminal using socat:
$ RIOT_TERMINAL=socat make BOARD=saml11-xpro -C examples/default/ flash term
> help
  • Try the redirection to a different output, here a local TCP server:
$ SOCAT_OUTPUT=TCP4-LISTEN:20000,reuseaddr RIOT_TERMINAL=socat make BOARD=saml11-xpro -C examples/default/ flash term
  • You can access the shell using netcat from another terminal (this is exactly what is done in IoT-LAB for instance):
$ nc localhost 20000
> help

Issues/PRs references

Inspired by #11003

@aabadie aabadie added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: tools Area: Supplementary tools labels Feb 20, 2019
@aabadie aabadie requested review from cladmi and jcarrano February 20, 2019 07:39
@aabadie aabadie force-pushed the pr/tools/serial_socat branch from 4c429ee to 5ad3fd4 Compare February 20, 2019 11:05
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 20, 2019
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works like a charm. ACK.

@kaspar030 kaspar030 merged commit f37b02a into RIOT-OS:master Feb 20, 2019
@aabadie
Copy link
Contributor Author

aabadie commented Feb 20, 2019

Thanks for merging @kaspar030!
I wasn't expecting this to be merged that fast though :)

@kaspar030
Copy link
Contributor

I wasn't expecting this to be merged that fast though :)

Should we revert? 😉

@danpetry danpetry added this to the Release 2019.04 milestone Mar 11, 2019
@aabadie aabadie deleted the pr/tools/serial_socat branch July 4, 2019 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants