Skip to content

3D Printer Emulator

Tres Finocchiaro edited this page Apr 24, 2018 · 19 revisions

Background

Install a virtual reprap 3D printer running Marlin

http://linuxaleph.blogspot.com/2017/03/3d-printing-software-cura-slic3r.html

Linux

simreprap

  1. Install dependencies

    sudo apt-get install libdevil-dev libtool-bin libtool libfontconfig1-dev clang libelf-dev freeglut3 freeglut3-dev gcc-avr avr-libc gcc make git libcairo2-dev picocom
    
  2. Clone repository

    git clone https://github.com/buserror/simreprap
  3. Compile

    cd simreprap
    make -I shared/libc3/
  4. Run

    export SIMAVR_UART_XTERM=1
    obj-x86_64-linux-gnu/reprap.elf

Pronterface

  1. Install dependencies

    python-wxgtk2.8 is required and is not available in the Ubuntu 16.0.4 repositories.

    sudo add-apt-repository ppa:nilarimogard/webupd8
    sudo apt update
    sudo apt install python-serial python-wxgtk2.8 python-pyglet python-numpy cython python-libxml2 python-gobject python-dbus python-psutil python-cairosvg
    
  2. Clone the stable branch for Printrun

    git clone -b stable https://github.com/kliment/Printrun
  3. Run

    cd Printrun
    python pronterface.py

tty0tty

This project will setup virtual COM ports, which is what 3D printers communicate through.

  1. Download

    git clone https://github.com/freemed/tty0tty
  2. Build

    # build
    cd tty0tty-1.2/module
    make
    
    # Copy the new kernel module into the kernel modules directory
    sudo cp tty0tty.ko /lib/modules/$(uname -r)/kernel/drivers/misc/
    
    # Load the module
    sudo depmod
    sudo modprobe tty0tty
  3. Test / set permissions You should see new serial ports in /dev/ (ls /dev/tnt*) Give appropriate permissions to the new serial ports

    # list new COM ports
    ls /dev/tnt*

    image

    # setup permissions
    sudo chmod 666 /dev/tnt*

    You can now access the serial ports as /dev/tnt0 (1,2,3,4 etc) Note that the consecutive ports are interconnected. For example, /dev/tnt0 and /dev/tnt1 are connected as if using a direct cable.

  4. Make tty0tty persistent

    # edit modules
    sudo vi /etc/modules
    
    # add this line
    tty0tty

picocom

Install picocom to see traffic over COM port

  1. Install

    sudo apt-get install picocom
  2. Use

picocom /dev/tnt0

simavr

  1. Build

    simavr

    git clone https://github.com/buserror/simavr.git
    cd simavr
    git checkout tags/v1.4
  2. Run

    ######### TODO ######## We need to add steps for running and opening a virtual com port

simutron

######### TODO ######### ######### DOES NOT WORK #########

simutron is not required. It only provides a GUI around simavr

  1. Download and extract

    # download
    wget https://sourceforge.net/projects/simutron/files/Simutron-1.0.1/Linux/simutron-1.0.1-SR1-Linux-x86_64.tar.gz
    
    # extract
    tar -xvzf simutron-1.0.1-SR1-Linux-x86_64.tar.gz
Clone this wiki locally