WebControl - RaspberryPi Install from Image File

This guide is for setting up WebControl on Raspberry Pi using @johnboiles disk image. Attribution: Original posted to the Software category by @tinker.

Conventions:
command = text to enter at the command prompt
[key] = hit the keyboard key with the text displayed

  1. Download the disk image to your computer:
    https://drive.google.com/file/d/132811KALMXDlxUa9jGZdCv1eB2lz09Ws/view

  2. Write the disk image to a SD card:
    2.1 Linux
    2.2 Mac
    2.3 Windows
    2.4 Chrome OS

  3. Connect Rapberry Pi
    3.1 Insert the SD card into the Raspberry Pi
    3.2 Connect HDMI video cable
    3.3 Connect keyboard and mouse
    3.4 Connect Ethernet cable
    3.5 Plug in the USB cable from the Maslow control board to the Raspberry Pi.

  4. Initial Connections
    4.1 Power on the Raspberry Pi and wait for login prompt
    4.2 Login using default credentials
    4.2.1 Login: pi
    4.2.2 Password: raspberry

  5. Setup Raspberry Pi:
    Use Cursor keys to navigate, [Tab] to cycle through prompts, [Space] to change options. [Enter] to execute selected prompt.
    5.1 At the command prompt enter: sudo raspi-config [Enter]
    5.1.1 Configure Localization option (not needed if in default UK).
    5.1.1.1 Select ‘Change Locale’. USA users should select “en_US.UTF-8 UTF8” using [spacebar] to highlight it. Unselect “en_GB.UTF-8 UTF-8”. [Tab] to ‘OK’ prompt and hit [Enter].
    5.1.1.2 ‘Select Debian default locale’ . USA users choose ‘en_US.UTF-8’. [Tab] to ‘OK’ prompt and hit [Enter].
    5.1.2 ‘Network Options’ - Select ‘Wi-fi’. Select your country: e.g. US. Enter your SSID (Wifi name) and passphase.
    5.1.3 ‘Interfacing Options’ - Select ‘SSH’ and select ‘Yes’ to enable if you plan on using the Rpi without a monitor.
    5.1.4 Select ‘Finish’ and hit [Enter] to save.

  6. Check networking
    6.1 Enter ip addr show [Enter] at command prompt.
    6.2 Look at ‘wlan0’ (for wifi) or ‘eth0’ (for ethernet cable) and check for IP address. e.g 192.168.1.110. Jot this down for later.
    6.3 Enter ping -c 4 google.com [Enter]. You should get four responses ending with ping time. Your network is working. If you get ‘Request timeout’ then something is wrong with network config.

  7. Wait for WebControl to download.
    If networking is working then Webcontrol will start downloading the Docker image. This can take a while (~15 mins) depending on your connection.
    7.1 You can enter top [Enter] at the command prompt to see a list of current processes. You should see a ‘Docker’ process running at the top. It will appear and disappear. When ‘Python’ process starts then everything has completed. Hit [Q] to exit out of ‘Top’.

  8. Connect to WebControl
    8.1. On your computer/tablet/phone open a browser and go to http://maslowpi.local:5001.
    8.2 If that does not work then use the IP address from earlier e.g. http://192.168.1.110:5001
    You should see the WebMCP control page.
    8.3 The main Webcontrol UI is on port 5000. http://maslowpi.local:5000

  9. Upload GroundControl.ini file (if you have one).
    On WebControl page select "Action’ on the menu, then ‘Import Groundcontrol.ini File’. Select the file on your computer and click ‘Submit’.

  10. Enable z-axis (optional)
    Click ‘Setting’ -> 'Maslow Setting. Scroll down to ‘Z-axis installed’ and click on the toggle to enable it.

  11. Enjoy!

4 Likes

nice, i’ll try this next time i have some maslow time. Just a thought, shouldn’t you set up a static ip as well?

Ideally yes. There are many ways of doing this. I prefer to have my router assign a static IP, as that also assigns a local domain name, but that varies per router manufacturer.

You can also setup static IP on the RaspberryPI (Use the DHCPCD method)

Also if you have the option of hardwired Ethernet then I recommend using it.

Working on this right now and it’s taking a very long time for Docker to install. I assume that’s because I’m trying to do so via wifi.

I would suggest that you try installing the pyinstaller version, it gets updates
much more frequently (and is a much smaller download)

David Lang

Is that the one here? https://github.com/madgrizzle/WebControl/releases

Yes… make sure you untar it into a subdirectory…

Awesome! Any chance there are step-by-step directions out there for going from a blank SD card on the Pi to a functioning Webcontrol environment with the pyinstaller version? My background is very much not in computer science, but I can read the heck out of some instructions.

If not, I’ll dig until I figure it out.

There’s really nothing special that’s needed. If you want a headless system without keyboard/monitor, you just need a functioning rpi with network access (i.e., wifi and ssh). Then you use putty or some other terminal application to access it to download, extract, and execute webcontrol. As of right now, I don’t have a script developed to autorun a pyinstaller release, so you have to manually run it.

Gotcha. I’m good with getting wifi and ssh taken care of through raspi-config, but it’s the download, extract, and execute commands that I’m not familiar with.

Is it as simple as using the following command to download and extract it after getting wifi and ssh up and running?

sudo apt-get https://github.com/madgrizzle/WebControl/releases/download/v0.918/webcontrol-0.918-rpi-singledirectory.tar.gz

Forgive me if this is information I should know. I’m a little in over my head here.

No problem, we are all learners… below is a list of commands… the wget and the URL are all on one line, it might look like two separate lines on your screen

mkdir webcontrol
cd webcontrol
wget https://github.com/madgrizzle/WebControl/releases/download/v0.918/webcontrol-0.918-rpi-singledirectory.tar.gz
tar -zxvf webcontrol-0.918-rpi-singledirectory.tar.gz

To run WebControl, try:

./webcontrol &

The ./ is important on Linux systems. The & at the end tells it to launch in a separate session so it doesn’t close out when you shutdown or lose ssh connection.

1 Like

pretty much, I cheat and fire up a graphical browser to do the download

then you need to add a line to /etc/rc.local to start webcontrol automatically
when the system boots

David Lang

./webcontrol &

The ./ is important on Linux systems. The & at the end tells it to launch in a separate session so it doesn’t close out when you shutdown or lose ssh connection.

actually, to be sure that it doesn’t shutdown when you logout, you need to then
to

disown %1

otherwise, even if it’s in the background, it will shutdown if you logout.

(and with some apps, you need to add </dev/null >/dev/null 2>/dev/null to make
sure that closing stdin/stdout/stderr doesn’t cause the app to exit)

David Lang

This is great! I’ll let you know how it goes. I really appreciate it.

If we only had someone to create a wiki on how to properly setup and rpi for webcontrol… :wink:

If I can get it to work, I’m on it.

I’m hung up on one last part. Everything is installed and working properly, except for the /etc/rc.local part.

I can get into the file and edit it, but I’m not adding the right code to get webcontrol to run.

My last attempt was removing everything in the file except for the exit 0 at the end and then adding the following line to try to run webcontrol from the directory.

/webcontrol/./webcontrol & disown %1

That didn’t work. Any ideas?

I’ve been documenting as I go for the wiki.

I added this to the rc.local file and it worked:

home/pi/webcontrol/./webcontrol &

Now I just need to figure out where the disown %1 goes.

Based on my recent googling, if you are running it from rc.local, it is run as root. Therefore it is my understanding that since you are not typing it from the command line, you should be able to use this line in your rc.local file:

/home/pi/webcontrol/webcontrol &

and not need the “disown %1” at the end. If you were typing it in, you would use the disown so when you log out, the process would not stop. If it works, I think you are good to go. When you log out is the web page still being served?

what directory did you install webcontrol in? go to that directory and type pwd

it’s probably /home/pi/webcontrol rather than /webcontrol

David Lang