diff --git a/bin/Makerverse.desktop b/bin/Makerverse.desktop new file mode 100644 index 00000000..387415da --- /dev/null +++ b/bin/Makerverse.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=Makerverse +Comment=Makerverse UI (web browser) +Icon=/home/pi/makerverse/logo.png +Exec=/home/pi/makerverse/bin/kiosk +Terminal=false +Categories=Internet; diff --git a/bin/kiosk b/bin/kiosk index c51d2c9a..36acbf29 100755 --- a/bin/kiosk +++ b/bin/kiosk @@ -1,21 +1,39 @@ #!/bin/bash -path=${1:-/} # Figure out where the git checkout directory lives, if any: if [[ -z "$MAKERVERSE_SRC_DIR" ]]; then # Otherwise, the parent directory of this script should (hopefully) work. MAKERVERSE_SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../" && pwd)" fi + +fn="${MAKERVERSE_SRC_DIR}/kiosk.log" +echo "Launching Makerverse kiosk..." > $fn +printenv | grep "MAKERVERSE" >> $fn + MAKERVERSE_PROTOCOL="${MAKERVERSE_PROTOCOL:-http}" MAKERVERSE_HOST="${MAKERVERSE_HOST:-localhost}" MAKERVERSE_PORT="${MAKERVERSE_PORT:-8000}" -MAKERVERSE_KIOSK_SCALE="${MAKERVERSE_KIOSK_SCALE:-1.0}" -url="${MAKERVERSE_PROTOCOL}://${MAKERVERSE_HOST}:${MAKERVERSE_PORT}${path}" +MAKERVERSE_PATH="${MAKERVERSE_PATH:-/}" +url="${MAKERVERSE_PROTOCOL}://${MAKERVERSE_HOST}:${MAKERVERSE_PORT}${MAKERVERSE_PATH}" +flags="" + +if [[ ! -z "$MAKERVERSE_SCALE" ]]; then + flags="${flags} --force-device-scale-factor=${MAKERVERSE_SCALE}" +fi + +if [[ ! -z "$MAKERVERSE_KIOSK" ]]; then + flags="${flags} --noerrdialogs --disable-infobars --kiosk" +fi while [[ ! $(curl -s $url) ]]; do - echo "Waiting for $url" + echo "Waiting for $url" >> $fn sleep 1; done -bash ${MAKERVERSE_SRC_DIR}/scripts/kiosk.sh "$url" \ - -f "--noerrdialogs --disable-infobars --ignore-certificate-errors --force-device-scale-factor=${MAKERVERSE_KIOSK_SCALE}" +echo "Ready to launch: ${flags}" >> $fn + +if [[ ! -z "${flags}" ]]; then + bash ${MAKERVERSE_SRC_DIR}/scripts/kiosk.sh "$url" -f "${flags}" +else + bash ${MAKERVERSE_SRC_DIR}/scripts/kiosk.sh "$url" +fi diff --git a/ci/raspbian-desktop.json b/ci/raspbian-desktop.json index 9057ebad..7041ad70 100644 --- a/ci/raspbian-desktop.json +++ b/ci/raspbian-desktop.json @@ -33,6 +33,8 @@ ["mkdir", "$MOUNTPOINT/home/pi/makerverse/commands"], ["mkdir", "$MOUNTPOINT/home/pi/makerverse/events"], ["mkdir", "$MOUNTPOINT/home/pi/makerverse/widgets"], + ["cp", "/build/docs/assets/logo.png", "$MOUNTPOINT/home/pi/makerverse/logo.png"], + ["cp", "/build/bin/Makerverse.desktop", "$MOUNTPOINT/usr/share/applications/Makerverse.desktop"], ["cp", "/build/.makerverse.docker", "$MOUNTPOINT/home/pi/.makerverse"], ["cp", "/build/scripts/gpio.sh", "$MOUNTPOINT/home/pi/makerverse/commands/gpio.sh"], ["cp", "-r", "/build/bin", "$MOUNTPOINT/home/pi/makerverse/"], @@ -86,8 +88,8 @@ "sudo usermod -aG docker pi", "sudo systemctl enable docker", "sudo systemctl start docker", - "cd /home/pi/makerverse && bash bin/build-service.sh install pi \"export MAKERVERSE_PORT=80\"", - "echo \"export MAKERVERSE_PORT=80\" >> /home/pi/.bashrc" + "echo \"MAKERVERSE_PORT=80\" >> /etc/environment", + "cd /home/pi/makerverse && bash bin/build-service.sh install pi \"export MAKERVERSE_PORT=80\"" ] } ] diff --git a/ci/raspbian-lite.json b/ci/raspbian-lite.json index c1bd033d..4a8c1bbb 100644 --- a/ci/raspbian-lite.json +++ b/ci/raspbian-lite.json @@ -79,6 +79,7 @@ "sudo usermod -aG docker pi", "sudo systemctl enable docker", "sudo systemctl start docker", + "echo \"MAKERVERSE_PORT=80\" >> /etc/environment", "cd /home/pi/makerverse && bash bin/build-service.sh install pi \"export MAKERVERSE_PORT=80\"" ] } diff --git a/docs/features/events.md b/docs/features/events.md index ac31ebb9..8bb4a2ec 100644 --- a/docs/features/events.md +++ b/docs/features/events.md @@ -30,5 +30,5 @@ nav_order: 4 ## Creating an Event - Go to Settings -> Events and press "+ Add" -- To run scripts, use a "system" trigger and follow the [commands](/features/commands/) instructions. +- To run scripts, use a "system" trigger and follow the [commands](/features/commands/) instructions. The event scripts reside in the events folder under the base makerverse folder and regardless of the makerverse folder name, the path to get to the event is ~/makerverse/events/scriptname. - To run Gcode, use a "G-code" trigger and enter any gcode you wish. diff --git a/docs/installation/web-server/raspberry-pi.md b/docs/installation/web-server/raspberry-pi.md index 5781038c..69630887 100644 --- a/docs/installation/web-server/raspberry-pi.md +++ b/docs/installation/web-server/raspberry-pi.md @@ -36,6 +36,8 @@ There are two download options in the [Latest Release](https://github.com/makerm These are merely customized versions of [the official Raspberry Pi OS images of the same names](https://www.raspberrypi.org/downloads/raspberry-pi-os/) (Lite vs. Desktop). Once you have downloaded the appropriate release file, unzip it and flash the `.img` to your SD card with your preferred application (e.g., Balena Etcher). +_**Note**: the `lite` image means that there is no GUI! It is "command-line only" (headless), so everything will be text based (no desktop)._ + Then, just plug the RPi in and power it up! ## Connecting to the RPi @@ -79,22 +81,26 @@ However, this UI is not the default UI because it is much less full-featured (it When running the `makerverse-raspberrypi-os-dekstop.**` (desktop version), you will need to follow on-screen instructions after the first boot to configure your Raspberry Pi. This image is based upon a standard Raspberry Pi OS Desktop installation, so please refer to the official documentation for any help. -You can open a web browser and navigate to Makerverse at `http://localhost`. Or, you can enable Kiosk mode... +You can find the Makerverse "application" in the "Other" section of the start menu. In fact, the "application" really just opens a web browser to `http://localhost`. ### Kiosk Mode -When running the "Desktop" variation, you can enable Kiosk mode: +When running the Desktop variation, you can enable "Kiosk" mode. This turn your Raspberry Pi into a dedicated Makerverse device. + +_**Note**: kiosk mode causes Makerverse to run full-screen and effectively disable the Raspberry Pi desktop. It is best suited for scenarios where you only want to use Makerverse on the Raspberry Pi (single-purpose device). It also can fit more on the screen, and doesn't require a keyboard/mouse to use (e.g., touchscreen)._ + +To enable Kiosk mode, run the following command: ``` -echo "@bash /home/pi/makerverse/bin/kiosk /" > /home/pi/.config/lxsession/LXDE-pi/autostart +echo "@bash /home/pi/makerverse/bin/kiosk" > /home/pi/.config/lxsession/LXDE-pi/autostart ``` -Once configured, it will automatically launch Chromium in "Kiosk" mode during boot. This will load the Makerverse application in a full-screen web browser. Makerverse is still running as a Web Server in the background, so other clients can also simultaneously connect. In this mode, Chromium takes over the desktop, hiding all menus in order to maximize screen-space. +... and then reboot the Raspberry Pi. Once it has rebooted, you should notice that the normal desktop does not open. Instead, the screen stays black while Makerverse starts. Makerverse is still running as a Web Server in the background, so other clients can also simultaneously connect. In this mode, Chromium takes over the desktop, hiding all menus in order to maximize screen-space. - If your keyboard/mouse are attached directly to the Pi, use the `Alt + F4` hotkey to close the full-screen web browser, and/or `Ctrl + Alt + T` to open a terminal. - If you don't have an extra keyboard/mouse, just SSH and use `sudo raspi-config` to turn on the VNC in `Interfacing Options`. Then use an app like VNC Viewer to connect from your computer. -_**Note**: if your screen is smaller than 7" or so, you will likely want your Kiosk to use the Tablet UI specified above. To do so, edit the `/home/pi/.config/lxsession/LXDE-pi/autostart` file to become: `@bash /home/pi/makerverse/bin/kiosk /tablet`._ +_**Note**: if your screen is smaller than 7" or so, you will likely want your Kiosk to use the Tablet UI specified above. To do so, use `sudo nano /etc/environment` to add the new line: `MAKERVERSE_PATH=/tablet`._ ## Shared Directories diff --git a/docs/machines/cnc/grbl.md b/docs/machines/cnc/grbl.md new file mode 100644 index 00000000..35d88d09 --- /dev/null +++ b/docs/machines/cnc/grbl.md @@ -0,0 +1,24 @@ +--- +layout: default +title: Grbl +grand_parent: Machines +parent: CNC +nav_order: 1 +--- + +# Grbl + +Grbl is an extremely common firmware/protocol option for CNC machines. + +Many manufacturers simply ship their CNC machines with Grbl, as it is such a well-known open-source (free) piece of Arduino code. If you're not sure what controller your CNC machine uses, chances are pretty good it uses Grbl. + +## Grbl Versions + +Find all versions on the [Grbl releases page](https://github.com/gnea/grbl/releases). + +- Major versions of Grbl are `1.1h`, `1.1g`, etc. +- Minor versions are designated by the date of the release (`20190825` was released on August 25th, 2019). + +## Updating Grbl + +Please see [the Github README for Grbl](https://github.com/gnea/grbl). diff --git a/docs/machines/cnc/maslow.md b/docs/machines/cnc/maslow.md index 5ca0502a..29eb1b49 100644 --- a/docs/machines/cnc/maslow.md +++ b/docs/machines/cnc/maslow.md @@ -3,7 +3,7 @@ layout: default title: Maslow grand_parent: Machines parent: CNC -nav_order: 1 +nav_order: 2 --- # Maslow @@ -20,7 +20,13 @@ The Maslow requires calibration to correct "chain sag" (catenary effects). ### Before you Start -Do a **pre-flight check**. +!!! WARNING !!! + +- If this is the *first* use of your maslow, before you do anything, reset the chains !!! Even if the sled is not exactly in the middle, to establish a baseline location, reset the chains. Once that is complete, the sled should respond to the shuttle commands to move so then you can avoid costly disaster or erratic behavior. As with all new equipment, please make power shutoff to the system accessible in case you must shut it off quickly. In the makerverse, the RESET button will cut power to the motors, so keep that in mind. After calibration, the sled will be properly positioned and allow future chain resets to occur with chain marks to reset back to the middle of the work piece. + +!!! WARNING !!! + +First, do a **pre-flight check**. Maslow frames are generally built from hand-cut, imprecise materials. Catching errors early will greatly improve the chances of an easy, successful calibration. diff --git a/scripts/docker.sh b/scripts/docker.sh index d2170cf5..9404eebb 100755 --- a/scripts/docker.sh +++ b/scripts/docker.sh @@ -8,6 +8,8 @@ DOCKER_REPO="makerverse/core" echo "Docker '$@' for $BUILD_PLATFORMS" +TAG2="" + if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then if [ "$1" = "build" ]; then # Master branch has a deploy step. Others use the build as the deploy. @@ -19,6 +21,7 @@ if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then TAG="prerelease" else TAG="latest" + TAG2="prerelease" fi else if [ "$TRAVIS_BRANCH" = "master" ]; then @@ -38,9 +41,18 @@ echo "Logged in to Docker." # n.b., this ALWAYS pushes the resulting image. This is because the --load flag does not # support multi-arch. https://github.com/docker/buildx/issues/59 if [[ ! -z "$CI_VERSION" ]]; then - docker buildx build --push "--platform=$BUILD_PLATFORMS" -t "$DOCKER_REPO:$TAG" -t "$DOCKER_REPO:v$CI_VERSION" . + if [[ -z "$TAG2" ]]; then + docker buildx build --push "--platform=$BUILD_PLATFORMS" -t "$DOCKER_REPO:$TAG" -t "$DOCKER_REPO:v$CI_VERSION" . + else + docker buildx build --push "--platform=$BUILD_PLATFORMS" -t "$DOCKER_REPO:$TAG" \ + -t "$DOCKER_REPO:$TAG2" -t "$DOCKER_REPO:v$CI_VERSION" . + fi else - docker buildx build --push "--platform=$BUILD_PLATFORMS" -t "$DOCKER_REPO:$TAG" . + if [[ -z "$TAG2" ]]; then + docker buildx build --push "--platform=$BUILD_PLATFORMS" -t "$DOCKER_REPO:$TAG" . + else + docker buildx build --push "--platform=$BUILD_PLATFORMS" -t "$DOCKER_REPO:$TAG" -t "$DOCKER_REPO:$TAG2" . + fi fi if [ $? -eq 0 ]; then diff --git a/scripts/kiosk.sh b/scripts/kiosk.sh index b50f6e08..898bcc0d 100755 --- a/scripts/kiosk.sh +++ b/scripts/kiosk.sh @@ -103,7 +103,7 @@ assign_positional_args 1 "${_positionals[@]}" sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences # Start chromium -cmd="/usr/bin/chromium-browser $_arg_chromium_flags --kiosk --app=$_arg_kiosk_url" +cmd="/usr/bin/chromium-browser $_arg_chromium_flags --app=$_arg_kiosk_url" echo "Opening chromium: $cmd" $cmd & diff --git a/src/app/widgets/Maslow/CalibrationModal.jsx b/src/app/widgets/Maslow/CalibrationModal.jsx index dd9b4b1b..618c0460 100644 --- a/src/app/widgets/Maslow/CalibrationModal.jsx +++ b/src/app/widgets/Maslow/CalibrationModal.jsx @@ -624,7 +624,16 @@ class CalibrationModal extends PureComponent { {curTab === 'welcome' && (
{i18n._('Welcome')}
- If you have not tested your frame before, please run a pre-flight check. + !!! WARNING !!! +
+ -- DAMAGE MAY OCCUR -- +
+ If this is the first use of your system and you have not yet tested sled movement please close this window and reset your chains. +
+ Please run a pre-flight check before attempting to calibrate. +
+ !!! WARNING !!! +

For help with this (or any other step), see the Calibration Help at the bottom.