1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

CommunityOS for Robo Printers (and others)

Discussion in 'Off Topic' started by WheresWaldo, Jun 3, 2019.

  1. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    communityos.png

    A replacement distribution for Robo3D R2 and C2 printers. It includes the OctoPrint host software for 3d printers out of the box and mjpg-streamer with RaspiCam support for live viewing of prints and timelapse video creation. A Linux proxy server is included so you can access your printer via your favorite browser at http://communityos.local.

    Features
     
    #1 WheresWaldo, Jun 3, 2019
    Last edited: Jun 3, 2019
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    What is included with CommunityOS

    CommunityOS is an attempt by a small group of Robo3D printer users to 'modernize' the operating environment used to run the R2 and C2 printers. The idea is to take the current hardware and extend their useful lives. Hopefully all the little bugs and nuisances of the existing control program will be a thing of the past. All the proprietary plugins, no longer supported by Robo3D are gone, replaced by the same or equivalent plugins from the original authors. No plugins that violate your privacy without asking permission.

    The Raspberry Pi (a Raspberry Pi 3 Model B+ recommended) has the following configuration:
    • Latest stable release of Raspbian Stretch Lite
    • Latest stable version of OctoPrint
      • All required Raspbian software is included in the distribution
      • All non-essential Raspbian software is removed from the distribution
    • PyBonjour is included for network access using friendly human-readable names
    • Latest version of mjpg-streamer for snapshots and timelapse
    • Latest version of HAProxy
    • Latest version of WiringPi for generalized GPIO support
    • SSH enabled by default
    • Easy way to provide a unique hostname for your network setup.
    We currently have two preconfigured distributions for your Robo3D printer. One for the R2 and another for the C2. A list of the preinstalled OctoPrint Plugins include:
    If you use one of the predefined distributions for the C2 or R2 you will have printer profiles preset within OctoPrint. The proper touchscreen drivers for the HDMI version of the C2 and the R2, respectively.

    If the predefined distribution is not exactly your cup of tea, then you have the option to build your very own distribution with the plugins you want preinstalled and preconfigured.
     
    #2 WheresWaldo, Jun 3, 2019
    Last edited: Jun 3, 2019
    Brandon Groves and TransBat like this.
  3. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Hardware requirements for CommunityOS

    You will need a new µSD card. We do not recommend that you reuse the existing card in your Robo printer. Please put that card in a safe place if you ever desire to return to the original RoboOS distribution, although the hope is you will never have to go back. We would recommend any quality µSD card with a minimum capacity of 8 GB (16 GB - 64 GB recommended). The image itself is only 2 GB in size, but it will expand automatically to use the entire capacity of your µSD card.

    If you already have a Robo3D C2 or R2 printer, there is nothing else needed. If you want to run this on another printer (Robo3D or otherwise), you will need the following hardware.

    • Raspberry Pi 3 Model B+ (tested on a Model 2 and above).
    • A +5.1 V micro USB power supply, with a minimum capacity of 2.5 A.
    • A USB cable to attach your Raspberry Pi directly to your printer
    • Optional Ethernet cable (if not using WiFi)
    • A compatible Raspberry Pi HDMI LCD Touchscreen, we have been very happy with most of the screens from Waveshare.com. For reference, the C2 uses a 3.5" resistive touchscreen and the R2 uses a 5" resistive touchscreen.
    • Some sort of case for it all, maybe even 3D print one.
     
    #3 WheresWaldo, Jun 3, 2019
    Last edited: Jun 3, 2019
    TransBat likes this.
  4. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    How to install a predefined CommunityOS image

    In order to use CommunityOS you first need to download and burn the image to removable media. The following instructions explain how to use balena Etcher to do just that.
    1. Download the latest release of CommunityOS from the GitHub repository to your local hard disk drive.
    2. Place an 8 GB or larger microSD card in a reader and plug it into your PC or Mac. Ignore any error messages or requests to format the drive.
    3. Open the balena Etcher application.
    4. At the opening screen press the Select Image button.
      [​IMG]
    5. In the file selection dialog select the .img file you downloaded in step 1 and press Open.
    6. Change the Drive selected in Etcher if it is not autodetected
    7. Press the Flash! button to continue.
      [​IMG]
    8. Etcher will pause for a few seconds as it is preparing to write the image to the microSD card.
    9. Once it has started flashing the image the following screen will appear with a percentage progression bar.
      [​IMG]
    10. Once flashing is complete, Etcher will validate that it has flashed the image correctly.
      [​IMG]
    11. After validating Etcher will unmount the drive and report that it is finish.
    12. You may get addition dialog boxes that indicate that your newly written image needs formatting, you must cancel all these dialog boxes.

    You are now ready to configure your CommunityOS image.
     
    #4 WheresWaldo, Jun 3, 2019
    Last edited: Jun 3, 2019
  5. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    How to configure your CommunityOS distribution

    Now that you have written the image onto a new µSD card, it is time to configure it for use on your home network. This requires the use of a text editor. Please do not use Windows Notepad or Wordpad to edit the necessary files. We recommend Notepad++ or any of a number of Linux style text editors.

    You may have to eject the µSD from your PC and insert it again for Windows to see it. Once Windows recognizes the µSD there may be a series of dialog boxes warning you that the drive requires formatting. Please Cancel all these warnings, without taking any other actions.

    Once you are ready for configuration, you should be able to get a directory of files in a /boot/ partition of the µSD.
    Directory-boot.png
    There are several files that can affect your configuration. The first file you will be editing is communityos-wpa-supplicant.txt. Within that file you will set up your access to your WiFi network. Once loaded in your text editor you should see something like this;
    wpa-supplicant-01.png
    The section that starts with ## WPA/WPA2 secured is where you need to start editing. First remove all the # characters from the front of every line starting with #network={ and ending with the line #}.In between the quotes where it says put SSID here, replace that text with the name of your WiFi network, remembering to leave the quotation marks. In the very next line replace the words put password here with the actual password used to connect to your WiFi network. Scroll down to the section with the lines that start with country=.
    wpa-supplicant-02.png
    Only one of the following lines must have the # removed, by default it is United Kingdom, if you are for example in the United States, add a # to the beginning of the line for GB and remove the # at the beginning of the line for the US. Save your file.

    If you are okay with accessing your CommunityOS server at the address of http://communityos.local then you are done editing and may now insert your µSD card into the Raspberry Pi and start the boot process. If you want or need to change the address for your CommunityOS server, create and edit a file named communityos-hostname.txt. If a host name other than communityos is desired type it into the first line, then save the file. Make sure there are no spaces or special characters in your hostname. Once complete you will be able to access your CommunityOS server at http://<hostname>.local, where <hostname> is replaced by whatever name you saved in the file, communityos-hostname.txt.

    You are now ready for your first boot up with CommunityOS.
     
    #5 WheresWaldo, Jun 3, 2019
    Last edited: Jun 7, 2019
  6. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    How to configure your CommunityOS distribution part 2

    After inserting your CommunityOS µSD into the Raspberry Pi and applying power it will boot up the first time and display the logo screen pictured here.
    logo_splash.png
    After 60 - 90 seconds you will see CommunityOS resizing its own file system to use the entire capacity of the µSD card used. Depending on the size of the µSD card it may take a moment or two to complete this operation. Upon completion the Raspberry Pi will reboot a second time.

    Once the second boot up is complete, a process that can take up to 5 minutes, you will be presented with an error screen stating that the control interface cannot connect to your OctoPrint server. At this point you must perform the first time configuration for OctoPrint. Every effort was made to "preconfigure" CommunityOS but a couple of items can only be configured after OctoPrint is running. Using your favorite browser, navigate to http://communityos.local. You may have to reload the page several times before you are presented with the OctoPrint Setup Wizard. Once OctoPrint is fully loaded you will be presented with the following setup screens.
    octoprint-setup-01.png
    Clicking on Next will move you to the Access Control screen.
    octoprint-setup-02.png
    Please make sure to fill this screen out completely and answer accordingly. Before proceeding you must select either to Disable or Keep Access Control (recommended) otherwise you will not be allowed to move one from this setup screen. Once you have made you Access Control determination, clicking on next with continue with the setup.
    octoprint-setup-03.png
    You can safely disable usage tracking if you like. Leaving it enabled will allow OctoPrint's author to track just how OctoPrint is being used. No personal data is ever transmitted with the anonymous usage statistics. For details on what gets tracked, please refer to tracking.octoprint.org and also the Privacy Policy at tracking.octoprint.org. Clicking on the Next button will move you to the final Setup Wizard screen.
    octoprint-setup-04.png
    At this point you have completed the Setup Wizard and clicking on Finish will take you to the default OctoPrint web interface. At the same time the display attached to your Raspberry Pi will have changed from the previous error screen to the home screen of the interface.
     
    #6 WheresWaldo, Jun 3, 2019
    Last edited: Jun 5, 2019
    Ogbo14 likes this.
  7. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    reserved 7
     
  8. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    reserved 8
     
  9. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    reserved 9
     
  10. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    reserved 10
     
  11. TransBat

    TransBat Member

    Joined:
    Dec 23, 2016
    Messages:
    67
    Likes Received:
    35
    Just stumbled across this - this is a huge and amazing undertaking @WheresWaldo . I will definitely be taking a look at this soon - thank you so much your hard/outstanding work! While I haven't had the opportunity to try it, will the C2 build work with both machine builds regarding the touchscreen (the GPIO pinout and HDMI versions)? My C2 was one of the original C2 Kickstarter units, and later replaced as faulty with a new unit, and I haven't checked to see which version of the screen connection I have now.
     
  12. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,957
    Likes Received:
    7,344
    It should work with either.
    Mine is the non-HDMI one, but AFAIK someone else tested with the HDMI version too.
     
    TransBat likes this.
  13. TransBat

    TransBat Member

    Joined:
    Dec 23, 2016
    Messages:
    67
    Likes Received:
    35
  14. Roberto Torres

    Roberto Torres New Member

    Joined:
    Apr 27, 2018
    Messages:
    6
    Likes Received:
    1
    I had tried on my R2 but the screen is rotated, I managed to rotate is on the config files but only the image rotated, the touch spots remain rotated...In any case great work, THANKS
     
  15. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,957
    Likes Received:
    7,344
    Hmm, there is a way to sort that too.

    Did you use this:

    lcd_rotate=2

    (in the config.txt use: lcd_rotate=2)

    That rotates the display as well as the touchscreen points.
     
    TransBat likes this.
  16. JeffreyB

    JeffreyB Member

    Joined:
    Mar 25, 2016
    Messages:
    71
    Likes Received:
    29
    Hey guys. Great work! I just got this up and running but needed to invert my screen. I tried the lcd_rotate in config.txt but that did nothing for my board. Also tried the "display_rotate=0" and it did rotate the screen, but did not rotate my touch points. Then I found that you had to run a file under the ./LCD-show directory called "LCD5-show" with the 180 argument and that did the trick, however it also broke my auto starting of the GUI on the touch screen. The touch screen now just shows the RPi boot info.How do I get it to launch the touch screen GUI that you guys created? If I go back and reimage, I'll be right back at square one with a flipped screen. Any ideas?

    Thanks,
    Jeff

    Here's what the LCD-show script does:


    i=1
    for lines in `cat ./boot/mark`
    do
    case ${i} in
    1) var1=${lines};;
    esac
    i=`expr ${i} + 1`
    done
    #echo "$var1"

    j=$(uname -n)
    if test "$var1" = "0" -a "$1" != "lite" -a "$2" != "lite";then

    if test "$j" != "retropie" ;then
    sudo apt-get install xserver-xorg-input-evdev
    sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
    fi

    if test "$j" = "retropie" ;then
    sudo cp -rf ./nes /home/pi/RetroPie/roms/
    fi

    echo "1" > ./boot/mark
    sudo dpkg -i -B ./xinput-calibrator_0.7.5-1_armhf.deb

    sudo apt-get install cmake -y
    cd ./rpi-fbcp/build/
    sudo cmake ..
    sudo make
    sudo install fbcp /usr/local/bin/fbcp
    cd ../../
    sudo mkdir -p /usr/share/X11/xorg.conf.d

    elif test "$var1" = "0" -a "$1" = "lite" ;then
    echo "1" > ./boot/mark
    echo "No touch driver installled"
    echo "No fbcp driver installled"
    sudo mkdir -p /usr/share/X11/xorg.conf.d

    fi

    sudo cp -rf ./etc/rc.local /etc/rc.local

    if test "$1" = "0" -o "$#" = "0" -o "$2" = "0"; then
    sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-5 /usr/share/X11/xorg.conf.d/99-calibration.conf
    sudo cp ./boot/config-5.txt /boot/config.txt
    echo "LCD configure 0"
    elif test "$1" = "lite" -a "$#" = "1"; then
    sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-5 /usr/share/X11/xorg.conf.d/99-calibration.conf
    sudo cp ./boot/config-5.txt /boot/config.txt
    echo "LCD configure 0"
    elif test "$1" = "90" -o "$2" = "90"; then
    sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-5-90 /usr/share/X11/xorg.conf.d/99-calibration.conf
    sudo cp ./boot/config-5.txt-90 /boot/config.txt
    echo "LCD configure 90"
    elif test "$1" = "180" -o "$2" = "180";then
    sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-5-180 /usr/share/X11/xorg.conf.d/99-calibration.conf
    sudo cp ./boot/config-5.txt-180 /boot/config.txt
    echo "LCD configure 180"
    elif test "$1" = "270" -o "$2" = "270" ;then
    sudo cp -rf ./etc/X11/xorg.conf.d/99-calibration.conf-5-270 /usr/share/X11/xorg.conf.d/99-calibration.conf
    sudo cp ./boot/config-5.txt-270 /boot/config.txt
    echo "LCD configure 270"
    fi

    sudo cp -rf ./usr/share/X11/xorg.conf.d/99-fbturbo.conf-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.conf
    if test "$j" = "kali" ;then
    sudo cp ./usr/share/X11/xorg.conf.d/99-fbturbo.conf-kali-HDMI /usr/share/X11/xorg.conf.d/99-fbturbo.conf
    fi

    if [ -b /dev/mmcblk0p7 ]; then
    sudo cp ./cmdline.txt-noobs /boot/cmdline.txt
    else
    sudo cp ./cmdline.txt /boot/
    fi

    sudo cp ./inittab /etc/


    if test "$#" = "0" -o "$1" = "0" -o "$1" = "90" -o "$1" = "180" -o "$1" = "270" -o "$2" = "0" -o "$2" = "90" -o "$2" = "180" -o "$2" = "270" -o "$1" = "lite" -o "$2" = "lite"; then
    sudo reboot
    echo "reboot now"
    else
    echo "Invalid parameter,Usage:LCD5-show [0] [90] [180] [270] [lite]"
    fi
     
  17. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,957
    Likes Received:
    7,344
    I am not sure if the image that is current contains the UI or not, I should have that online and you can download it (I have not been looking at the community OS image in a while, @WheresWaldo might have more information).
    If all you are missing is the GUI code, let me know. I can get that to you.
     
  18. JeffreyB

    JeffreyB Member

    Joined:
    Mar 25, 2016
    Messages:
    71
    Likes Received:
    29
    The current image does contain the touch screen GUI because it all worked correctly when I flashed that image. But then running that LCD5-show command to rotate the screen broke the GUI (or stopped it from running). Now it just shows the boot screens and login prompt instead of the super sweet GUI on the touch panel.
     
  19. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,905
    Likes Received:
    3,593
    Which screen is it, because it should work with the standard LCD on the R2. I don't run LCD5-show during the setup because it does too much. I am not sure, but I think that part that breaks it is their version of cmdline.txt.

    Also, did you build your own version or use one of the pre-built releases? https://github.com/WheresWaldo/CommunityOS/releases
     
  20. JeffreyB

    JeffreyB Member

    Joined:
    Mar 25, 2016
    Messages:
    71
    Likes Received:
    29
    I'm using CommunityOS for my R2 with it's native screen, but I've also using it with a CR-10S with a 5" touch screen from Amazon after I got tired of their buggy OS. I ended up just printing a different case that keeps the orientation the same, easier than trying to fix the damage LCD5-show does.

    Thanks,
    Jeff
     

Share This Page