In this article you will learn how to setup a static IP address
INTRODUCTION
Depending on the demands of your work or home network configuration, it may become necessary for you to set up a static IP address for your printer. To do this you will need to SSH (remotely connect to the printer). Please note that some of the modifications that we will make may cause issues. If you can not connect to the printer or notice any other irregularities after this tutorial we recommend a 60 second hard reset of the printer for a M series printer; the always-on AP mode can be used to recover from network issues with the Ultra One.
WARNING: SSH Remote Access is only meant for advanced users. MakerGear is not responsible for any problems or damage created by the use of SSH to modify your printer.
Requirements:
- Time
- 10 - 15 minutes
- Hardware
- MakerGear M3-SE, M3-ID, or Ultra One 3D printer
- Software - A SSH program:
- For Windows - PuTTY (PuTTY website)
- For Linux or OSX - Terminal
- Prerequisites:
What you'll Learn:
- How to set up a static IP address
- How to modify files on the Raspberry PI
Before You begin:
- Follow the instructions for Enabling SSH
- Note: These instructions work with both the M3 Series and the U1. Any commands, settings or directions should use the relevant format ("u1printer1a234" for the U1 hostname, "m3printer12a34" for the M3 hostname, etc.). Please contact Support if you have any questions.
GETTING STARTED
Step 1
SSH into the printer with standard credentials:
- Username: pi
- Password: Printer serial number with all the letters capitalized.
ssh pi@m3printer12a34.local
or
ssh pi@u1printer1a234.local
- Replace the 12a34 with the last 5 characters of your serial number.
- Log into your printer by using the Serial number (all letters capitalized) as the password.
pi@m3printer12a34.local's password:
or
pi@u1printer1a234.local's password:
Note: when entering the password, no characters will be displayed. Once the password has been entered, hit "Enter" to login.
Step 2
Enter "ifconfig" into the terminal to view the current network settings, note current IP ("inet"), Broadcast and Netmask/Mask values:
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Thu Jul 5 13:41:57 from 10.1.1.98
pi@M3Printer12a34:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.1.121 netmask 255.255.0.0 broadcast 10.1.255.255
inet6 fe80::ba27:ebff:fea7:dd41 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:a7:dd:41 txqueuelen 1000 (Ethernet)
RX packets 10680866 bytes 2051365134 (1.9 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1012321 bytes 710249629 (677.3 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.31.4 netmask 255.255.255.0 broadcast 172.16.31.255
inet6 fe80::290:9eff:fe9a:a680 prefixlen 64 scopeid 0x20<link>
ether 00:90:9e:9a:a6:80 txqueuelen 1000 (Ethernet)
RX packets 1175 bytes 785801 (767.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 111057 bytes 34072896 (32.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2107801 bytes 945379957 (901.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2107801 bytes 945379957 (901.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.1.1.96 netmask 255.255.0.0 broadcast 10.1.255.255
inet6 fe80::ba27:ebff:fef2:8814 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:f2:88:14 txqueuelen 1000 (Ethernet)
RX packets 4582816 bytes 612918045 (584.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 114914 bytes 37494952 (35.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Note: a U1 or M3 printer may display other network interfaces in this report. For setting a static IP address for the wired network connection, we only care about the settings for eth0.
Step 3
Next, in the terminal, enter:
sudo nano -B /etc/network/interfaces
Nano (a Linux command line text editor) should open, displaying the file with text like this:
GNU nano 2.2.6 File: /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
iface eth0 inet dhcp
#allow-hotplug wlan0
#iface wlan0-raspbian inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1-raspbian inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
mapping wlan0
script /root/bin/map_iface
mapping wlan1
script /root/bin/map_iface
source /boot/octopi-network.txt
Step 4
Go down to the line that reads "iface eth0 inet dhcp", add a "#" to the front of it.
Now, add a new line, and then enter the values in bold text:
GNU nano 2.2.6 File: /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address [target.static.ip.address]
netmask [value.from.ifconfig.Mask]
broadcast [value.from.ifconfig.Bcast]
#allow-hotplug wlan0
#iface wlan0-raspbian inet manual
# wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1-raspbian inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
mapping wlan0
script /root/bin/map_iface
mapping wlan1
script /root/bin/map_iface
source /boot/octopi-network.txt
Note: indentation is only for clarity - it is not required.
An example:
The results for eth0 from "ifconfig":
inet addr:10.1.1.87 Bcast:10.1.255.255 Mask:255.255.0.0
inet6 addr: fe80::e8ad:3794:3b38:926d/64 Scope:Link
So add this section to /etc/network/interfaces:
auto eth0
iface eth0 inet static
address 10.1.1.240
netmask 255.255.0.0
broadcast 10.1.255.255
Step 5
Once entered, press Ctrl+X to Exit, then type "y" to confirm overwriting the current file.
It is critical you use the correct values for your local network, as any misconfiguration here will likely prevent communication on the modified interface. Also, ensure that the static IP address you are attempting to set does not interfere with anything else on the network - preferably choose an address outside of your local DHCP assignment range (many routers allow this to be configured, and some will have a range reserved for non-DHCP clients).
Once you are certain the changes have been made correctly, reboot the system by sending "sudo reboot" in the terminal. The Raspberry Pi should reboot with the new static IP address. It should still be reachable via M3Printer[#####].local, or U1Printer[#####].local.