Get a RaspberryPi and control your Felix from a browser

This is the place to show off your felix printer hacks and improvements.
Post Reply
hoolito
Posts: 95
Joined: Wed Feb 27, 2013 7:15 pm

Get a RaspberryPi and control your Felix from a browser

Post by hoolito » Sun Jun 30, 2013 4:56 pm

Hello,

A while ago I posted this question LCD module or Linux Barebone as a control? . I finally found time to try things myself...
I'll try to walk you through what I did as best as I can, but if there are any errors or omissions, please note that prior to this Friday, I did not have any experience whatsoever with Linux or RaspberryPi!
For this project I borrowed everything I needed to learn from timeLab in Gent where I live. (Thanks Kurt!)

My motivation for doing this was to improve the user interface of the Felix. Previously, I needed either to stay tethered to the printer by USB during the duration of the print (not comfortable + risk of losing connection) or copy the gcode to the SD card (loss of ability to monitor the printer during print)
An alternative was buying the LCD module, but I had used this briefly with Ultimakers, and I find the navigation a PITA, and I would still need to transfer the code through an SD card (cumbersome).

The makers of RepetierHost are writing RepetierServer and their first working version runs on a RaspberryPi... [Spoiler alert] I ended up controlling my Felix through a web browser and uploading gcodes though my network. I can even control the printer with my iPhone now... and all this for 50 euros or less!
So this is what I did using Win 7 (actually this is a mashup of several walkthroughs I found on the web I'll reference below). You should be able to do this in about 1 hour once you have a RPi:
  • Get a beer
  • Get a RaspberryPi model B, a power supply (USB connector, 5V 1500ma) and connect it via Ethernet to your router. This is almost the smallest BOM needed. I actually started with a monitor, keyboard, mouse etc. But then I learned these are not a must for what we attempt to do here.
  • Download and install this disk imaging tool: Win32DiskImager
  • Download and decompress this Linux distribution image: 2013-05-25-wheezy-raspbian.zip
  • Write the image onto an SD card (you need minimum a 4Gb card)
  • Insert the card in the RPi and plug the RPi in. Allow about a minute to boot. Ok: Now, the first time Raspbian boots it will start it's configuration utility raspi-config. I don't know if you already have SSH access at this point. (See my disclaimer: I'm a linux noob!)
  • Get the IP address given by your router to the RPi
  • Download and install this SSH client: PuTTY
  • Run PuTTY and enter the previous IP address as host name and press enter
  • You will need to login (user=pi, pass=raspberry)
  • Since I'm reconstructing these steps by heart I THINK you have logged in to a new SSH session so you'll need to enter raspi-config to get to the configuration utility.
  • From all the things you can configure here, I only needed to enable "Expand root partition to fill SD card". (Otherwise you won't have enough space to install the RepetierServer)
  • Quit raspi-config and reboot
  • Open an SSH session again and log in
  • Now type all these commands one by one to install RepetierServer on the RPi:
    - sudo apt-get install cmake
    - sudo apt-get install libboost-all-dev
    - sudo apt-get install git
    - git clone git://github.com/repetier/Repetier-Server.git
    - mkdir build
    - cd build
    - cmake ..
    - make (this will take about 30 minutes)
    - sudo cp RepetierServer /usr/bin
    - sudo cp ../linux/repetier-server.conf /etc
    - sudo mkdir /var/lib/Repetier-Server /var/lib/Repetier-Server/configs /var/lib/Repetier-Server/www /var/lib/Repetier-Server/storage /var/lib/Repetier-Server/languages
    - sudo cp -r ../www/* /var/lib/Repetier-Server/www
    - sudo cp ../languages/* /var/lib/Repetier-Server/languages
    - sudo cp ../linux/init_Repetier-Server_debian /etc/init.d/Repetier-Server
    - sudo chmod 755 /etc/init.d/Repetier-Server
    - sudo update-rc.d Repetier-Server defaults
  • Type:
    - cd /dev
    - ls
  • Plug in the USB cable from the Felix
  • Type ls again and try to see which one was added (mine was ttyUSB0, but your mileage my vary)
  • Now we need to add our Felix to RepetierServer. Since I don't know how to edit text files from the command line I used the GUI...
  • Install and start a VNC server on your RPi by typing
    - sudo apt-get update
    - sudo apt-get install vnc-server
    - vncserver (next time you only meed to type this to statrt it)
  • Install and run this VNC client on Win7: TightVNC 32-bit (I used actually the 64-bit version)
  • Follow the instructions to add a server password confirm the password say no to the view only option
  • Log in to LXDE in your RPi with something like this 192.168.1.25:5901 (use your IP but keep the port number).
  • Double-click on the icon to the right of what would be the start icon (the File Manager)
  • Navigate to /home/pi/Repetier-Server/configs and double-click on a0-101.cfg to edit it as follows
    - name="Felix"
    - slugName="Felix"
    - device="here you need to type the device name assigned to the Felix (mine was ttyUSB0)"
    - baudrate=250000
    - xmax=255.0
    - ymax=205.0
    - zmax=195.0
    If you like you can edit the speed settings (these are for the manual controls, they do not influence your gcode)
  • Save the file as felix.cfg on the same directory
  • Copy felix.cfg to the working directory of RepetierServer by typing the following via your PuTTY terminal
    - sudo cp /home/pi/Repetier-Server/configs/felix.cfg /var/lib/Repetier-Server/configs
  • Start RepetierServer with
    - sudo /etc/init.d/Repetier-Server start
    Note that the server will automatically start when you reboot the RPi
    If you need, you can reedit the previous config file, stopping the server (same line above with "stop", overwriting the config file on the working directory and restarting the server
  • Almost there!
  • Go to the following address with your browser from Win7 or your iPhone: http://[yourIP]:8080
  • There! Get another beer!
Explore the pages (this is a website residing on you RPi (/var/lib/Repetier-Server/www)
Although this is a work-in-progress, I found it already at a pretty usable state!!
Multiple users can log in to the same printer and you can manage multiple printers (connecting them to the RPi via a powered USB hub)
There is no "Power" button but you can send the command M80 to power via de manual controls and M81 to power off
You can easily upload your gcodes and add them to print queues.
Another advantage is that you are independent of FTDI driver issues on whichever OS you are. You can also choose your slicer software with more freedom!

ENJOY!!

ref 1 http://www.engadget.com/2012/09/04/rasp ... de-how-to/
ref 2 http://elinux.org/RPi_A_Method_for_ssh_blind_login
ref 3 http://elinux.org/RPi_Wheezy_VNC
ref 4 https://github.com/repetier/Repetier-Se ... NSTALL.txt

I have a ToDo list to improve on these solution... (More like a wishlist actually, since I don't know if I'll be able to do it)
  • Reduce this walkthrough drastically by hosting an image of Raspbian with RepetierServer and VNCServer pre-installed
  • Power the RPi with the same power supply of the Felix
  • Get rid of the UTP cable by using a USB Wifi network adapter for the RPi
  • Redesign the upper cover of the Felix Power supply to mount the RPi inside the housing
  • Submit felix.cfg as felix20.cfg to Github to be included on the next version
Cheers!
Last edited by hoolito on Mon Jul 01, 2013 8:48 am, edited 1 time in total.
Felix 2.0

seaton
Posts: 291
Joined: Tue May 14, 2013 9:04 am
Location: Bunbury, Western Australia
Contact:

Post by seaton » Mon Jul 01, 2013 8:32 am

love It!!!! It's on my toDo List :)
Stephen...

Felix 2.0 -> Felix 3.0 dual
Simplify3D Slicer, Kisslicer
Have you added your Felix to the Map? http://goo.gl/maps/HajnZ

http://blog.strobotics.com.au

hoolito
Posts: 95
Joined: Wed Feb 27, 2013 7:15 pm

Post by hoolito » Mon Jul 01, 2013 8:59 am

Thanks!
Once there is some feedback from this thread and I know it's debugged, I could also send the .cfg file to github so that it comes standard with the package.
I added this item to the list above. Maybe the XYZ or the speed values need some tweaking first.
Although I think that in the next version more things will be possible through the web interface.
Felix 2.0

dsnijders
Posts: 30
Joined: Fri Jul 26, 2013 4:13 pm

Post by dsnijders » Thu Sep 12, 2013 8:58 am

I followed the instructions above and installed it on Ubuntu Linux (12.04).
I can approach the repetier-server thru firefox and it shows my Felix 2.0 online.
However, the printer does not respond to any of the command (e.g. home x).
Any idea what this could be? btw, running on marlin firmware, could that be a compatibility issue?

Would love some suggestions, since I really would like to use the web ui interface to manage the print job.

Thanks, Daan

hoolito
Posts: 95
Joined: Wed Feb 27, 2013 7:15 pm

Post by hoolito » Thu Sep 12, 2013 9:23 am

Hi,
You need to manually send the M80 command to turn on the printer before anything. You do this in the command area (top of "control" page if I remember correctly)
Then use M81 to turn it off.
Hope this helps
Felix 2.0

dsnijders
Posts: 30
Joined: Fri Jul 26, 2013 4:13 pm

Post by dsnijders » Thu Sep 12, 2013 10:13 am

I tried that, but no results sofa.
when i start repeater-server, the printer does respond (Fan goes off for sec, LCD goes to black, and both come back after a sec). It is online, but does not respond to home commands. M80 also does not seem to do a lot. I checked the USB serial driver (ttyUSB0), that seems to be ok.

I selected 'protocol 0' in the felix config file, since I run MARLIN firmware.
Guess that is ok too.

Any other suggestion?

Daan

dsnijders
Posts: 30
Joined: Fri Jul 26, 2013 4:13 pm

Post by dsnijders » Thu Sep 12, 2013 10:40 am

I have it working.
Needed to change serial port mapping:
- from /dev/ttyUSB0
- to /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A800f4AP-if00-port0

Work perfect now, and I love it.
Thanks for your help with your clear instructions.

Daan

Daan

hoolito
Posts: 95
Joined: Wed Feb 27, 2013 7:15 pm

Post by hoolito » Thu Sep 12, 2013 11:08 am

Glad it works and you like it!
Yeah, that's why I put "your mileage might vary" ;-) That list of devices was rather big in my case and discovering which one was being added was not easy...

I just saw on github that they updated a .conf file that added some things ("Fixed threading bug, added logging, added eeprom support"). Version is still 0.24 though.
It would be nice to know with which command you refresh the files from your RPi to reflect this changes locally. I should look it up but don't have time now... :-|

Happy printing!
Felix 2.0

dsnijders
Posts: 30
Joined: Fri Jul 26, 2013 4:13 pm

Post by dsnijders » Sat Sep 21, 2013 12:56 am

Bought an Raspberry PI, and installed both Repetier-Server and OctoPrint. It all went pretty smooth, just had to open up the serial port ttyUSB0 for access to my Felix 2.0 printer (on Rpi : sudo chmod 777 /dev/ttyUSB0 to do this). Using OctoPrint now, it offers a little more functionality and a better UI but both are close.

hoolito
Posts: 95
Joined: Wed Feb 27, 2013 7:15 pm

Post by hoolito » Mon Sep 30, 2013 2:09 pm

Very nice!!
I'd like to try that!
Thanks
Felix 2.0

Post Reply