robotology / icub-firmware-shared

Protocols and Other Stuff Used both by iCub Firmware and iCub Software
GNU Lesser General Public License v2.1
4 stars 18 forks source link

ETH boards - added remote address configurator #41

Closed davidetome closed 3 years ago

davidetome commented 3 years ago

HOW TO USE ETH BOARDS WITH A DIFFERENT IP SUBNET

Here is the instruction about using ETH boards with a different subnet from the standard one (10.0.1.X)

CHANGE IP TO THE BOARD

Assuming the board we are going to use have the 10.0.1.1 IP at the moment and want to move to 10.0.2.1, follow the steps :

  1. Run FirmwareUpdater -a
  2. Select the eth interface and then Discover
  3. Select the board and then Force ETH Maintenance
  4. Select Upload Application and flash the new firmware (icub-firmware-build on branch devel)
  5. Select Change IP Address and input 10.0.2.1

CONFIGURE THE SYSTEM

  1. Change the IP address of your ETH interface to 10.0.2.104
  2. Change the firmwareupdater.ini file including this line
    ETH "10.0.2.104:3333"
  3. Reset the board and check if it is discoverable with the FirmwareUpdater
  4. Change the following xml files :

/hardware/electronics/pc104.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE params PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">

<params xmlns:xi="http://www.w3.org/2001/XInclude" robot="single-ETH-2FOC-motor" build="1">

    <group name="PC104">
        <param name="PC104IpAddress">           10.0.2.104      </param>
        <param name="PC104IpPort">              12345           </param>
        <param name="PC104TXrate">              1               </param> 
        <param name="PC104RXrate">              5               </param>
    </group>

</params>

hardware/electronics/knee-eb10-j0-eln.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE params PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">

<params xmlns:xi="http://www.w3.org/2001/XInclude" robot="single-ETH-2FOC-motor" build="1">

    <xi:include href="./pc104.xml" />

    <group name="ETH_BOARD">

        <group name="ETH_BOARD_PROPERTIES">
            <param name="IpAddress">                10.0.2.1              </param>
            <param name="IpPort">                   12345                   </param>
            <param name="Type">                     mc4plus                    </param>
            <param name="maxSizeRXpacket">          768                     </param>
            <param name="maxSizeROP">               384                     </param>
        </group>

        <group name="ETH_BOARD_SETTINGS">
            <param name="Name">                     "knee-eb10-j0"    </param> 
            <group name="RUNNINGMODE">
                <param name="period">                   1000                </param>
                <param name="maxTimeOfRXactivity">      400                 </param>
                <param name="maxTimeOfDOactivity">      300                 </param>   
                <param name="maxTimeOfTXactivity">      300                 </param>                
                <param name="TXrateOfRegularROPs">      5                   </param> 
            </group>              
        </group>                 

        <group name="ETH_BOARD_ACTIONS">
            <group name="MONITOR_ITS_PRESENCE">
                <param name="enabled">                  true                </param> 
                <param name="timeout">                  0.020               </param> 
                <param name="periodOfMissingReport">    60.0                </param> 
            </group>
        </group>

    </group>  

</params>

RUN YARPROBOTINTERFACE

Finally, if all operations above went well you're able to run yarprobotinterface using the new subnet 10.0.2.X

TEST

The software has been compiled also on the Linux machine running yarprobotinterface and it works.

Below an example of yarprobotinterface running with a gateway set to 10.0.2.104 connected to an ems4 board with address 10.0.2.1 and an F/T sensor (strain2) connected to it

image

cc @marcoaccame @pattacini

davidetome commented 3 years ago

@marcoaccame as agree I tested also the mods compiling on the Linux machine, see updated PR description above.

cc @pattacini

plinioMoreno commented 3 years ago

@davidetome many thanks for these changes. We were able to change the IP address of one of our MC4plus boards.