7i76E hm2 driver
For a project at my university, I am currently developing a Gantry CNC with a wireless, “realtime capable” connection between LinuxCNC and MESA 7i76E.
FYI, I am currently troubleshooting with by a wired connection with network emulation (netem: wiki.linuxfoundation.org/networking/netem).
Everything is running smooth except the initialization (start up) of the MESA 7i76E. When initilized, adding latency to a certain degree is not a problem. In another thread I already got help and understand the issue (forum.linuxcnc.org/10-advanced-configura...tup-without-encoders).
However, due to my lack of “C” skills I need maybe a little further help.
The goal is to initialize the connection between LinuxCNC and MESA with a connection with a latency of 1.5ms. The current error (console_output) as well as the correct initialization phase (correct_console_output) is attached. The "hm2_eth.c" file should be the one, I have to adapt (github.com/LinuxCNC/linuxcnc/blob/d221e2...a-hostmot2/hm2_eth.c)
The error messages show that “rtapi_app_main” fails. This contains of “hm2_eth_probe”, “hm2_eth_items” and “hal init”.The error Message “board fails HM2 registration” indicates that “hm2_eth_probe” does not work due to “ret != 0”. From my understanding, the variable “ret” is used to store the return value of different functions (e.g. eth_socket_send() and eth_socket_recv_loop(), etc.).
First I thought the variables I have to adapt in the hm2_eth.c file are:
SEND_TIMEOUT_US 10
RECV_TIMEOUT_US 10
READ_PCK_DELAY_NS 10000.
However, by adapting those (tried different values) and recompile LinuxCNC, the initialization does not work with the same error message.So my question: Is the solution in adapting “hm2_eth.c” or should I also look into "deeper" parts that have nothing directly to do with the ethernet-based MESA (e.g. “hostmot2.c” or some further C-Code). Maybe someone can help a little where to look at.
I am sorry, I cannot embed the links. I always get "Kunena Internal Errors". Maybe this thread can also be moved to the driver board section if wrong at this place.
Thank you! If more information are needed, feel free to ask/contact me.
Please Log in or Create an account to join the conversation.
(hm2_7i76e.packet-read-timeout)
To say 10000000
(that would be 10 ms)
Please Log in or Create an account to join the conversation.
already tried that.
I also thought that this would be enough. Unfortunately not.
I played around with the pins that can be adapted regarding this: linuxcnc.org/docs/html/man/man9/hm2_eth.9.html
I can attach a trial .hal and .ini. The values for Servo thread, watchdog.timeout, and packet-read-timeout are very high in that example.
I think there are no further adjustments that can be done except the driver adaption (hm2_eth).
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
- Posts: 19123
- Thank you received: 6406
Please Log in or Create an account to join the conversation.
Also this line in the driver:
long read_timeout = board->hal ? board->hal->read_timeout : 1600000;
may set the timeout before the hal file has been parsed, not sure when it is run relative to
hm2_eth initialization.
Please Log in or Create an account to join the conversation.
We are developing our own wireless communication based on a token ring system.What are you using for wireless coms?
Currently we are just emulating the network behaviour using NetworkEmulator. To be precise: we give latency and jitter on the network interface that is directly connected to the MESA by wire. If we add a latency of >= 1.5ms and no Jitter, the initialization of the MESA fails. If we add this latency after initialization, the machine tool works.
Thank you. I will look into that. Usually packets should not be dropped. But maybe I should do some wireshark analysis and look what "exactly" happens.Is it possible your interface drops packets?
Also this line in the driver:
long read_timeout = board->hal ? board->hal->read_timeout : 1600000;
may set the timeout before the hal file has been parsed, not sure when it is run
Please Log in or Create an account to join the conversation.
Looks suspicious when you say an added 1.5 ms makes initialization fail.
Please Log in or Create an account to join the conversation.
The weird thing is that the operation after initialization works stable (more or less)
I will look into it today or tomorrow and give feedback.
Please Log in or Create an account to join the conversation.
What did I do:
After struggeling with hm2_eth and trying basically everything I could imagine, I changed the hardcoded delay of "halcmd_commands.c" and "halrmt.c" to a high amount of time.
Still errors (see attachement)
Maybe it has something to do with "waitpid failed". Have to look into it
On the other side, maybe I will ignore some stuff of the code to initialize the MESA so that at leat it can start one time.
Could it also be regarding the firmware, how MESA handles stuff?
Have to look way deeper into it and will report
Please Log in or Create an account to join the conversation.
long read_timeout = board->hal ? board->hal->read_timeout : 1600000;
Please Log in or Create an account to join the conversation.