Difference between revisions of "Change Network Address of Embedded Linux PC"

From Wiki
Line 19: Line 19:
 
[...]
 
[...]
 
</syntaxhighlight>
 
</syntaxhighlight>
3. Edit the IP in the file <code>/home/robot/TinyCtrl/Data/Robots/<CATEGORY>/<ROBOT_TYPE>/<ROBOT_TYPE>.xml</code>
 
  
<syntaxhighlight lang=xml>
+
3. Find and edit the following section in file <code>/etc/dhcpcd.conf</code>
<RemoteConfiguration IP="192.168.3.11" CycleTimeMS="50" Protocol="CRI_V01" />
 
</syntaxhighlight>
 
 
 
4. Find and edit the following section in file <code>/etc/dhcpcd.conf</code>
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
interface eth0
 
interface eth0
Line 33: Line 28:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
5. Reboot the Embedded Linux Computer.
+
4. Reboot the Embedded Linux Computer.
  
6. Make any changes required to your network settings on the Windows PC and/or Router.
+
5. Make any changes required to your network settings on the Windows PC and/or Router.
  
7. Make the nessesary changes in CPRog / iRC (described below)
+
6. Make the nessesary changes in CPRog / iRC (described below)
  
 
== Phytec-based controls ==
 
== Phytec-based controls ==
Line 48: Line 43:
 
<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>
 
3. Edit the IP in the file <code>/home/root/TinyCtrl/Data/Robots/<CATEGORY>/<ROBOT_TYPE>/<ROBOT_TYPE>.xml</code>
 
 
<syntaxhighlight lang=xml>
 
<RemoteConfiguration IP="192.168.3.11" CycleTimeMS="50" Protocol="CRI_V01" />
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  
4. Edit the file <code>/lib/systemd/network/eth0.network</code> or <code>/lib/systemd/network/10-eth0.network</code>
+
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 70: Line 60:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
5. Reboot the Embedded Linux Computer.
+
4. Reboot the Embedded Linux Computer.
  
6. Make any changes required to your network settings on the Windows PC and/or Router.
+
5. Make any changes required to your network settings on the Windows PC and/or Router.
  
7. Make the nessesary changes in CPRog / iRC (described below)
+
6. Make the nessesary changes in CPRog / iRC (described below)
  
 
= CPRog / iRC =
 
= CPRog / iRC =
Line 80: Line 70:
 
CPRog/iRC needs to be configured to connect to the new IP address:
 
CPRog/iRC needs to be configured to connect to the new IP address:
  
8. Start CPRog/iRC. Do not maximise the Window and check which Project (.prj) file is loaded by looking at the title bar.
+
7. Start CPRog/iRC. Do not maximise the Window and check which Project (.prj) file is loaded by looking at the title bar.
  
9. Close CProg/iRC and open the project file (<code>C:\CProg\Data\Projects\<CATEGORY>\<PROJECTFILE>.prj</code>). Check what robot file is referenced (same as in step 2).
+
8. Close CProg/iRC and open the project file (<code>C:\CProg\Data\Projects\<CATEGORY>\<PROJECTFILE>.prj</code>). Check what robot file is referenced (same as in step 2).
  
10. Edit the robot file <code>C:\CProg\Data\Robots\<CATEGORY>\<ROBOT_TYPE>\<ROBOT_TYPE>.xml</code>
+
9. Edit the robot file <code>C:\CProg\Data\Robots\<CATEGORY>\<ROBOT_TYPE>\<ROBOT_TYPE>.xml</code>
  
11. Change the IP address as shown in step 3.
+
10. Change the IP address as shown in step 3.
  
 
[[Category:TinyCtrl]]
 
[[Category:TinyCtrl]]

Revision as of 15:54, 16 December 2022

Changing the IP address of the embedded Linux PC is highly discouraged, as it is very easy to lock oneself out of the system. Once that happens, only serial terminal access may remain, which requires additional hardware.

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. Check what robot Type is referenced in /home/robot/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. 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

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)

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

CPRog/iRC needs to be configured to connect to the new IP address:

7. Start CPRog/iRC. Do not maximise the Window and check which Project (.prj) file is loaded by looking at the title bar.

8. Close CProg/iRC and open the project file (C:\CProg\Data\Projects\<CATEGORY>\<PROJECTFILE>.prj). Check what robot file is referenced (same as in step 2).

9. Edit the robot file C:\CProg\Data\Robots\<CATEGORY>\<ROBOT_TYPE>\<ROBOT_TYPE>.xml

10. Change the IP address as shown in step 3.