I have this simple code: it takes Arduino serial data to a Raspberry Pi. On the Pi, I want to display the data on a browser in PHP.
<?php
$fp = fopen('/dev/cu.wchusbserial1a12130','r+'); //use this for Mac Nano
echo $fp."<br>";
echo fread($fp, "10");
fclose($fp);
?>
It works perfectly fine on the Mac server with a Nano or Uno. But once I load it onto my Pi server, and change the port to /dev/ttyUSB0, it does not work any more. The browser is just blank. Does it have something to do with the Pi permissions? Thanks.