Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 17928

Re: How can I get an Arduino sketch and Node.js script to communicate with each other?

$
0
0

One thing I did was just create a named pipe (using mkfifo, which if necessary you can invoke with "system" from inside Arduino).   Then you can read and write to it like a file from both sides.   For full-duplex communication you might want to create one for each direction.   I only tested this with Python but there's no reason it's can't work with Node.

 

I think this is a subset of the "IPC" answer but has the advantage that it only uses file I/O operations, which are universally supported.

 

Another universally-supported approach would be to open a local network connection.  While this seems like overkill just to communicate between two processes on the same device, it has the advantage of being generalizable to code running on different devices, but may be more complicated to set up.


Viewing all articles
Browse latest Browse all 17928

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>