You will need to install nodejs to run the webgui server. You can get the last version of nodejs from the official website. The 32-bit version will have less problems with some libraries that don't have a good 64-bit support yet.
Also install pm2 to prevent any errors from crashing the server
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
To check whether node is properly installed or not, just open a terminal (cmd.exe
in windows) and execute node
command. If node
is not found, check if the nodejs route is included in PATH environment variable.
In windows 7 you can find PATH variable in: Start -> Search for systempropertiesadvanced.exe
-> Environment variables -> Look inside system variables -> Path -> Edit. If the nodejs path is not in the variable, include it adding ;C:\Program Files\nodejs\
at the end. Replace the route if it is different.
You will also need the Node Package Manager. In windows it is included with nodejs but in linux you must install it:
sudo apt-get install npm
Once nodejs and npm are properly installed, open a terminal, go to the webgui server directory (where the webgui-server.js
is located) and run:
npm link
This order will download the non-native modules that the webgui server uses. In Windows, you can use the INSTALL MODULES.bat
script instead to install the non-native modules.
To execute the server, just open a terminal (cmd.exe
in windows), go to the webgui server directory (eg: cd C:\WebGUI\javascript
) an execute:
pm2 start webgui-server.js
or use the file RUN WEBGUI SERVER.bat
in windows. Now the server is prepared to receive connections from arduino and to receive http connections from the browser
To test if the http server works, open a browser and go to http://localhost
. The file OPEN WEBGUI INTERFACE.html
will redirect to the localhost server. You can also access from anoter computer, specifying the url the IP of the computer that is running the webgui server. To know the IP of the computer, open a terminal and run ipconfig
.
If you are using skype or other software that uses port 80, an error may occur when trying to start the server. To solve this, close the program that is using the port and try to restart the server again. If the problem persists or you cannot close the program, the web port of the server can be changed using the --http
option in the server parameters. Just try for example node webgui-server.js --http 1337
and then put in the URL of the browser http://localhost:1337
. In windows you can use the batch script RUN WEBGUI SERVER WITH OTHER HTTP PORT.bat
to start the server in a different port that you specify.