Devuan Raspberry Pi 2 3D Printer server

Mini 3D Printer server

Devuan Raspberry Pi 2 is ready.

Computer: Raspberry Pi 2 Model B
OS: Devuan 1.0

Modification of 5V/2A power supply

I had a USB to micro USB adaptor and decided to use it instead buying a 5V/2A power supply with micro USB plug.

Find power and ground wires from the power supply cable using a multimeter.

20160815_0024

Identifying power adaptor’s voltage polarity

Cut USB and power cable using a wire stripper. 20160815_0030

0.9 mm wire and 4.45 mm USB cable

4 pin USB plug

| 4 2 3 1 |
+---------+
4: Ground
1: VCC (5V+)
20160815_0031

micro USB and USB plug pins

Red wire: VCC (5V+)
Black: Ground
Green and white: signal

20160815_0026

Shielded four wires in USB cable

Solder the two cable wires.

I used heat shrink tubes for the insulation.

20160815_0027

Soldering power supply and USB wires

5V/2A power supply

3D Printing the case

Case files: http://www.thingiverse.com/thing:1279415

Filament: 1.75 mm PLA red (eSun) and yellow (No brand)
Layer height: 0.25 mm

Install and set up Devuan

Installation guide I followed is here.

I spent few hours from start to finish.

I had trouble while preparing a bootable SD card.  The SD card reader I have intermittent connection problem, which I should replace it for headache shake.

A weird thing is that only long USB cable off of Wacom table makes the card reader being plugged in Devuan.

Each time after I wrote the image file to microSD card, the card reader went dead.
$ sudo dd bs=4M if=raspbian-ua-netinst-v1.0.7.img of=/dev/sdb

gparted couldn’t format the microSD card so  I had to work on a Windows laptop for formatting and creating the installation microSD card.  I need to learn how to format a dd-ed SD card.

In second trial, the board was working. I could see IP address of the board on router’s admin page and “nmap -sn 192.168.1.0/24” command.

Installing Devuan Linux

Upgrade from Wheezy to Devuan

I could login in Raspberry Pi Wheezy using ssh.
Login ID/Passwd: root/raspbian

The whole upgrade had done in two ssh terminals.


# dpkg-reconfigure locales
en_US.UTF-8
ko.KR.EUC-KR
ko.KR.UTF-8

# dpkg-reconfigure tzdata

Update /etc/apt/sources.list

# wget http://packages.devuan.org/devuan/pool/main/d/devuan-baseconf/devuan-baseconf_0.6.4%2Bdevuan3_all.deb

$ dpkg -i devuan-baseconf_0.6.4+devuan3_all.deb

Create 01lean file
/etc/apt/apt.conf.d# more 01lean
APT::Install-Suggests "0";
APT::Install-Recommends "0";
APT::AutoRemove::SuggestsImportant "false";
APT::AutoRemove::RecommendsImportant "false";

# gpg --recv-keys 94532124541922FB

# gpg --export -a 94532124541922FB | apt-key add -

# apt-get update && apt-get upgrade && apt-get dist-upgrade

# apt-get install -y aptitude

# aptitude search '?installed' | grep systemd

# apt-get install task-lxde-desktop xrdp

# aptitude search '?installed' | grep systemd

# apt-get install sudo

Created a user named penguin.

VNC setup

# apt-get install vnc4server

penguin@pi:~$ vncserver  -geometry 1024x728 -alwaysshared -depth 24

You will require a password to access your desktops.

Password:
Verify:
xauth: file /home/penguin/.Xauthority does not exist

New 'pi:3 (penguin)' desktop is pi:3

Creating default startup script /home/penguin/.vnc/xstartup
Starting applications specified in /home/penguin/.vnc/xstartup
Log file is /home/penguin/.vnc/pi:3.log

VNC client in the remot host

$ sudo aptitude install xvnc4viewer

$ xvnc4viewer 192.168.1.103:3

VNC Viewer Free Edition 4.1.1 for X - built Apr  2 2015 21:51:06
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Fri Aug 19 00:57:48 2016
 CConn:       connected to host 192.168.1.103 port 5903
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8
Password:
Fri Aug 19 00:57:56 2016
 TXImage:     Using default colormap and visual, TrueColor, depth 24.
 CConn:       Using pixel format depth 6 (8bpp) rgb222
 CConn:       Using ZRLE encoding
 CConn:       Throughput 15714 kbit/s - changing to hextile encoding
 CConn:       Throughput 15714 kbit/s - changing to full colour
 CConn:       Using pixel format depth 24 (32bpp) little-endian rgb888
 CConn:       Using hextile encoding

Install hibernation program
$ sudo aptitude install pm-utils

Install Printrun for 3D Printer server

Install dependent packages
$ sudo apt-get install python-serial python-wxgtk3.0 python-pyglet python-numpy cython python-libxml2 python-gobject python-dbus python-psutil python-cairosvg git

Clone the repository
git clone https://github.com/kliment/Printrun.git

Build Cython-based G-Code parser
Go to Printrun directory and execute below command.
$ python setup.py build_ext –inplace

Remote 3D Printing on Raspberry Pi 2 server

It requires simple two steps.
First, upload a gcode file to the server. I use scp.
$ scp idler-bracket-v2.gcode pi@raspberrypi:3D-Printing/gcode-files

Second, ssh login to the server.
$ ssh -X pi@raspberrypi

Running Pronterface that provides GUI
Go to Printrun directory and start pronterface.py

20160902_0015

pronterface

Running  Pronsole that provides simple text UI
Go to the directory that stores gcode-file and start pronsole.py.
20160902_0016

pronsole

Configure 250000 baud rate in USB connection

Open Configuration.h of Mariln firmware in Arduino IDE and change the baud rate constant to 250000.

#define BAUDRATE 250000 // (115200)

Upload the firmware.

You need to install latest pyserial from source code.

Download the source of pyserial https://github.com/pyserial/pyserial.
Decompress it
Go to the source directory
$ python setup.py build
$ sudo python setup.py install

About janpenguin

Email: janpenguin [at] riseup [dot] net Every content on the blog is made by Free and Open Source Software in GNU/Linux.
This entry was posted in DIY, GNU/Linux, Reprap 3D Printer and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s