Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

IP adress


    JAPIB - 2014-01-09


    J begin to work with a Raspberry PI with CODESYS V3. It works very well.
    I use a DHCP server to bring an IP adress to my Raspberry. Is it possible to fix this adress, without the use of a DHCP server ?
    Maybe he should use linux commands, but I'm not an expert linux.
    Thank you in advance for your response

  • Anonymous - 2014-01-10

    Originally created by: M.Schaber


    Some DHCP servers (like current FritzBox models) allow to set a fixed IP address for a specific computer (MAC address). This way, you should be able to solve the problem without touching the Linux running on the Raspberry Pi. Another advantage is that the IP address also stays fixed when you boot a different image on the Pi.


  • eschwellinger

    eschwellinger - 2014-01-10


    if you want to change this setting in the Pi the following steps are needed:

    1. you need on windows 'putty' (google it - this is a program which allow to login via ssh to the pi)

    2. Login with putty to the pi (you could find the current ip address in the plc logger in CODESYS)

    the login in for the Raspberry Pi

    (this is the default from the raspberry.org sd image)

    Then exeute:
    sudo nano /etc/network/Interfaces

    remove the line
    iface eth0 inet dhcp

    and add the following lines
    iface eth0 inet static
    address 192.168.xxx.xxx
    gateway 192.168.xxx.1

    then Ctrl-o to save the changes, and ctrl-x to quit the Editor


    sudo /etc/init.d/networking restart

    or simply reboot the pi
    sudo reboot

    That was it!

    Cheers Edwin


    JAPIB - 2014-01-14

    Thank you Edwin.
    It works well.
    But the command line seems to be case sensitive, if I write "sudo nano /etc/network/Interfaces", no file is found.
    If I write "sudo nano /etc/network/interfaces", the file is found, and I can modify it.
    I still have some things to learn with linux

    Thank you again

  • eschwellinger

    eschwellinger - 2014-01-14

    thanks you're right
    sudo nano /etc/network/interfaces
    is the right spelling...


Log in to post a comment.