Difference between revisions of "IP Address"

From SoftMC-Wiki
Jump to: navigation, search
m (Setting Permanent Default IP Address)
 
(71 intermediate revisions by 4 users not shown)
Line 1: Line 1:
== Cable Connections ==
+
==Introduction==
 +
The softMC can be assigned an IP address in three different methods:
 +
* DHCP - the recommended method
 +
* Static IP address
 +
* Manual IP address - assigned by ControlStudio.
 +
 
 +
In order to be able to set the IP address we first need to communicate with the MC. This is done via Serial Console.<br/>
 +
Further in this article there is a comprehensive explanation how to set up the serial communication with the MC.<br/>
 +
Once we have established Serial communication with the MC we will create or edit some files that will set up the IP address and TCP/IP communication.
 +
 
 +
== Required Cable Connections ==
  
 
Two connections are needed:
 
Two connections are needed:
  
 
Serial:
 
Serial:
* Connect MC on COM1 via serial cable to your PC.
+
* Connect the MC COM1 serial port to the PC serial port using a serial cable.  
  
 
Ethernet
 
Ethernet
* Connect MC on Ethernet port 1 (LAN) via to the network where your PC is connected to (or directly with cross-cable to the PC)
+
* Connect the MC Ethernet port 1 (LAN) to the network to which the PC is connected (or connect directly to the PC using a cross-cable)
 
 
== Establishing Serial Communication ==
 
  
Open Windows- HyperTerminal (or similar) communication software and set the parameters:
+
== Serial Communication Parameters ==
  
[[Image:TANK-SETUP-SCR0.PNG|300px]]  [[Image:TANK-SETUP-SCR1.PNG|300px]]  [[Image:TANK-SETUP-SCR2.PNG|300px]]
+
Open any serial console program. Putty, for example, can be downloaded from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.<br/>
 +
Configure the serial port with the following parameters:<br/>
 +
* Baud rate: 115200<br/>
 +
* Data bits: 8<br/>
 +
* Parity: None<br/>
 +
* Stop bits: 1<br/>
 +
* Flow control: None<br/>
 +
Set the correct COM port<br/>
 +
Click 'open':<br/>
 +
[[Image:Putty_Config0.JPG|400px]]
  
This means:  
+
[[Image:Putty_Config1.JPG|400px]]
 +
<!-- This means:  
 
* Baud rate: 11520
 
* Baud rate: 11520
 
* Data bits: 8
 
* Data bits: 8
 
* Parity: None
 
* Parity: None
 
* Stop bits: 1
 
* Stop bits: 1
* Flow control: None
+
* Flow control: None -->
 +
 
  
 
== Connecting to Motion Controller ==
 
== Connecting to Motion Controller ==
Line 26: Line 45:
 
Once the communication parameters are set and the serial cable is connected between MC and PC, turn on the MC.
 
Once the communication parameters are set and the serial cable is connected between MC and PC, turn on the MC.
  
On the HyperTerminal screen you will see the boot printouts. After MC boot is complete, type:
+
On the serial console screen you will see the Linux boot sequence printouts. After MC boot is complete, type (without the "-bash-3.2$"):
<pre>/sbin/ifconfig'''
+
<pre>-bash-3.2$ /sbin/ifconfig
 
</pre>
 
</pre>
  
[[Image:TANK-SETUP-SCR3.PNG|600px]]
+
[[File:Putty Config2 1.JPG|800px|Putty Config2 1.JPG]]
  
 
You will see:
 
You will see:
  
[[Image:TANK-SETUP-SCR4.PNG|600px]]
+
[[File:Putty Config3 1.JPG|800px|Putty Config3 1.JPG]]
  
Instead of '''10.4.20.171''' as shown above, the current IP address of your MC will be displayed.
+
Note that in the eth0 section, '''inet addr''' will show your MC's current IP address, and not '''10.4.20.210''' as in the example above.
 +
 
 +
= Getting the IP Address from DHCP Server =
  
== Setting Temporary IP Address ==
+
{{Note| Host PC and SoftMC must get IP address from the same DHCP server, that is, reside at the same IP subnet }}
  
Simply type  
+
''' Creating FWCONFIG File '''<br/>
<pre>sudo /sbin/ifconfig eth0 90.0.0.51
+
IP Address setting method is configured in [[FWCONFIG|FWCONFIG]] file.<br>
 +
FWCONFIG can be created or edited with built-in text editor over serial (RS232) connection.<br/>
 +
In the Serial Console window, type in the command line (case sensitive!):<br/>
 +
<pre>-bash-3.2$ nano /FFS0/FWCONFIG
 
</pre>
 
</pre>
Your MC will get the new IP address.
+
Enter the text as it appears in the example with the following content:
 
 
[[Image:TANK-SETUP-SCR5.PNG|600px]]
 
 
 
{{Note| The above example sets the permanent IP address only, this address will vanish immediately after }}
 
 
 
= Setting Permanent Default IP Address  ==
 
 
 
Once the temporary IP address has been set, you can connect to the MC with ControlStudio:
 
  
{{Note| Your PC must have Ethernet port configured in the same address space e.g. '''90.0.0.1''' }}
 
 
== Creating FWCONFIG File ==
 
Create text file FWCONFIG (no extension) with the following content:
 
 
<pre>
 
<pre>
ipaddressmask 90.0.0.51:255.0.0.0
+
ipaddressmask dhcp
 
sleep 20
 
sleep 20
 
ramdisksize=64 mByte
 
ramdisksize=64 mByte
StringPreload=300000
+
StringPreload=3000
</pre>
 
 
 
On more details how to set-up the FWCONFIG file take a look at: [[Debugging_softMC_Firmware_Linux#FWCONFIG | FWCONFIG syntax]]
 
 
 
== Setting the IP Address of the Motion Controller ==
 
Save the file in the current directory of the ControlStudio and send it to MC using:
 
<pre>
 
-->privilegelevel=1
 
-->send FWCONFIG
 
 
</pre>
 
</pre>
 +
[[Image:IP_Assignment_5.JPG|800px]]<br/><br/>
 +
{{Note|
 +
FWCONFIG may contain a few lines that are not relevant to IP address settings. The only relevant property line is <code>ipaddressmask <argument></code>.}}
 +
For more information on setting up the FWCONFIG file, refer to: [[Debugging_softMC_Firmware_Linux#FWCONFIG | FWCONFIG syntax]]
  
typed from the terminal windows of ControlStudio.
+
After you are done typing the text click ctrl+x. The lower menu bar will change, prompting you to save the new file.<br/>
 +
Click y and then click 'Enter'.<br/>
 +
Nano will save the file and exit back to the command line:<br/><br/>
 +
[[Image:IP_Assignment_6.JPG|800px]]<br/><br/>
  
Now you can reset the MC and it will boot up with the '''90.0.0.51''' address.
+
Now you can reset the MC and it will boot up and be assigned with an IP address by the DHCP server.
This is how the default IP address is set, the non-default address cab be set using [[MC-Basic:SYSTEM.IPADDRESSMASK|SYS.IPADDRESSMASK]] command
 
  
= Getting the IP Address from DHCP Server =
+
= Setting a static IP Address =
 +
The following steps describe how to set the fixed IP address. <br/>
 +
Fixed IP address can be later changed from application or CONFIG.PRG, with the command [[MC-Basic:SYSTEM.IPADDRESSMASK|SYS.IPADDRESSMASK]]
  
Once the temporary IP address has been set, you can connect to the MC with ControlStudio:
+
{{Note| Your PC must have an IP address in the same address space as you are assigning to the MC }}
  
{{Note| Your PC must have Ethernet port configured in the same address space e.g. '''90.0.0.1''' }}
 
  
== Creating FWCONFIG File ==
+
''' Creating FWCONFIG File '''<br/>
Create text file FWCONFIG (no extension) with the following content:
 
  
 +
Create FWCONFIG using Nano with the following content:
 
<pre>
 
<pre>
ipaddressmask dhcp
+
ipaddressmask aaa.bbb.ccc.ddd:eee.fff.ggg.hhh
 
sleep 20
 
sleep 20
 
ramdisksize=64 mByte
 
ramdisksize=64 mByte
StringPreload=300000
+
StringPreload=3000
</pre>
+
</pre><br/>
 +
[[Image:IP_Assignment_7.JPG|800px]]<br/><br/>
 +
Where aaa.bbb.ccc.ddd:eee.fff.ggg.hhh holds the permanent IP address and subnet mask you want to assign to the MC.<br/>
 +
For more details on the FWCONFIG file refer to: [[Debugging_softMC_Firmware_Linux#FWCONFIG | FWCONFIG syntax]]
 +
 
 +
After you are done typing the text click ctrl+x. The lower menu bar will change, prompting you to save the new file.<br/>
 +
Click y and then click 'Enter'.<br/>
 +
Nano will save the file and exit back to the command line:<br/><br/>
 +
[[Image:IP_Assignment_8.JPG|800px]]<br/><br/>
  
For more information on setting up the FWCONFIG file, refer to: [[Debugging_softMC_Firmware_Linux#FWCONFIG | FWCONFIG syntax]]
+
Now you can reset the MC and it will boot up with the permanent IP address you chose.
  
== Setting the IP Address of the Motion Controller ==
+
= Assign Manual IP Address via ControlStudio =
Save the file in the current directory and  send it to MC using:
 
  
<pre>
+
Start the ControlStudio. Open the 'Settings' Tab. Under 'Controller Monitor' Set 'TCP/IP Connection' to 'Manual IP'
-->privilegelevel=1
 
-->send FWCONFIG
 
</pre>
 
  
typed from the terminal windows of ControlStudio.
+
[[Image:Putty_Config4.JPG|800px]]
  
Now you can reset the MC and it will boot up with the IP address from DHCP pool.
+
At this point ControlStudio sends a broadcast over the network, looking for softMC's that are present. Those who don't have
This is how the default IP address is set, the non-default address can be set using [[MC-Basic:SYSTEM.IPADDRESSMASK|SYS.IPADDRESSMASK]] command.
+
an IP address yet are assigned an IP from the 'IP Pool' file.
 +
{{Note| IP pool file shall contain a list of IP addresses that are '''explicitly''' excluded from the DHCP range by network administrator and shall be used exclusively by SoftMCs. Host PC IP address shall be in the same subnet as addresses in ControlStudio IP pool }}
 +
Open the 'Controller Monitor' Tab. All the softMC controllers that are present in the network will appear in the list,
 +
with the manual IP address that was assigned to to them.<br/><br/>
 +
[[Image:Putty_Config5.JPG|800px]]<br/><br/>
 +
You can choose a softMC controller and connect to it by double clicking the controller's name.<br/><br/>
 +
[[Image:Putty_Config6.JPG|800px]]<br/><br/>

Latest revision as of 13:08, 19 May 2020

Introduction

The softMC can be assigned an IP address in three different methods:

  • DHCP - the recommended method
  • Static IP address
  • Manual IP address - assigned by ControlStudio.

In order to be able to set the IP address we first need to communicate with the MC. This is done via Serial Console.
Further in this article there is a comprehensive explanation how to set up the serial communication with the MC.
Once we have established Serial communication with the MC we will create or edit some files that will set up the IP address and TCP/IP communication.

Required Cable Connections

Two connections are needed:

Serial:

  • Connect the MC COM1 serial port to the PC serial port using a serial cable.

Ethernet

  • Connect the MC Ethernet port 1 (LAN) to the network to which the PC is connected (or connect directly to the PC using a cross-cable)

Serial Communication Parameters

Open any serial console program. Putty, for example, can be downloaded from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.
Configure the serial port with the following parameters:

  • Baud rate: 115200
  • Data bits: 8
  • Parity: None
  • Stop bits: 1
  • Flow control: None

Set the correct COM port
Click 'open':
Putty Config0.JPG

Putty Config1.JPG


Connecting to Motion Controller

Once the communication parameters are set and the serial cable is connected between MC and PC, turn on the MC.

On the serial console screen you will see the Linux boot sequence printouts. After MC boot is complete, type (without the "-bash-3.2$"):

-bash-3.2$ /sbin/ifconfig

Putty Config2 1.JPG

You will see:

Putty Config3 1.JPG

Note that in the eth0 section, inet addr will show your MC's current IP address, and not 10.4.20.210 as in the example above.

Getting the IP Address from DHCP Server

NOTE-Info.svgNOTE
Host PC and SoftMC must get IP address from the same DHCP server, that is, reside at the same IP subnet

Creating FWCONFIG File
IP Address setting method is configured in FWCONFIG file.
FWCONFIG can be created or edited with built-in text editor over serial (RS232) connection.
In the Serial Console window, type in the command line (case sensitive!):

-bash-3.2$ nano /FFS0/FWCONFIG

Enter the text as it appears in the example with the following content:

ipaddressmask dhcp
sleep 20
ramdisksize=64 mByte
StringPreload=3000

IP Assignment 5.JPG

NOTE-Info.svgNOTE
FWCONFIG may contain a few lines that are not relevant to IP address settings. The only relevant property line is ipaddressmask <argument>.

For more information on setting up the FWCONFIG file, refer to: FWCONFIG syntax

After you are done typing the text click ctrl+x. The lower menu bar will change, prompting you to save the new file.
Click y and then click 'Enter'.
Nano will save the file and exit back to the command line:

IP Assignment 6.JPG

Now you can reset the MC and it will boot up and be assigned with an IP address by the DHCP server.

Setting a static IP Address

The following steps describe how to set the fixed IP address.
Fixed IP address can be later changed from application or CONFIG.PRG, with the command SYS.IPADDRESSMASK

NOTE-Info.svgNOTE
Your PC must have an IP address in the same address space as you are assigning to the MC


Creating FWCONFIG File

Create FWCONFIG using Nano with the following content:

ipaddressmask aaa.bbb.ccc.ddd:eee.fff.ggg.hhh
sleep 20
ramdisksize=64 mByte
StringPreload=3000

IP Assignment 7.JPG

Where aaa.bbb.ccc.ddd:eee.fff.ggg.hhh holds the permanent IP address and subnet mask you want to assign to the MC.
For more details on the FWCONFIG file refer to: FWCONFIG syntax

After you are done typing the text click ctrl+x. The lower menu bar will change, prompting you to save the new file.
Click y and then click 'Enter'.
Nano will save the file and exit back to the command line:

IP Assignment 8.JPG

Now you can reset the MC and it will boot up with the permanent IP address you chose.

Assign Manual IP Address via ControlStudio

Start the ControlStudio. Open the 'Settings' Tab. Under 'Controller Monitor' Set 'TCP/IP Connection' to 'Manual IP'

Putty Config4.JPG

At this point ControlStudio sends a broadcast over the network, looking for softMC's that are present. Those who don't have an IP address yet are assigned an IP from the 'IP Pool' file.

NOTE-Info.svgNOTE
IP pool file shall contain a list of IP addresses that are explicitly excluded from the DHCP range by network administrator and shall be used exclusively by SoftMCs. Host PC IP address shall be in the same subnet as addresses in ControlStudio IP pool

Open the 'Controller Monitor' Tab. All the softMC controllers that are present in the network will appear in the list, with the manual IP address that was assigned to to them.

Putty Config5.JPG

You can choose a softMC controller and connect to it by double clicking the controller's name.

Putty Config6.JPG