Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

hyperfeel

macrumors newbie
Original poster
Sep 12, 2018
19
8
UK
I got a piece of code written in Python that interacts with different devices through a serial port connection. I usually run in on a Raspberry Pi (e.g. /dev/ttyUSB0 port) or PC (e.g. COM0 port). Currently, I don't have access to these devices, but need to debug the code and only got my MacBook with me. Is there any software that would create a virtual serial port that I can send commands to, and also allow me to monitor exactly what commands are being sent to it? Thanks!
 
Several possibilities come to mind.

1) Named pipe, aka a FIFO. See man page for 'man mknod 8' or 'man mkfifo'.

2) The pseudo-tty devices /dev/pty* and /dev/tty*. See 'man pty'

3) A Unix-domain socket.


You could also connect a USB-to-serial device to your Mac, which plugs into your USB port. Sparkfun sells such devices with FTDI chips:
https://www.sparkfun.com/products/9716

There are other sources for similar devices, such as Adafruit.com. The prices can vary widely, as can quality of build and authenticity of the FTDI or other chip.
 
Last edited:
  • Like
Reactions: Krevnik and robvas
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.