connect raspberry via ehternet as IO-port - some developer help needed

More
28 Jan 2019 13:34 #125075 by PCW
The kernel supplied with LinuxCNCs RTAI ISO is likely way too old for a I7 7400

I suspect the I7 7400 can do much better but still has some power saving, speed switching or BIOS call enabled. Here's a gen 3 I5 with Preempt-RT:

freeby.mesanet.com/8300-4.18.png

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
28 Jan 2019 16:49 #125078 by wicki

Remind me why you are doing this again :-)


because it is for a mesa - I want it for a rasPI.
and I want raw-ethernet.

and I want to know, if and how it works ;-)

I will try a preconfigured kernel on the i3 next...

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
29 Jan 2019 06:16 - 29 Jan 2019 06:29 #125131 by wicki

I will try a preconfigured kernel on the i3 next...


with "SMP PREEMPT Debian 3.4.55-4linuxcnc" I get a 10k jitter on the i3.
so it is not a hardware-problem.
but it is out of 2015....

can anybody tell me:
which is last latest rtai-kernel that is known as a working one?


hmmmm.... is rtai really supported any more?
Last update: January 22, 2018, 10:14
RTAI 5.1 released February 05, 2018

any hints ?
Last edit: 29 Jan 2019 06:29 by wicki.

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
29 Jan 2019 10:08 #125149 by wicki
I've taken a further look into hm2_eth.c an now I have a lot of questions:

the driver uses the IP-layer-communications - not RAW-eth.
and because I havn't found any rtapi_socket-functions, I assume,
thats the reason, this driver is running in userspace.

because no rtapi-socket-funtion exist, a realtime-eth-driver cannot be
written inside linuxcnc.

my raspi-driver is running as a uid-root-thread and the communication
between the linuxcnc virtual parport and the driver is done via shared
memory.

to save some cpu-time, I want to use external function calls instead of
polling the shared memory.

is this a usable solution or do you ave any other ideas to solve this?

or is this a completely wrong way ?

and who is the person I have to contact, to get more information about
building a configure/makefile for linuxcnc?

is it supported any more?
I remember, to have tested 2.8.pre years ago, 2.7.14 is more than 6 month old.

and what about the "machinekit-fork" ?
is it still under development?
I've also tried the supports by mail but got no respond.

questions over questions... ;-)

Please Log in or Create an account to join the conversation.

More
29 Jan 2019 11:18 #125152 by andypugh

the driver uses the IP-layer-communications - not RAW-eth.
and because I havn't found any rtapi_socket-functions, I assume,
thats the reason, this driver is running in userspace.

because no rtapi-socket-funtion exist, a realtime-eth-driver cannot be
written inside linuxcnc.


The history, as I understand it, is that the current userspace hm2_eth was written first a it was easier, and the plan was to then write the rtapi code needed for rtai kernal module access. But it was found that the preempt-rt approach worked so well that there wasn't much motivation for the work involved. Note that RTAI and PREEMPT-RT are both "Realtime" but one is kernel and one is userspace.

There is an ambition to make LinuxCNC a normal application downloadable from the repositiories, but for that to happen it needs to run on mainline kernels, and there is some hope that preempt-rt will be mainlined, so it is worth the trouble of supporting it.

Whether preempt-rt will evet be good enough for software-stepping remains to be seen. I have a machine where it would be entirely usable (my RM One has better latency under preempt-rt than any of my other machines running rtai.). It is possible the preempt-rt might improve to be usable on more hardware.



my raspi-driver is running as a uid-root-thread and the communication
between the linuxcnc virtual parport and the driver is done via shared
memory.

to save some cpu-time, I want to use external function calls instead of
polling the shared memory.

is this a usable solution or do you ave any other ideas to solve this?

This is way outside my are of expertise. Can I suggest that you move this discussion to the developers mailing list? Your chances of catching the core developers on this forum are pretty slim.


and who is the person I have to contact, to get more information about
building a configure/makefile for linuxcnc?

Again, you can try the develpers mailing list. But I don't understand what you are really asking.
For your own use you seem to be suggesting that halcompile works?
If the driver is to be released into the main LinuxCNC distribution then you would just add references to your driver to the existing makefiles. What makes you think that you need to create a new makefile for your driver?

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
30 Jan 2019 07:22 #125257 by wicki


This is way outside my are of expertise. Can I suggest that you move this discussion to the developers mailing list? Your chances of catching the core developers on this forum are pretty slim.

Again, you can try the develpers mailing list. But I don't understand what you are really asking.
For your own use you seem to be suggesting that halcompile works?
If the driver is to be released into the main LinuxCNC distribution then you would just add references to your driver to the existing makefiles. What makes you think that you need to create a new makefile for your driver?


my hal_parport_praPI-driver is a patched version of hal_parport.c
it allows the usage of an existing parport _or_ an raspberry-PI (or both).
of course, it's possible to publish it as a patchfile, but I think, it would be nice,
if the driver is working out of the box.

therefore it has to be included into the ./configure -/- /makefile.

that's the plan... but let me make further tests at first......

I'm now subscribed to the developers list and we will see ;-)

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
14 Feb 2019 11:09 #126442 by wicki
this ha happend the last weeks:

I changed my native-C rasPI-driver into a HAL-component.

It builds 16 IN- and 16 OUT-Pins for the Raspberry.

The receiving parts (for rasPI- an and PC-side) are
also working but not published now. I will make further
tests at first.

It would be fine, if a linuxCNC-developer an take a look
at this:

erste.de/raspi.comp

and give me some feedback.

I'm not sure:
should I include -INV/-NOT-pins into this component or
should those inversion be done by the rasPI- or by the
PC-communication task?
or by the linuxCNC-in/hal-config?

I think, it depends on the number of pins, which need
inversions.... ? or what do you think?

regards

wicki

Please Log in or Create an account to join the conversation.

More
16 Feb 2019 10:22 #126604 by gtt38
I was looking for an I/O expander cheaper than mesa boards and i think it's possible to create a driver for a STM32F4 or F7 using eth_hm2 with STM32 nucleo 144 boards (with ethernet)

I was looking to STMBL and i talked to Rene_dev and he told me it's definitly possible. the spi connexion is also possible (like the Mesa 7i90HD) that could make a perfect I/O expander for the raspberry pi or other small computers without fast I/O.
The STM32 could drive some powerstep01 or some L6470 (SPI based motor drivers) or regular drivers, pendants etc....

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
16 Feb 2019 17:10 #126614 by wicki
I want to finish the rasPI-driver first.
Now I get a latency of 100-120 usec with my rasPI.
Next step is to try the same thing with an arduino, which has a card-slot
and an eth-interface (100MBit). Could be enough for 30kHz at 40 pins.



Source-code and description here: erste.de/rasPiCat.html

Please Log in or Create an account to join the conversation.

  • wicki
  • wicki's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
18 Feb 2019 15:20 #126718 by wicki
Now both driver parts (linuxCNC-PC and raspberry) are available:

erste.de/rasPiCat.html

feedback would be nice.....

regards

wicki
The following user(s) said Thank You: tommylight, emilvv

Please Log in or Create an account to join the conversation.

Moderators: PCWjmelson
Time to create page: 0.075 seconds
Powered by Kunena Forum