alde103

alde103

EtherCAT + Nerves

Hi all, has anyone worked with EtherCAT and Nerves before?

I’m quite new with Ethercat, so I’m looking for a good starting point like a reliable and recommended library (and easy to use haa) that handles Ethercat that can be added to a nerves custom system.

Thanks in advance :slight_smile: .

Most Liked

ElixirTip

ElixirTip

I’ve worked with EtherCAT. Nerves uses Buildroot which includes an EtherCAT package igh-ethercat. It goes through the standard network stack. It also has a few hardware drivers such as e100 for better performance. To include it you need to make a custom Nerves system and add the package.

Ultimately, we found it didn’t have the performance we needed for our specific hardware. So we made a custom, private Nerves system that uses Acontis’s EtherCAT offering.

alde103

alde103

Hi all, here is an update of this thread; first, I tried to build igh-ethernet package in buildroot for a rpi3, however, since rpi3 doesn’t have any igh-ethernet supported hardware. The igh-ethernet needs to be compiled with --enable-generic option, therefore, I needed to add a custom igh-ethernet package to buildroot, also I enabled udev, taskset packages. Despite this, I had these types of warnings during compilation:

depmod: WARNING: /home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi3/.nerves/artifacts/valiot_system_rpi3-portable-1.7.2-valiot.7/target/lib/modules/4.19.25/extra/devices/ec_generic.ko needs unknown symbol kernel_bind

depmod: WARNING: /home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi3/.nerves/artifacts/valiot_system_rpi3-portable-1.7.2-valiot.7/target/lib/modules/4.19.25/extra/master/ec_master.ko needs unknown symbol sched_setscheduler
.
.
.

The following error was shown during runtime:

iex(3)> cmd "modprobe ec_master"
modprobe: can't load module ec_master (extra/master/ec_master.ko): unknown symbol in module, or unknown parameter
1

At this point I thought it could be a kernel version issue, since when compiling a similar repository (for bbb), the compilation works without warnings, therefore, I lost interest in using igh-ethernet haha.

The second option was the arcontis software atemsys, which it appears to be easier to compile, so I added a custom package to buildroot, however, during compilation I had the same type of warning (only 1 warning) as before:

depmod: WARNING: /home/alde/Documents/Elixir/Nerves/repos/valiot_system_rpi3/.nerves/artifacts/valiot_system_rpi3-portable-1.7.2-valiot.7/target/lib/modules/4.19.25/extra/atemsys.ko needs unknown symbol of_find_compatible_node

Therefore, it also fails at runtime.

My third option was the SOEM project, I had no issue with this library (compiles with no warnings), however, this package is refered by the community more as a library than a master software, therefore, I think that its better to make an Elixir wrapper than add the package in buildroot.

Giving another chance to the previous options (atmsys, igh-ethernet) and looking the bbb project, it seems that by disabling CONFIG_TRIM_UNUSED_KSYMS=y in linux-x.x.defconfig both packages works in runtime !!!

The option CONFIG_TRIM_UNUSED_KSYMS=y seem to be to trim exported kernel symbols that are not used, which for me seems that it makes the opposite, I also do not know what kind of problems I am creating when disabling this option :(, Does anyone knows?

Currently, the problem in which I am working with igh-ethernet is to open a device /dev/EtherCAT0 that does not exist, but I think it’s a matter of executing some package commands and defining some rules in /etc/udev/rule.d (this directory does not exist either).

Does anyone know how to define these rules in Nerves?, or does it have to be done in Buildroot?

Regards.

ElixirTip

ElixirTip

We had problems with igh-ethercat with raspberry pi. It simply couldn’t compile the igh-ethercat package. We never figured out why. It worked with BeagleBone Black and that’s what we’re still using.

We needed sub-millisecond response times on EtherCAT. igh-ethercat doesn’t provide hardware drivers for BBB (or RPi). So it was taking several milliseconds for a round trip.

If you don’t need that level of performance, then go with igh-ethercat. It’s also open source. Actontis provides proprietary, enterprise-level solutions so you’ll be paying quite a bit for it.

Where Next?

Popular in Questions Top

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
Kurisu
For example for a current url like http://localhost:4000/cosmetic/products?_utf8=✓&query=perfume&page=2, I would like to get: ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
sen
Hi All, I set a environment variables in dev.exs , like below code. when i start server, how can i set the ${enable} value? thanks. d...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39523 209
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement