WebControl Setup on Raspberry Pi

Options

To set up your RPI, you now have 4 options for the basic OS called Raspian in order from easiest to hardest (totally subjective and may not be the same order for your talents):

1. Full Image Raspian

get it here: LINK

2. PiBakery

directions here

3. Docker

It was broken but now is fixed and the link will be posted… check webcontrolcnc github page.

4. Manual Raspian or Raspian Lite install

This guide is for those who want to do this the older / more difficult / hard way #1 or #2. If you want to just get it and go, the fourth option is likely the simplest.

the first option is a stripped down version that does not have the ability to display graphics. It is a command line interface (CLI) with just the cursor and looks like a terminal window. The second is the full desktop and if you have a touchscreen this would be the option.

(Assumption: you have imaged and set up the rpi on your local network and have both internet access and ssh access or keyboard access to it to type in commands. Internet searching can get you imaged and set up to this point, but here is a list of items to be completed in that process:

image
copy “ssh” file to folder on flash drive from imaging computer - a blank file just so ssh will be enabled
copy network file -
make a text file called wpa_supplicant.conf. in it put your network ssid in the “” and your network passkey in the appropriate quotes:

trl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US
network={
ssid=“”
psk=“”
key_mgmt=WPA-PSK
}
(should look like this, but formatting doesn’t carry over:

)

$ sudo raspi-config
Network options → set pi name
Localization options → set keyboard layout to 104
_________________-> set time zone to US central
_________________-> set locale to en-us UTF8
________________ → set wifi country (you may have to reboot to do this)
$ sudo reboot

…!!..make sure if you change the password over ssh, you have set the keyboard to local otherwise if you use any special characters, a regular usb keyboard will input a different password because the default is an international UK keyboard and some character maps are different…!!..
change the default password

$ passwd

update the repository links

$ sudo apt-get update

upgrade the distribution kernel

$ sudo apt-get upgrade

and now you are set and ready to go.

In either case of distribution option, open a terminal window if you are on the desktop version or simply type in the command line the commands below or right click in putty to paste (don’t type the "$ ". It represents a command line command : EDIT → the $ show up in the preview on the right when I make the post, but once it saves, some of them get stripped out. no idea why):

$ cd ~
$ mkdir webcontrol
$ cd webcontrol
$ wget Releases · WebControlCNC/WebControl · GitHub

find the latest single directory release or the one with the feature you want.

$ tar -zxvf webcontrol-(YOUR VERSION HERE)-rpi-singledirectory.tar.gz

(932 is the version as of today. Verify the newest version here). Run the program:

$ cd webcontrol
$ ./webcontrol

If you want to run it in the background and have the ability to type in other commands on the same ssh window, then you can use this command instead:

$ ./webcontrol & disown %1

is supposed to stop the terminal messages, but it doesn’t on my screen. and if you use the &, you have to run htop and scroll down the the webcontrol line and press F9 and 9 to kill the program.

You need to connect to the maslow via USB in the Settings → Maslow Settings menu and select the correct serial port for your Maslow:

Run as a Service

Once you are certain it functions and you want it to run whenever the rpi is on, you can make it run automatically as a service

$ sudo nano /etc/systemd/system/Maslow.service

You can name it whatever you want. Maslow.service, webcontrol.service… totally your call.

paste this in that file and adjust the Description, working directory, ExecStart if necessary:

[Unit]
Description=webcontrol
After=network.target
[Service]
ExecStart=/home/pi/webcontrol/webcontrol
WorkingDirectory=/home/pi/webcontrol
StandardOutput=inherit
StandardError=inherit
Restart=never
User=pi
[Install]
WantedBy=multi-user.target

then exit and save with CTRL+X, Y, Enter
to start it, type

$ sudo systemctl start Maslow

if it works, then enable it and it will start automatically when you reboot.

$ sudo systemctl enable Maslow

if you change the “Restart = never” line to “restart=always” then it will try to restart whenever it crashes, but it won’t allow itself to shut down when you click on the upgrade link. you will have to manually stop it.

Once you have the server side running, if you are on command line, you are done for now. To open the web browser on your desktop version, use your mouse to open the webpage and use “http://localhost:5000” as the web page address and you should be able to interact with it.

Type $ ifconfig in a terminal window, you can get your IP address and use that on your phone with :5000 at the end and control Maslow from your phone via webcontrol. Do the same on your design computer (whatever the type) and you can upload gcode to it. Import your groundcontrol.ini file using the actions->import button in webcontrol, to avoid recalibrating.

Another nice option is if you set up /home/pi/.WebControl/gcode as a shared SAMBA folder (instructions here), and give that folder permissions, you can open the folder from your design computer and drag and drop your gcode in without uploading via the web page. This is not entirely necessary, but I find it easy to do. More recently, when I generate gcode, I have it save there directly so no copying or uploading is required.

(author note: this is a wiki entry. if you have additions, please edit this directly rather than comment. at request, this was put in wiki, but I realize this is scattered in various other posts on the forum and in the wiki.)

5 Likes

By the gods I hate asking this question. Has anyone done this using Raspberry Pi Bookworm?

Ok, I got this to work following Graham’s Tutorial (https://www.youtube.com/watch?v=rIk0-BN44a8) using Debian Bullseye 32 and release 9331, not 94. I’ll test that and report back here.

bookworm is the newer version with all the visual and gui updates. Tyipcally we run the raspberry pi in command line interface mode as the maslow server does not need a display and the gui has in the past made the system slow… perhaps not an issue with a 4 or 5 now.

@Orob Thanks for the quick response! This helps explain things a bit better. My plan is to run this thing headless. And I am running it on a 4 B with 8 GB RAM. It “should” work, but it didn’t (at least not on my first try). I DID get it to work on the 32 bit version of Bullseye so I’m not dead in the water. FYI I saw CPU utilization hit 50 - 60% according to the Webcontrol Interface (nice feature btw).
Now I’m just hacking. Like I said, I’ll report back my results. I’m just about to start with Bookworm again.
Cheers!

Ok, that didn’t work very well.
Followed the same steps, no joy. I’ll be rolling back to Bullseye to get back to standing up my CNC.
Attached are screen captures of the status and journal outputs just in case anyone wants to weigh in on why this isn’t working.
Can’t reach ‘localhost:5000’ when on the
This is being run on Bookworkm 64 bit. Hardware is 4B, 8 GB RAM.

webcontrol.service is as follows:

[Unit]
Description=WebControl
After=network.target

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

[Install]
WantedBy=multi-user.target


I don’t know that we have much info or help for you on using the 64 bit OS since that wasn’t really an option when this was put in place.

@Orob No worries. I’m posting what I’m finding out just in case someone wants to port it to a 64 bit OS. I DID just find out that it will work with Bookworm 32 bit. It certainly is not the end of the world, and I do appreciate the responsiveness.

My intent is to leave my footprints so that the next poor SOD that tries this has something to go on.

3 Likes

Hey folks, I am hoping y’all can help me out with some issues that I am seeing during setup.

Issue: WebControl does nothing when I try to execute it.

Steps to replicate:

  1. Imaged the Raspberry pi with Bookworm (details below).
  2. Booted it up
  3. Created a webcontrol directory and ran the wget command from the README:
    cd ~
    mkdir webcontrol
    cd webcontrol
    wget https://github.com/WebControlCNC/WebControl/releases/download/v0.94/webcontrol-0.94-rpi-singledirectory.tar.gz
  4. Extracted the files in that directory (using the GUI)
  5. Executed the executable file “webcontrol” both with the GUI and via terminal
  6. Seemed to do nothing
  7. localhost:5000 has nothing


Am I on the wrong track? What could I be missing? Thanks so much!


My setup:

Raspberry pi: Raspberry Pi 4 Model B - 2 GB RAM (from Adafruit)
Imaged with: Raspberry pi OS (64-bit) - a port of Debian Bookworm
SD card: SanDisk 64GB Ultra MicroSDXC Class 10 / U1 / A1 Flash Memory Card (from Microcenter)
Power supply: Official Raspberry Pi Power Supply 5.1V 3A with USB C (from Adafruit)

WebControl version: Latest as of 1/4/24 - webcontrol-0.94-rpi-singledirectory.tar.gz

the python distributed version you are using is for 32 bit raspberry pi os formerly known as raspbian. Your 64 bit OS may or may not be part of the issue. There is an image you can pull from here if you just wanted to go with it rather than provision and install. You could try that. It doesn’t answer the question why, but it could get you going.

2 Likes

Thanks very much for the response! I will give it a shot and see what happens.
It sounds like you are saying the 64 bit OS could be incompatible with the image I’m using, so it could possibly be one or the other?

I’m up for reimaging the pi if needed (I’ve done it a couple times lol) so if the previous doesn’t work I’ll try to use a different OS.

1 Like

Okay, I did a bunch of stuff… and now I’m back.
Now my issue is: Getting message “Trying to connect to controller on” (with nothing after it), webcontrol hanging on this.

Steps to replicate:

  1. Reimaged pi with Lite version (details below)
  2. Booted it up
  3. Once again created a webcontrol directory and ran the wget command from the README:
    cd ~
    mkdir webcontrol
    cd webcontrol
    wget https://github.com/WebControlCNC/WebControl/releases/download/v0.94/webcontrol-0.94-rpi-singledirectory.tar.gz
  4. Extracted the files using command line
  5. Executed the executable file “webcontrol” via terminal - this seemed to do things!
  6. Hanging on “Trying to connect to controller on”

Any help or thoughts on what I could be missing appreciated!

——
2nd iteration:
——

Raspberry pi: Raspberry Pi 4 Model B - 2 GB RAM (from Adafruit)
Imaged with: Raspberry Pi OS Lite (32-bit)
SD card: SanDisk 64GB Ultra MicroSDXC Class 10 / U1 / A1 Flash Memory Card (from Microcenter)
Power supply: Official Raspberry Pi Power Supply 5.1V 3A with USB C (from Adafruit)
WebControl version: Latest as of 1/4/24 - webcontrol-0.94-rpi-singledirectory.tar.gz

now you need to open the web page and tell it where to find the controller

with web browser go to [IP address of rpi]:5000

see post #3 above in this thread. when you load, click settings->Maslow Settings and select your USB port. Usually /dev/ttyACM0 or /dev/ttyUSB0 or similar

This can be done with another PC or a phone on the same network.

1 Like

In case anyone ends up reading this later…
I had some struggles with my raspberry pi just booting and rebooting after moving it to next to the Maslow, which is oftentimes a power issue (apparently). I ended up moving the power adapter to a different outlet and that worked, if you can believe it.

Now I have what appears to be a working connection!!
Thanks so much.



Raspberry pi: Raspberry Pi 4 Model B - 2 GB RAM (from Adafruit)
Imaged with: Raspberry Pi OS Lite (32-bit)
SD card: SanDisk 64GB Ultra MicroSDXC Class 10 / U1 / A1 Flash Memory Card (from Microcenter)
Power supply: Official Raspberry Pi Power Supply 5.1V 3A with USB C (from Adafruit)
WebControl version: Latest as of 1/4/24 - webcontrol-0.94-rpi-singledirectory.tar.gz

2 Likes