Coder Social home page Coder Social logo

thormj / webcontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webcontrolcnc/webcontrol

0.0 1.0 0.0 4.77 MB

Web-based Ground Control

License: GNU General Public License v3.0

Python 25.63% CSS 0.40% HTML 10.86% JavaScript 62.59% Dockerfile 0.17% Shell 0.26% Batchfile 0.08%

webcontrol's Introduction

layout title nav_order description wcversion tags
default
Home
1
Help pages for WebControl
0.915.001
web-control

WebControl

The official tool for Maslow CNC; control your Maslow with any web browser.

  • Browser-based, multi-platform controller software.
  • Connects to Maslow's Arduino Mega (or similar) via USB.
  • Includes setup instructions (updated from Maslow Community Garden).
  • Runs gcode (.nc files) for printing cuts.

You can report issues to the volunteer team.

Context

WebControl started as a browser-based port of the original GroundControl application, but has grown to support more features:

  • The calibration and setup process is better documented and easier to use.
  • It implements a flask+socketio web server, so other computers on the network may control the machine.
  • It can be run on a low-cost device, like a Raspberry Pi.
  • It can also support multiple custom firmwares developed by the community which enhance the Maslow.

At this point, WebControl has become the de-facto beginner's tool for Maslow.

Screenshot

Installation

Pre-Built Raspberry Pi Image

See the dedicated repository.

Raspberry Pi

Replace the version number with the latest release...

cd ~
mkdir webcontrol
cd webcontrol
wget https://github.com/WebControlCNC/WebControl/releases/download/v0.920/webcontrol-0.920-rpi-singledirectory.tar.gz
tar -zxvf webcontrol-0.920-rpi-singledirectory.tar.gz

Linux (Debian)

Replace the version number with the latest release...

cd ~</br>
mkdir webcontrol
cd webcontrol
wget https://github.com/WebControlCNC/WebControl/releases/download/v0.920/webcontrol-0.920-linux-singledirectory.tar.gz
tar -zxvf webcontrol-0.920-linux-singledirectory.tar.gz

Linux Autostart (systemd)

To run WebControl automatically on startup for a Linux-based machine, it is recommended to create a service:

nano webcontrol.service

type the following:

[Unit]
Description=WebControl
After=network.target

[Service]
ExecStart=/home/pi/webcontrol/webcontrol
WorkingDirectory=/home/pi/webcontrol
StandardOutput=inherit
StandardError=inherit
Restart=always
User=pi

[Install]
WantedBy=multi-user.target

Save file using Ctrl-X/Yes

sudo cp webcontrol.service /etc/systemd/system

Test with the following:

sudo systemctl start webcontrol.service

Try to reach webcontrol using your browser.

To debug, try:

sudo systemctl status webcontrol

Or, to. get logs:

journalctl -xe

When it works, then type:

sudo systemctl enable webcontrol.service

see for more details: https://www.raspberrypi.org/documentation/linux/usage/systemd.md

Docker & Kubernetes

  • Pull the docker image from inzania/web-control using the armv7 or amd64 tag.
  • Mount a data/config volume at /root/.WebControl
  • Expose port 5000
  • Run with privileged: true security context for USB access.

Remote Access

WebControl can be run behind a front-proxy with TLS termination, such as nginx. You can use this in conjunction with semi-static IP to access your Maslow from anywhere with internet access. The full scope of this is outside this documentation, so you should be sure you understand the security implications before proceeding (hint: WebControl doesn't have a login or user authentication system).

Usage

Open your web browser to localhost:5000 (or use the IP address of your device).

Built With

  • Flask - The web framework used
  • Flask-Socketio - Websocket integration for communications with browser clients
  • Bootstrap4 - Front-end component library
  • Jinja2 - Template engine for web page generation
  • Feather.js - Only icon library I could find that had diagonal arrows.. works well to boot.
  • OpenCV - Library for computer vision to implement optical calibration
  • Numpy - Library for math routines used with optical calibration
  • Scipy - Another library for math routines used with optical calibration
  • Imutils - Adrian Rosebrock's library used with optical calibration
  • Schedule - Library used to schedule checking connection with arduino
  • Ground Control - Much of this was adapted from the Kivy-based Ground Control

Developing

Virtualenv

You can use virtualenv to set up a local development environment for running the code without installing packages in the system Python installation.

# Create a virtual environment
virtualenv -p python3 .venv
# Activate the virtual environment
source .venv/bin/activate
# Install the prerequisites
pip install -r requirements.txt

When running on the Pi, you'll also need some extra dependencies and will need to build OpenCV from source. See the Dockerfile for details. (TODO: add instructions here)

Then you can run the code with.

python main.py

The server will then be available at http://localhost:5000

Automatic code formatting

This project uses black to automatically format python code. To run the autoformatter, simply install black locally with pip.

pip install black

Subsequently, you can just run black . to format all files in the current directory.

black .

If you don't have python3.6+ locally (to be able to run black), you can run black in a Docker container.

docker run -v $(pwd):/code johnboiles/python-black .

IDE

Pycharm Community Edition is a free, well-featured Python IDE.

With the File Watchers and BlackPycharm plugins you can set up your editor to automatically format your code on save. Then you never have to think about code formatting again ๐ŸŽ‰

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

Added to TODO list?

With Thanks

See also the list of contributors who participated in this project.

License

See LICENSE

webcontrol's People

Contributors

madgrizzle avatar gb0101010101 avatar johnboiles avatar emilecantin avatar orob-maslow avatar zaneclaes avatar hackmd-deploy avatar md8n avatar dependabot[bot] avatar dangerdespain avatar thormj avatar shepelt avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.