Difference between revisions of "Change Network Address of Embedded Linux PC"
m (Add ReBel) |
(Extended PC-side IP config change for V14 and V13 with duplicating config) |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | Changing the IP address of the embedded Linux PC is highly discouraged, as it is very easy to lock oneself out of the system. | + | Changing the IP address of the embedded Linux PC is highly discouraged, as it is very easy to lock oneself out of the system. When that happens a factory reset is necessary. Newer Raspberry Pi-based controls (wide module with a fan on top, also igus ReBeL) can be [[Restore_SD_Card_of_Embedded_Computer|reset by rewriting the SD card]], older Phytec-based ones (slim module, also DCi robots) need to be sent in to our factory in Germany since additional hardware is needed. |
Nevertheless this article shows how to do it. | Nevertheless this article shows how to do it. | ||
− | '''Note:''' | + | '''Note:''' Setting an IP address in the range 169.254.x.x may not work since this is the link local adress range. |
= Embedded control = | = Embedded control = | ||
The configuration depends on the type of embedded control module: | The configuration depends on the type of embedded control module: | ||
+ | * Raspberry-Pi: Wide module with only 1 Ethernet port / igus ReBel | ||
* Phytec: Slim module with 2 Ethernet ports | * Phytec: Slim module with 2 Ethernet ports | ||
− | + | ||
+ | == Raspberry Pi-based controls == | ||
+ | 1. Log into the Embedded Linux Computer via [[FTP_and_PuTTY_Access|SSH]]. | ||
+ | |||
+ | 2. Use a command line text editor to edit the file (a graphical client like FileZilla will not work since the file is protected). To edit the file you can use a command line text editor like nano or vim: | ||
+ | <syntaxhighlight lang=bash> | ||
+ | sudo nano /etc/dhcpcd.conf | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | Find and edit the following section in file <code>/etc/dhcpcd.conf</code> | ||
+ | <syntaxhighlight lang=bash> | ||
+ | interface eth0 | ||
+ | static ip_address=192.168.3.11/24 | ||
+ | #static ip6_address=fd51:42f8:caae:d92e::ff/64 | ||
+ | static routers=192.168.3.1 | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | 3. Reboot the Embedded Linux Computer. | ||
+ | |||
+ | 4. Make any changes required to your network settings on the Windows PC and/or Router. | ||
+ | |||
+ | 5. Make the nessesary changes in CPRog / iRC (described below) | ||
== Phytec-based controls == | == Phytec-based controls == | ||
+ | |||
1. Log into the Embedded Linux Computer via [[FTP_and_PuTTY_Access|SSH]]. | 1. Log into the Embedded Linux Computer via [[FTP_and_PuTTY_Access|SSH]]. | ||
Line 18: | Line 41: | ||
<Robot Name="igus Gantry" Type="drylin-gantry\DLE-RG-0001" Homepos="100.0 100.0 20.0 0.0 0.0 0.0" | <Robot Name="igus Gantry" Type="drylin-gantry\DLE-RG-0001" Homepos="100.0 100.0 20.0 0.0 0.0 0.0" | ||
[...] | [...] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 3. Edit the file <code>/lib/systemd/network/eth0.network</code> or <code>/lib/systemd/network/10-eth0.network</code> | |
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
[Match] | [Match] | ||
Line 40: | Line 58: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | 4. Reboot the Embedded Linux Computer. | |
+ | |||
+ | 5. Make any changes required to your network settings on the Windows PC and/or Router. | ||
+ | |||
+ | 6. Make the nessesary changes in CPRog / iRC (described below) | ||
+ | |||
+ | = CPRog / iRC = | ||
+ | You need to enter the new IP address in the PC software so that it can find the robot again. | ||
− | + | == Version 14 == | |
+ | To connect click "File" -> "Connect Robot..." -> "New Connection" and enter the new IP address. The robot will then appear in the list for future connects. | ||
− | == | + | == Version 13 and earlier == |
− | |||
− | + | CPRog/iRC needs to be configured to connect to the new IP address. This is simplified in version 14. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === Single Robot === | |
− | + | Do the following if you only got one robot of this type: | |
− | |||
− | + | 1. First find the installation directory of CPRog/iRC: Usually <code>C:\iRC-igusRobotControl\</code> or <code>C:\CPRog\</code>. The following Data paths are in here. | |
− | < | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 2. Start CPRog/iRC. At the left side next to the 3D view find the Robot section, in there the line in format <CATEGORY>/<ROBOT_TYPE>. | |
− | + | 3. Open the robot configuration file <code>Data\Robots\<CATEGORY>\<ROBOT_TYPE>\<ROBOT_TYPE>.xml</code> and change the IP address in the line <code><RemoteConfiguration IP="192.168.3.11" CycleTimeMS="50" Protocol="CRI_V01" /></code> | |
− | = | + | === Multiple Robots === |
+ | If you got multiple robots of the same type you will either need to change the IP address as explained above each time you connect to the other robot or duplicate some configuration files: | ||
− | + | 1. Duplicate the robot category folder (e.g. "igus-gantry", which contains the robot folder). Rename it (name must not contain spaces). You may delete the other robot folders inside, they are not needed. | |
+ | (Note: instead of duplicating the category folder we could just duplicate the robot folder, but since its name is checked on connect iRC would always complain about connecting to a robot with different type) | ||
− | + | 2. Change the IP in the robot config file inside the new category folder | |
− | + | 3. Duplicate the project configuration file and rename it | |
− | + | 4. Open the project file and find the Type parameter in line "<Robot..." (should be line 4). Change the category part (before the slash) to the name of your new category. | |
− | + | 5. Start/Restart iRC. You should now have the new project in the projects selection and it should connect to the other robot control. | |
− | [[Category:TinyCtrl]] | + | [[Category:Configuration]][[Category:TinyCtrl]] |
Latest revision as of 12:41, 3 November 2023
Changing the IP address of the embedded Linux PC is highly discouraged, as it is very easy to lock oneself out of the system. When that happens a factory reset is necessary. Newer Raspberry Pi-based controls (wide module with a fan on top, also igus ReBeL) can be reset by rewriting the SD card, older Phytec-based ones (slim module, also DCi robots) need to be sent in to our factory in Germany since additional hardware is needed.
Nevertheless this article shows how to do it.
Note: Setting an IP address in the range 169.254.x.x may not work since this is the link local adress range.
Embedded control
The configuration depends on the type of embedded control module:
- Raspberry-Pi: Wide module with only 1 Ethernet port / igus ReBel
- Phytec: Slim module with 2 Ethernet ports
Raspberry Pi-based controls
1. Log into the Embedded Linux Computer via SSH.
2. Use a command line text editor to edit the file (a graphical client like FileZilla will not work since the file is protected). To edit the file you can use a command line text editor like nano or vim:
sudo nano /etc/dhcpcd.conf
Find and edit the following section in file /etc/dhcpcd.conf
interface eth0
static ip_address=192.168.3.11/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.3.1
3. Reboot the Embedded Linux Computer.
4. Make any changes required to your network settings on the Windows PC and/or Router.
5. Make the nessesary changes in CPRog / iRC (described below)
Phytec-based controls
1. Log into the Embedded Linux Computer via SSH.
2. Check what robot Type is referenced in /home/root/TinyCtrl/Data/Projects/EmbeddedCtrl.prj
[...]
<Robot Name="igus Gantry" Type="drylin-gantry\DLE-RG-0001" Homepos="100.0 100.0 20.0 0.0 0.0 0.0"
[...]
3. Edit the file /lib/systemd/network/eth0.network
or /lib/systemd/network/10-eth0.network
[Match]
Name=eth0
[Network]
DHCP=ipv4
Address=192.168.3.11/24
[DHCP]
#When CriticalConnection is applied to networkd, the IP address will not
#change after this service was reloaded. Just reboot the system.
CriticalConnection=true
4. Reboot the Embedded Linux Computer.
5. Make any changes required to your network settings on the Windows PC and/or Router.
6. Make the nessesary changes in CPRog / iRC (described below)
CPRog / iRC
You need to enter the new IP address in the PC software so that it can find the robot again.
Version 14
To connect click "File" -> "Connect Robot..." -> "New Connection" and enter the new IP address. The robot will then appear in the list for future connects.
Version 13 and earlier
CPRog/iRC needs to be configured to connect to the new IP address. This is simplified in version 14.
Single Robot
Do the following if you only got one robot of this type:
1. First find the installation directory of CPRog/iRC: Usually C:\iRC-igusRobotControl\
or C:\CPRog\
. The following Data paths are in here.
2. Start CPRog/iRC. At the left side next to the 3D view find the Robot section, in there the line in format <CATEGORY>/<ROBOT_TYPE>.
3. Open the robot configuration file Data\Robots\<CATEGORY>\<ROBOT_TYPE>\<ROBOT_TYPE>.xml
and change the IP address in the line <RemoteConfiguration IP="192.168.3.11" CycleTimeMS="50" Protocol="CRI_V01" />
Multiple Robots
If you got multiple robots of the same type you will either need to change the IP address as explained above each time you connect to the other robot or duplicate some configuration files:
1. Duplicate the robot category folder (e.g. "igus-gantry", which contains the robot folder). Rename it (name must not contain spaces). You may delete the other robot folders inside, they are not needed. (Note: instead of duplicating the category folder we could just duplicate the robot folder, but since its name is checked on connect iRC would always complain about connecting to a robot with different type)
2. Change the IP in the robot config file inside the new category folder
3. Duplicate the project configuration file and rename it
4. Open the project file and find the Type parameter in line "<Robot..." (should be line 4). Change the category part (before the slash) to the name of your new category.
5. Start/Restart iRC. You should now have the new project in the projects selection and it should connect to the other robot control.