Archive:PrinterBot

From The Munich Maker Lab's Wiki
Revision as of 16:13, 10 September 2022 by Vrs (talk | contribs) (Vrs moved page PrinterBot to Archive:PrinterBot without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Attention.png You are visiting an old member project. The information found on "PrinterBot" might be out of date.
 
PrinterBot

Release status: obsolete [box doku]

Description 3d Printers multiple octoprint machine
Author(s)  Ricardo Gomes (organom)

Lab pc to run multiple instances of OctoPrint and connect to the 3d printers.

Hardware

 VoomPC-2 Enclosure [1]
 Point of view nvidia ion mini-itx board - QuadCore Atom 1.6Ghz (from the free to use shelf)
 2 x HP 2Gb ddr2 800 ECC
 M1-ATX [2]
 19V 3.4A laptop charger (from the free to use shelf)
 8gb SanDisk usb pen as main disk  -- only class 4 device :(


Board detail:

PrinterBot-0.jpg


Installing debian:

PrinterBot-1.jpg

 user: mumalab
 ip: 10.10.20.25


Installing Octopi:

 sudo apt-get install python-pip python-dev git
 sudo apt-get install python-setuptools
 git clone https://github.com/foosel/OctoPrint.git
 cd OctoPrint
 sudo python setup.py install
 sudo usermod -a -G tty,dialout mumalab

Test Run:

 mkdir ~/.octoprint
 ~/Octoprint/run

Open http://10.10.20.25:5000 to check if it works

Creating n-home folders for the octoprint instances:

 numInstances=9
 for ((i = 1; i<=$numInstances; i++)); do cp -rf .octoprint .octoprint$i; done
 rm -rf .octoprint

Creating script to boot the instances:

Edit /home/mumalab/octoprintInstances.sh

 #!/bin/sh
 OCTOPRINT_HOME=/home/mumalab/OctoPrint
 numInstances=4
 die () {
   echo >&2 "$@"
   exit 1
 }
 [ "$#" -eq 1 ] || die "Action start, stop or restart needs to be provided as argument."
 for i in $(seq 1 $numInstances);
 do
       echo "Octoprint$i - $1"
       $OCTOPRINT_HOME/run --daemon $1 --port 500$i --pid /tmp/octoprint$i --basedir ~/.octoprint$i
 done

Creating startup script:

Edit /etc/init.d/octoprintInstances

 #! /bin/sh 
 ### BEGIN INIT INFO
 # Provides:		octoprintInstances
 # Required-Start:	$remote_fs $syslog
 # Required-Stop:	$remote_fs $syslog
 # Default-Start:	2 3 4 5
 # Default-Stop:		
 # Short-Description:	Octoprint multiple instances script
 ### END INIT INFO
 case "$1" in
   start)
       echo "Starting instances:"
       su mumalab -c '/home/mumalab/octoprintInstances.sh start'
       ;;
   restart|reload|force-reload)
       echo "Restarting instances:"
       su mumalab -c '/home/mumalab/octoprintInstances.sh restart'
       ;;
   stop)
       echo "Stopping instances:"
       su mumalab -c '/home/mumalab/octoprintInstances.sh stop'
       ;;
   *)
       echo "Usage: $0 start|stop" >&2
       exit 1
       ;;
 esac
 exit 0

Adding to the startup

 cd /etc/rc2.d/
 ln -s /etc/init.d/octoprintInstances S01octoprintInstances


Creating customized dev entries for the printers:

Foreach device connected do a

 dmesg | tail

and check the port the device connected to and if the idVendor and idProduct can be seen right away.

For the serial attribute, use:

 udevadm info -a -n /dev/ttyUSB0 | grep '{serial}'

Next edit the /etc/udev/rules.d/10-local.rules and add something like the following.

 SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{serial}=="AE01DRVY", SYMLINK+="SolidDoodle"
 SUBSYSTEM=="tty", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="0483", ATTRS{serial}=="12345", SYMLINK+="Neo"
 SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042", ATTRS{serial}=="55434343633351710270", SYMLINK+="Ultimaker1"

Reboot so that the devices are available.

Instances customization:

Add the following to the /home/mumalab/.octoprint1/config.yaml

 serial:
   port: /dev/Ultimaker1
   autoconnect: true
   additionalPorts:
   - /dev/Ultimaker1
   baudrate: 250000
 appearance:
   name: Ultimaker1
   color: orange
 system:
   actions:
   - name: Restart instance
     command: /home/mumalab/OctoPrint/run --daemon restart --port 5001 --pid /tmp/octoprint1 --basedir ~/.octoprint1
     action: restartInstance
     confirm: You are about to restart the instance.

Add the following to the /home/mumalab/.octoprint2/config.yaml

 serial:
   port: /dev/Neo
   autoconnect: true 
   additionalPorts:
   - /dev/Neo
   baudrate: 250000
 appearance:
   name: Neo
   color: blue
 system:
   actions:
   - name: Restart instance
     command: /home/mumalab/OctoPrint/run --daemon restart --port 5002 --pid /tmp/octoprint2 --basedir ~/.octoprint2
     action: restartInstance
     confirm: You are about to restart the instance.

Add the following to the /home/mumalab/.octoprint3/config.yaml

 serial:
   port: /dev/SolidDoodle
   autoconnect: true
   additionalPorts:
   - /dev/SolidDoodle
   baudrate: 250000
 appearance:
   name: SolidDoodle
   color: white
 system:
   actions:
   - action: restartInstance
     command: /home/mumalab/OctoPrint/run --daemon restart --port 5003 --pid /tmp/octoprint3 --basedir ~/.octoprint3
     confirm: You are about to restart the instance.
     name: Restart instance

Issues

 One of the capacitor from m1-atx was damaged and was causing weird issues on bootup of the system 
 --> Capacitor replaced and the system went back to normal.
 The initial installed cpu fan was too big leaving almost no space from the case ceiling, what was causing the cooling not to work properly 
 --> Replaced with a smaller fan.
 Ethernet card is not recognized and seems not to be working at all.
 Some errors regarding not shielded usb ports (causes the system to sometimes hang when connecting usb devices)

.