Raspberry Pi and Wireless Interface

The Raspberry Pi is an affordable computing solution, with the Raspberry Pi 3 Model B, power supply, and MicroSD card for OS costing a total of $60. The Pi is able to connect to the Melzi Board through the ethernet port. Since the Pi has wi-fi and blue tooth enabled, there are two available connections for reaching the Pi wirelessly. By enabling VNC Server on the Pi, you can reach and control the Pi from any device running RealVNC Viewer. By enabling a DNS Service such as no-ip at startup, the Pi can be reached outside a local network even if the router the Pi is connected to is working on a Dynamic IP address. By enabling the Pi camera and an MJPG Stream, the printer can be monitored remotely.

Original Author: User:Tjmahan

Design and Printing

Design

The raspberry pi case has been modified to allow attachment of the Raspberry Pi Camera to the adjustable arm, as well as allow it to be mounted directly on the vertical support of the RepRap Athena. The links are parametric to fit the arm length you need. The ball joint can be scaled down to allow for an easier fit into the camera mount and ball socket. Case and camera arm are a mash-up of [1] by Thingiverse User Adrien12 and [2] by Thingiverse User 3dkarma. All files can be found at [3] and [4]. Each are identical entries labeled as remixes,to give adequate credit to each creator.

TheBigPicture.jpg

Printing

The piece does not have to support a large weight, and a 15 or 20 percent in-fill will be sufficient. The ball joint can be scaled down to .99 to allow for an easier fit into the camera mount and ball socket.

Installation and Programming

Installation

Materials
Description Count
6-30x3/4" Hex Screws 2
6-30 Nuts 2
2mm camera mount screws 2
6mm stainless steel washer 2
5/8" wood screw 3
Camera Front Right 1
Ball Joint 1
Ball Socket 1
Parametric Link 2
Raspberry Pi Bot with Clip 1
Haur-de-boite_all 1
Raspberry Pi 3 Model B 1
Raspberry Pi Power Supply 1
MicroSD Card 1 - 16GB recommended
HDMI Cable 1
RepRap Athena 1
Ethernet Cable 1
  1. Insert Square Peg of Ball Joint into Square Hole of Camera Front Right. Press hard until Square Peg can slide no further.
  2. Insert Round end of Ball Joint into Ball Socket. Some force is needed.
  3. Ream all holes on links, Ball Socket, and Raspberry Pi Case Bottom using 4mm drill bit.
  4. Insert Links into grooves of Ball Socket and allign the holes.
  5. Insert 1 6x30 hex screw into hole on Ball socket, feeding through fully.
  6. Place washer onto end of hex screw.
  7. Place nut onto end of hex screw. Tighten as needed for firm hold.
  8. Align holes of Links with holes on Raspberry Pi Case Bottom.
  9. Insert 1 6x30 hex screw into hole on Ball socket, feeding through fully.
  10. Place washer onto end of hex screw.
  11. Place nut onto end of hex screw. Tighten as needed for firm hold.
  12. Insert ribbon of raspberry pi camera into camera module on Raspberry Pi 3 such that the leads on both align. Press firmly to bring leads into place.
  13. Important:Pause here until Raspberry Pi 3 Model B is formatted according to Programming instructions. One raspberry Pi is functioning as intended, proceed in installation process.
  14. Insert Raspberry Pi 3 into bottom of case. Note: Vertical posts may be trimmed with sharp X-Acto blade if needed. Pi should not be forced onto posts.
  15. Remove tape of Raspberry Pi Camera from Raspberry Pi 3 Model B.
  16. Place Haur-de-boite_all onto Raspberry Pi Case Bottom.
  17. Align strip of Raspberry Pi camera with available slot of Front Camera Right. Secure Raspberry Pi Camera to Front Camera Right using 2 2mm screws.
  18. Insert ribbon of raspberry pi camera into camera module on Raspberry Pi 3 such that the leads on both align. Press firmly to bring leads into place.
  19. Secure Case assembly to RepRap with wood Screws.
  20. Plug in all cables and ensure adequate connections.
  21. Ensure Raspberry Pi connected to RepRap through Ethernet cord and to monitor via HDMI cord. Using Raspberry Pi Graphical User Interface, connect through Chromium using address <http://192.168.76.2:8000/admin>

Programming

  1. On laptop or Desktop with SD Card reader, create folder with meaningful or memorable name, e.g. RaspberryPiSetUp
  2. Download SD Formatter 4.0 to folder from site [5]
  3. Follow Software installation process.
  4. Plug MicroSD into SD card adaptor, and plug SD adaptor into SD Card reader.
  5. Open SDFormatter4.0. From menu, select the Drive of your micro SD, and select format.
  6. Download NOOBS zip file from site [6].
  7. Unzip all files in NOOBS zip file. Copy all unzipped NOOBS files onto microSD card.
  8. Ensure Raspberry Pi Power supply is not plugged into Pi at this step.
  9. Plug microSD card into the rear slot of the Raspberry Pi.
  10. Use HDMI cable to connect Raspberry Pi to any monitor, and power on the monitor.
  11. Plug mouse and keyboard into USB port of Pi.
  12. Plug Raspberry Pi power supply into Raspberry Pi 3 Model B.
  13. When prompted to, selected raspian and select install. The installation process may take several minutes. Do not power down during installation.
  14. When Raspberry Pi Graphical User Interface is seen, open terminal window and enter the following commands to update and reboot, pressing enter between each:
  sudo apt-get update
  sudo apt-get upgrade
  sudo reboot
  1. When rebooted, open preferences -> mouse and keyboard configuration -> keyboard -> Keyboard Layout -> United States -> English(US). Click Ok to accept
  2. Open preferences -> Raspberry Pi Configuration -> Interfaces -> Enable Camera and VNC. Click Ok to accept and reboot
  3. Open terminal window and enter the following to enable the MJPG streaming Service
  sudo apt-get install libjpeg8-dev imagemagick libv4l-dev
  sudo ln -s /usr/include/linux/videodev2.h /usr/include/linux/videodev.h
  wget http://sourceforge.net/code-snapshots/svn/m/mj/mjpg-streamer/code/mjpg-streamer-code-182.zip
  1. Note: If an Error report is written, follow link [7]]and download through Graphical User Interface.
  unzip mjpg-streamer-code-182.zip
  cd mjpg-streamer-code-182/mjpg-streamer
  make mjpg_streamer input_file.so output_http.so
  sudo cp mjpg_streamer /usr/local/bin
  sudo cp output_http.so input_file.so /usr/local/lib/
  sudo cp -R www /usr/local/www
  mkdir /tmp/stream
  raspistill --nopreview -w 640 -h 480 -q 5 -o /tmp/stream/pic.jpg -tl 100 -t 9999999 -th 0:0:0 &
  1. Note: The output window will show cycling frames. Select File -> New Tab, and continue typing in the command window.
  LD_LIBRARY_PATH=/usr/local/lib mjpg_streamer -i "input_file.so -f /tmp/stream -n pic.jpg" -o "output_http.so -w /usr/local/www"
  1. In command window, select File -> New tab. Type command and press Enter
  ifconfig 
  1. Take note of section wlan0 HWaddr and inet addr
  2. Open Chromium, and enter http://<inet addr>:8080, where inet addr is from the previous step.
  3. If the site cannot be reached, repeat all steps for enabling MJPG Streaming Service. All steps are based on article listed in [8]
  4. In upper right hand corner of raspberry pi desktop Right Click on VNC -> Options -> Users & Permissions -> Standard User -> Password
  5. Enter a new password for the VNC Server
  6. On any Android, iOS, Windows, Mac, or Linux device, install RealVNC viewer from link [9]
  7. Open VNC Viewer, add new device. Type the inet addr for the ip address, press connect, and enter the password set for VNC server.

Update! Control through Wireless Hotspot/Tethering

For use when wi-fi is not available. This solution does not draw data, but tricks your phone into creating a network the raspberry pi can connect to, which can be used to connect to the printer via ethernet connection.

  1. Download Mobile Hotspot App for Android or iOS e.g. "Portable Wifi Hotspot" by Core Technology and install
  2. Turn on Mobile Data and close wifi
  3. Open App to start Mobile Hotspot
  4. Name Network and Create password
  5. In Android or iOS, go to Settings -> Connections -> Mobile Hotspot and Tethering -> Turn on Mobile Hotspot
  6. Turn off Mobile data
  7. Connect Raspberry Pi to phone's wifi hotspot
  8. Open VNC viewer on phone
  9. Run ifconfig on Raspberry Pi and enter wlan0 inetaddr into field for ip address VNCViewer.
  10. Mobile interface should function same as for a local network.

Mobile Access

For access outside of a local network, a static ip address is recommended. However, if one is not available, it is possible to set up a DNS Service to compensate. For this, first set a static ip for the wlan0 of the Raspberry pi, as shown in [10] on Snipplr. In this case, replace wlan0 for all instances of eth0. After that, establish port forwarding on the router and set up a dynamic dns service, as seen in this guide [11] by Gus. The domain provided by no-ip will point VNC viewer to the ip of the router, and port forwarding will point it toward the Raspberry Pi. The mobile interface should function the same as for a local network.



Wireless Control Example

Wireless Control of RepRap
Error in widget YouTube: Unable to load template 'wiki:YouTube'
Cookies help us deliver our services. By using our services, you agree to our use of cookies.