[Home]Rockhopper Web Server

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Rockhopper Web Server for LinuxCNC

Background

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

The server also uses the halcmd program, a part of LinuxCNC which can access and configure the HAL layer of LinuxCNC.

To communicate with the LinuxCNC WebSocket? Server, a client application opens a WebSocket? with the server, and sends text commands. All commands result in an immediate reply, such as the result of executing the command or some status information. Some commands will also send further replies, such as notifying the client when a watched status variable has changed. Using this WebSocket? based interface, a remote program can query status, send commands, and otherwise control the running LinuxCNC machine controller. All commands and replies are formatted using JSON (JavaScript? Object Notation). This is a text based, human readable format which is widely supported in many programming platforms.

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.

Browser Based Interface

The browser interface provides several tabs, each exposing different capabilities of the LinuxCNC system.

Tab: Configure

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.

upload:Rockhopper1.png

Tab: HAL Setup

This page allows editing of the HAL files referenced in the INI file.

upload:Rockhopper2.png

Tab: HAL Graph

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.

upload:Rockhopper3.png

Tab: Status

Shows the live status information. As the state of the system changes, the entries in the table will update automatically.

upload:Rockhopper4.png

Tab: Commands

Lists some low-level commands that can be sent to the running system. Parameters, if any, are comma separated.

upload:Rockhopper5.png

Installation

Installation:

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:

graphviz:

 sudo apt-get install graphviz

pygraphviz:

 sudo apt-get install python-pygraphviz

Running:

To launch the webserver:

cd Rockhopper
python ./LinuxCNCWebSktSvr.py <full path to your .ini file>

Example:

 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:

 http://your-linuxcnc-computer-ip:8000/

When prompted for a username and password, the username is:

default
and the password is also:
default

Usernames and passwords can be added with the AddUser?.py script, and removed by editing the users.ini file in the Rockhopper directory.


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited February 21, 2013 2:34 am by PeterJ (diff)
Search:
Published under a Creative Commons License