The LinuxCNC WebSocket? Server, developed by Machinery Science, LLC, is a lightweight web server customized to provide information and (diagnostic) control of a running LinuxCNC system. It taps into the python interface to LinuxCNC, so the information and control is at a fairly low level. The intent is to provide access to some basic configuration and system parameters for diagnostic use, and for use by a program running remotely to control the system.
The server is based on the Tornado open source web server framework. Tornado is written in Python, and the LinuxCNC Web Socket Server is also written using the Python programming language.
The interface to the LinuxCNC system uses the Python API for LinuxCNC. Documentation for this API is at http://www.linuxcnc.org/docs/devel/html/config/ini_config.html#_emc_section_a_id_sub_emc_section_a
A set of traditional web pages are also provided for browswer based access to the LinuxCNC system. These pages will only render properly on a browser that supports websockets. It has been tested with FireFox? and Chrome. It will not work with Internet Explorer.
The browser interface provides several tabs, each exposing different capabilities of the LinuxCNC system.
This page allows you to view and edit the .ini file used to load the system. The table is editable, and changes can be saved. The editor will preserve the position of comments in the original ini file, but the sections will be reordered alphabetically when a change is saved.
This page allows editing of the HAL files referenced in the INI file.
Diagrams the HAL Graph for visualization. The LinuxCNC system must be up and running for this to work, as the running system is queried for, using halcmd, to get the signals, pins and modules that are active.
Note that this graph works well for smaller HAL configurations, but for large configurations the graph can become messy and difficult to read. The graphviz program is used to do auto-layout.
Shows the live status information. As the state of the system changes, the entries in the table will update automatically.
Lists some low-level commands that can be sent to the running system. Parameters, if any, are comma separated.
Download source from github. Run:
git clone git://github.com/MachineryScience/Rockhopper.git
The Rockhopper directory can be placed anywhere on your system that you have permissions to access.
The following dependencies are needed to be installed separately:
tornado web server:
sudo apt-get install graphviz
sudo apt-get install python-pygraphviz
To launch the webserver:
cd Rockhopper python ./LinuxCNCWebSktSvr.py <full path to your .ini file>
python LinuxCNCWebSktSvr.py /home/linuxcnc-user/linuxcnc/configs/sim/axis/axis.ini
To access the webpage:
Only tested in FireFox? and Chrome. Will DEFINITELY NOT WORK with Internet Explorer. Point your browser at:
When prompted for a username and password, the username is:
defaultand the password is also:
Usernames and passwords can be added with the AddUser?.py script, and removed by editing the users.ini file in the Rockhopper directory.