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

Multiple Ethernet adapters Raspberry Pi

wrt54gl
2014-04-12
2014-04-16
  • wrt54gl - 2014-04-12

    Is it possible to add multiple Ethernet adapters in rpi? I would like to use a vlan for modbus tcp. rpi allows me to create a vlan but how do I add that ethernet adapter in codesys. This would also apply to a usb or wireless network adapter as well.

     
  • jzhvymetal - 2014-04-12

    yes...most usb ethernet adapters work out of the box...Wifi need to connect and authenticate. If you have a second adapter you have to enable it

    ###Use putty SSH to connect to PI user:pi password:raspberry
    ###Check if USB adapter was found
    lsusb
    dmesg

    ###Setup enable second network interface to have DHCP
    sudo nano /etc/network/interfaces
    ####Modify/Add the following lines
    auto lo
    auto eth0
    auto eth1

    iface lo inet loopback
    iface eth0 inet dhcp
    iface eth1 inet dhcp

    allow-hotplug eth0
    allow-hotplug eth1
    ###(ctrl-x Save exit)

    sudo reboot

    ###Use putty SSH to connect to PI user:pi password:raspberry
    ###Check if second ethernet USB adapter was initialized
    ifconifg

    if you want to get WLAN adapter to work follow the following steps
    http://pingbin.com/2012/12/setup-wifi-raspberry-pi/ m

     
  • wrt54gl - 2014-04-12

    I am sorry but my original post was not clear enough. I have been able to add a vlan interface eth0.4 by loging in with ssh. Now I would like to configure it in codesys to use that interface for a modbus tcp master. When I right click and choose add a device and add an ethernet adapter it just says (Device uses operating system settings) in the configuration window. Is there some way to tell codesys which ethernet adapter to use?

     
  • eschwellinger

    eschwellinger - 2014-04-16

    Hi,
    yes should work!
    It is not needed to setup in CODESYS,
    CODESYS takes the System settings.. means if you have a route to your modbus slave this
    will work even with your vlan config.
    Could you try it and give us the feedback?

    BR Edwin

    IMG: ethernet.jpg

     

Log in to post a comment.