Skip to content

PegorK/PeggyBoard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoverRender

CoverRender

Close your eyes and take a deep breath. It's January 2020. You think to yourself this is going to be a great year for climbing. You've been climbing hard lately, pushing grades, training hard, and almost flashing the pink one in the corner, nothing can stop you. A couple months go by and your goals for the year are well defined, but you keep hearing talks of some novel virus. You brush it off.

It's now March. Looking at your phone the only headlines you see are about COVID-19. It's spreading quick. There are talks of quarantine measures to be put in place, social distancing, and the closure of public places. As you scroll through this you notice an email from your over-charging perfectly average climbing gym. They're closing their doors until further notice, but they're gladly still accepting your membership fees. Your climbing plans crumble like the choss in New Jack City, but you realize you have to stay in shape somehow. Like everyone else and their grandmother you begin to build a woody and so the PeggyBoard was born.

So what is the PeggyBoard?

  • It's a Raspberry Pi project developed to be paired with your home "woody"/climbing wall. It features an easy to use webapp that anyone on your network can open up and begin setting a custom route that will then light up the respective holds on your wall. These routes can also be saved so they can be revisited later.
  • It was originally developed for my climbing partner, Liam, for his home wall during the pandemic. He was putting together a 12ft 45° (ouch) wall and wanted to make it more fun/interactive.

Why not just get a MoonBoard?

  • The MoonBoard is an awesome product, but at the time their supplies were very low (since everyone was building one) and ~$700 on just the LED System alone ain't cheap.

Initial Features

PeggyBoard Route Creation
Figure 1. Route creation page.
PeggyBoard Routes Select
Figure 2. Searching for routes previously made.
PeggyBoard Save
Figure 3. Saving a route.

When accessing the app through a mobile device the user is presented with the route creation page as seen in Figure 1. This is where the user can interact with the wall by clicking different dots to set them up as either "Starting Holds" (green), "Foot Holds" (blue), "Hand Holds" (pink), or "Finishing Holds" (red). Each time a user presses on a dot it changes the type and doesn't let you set more than two of "Starting Holds" and "Finishing Holds".

Switching holds gif.
Figure 4. Alternating through holds.

The user can also view previously saved routes by clicking the folder icon or save their current route by clicking the save icon. When the user is ready to climb one of the routes they can press the light bulb icon and it will then light up the respective holds on the wall as seen in Figure 5.

PeggyBoard displaying a route
Figure 5. PeggyBoard displaying a route.

Updates

Initially the PeggyBoard only featured a web app and had no way of configuring the WiFi connection to use, what its current IP address is, or deleting saved routes. Years later (now) I decided to add a touch screen to the main control panel and utilize some of the code I wrote for a previous project (JagerMachine) to give the PeggyBoard a more user friendly interface for settings and while I was at it I decided to cleanup some of the code and make this project open source. Enjoy!

PeggBoard Settings UI
Figure 6. Control panel main screen.
Settings Menu
Figure 7. Settings page.
WiFi List
Figure 8. WiFi list.
WiFi Login
Figure 9. WiFi login.

Raspberry Pi Setup Instructions

  1. Configure Rpi to Kiosk Mode

  2. Enable Root SSH

  3. Install NGINX Webserver (w/ PHP Installation)

    1. To restrict the settings page to be only accessed from the control panel the nginx config at /etc/nginx/sites-enabled/default was edited and the following was added to the server section at the very end:
        location ^~ /settings {
            allow 127.0.0.1;
            deny all;
        }
    
  4. Setup a MYSQL Database (name the database 'peggyboardDB' and add a user 'master' with password 'climbhard'). After you have setup the database you will need to create a table named routes with a couple fields. You can use the following commands.

    1. Launch mysql with the created user master:
      mysql -u master -p
      
    2. Switch to use the peggyboardDB:
      use peggyboardDB
      
    3. Create a table named routes with the required fields:
      CREATE TABLE routes (
          id INT(10) unsigned NOT NULL AUTO_INCREMENT,
          routename VARCHAR(30) NOT NULL,
          grade INT(11) unsigned NOT NULL,
          author VARCHAR(30) NOT NULL,
          date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
          holds MEDIUMTEXT NOT NULL,
          primary key (id));
      
    4. Verify you have created the table properly. If you run the command DESCRIBE routes you should see a table like so:
      Database layout
    5. Exit mysql: exit


    NOTE - IF YOU CHOSE A DIFFERENT DB NAME AND USER MAKSE SURE YOU UPDATE THE FUNCTION openDatabase() in main_backend.php to the credentials and database name.

  5. Rotate LCD (optional)

  6. Enable GPIOs

  7. Setup NeoPixel libraries

    sudo pip3 install rpi_ws281x adafruit-circuitpython-neopixel
    sudo python3 -m pip install --force-reinstall adafruit-blinka
    
  8. Add custom splash (optional)

  9. Hide unwanted text from touchscreen:

    1. Hide autologin message by modifying auto login service:

      sudo nano /etc/systemd/system/getty@tty1.service.d/autologin.conf
      

      Replace

      ExecStart=-/sbin/agetty --autologin pi --noclear %I xterm-256color
      

      with:

      ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM
      
    2. Hide xorg messages by modifying bash_profile:

      sudo nano ~/.bash_profile
      

      Replace

      [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx -- -nocursor
      

      with:

      [[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx >/dev/null 2>&1 -- -nocursor
      
    3. Hide boot text and blinking cursor by modifying cmdline.txt:

      sudo nano /boot/cmdline.txt
      

      Add this the end. Make sure cmdline.txt contents are all on a single line.

      console=tty3 logo.nologo loglevel=3 splash silent quiet vt.global_cursor_default=0
      
      
    4. Hide Linux information text by modifying 10-uname script to comment out call of uname:

      sudo nano /etc/update-motd.d/10-uname
      

      Comment out uname call by adding a "#" behind it.

    5. Hide copyright text by removing all test inside motd file.

      sudo nano /etc/motd
      

      Remove all text there.

    6. Hide "Last login..." text by creating .hushlogin file on home directory:

      cd $HOME && touch .hushlogin
      
  10. Clone the repo to the base directory of the Raspberry Pi and copy the folders in the Software folder (custom_scripts, html) to /var/www/.

    • It is important that the original directory of the cloned repo lives in /home/pi/PeggyBoard
    • *If the repo is cloned to a different location be sure to update updateScript.sh.
    • You might need to add an exception for this directory so some git calls for update and versioning work: git config --global --add safe.directory /home/pi/PeggyBoard
  11. Give root privilege to custom script runRoot.sh

  12. Make runRoot.sh, connectToWifi.sh, and updateScript.sh into executables:

    chmod +x runRoot.sh && chmod +x connectToWifi.sh
    

Hardware

Parts

The control panel for the PeggyBoard was housed inside of a fireproof safe. Looking back it would have been way easier dealing with a project box of similar size. The panel contains the Raspberry Pi, power supply, 3.3V to 5V level shifter, two terminal blocks, 3 2-pin connectors, 3-pin connector, and a touchscreen. It looks like a rats nest but it's a rather simple setup. The schematic in Figure 10 is a simplified version of the finished product seen in Figure 10. The use of a 3v3 to 5v level shifter was necessary since the Raspberry Pi handles logic in 3v3, but the addressable LEDs expect 5V. The reason behind the 3 2-Pin connectors is due to voltage drop across the LEDs. Powering 400 LEDs from a single terminal is a bad idea. Not only will that terminal get extremely hot (even melt wires if too low gauge) it would also show a visible color change in LEDs the further out they are. To avoid this the 400 LED strip was split into 4 sections where each section ran a separate 5v and GND connection, but maintained the same signal line from the previous section as seen in Figure 12.

PeggBoard Schematic
Figure 10. Control panel schematic.
PeggyBoard Control Panel
Figure 11. Control Panel.
LED Connection
Figure 12. LED strip connections.
LED bulbs
Figure 13. LED bulbs on the back of the wall.
Mounted control panel
Figure 14. The PeggyBoard control panel.

Contact

Buy me a Coffee!
devPegor@gmail.com