Thank you for the thorough tutorial. I ran into some minor problems/typos when setting up the Raspberry Pi
home gateway that I wanted to note in case it'll help someone else out.
1) For the index.php file, I think you want this syntax:
which will emit the verbose php setup.
2) For creating the self-signed certificate, openssl was barfing when I specified the "-days 365" option. Leaving it out seemed to work fine:
sudo openssl req -new -x509 -nodes -newkey rsa:2048 -out server.crt -keyout server.key
3) When running npm, there were issues with permissions (folder owned by root, npm run as me). I think it worked best if I created the directory as my own user then ran npm as the same:
mkdir ~/moteino
cd ~/moteino
npm install serialport
4) The chat.html sample is missing an open script tag after the socket.io.js is loaded. Instead of this:
<script src="socket.io.js"></script>
var socket = io.connect
I think you want this:
<script src="socket.io.js"></script>
<SCRIPT LANGUAGE="JavaScript">
var socket = io.connect
Again, thank you for the thorough work.