4 ms·
socat + "everything as a file" lets you network up stuff only designed to be used over a serial link too, which I've found super useful. Wireless calibration o
by erinaceousjones 6y ago
socat + "everything as a file" lets you network up stuff only designed to be used over a serial link too, which I've found super useful. Wireless calibration of a drone using software that only supports USB serial? Hook it up to a raspberry pi in AP mode, stick some socats with udp on one side and /dev/ttyUSB0 on the other, boom, now you can talk to the flight controller untethered with 10 minutes reading the man page for socat and some trial and error.
- rubatuga 6y agoI'm using socat to emulate a PTY that I then run a PPP link over. socat gets its byte stream from an RTL-SDR and send out data using a tiny FM transmitter. After setting up these on both computers, I was able to SSH and ping google over FM radio.
- dbolgheroni 6y agoDo you have any page describing it?
- rubatuga 6y agoI'll be uploading a video to my youtube channel in the coming weeks! Part 1 will be describing the link layer. Part 2 will be full duplex communication. [0]: https://www.youtube.com/channel/UCsRWsHhvzSoMgVfiNhy0NoA https://www.youtube.com/channel/UCsRWsHhvzSoMgVfiNhy0NoA
- ac29 6y agoIs it actually a FM transmitter, or is it FSK? Or something like AFSK?
- rubatuga 6y agoRight, it is AFSK. The FM transmitter is something off the shelf, for car radios and such, meaning it has a low pass filter installed, along with spitting out a 19khz stereo carrier.
- ac29 6y agoThats pretty cool, I'll have to check out your video when you put it up. I'm under the impression that at least in the US, the legal limits mean this really wouldn't be useful past 100 feet or so, line of sight. That's assuming little to no co-channel interference and not using impractically large directional antennas on the receive side. Of course if you were able to frequency shift the transmitter up into the 2m band and had an amateur license, you could trivially go miles (and slightly less trivially 10s of miles).
- rhn_mk1 6y agoSocat is also useful to hide services that otherwise force themselves on a network interface. My torrent daemon has no business permanently exposing the Web controls on any network interface - not even localhost, because localhost is potentially accessible by untrusted stuff running in the browser. I solve this by placing it inside a dedicated, firewalled container, and using socat to forward from a local socket (browser can't access) to the network one. When I need to connect to it via the browser, I do the opposite forwarding (SSH can also forward to local sockets).