Setting up RTNet for SOEM on Xenomai?

We are trying to set up RTNet on Xenomai so we can run SOEM in hard
realtime. However, we are having trouble getting RTNet working.

It seems as if RTNet wants to do TDMA -- but we don't need that, all
we need is raw sockets so we can do EtherCAT.

How do I set up RTNet so we can do EtherCAT? I don't even know if we
should still be using /usr/local/rtnet/sbin/rtnet to start everything,
or if we should be using something else.

What is the right way to try to get this working?

Thank you for any help,
Johnathan Van Why
Dynamic Robotics Laboratory
Oregon State University

Ruben Smits's picture

Setting up RTNet for SOEM on Xenomai?

Hello Jonathan,

On Tue, Aug 28, 2012 at 7:36 PM, Johnathan Van Why <jrvanwhy [..] ...> wrote:
> We are trying to set up RTNet on Xenomai so we can run SOEM in hard
> realtime. However, we are having trouble getting RTNet working.
>
> It seems as if RTNet wants to do TDMA -- but we don't need that, all
> we need is raw sockets so we can do EtherCAT.
>
> How do I set up RTNet so we can do EtherCAT? I don't even know if we
> should still be using /usr/local/rtnet/sbin/rtnet to start everything,
> or if we should be using something else.
>
> What is the right way to try to get this working?

We have been successfully using xenomai and rtnet with SOEM, I suppose
you already use the patched version of SOEM available at
http://git.mech.kuleuven.be/robotics/soem.git.

We have a small script that sets up rtnet for us. I'll look it up and
send it to you when I'm back at the office tomorrow

Ruben

> Thank you for any help,
> Johnathan Van Why
> Dynamic Robotics Laboratory
> Oregon State University
> --
> Orocos-Users mailing list
> Orocos-Users [..] ...
> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users

Setting up RTNet for SOEM on Xenomai?

On Tue, Aug 28, 2012 at 9:57 PM, Ruben Smits
<ruben [dot] smits [..] ...> wrote:
> Hello Jonathan,
>
>
> On Tue, Aug 28, 2012 at 7:36 PM, Johnathan Van Why <jrvanwhy [..] ...> wrote:
>> We are trying to set up RTNet on Xenomai so we can run SOEM in hard
>> realtime. However, we are having trouble getting RTNet working.
>>
>> It seems as if RTNet wants to do TDMA -- but we don't need that, all
>> we need is raw sockets so we can do EtherCAT.
>>
>> How do I set up RTNet so we can do EtherCAT? I don't even know if we
>> should still be using /usr/local/rtnet/sbin/rtnet to start everything,
>> or if we should be using something else.
>>
>> What is the right way to try to get this working?
>
> We have been successfully using xenomai and rtnet with SOEM, I suppose
> you already use the patched version of SOEM available at
> http://git.mech.kuleuven.be/robotics/soem.git.

We are using soem_core within that repository, but not the soem_master
component (we have our own master code). We've enabled RTNet in the
CMakeLists.txt for soem_core.

We have gotten RTNet itself working... but we're still trying to get
SOEM to work under RTNet.

> We have a small script that sets up rtnet for us. I'll look it up and
> send it to you when I'm back at the office tomorrow

Thank you very much -- that script will be very helpful.

> Ruben
>
>> Thank you for any help,
>> Johnathan Van Why
>> Dynamic Robotics Laboratory
>> Oregon State University
>> --
>> Orocos-Users mailing list
>> Orocos-Users [..] ...
>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>
>
>
> --
> Ruben Smits, Phd
> Chief Technology Officer
> Intermodalics BVBA
> +32479511786
> www.intermodalics.eu

Ruben Smits's picture

Setting up RTNet for SOEM on Xenomai?

Hi Johnathan,

On Wed, Aug 29, 2012 at 6:02 PM, Johnathan Van Why <jrvanwhy [..] ...> wrote:
> On Tue, Aug 28, 2012 at 9:57 PM, Ruben Smits
> <ruben [dot] smits [..] ...> wrote:
>> Hello Jonathan,
>>
>>
>> On Tue, Aug 28, 2012 at 7:36 PM, Johnathan Van Why <jrvanwhy [..] ...> wrote:
>>> We are trying to set up RTNet on Xenomai so we can run SOEM in hard
>>> realtime. However, we are having trouble getting RTNet working.
>>>
>>> It seems as if RTNet wants to do TDMA -- but we don't need that, all
>>> we need is raw sockets so we can do EtherCAT.
>>>
>>> How do I set up RTNet so we can do EtherCAT? I don't even know if we
>>> should still be using /usr/local/rtnet/sbin/rtnet to start everything,
>>> or if we should be using something else.
>>>
>>> What is the right way to try to get this working?
>>
>> We have been successfully using xenomai and rtnet with SOEM, I suppose
>> you already use the patched version of SOEM available at
>> http://git.mech.kuleuven.be/robotics/soem.git.
>
> We are using soem_core within that repository, but not the soem_master
> component (we have our own master code). We've enabled RTNet in the
> CMakeLists.txt for soem_core.
>
> We have gotten RTNet itself working... but we're still trying to get
> SOEM to work under RTNet.
>
>> We have a small script that sets up rtnet for us. I'll look it up and
>> send it to you when I'm back at the office tomorrow
>
> Thank you very much -- that script will be very helpful.

Attached you can find the script. It does not use any of the recent
fancy RTNet configuration tools/files.

Ruben

>> Ruben
>>
>>> Thank you for any help,
>>> Johnathan Van Why
>>> Dynamic Robotics Laboratory
>>> Oregon State University
>>> --
>>> Orocos-Users mailing list
>>> Orocos-Users [..] ...
>>> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
>>
>>
>>
>> --
>> Ruben Smits, Phd
>> Chief Technology Officer
>> Intermodalics BVBA
>> +32479511786
>> www.intermodalics.eu

Setting up RTNet for SOEM on Xenomai?

On Wed, Aug 29, 2012 at 9:02 AM, Johnathan Van Why <jrvanwhy [..] ...> wrote:
>
> On Tue, Aug 28, 2012 at 9:57 PM, Ruben Smits
> <ruben [dot] smits [..] ...> wrote:
> > Hello Jonathan,
> >
> >
> > On Tue, Aug 28, 2012 at 7:36 PM, Johnathan Van Why <jrvanwhy [..] ...>
> > wrote:
> >> We are trying to set up RTNet on Xenomai so we can run SOEM in hard
> >> realtime. However, we are having trouble getting RTNet working.
> >>
> >> It seems as if RTNet wants to do TDMA -- but we don't need that, all
> >> we need is raw sockets so we can do EtherCAT.
> >>
> >> How do I set up RTNet so we can do EtherCAT? I don't even know if we
> >> should still be using /usr/local/rtnet/sbin/rtnet to start everything,
> >> or if we should be using something else.
> >>
> >> What is the right way to try to get this working?
> >
> > We have been successfully using xenomai and rtnet with SOEM, I suppose
> > you already use the patched version of SOEM available at
> > http://git.mech.kuleuven.be/robotics/soem.git.
>
> We are using soem_core within that repository, but not the soem_master
> component (we have our own master code). We've enabled RTNet in the
> CMakeLists.txt for soem_core.
>
> We have gotten RTNet itself working... but we're still trying to get
> SOEM to work under RTNet.
>
> > We have a small script that sets up rtnet for us. I'll look it up and
> > send it to you when I'm back at the office tomorrow
>
> Thank you very much -- that script will be very helpful.

Just an update, we are now getting a SIGXCPU crash when we are
initializing. Here is the backtrace from GDB (just lower layers):

Program received signal SIGXCPU, CPU time limit exceeded.
0x00007fffd1d6c2bd in __wrap_send () from /usr/xenomai/lib/libpthread_rt.so.1
(gdb) bt
#0 0x00007fffd1d6c2bd in __wrap_send () from
/usr/xenomai/lib/libpthread_rt.so.1
#1 0x00007fffd1f7c865 in ec_outframe (idx=1 '\001',
stacknumber=<optimized out>) at
/home/drl/rosstacks/soem/soem_core/build/soem_core/src/nicdrv.c:395
#2 0x00007fffd1f7c8c1 in ec_outframe_red (idx=1 '\001') at
/home/drl/rosstacks/soem/soem_core/build/soem_core/src/nicdrv.c:415
#3 0x00007fffd1f7cecf in ec_srconfirm (idx=1 '\001', timeout=20000)
at /home/drl/rosstacks/soem/soem_core/build/soem_core/src/nicdrv.c:684
#4 0x00007fffd1f745f7 in ec_BRD (ADP=<optimized out>, ADO=0,
length=2, data=0x7fffffffc77a, timeout=20000) at
/home/drl/rosstacks/soem/soem_core/build/soem_core/src/ethercatbase.c:199
#5 0x00007fffd1f76cb7 in ec_config_init (usetable=0 '\000') at
/home/drl/rosstacks/soem/soem_core/build/soem_core/src/ethercatconfig.c:161
#6 0x00007fffd21f3d81 in atrias::ecatConn::ConnManager::configure
(this=0x6ea220) at
/home/drl/atrias/software/atrias_ecat_conn/src/ConnManager.cpp:29

Does anyone know what can cause this?

Thank you,
Johnathan Van Why

> > Ruben
> >
> >> Thank you for any help,
> >> Johnathan Van Why
> >> Dynamic Robotics Laboratory
> >> Oregon State University
> >> --
> >> Orocos-Users mailing list
> >> Orocos-Users [..] ...
> >> http://lists.mech.kuleuven.be/mailman/listinfo/orocos-users
> >
> >
> >
> > --
> > Ruben Smits, Phd
> > Chief Technology Officer
> > Intermodalics BVBA
> > +32479511786
> > www.intermodalics.eu

Setting up RTNet for SOEM on Xenomai?

On Wed, Aug 29, 2012 at 10:12 PM, Johnathan Van Why <jrvanwhy [..] ...>wrote:

> On Wed, Aug 29, 2012 at 9:02 AM, Johnathan Van Why <jrvanwhy [..] ...>
> wrote:
> >
> > On Tue, Aug 28, 2012 at 9:57 PM, Ruben Smits
> > <ruben [dot] smits [..] ...> wrote:
> > > Hello Jonathan,
> > >
> > >
> > > On Tue, Aug 28, 2012 at 7:36 PM, Johnathan Van Why <jrvanwhy [..] ...
> >
> > > wrote:
> > >> We are trying to set up RTNet on Xenomai so we can run SOEM in hard
> > >> realtime. However, we are having trouble getting RTNet working.
> > >>
> > >> It seems as if RTNet wants to do TDMA -- but we don't need that, all
> > >> we need is raw sockets so we can do EtherCAT.
> > >>
> > >> How do I set up RTNet so we can do EtherCAT? I don't even know if we
> > >> should still be using /usr/local/rtnet/sbin/rtnet to start everything,
> > >> or if we should be using something else.
> > >>
> > >> What is the right way to try to get this working?
> > >
> > > We have been successfully using xenomai and rtnet with SOEM, I suppose
> > > you already use the patched version of SOEM available at
> > > http://git.mech.kuleuven.be/robotics/soem.git.
> >
> > We are using soem_core within that repository, but not the soem_master
> > component (we have our own master code). We've enabled RTNet in the
> > CMakeLists.txt for soem_core.
> >
> > We have gotten RTNet itself working... but we're still trying to get
> > SOEM to work under RTNet.
> >
> > > We have a small script that sets up rtnet for us. I'll look it up and
> > > send it to you when I'm back at the office tomorrow
> >
> > Thank you very much -- that script will be very helpful.
>
> Just an update, we are now getting a SIGXCPU crash when we are
> initializing. Here is the backtrace from GDB (just lower layers):
>
> Program received signal SIGXCPU, CPU time limit exceeded.
> 0x00007fffd1d6c2bd in __wrap_send () from
> /usr/xenomai/lib/libpthread_rt.so.1
> (gdb) bt
> #0 0x00007fffd1d6c2bd in __wrap_send () from
> /usr/xenomai/lib/libpthread_rt.so.1
> #1 0x00007fffd1f7c865 in ec_outframe (idx=1 '\001',
> stacknumber=<optimized out>) at
> /home/drl/rosstacks/soem/soem_core/build/soem_core/src/nicdrv.c:395
> #2 0x00007fffd1f7c8c1 in ec_outframe_red (idx=1 '\001') at
> /home/drl/rosstacks/soem/soem_core/build/soem_core/src/nicdrv.c:415
> #3 0x00007fffd1f7cecf in ec_srconfirm (idx=1 '\001', timeout=20000)
> at /home/drl/rosstacks/soem/soem_core/build/soem_core/src/nicdrv.c:684
> #4 0x00007fffd1f745f7 in ec_BRD (ADP=<optimized out>, ADO=0,
> length=2, data=0x7fffffffc77a, timeout=20000) at
> /home/drl/rosstacks/soem/soem_core/build/soem_core/src/ethercatbase.c:199
> #5 0x00007fffd1f76cb7 in ec_config_init (usetable=0 '\000') at
> /home/drl/rosstacks/soem/soem_core/build/soem_core/src/ethercatconfig.c:161
> #6 0x00007fffd21f3d81 in atrias::ecatConn::ConnManager::configure
> (this=0x6ea220) at
> /home/drl/atrias/software/atrias_ecat_conn/src/ConnManager.cpp:29
>
> Does anyone know what can cause this?
>

Which Xenomai version ??

That's *either* the Xenomai watchdog killing your thread because it's
missing its deadlines *or* you turned on the T_WARN_SW, which kills your
thread when its making a mode switch. I don't see any code that could make
a mode switch in your backtrace, unless you somehow use a standard ethernet
device instead of the rtnet device.

Peter

Setting up RTNet for SOEM on Xenomai?

Hi Ruben,

We have a small script that sets up rtnet for us. I'll look it up and
> send it to you when I'm back at the office tomorrow
>

Can this script be officially available on soem repository?

- Enea