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

From Wiki
m (Added category TinyCtrl)
(Split into two sections for embedded and CPRog/iRC)
Line 2: Line 2:
  
 
Nevertheless here's a short how-to:
 
Nevertheless here's a short how-to:
+
 
* Log into the Embedded Linux Computer via ssh.
+
== Embedded control ==
* Check what robot '''Type''' is referenced in <code>/home/root/TinyCtrl/Data/Projects/EmbeddedCtrl.prj</code>
+
 
 +
1. Log into the Embedded Linux Computer via ssh.
 +
 
 +
2. Check what robot '''Type''' is referenced in <code>/home/root/TinyCtrl/Data/Projects/EmbeddedCtrl.prj</code>
 
<syntaxhighlight lang=xml>
 
<syntaxhighlight lang=xml>
 
[...]
 
[...]
<Robot Name="igus Gantry" Type="igus_xyzGantry" 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>
*Edit the IP in the file <code>/home/root/TinyCtrl/Data/Robots/<ROBOT_TYPE>/<ROBOT_TYPE>.xml</code>
+
3. Edit the IP in the file <code>/home/root/TinyCtrl/Data/Robots/<CATEGORY>/<ROBOT_TYPE>/<ROBOT_TYPE>.xml</code>
  
 
<syntaxhighlight lang=xml>
 
<syntaxhighlight lang=xml>
Line 16: Line 19:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
*Edit the file <code>/lib/systemd/network/10-eth0.network</code>
+
4. Edit the file <code>/lib/systemd/network/10-eth0.network</code>
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
[Match]
 
[Match]
Line 31: Line 34:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
*Start CPRog. Do not maximise the Window and check which Project (xml) file is loaded by looking at the title bar
+
5. Reboot the Embedded Linux Computer.
*Close CProg and open the project file (<code>C:\CProg\Data\Projects\<PROJECTFILE>.prj</code>). Check what Robot file is referenced (same as in step 2.).
+
 
*Edit the robot file <code>C:\CProg\Data\Robots\<ROBOT_TYPE>\<ROBOT_TYPE>.xml</code>
+
6. Make any changes required to your network settings on the Windows PC and/or Router.
*Change the IP in that file to the same IP that you entered in step 3.
+
 
*Reboot the Embedded Linux Computer.
+
== CPRog / iRC ==
*Make any changes required to your network settings on the Windows PC and/or Router
+
 
*Done.
+
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 (<code>C:\CProg\Data\Projects\<CATEGORY>\<PROJECTFILE>.prj</code>). Check what robot file is referenced (same as in step 2).
 +
 
 +
9. Edit the robot file <code>C:\CProg\Data\Robots\<CATEGORY>\<ROBOT_TYPE>\<ROBOT_TYPE>.xml</code>
 +
 
 +
10. Change the IP address as shown in step 3.
  
 
[[Category:TinyCtrl]]
 
[[Category:TinyCtrl]]

Revision as of 14:27, 6 May 2021

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 here's a short how-to:

Embedded control

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 IP in the file /home/root/TinyCtrl/Data/Robots/<CATEGORY>/<ROBOT_TYPE>/<ROBOT_TYPE>.xml

<RemoteConfiguration IP="192.168.3.11" CycleTimeMS="50" Protocol="CRI_V01" />

4. Edit the file /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

5. Reboot the Embedded Linux Computer.

6. Make any changes required to your network settings on the Windows PC and/or Router.

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.