Ethercat HAL driver

More
21 Apr 2020 19:13 #164995 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
Albert, we are grateful for the help and the work you have done on the extra terminals that you added. This is what makes open source so great, but it still takes people like you helping all of us that are learning to make it all work. Two thumbs up all day long.
The following user(s) said Thank You: chimeno

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

More
21 Apr 2020 19:25 #164997 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
I forgot to add about the restoring the EPROM. I am going to set up another computer with TwinCAT and try getting another free 30 day trial... as I would hate to "Brick" a EL5151. Flashing the EPROM will be my last resort. Years ago I bricked 2 OptiPlex motherboards with a BIOS that I modified and obviously had wrong LOL.

Robert

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

More
27 Apr 2020 19:47 #165861 by chimeno
Replied by chimeno on topic Ethercat HAL driver
hello @CORBETT,
I am attaching a new screenshot in another easier way to write in the eeprom, I hope you are lucky with the project
Greeting
Chimeno
Attachments:
The following user(s) said Thank You: CORBETT

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

More
28 Apr 2020 22:58 #166027 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
Hey thanks again... I will try this out when I get a break from work.

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

More
01 May 2020 01:37 - 01 May 2020 01:38 #166272 by theshade
Replied by theshade on topic Ethercat HAL driver
Hello all,

Sorry I am new here and it's my first post.. I was trying to build linuxcnc with ethercat HAL on raspberry pi
following the instructions here: github.com/icshwi/etherlabmaster
mainly... ;)
sudo systemctl start ethercat
pi@raspberrypi:~/ec-debianize/etherlabmaster $ systemctl status ethercat
* ethercat.service - EtherCAT Master Kernel Modules
Loaded: loaded (/etc/systemd/system/ethercat.service; enabled; vendor preset:
Active: active (exited) since Fri 2020-05-01 02:01:31 CEST; 1h 8min ago
Process: 610 ExecStart=/opt/etherlab/sbin/ethercatctl start (code=exited, stat
Main PID: 610 (code=exited, status=0/SUCCESS)

May 01 02:01:30 raspberrypi systemd[1]: Starting EtherCAT Master Kernel Modules.
May 01 02:01:31 raspberrypi systemd[1]: Started EtherCAT Master Kernel Modules.



So I managed to have the generic driver installed and documentation seems pretty outdated after that point and could not find much help here:
wiki.linuxcnc.org/cgi-bin/wiki.pl?EtherCatDriver
but found this:
forum.linuxcnc.org/38-general-linuxcnc-q...-of-eathercat-master
And then I got stuck at this step:

2. Install etherlabmaster-dev
sudo apt-get install etherlabmaster-dev
E: Unable to locate package etherlabmaster-dev
I tried to install some repos but I don't think I can find it.


and if I understand correctly I could also do it by doing my own dpkg of the etherlabmaster-dev: but it doesn't work for me either..

pi@raspberrypi:~/ec-debianize/etherlabmaster $ dpkg-buildpackage
dpkg-buildpackage: info: source package etherlabmaster
dpkg-buildpackage: info: source version 1.5.2+20190904hg33b922p8ea394-1
dpkg-buildpackage: info: source distribution lucid
dpkg-buildpackage: info: source changed by Sascha Ittner <This email address is being protected from spambots. You need JavaScript enabled to view it.>
dpkg-buildpackage: info: host architecture armhf
dpkg-source --before-build .
fakeroot debian/rules clean
dh clean --with autoreconf,dkms
debian/rules override_dh_clean
make[1]: Entering directory '/home/pi/ec-debianize/etherlabmaster'
rm -f ChangeLog
dh_clean
make[1]: Leaving directory '/home/pi/ec-debianize/etherlabmaster'
dpkg-source -b .
dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../etherlabmaster_1.5.2+20190904hg33b922p8ea394.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit status 255


uname -a
Linux raspberrypi 4.19.58-rt22-v7l+ #1 SMP PREEMPT RT Fri Nov 1 14:58:37 KST 2019 armv7l GNU/Linux

Thank you in advance for any hints....

End of main question ... read further if you have time to waste...

I am not exactly sure where I am putting my feets for now, but I had the crazy idea to build my first 3axis CNC with:
raspberry4 ethercatmaster with linuxCNC
beckhoff IOs EL1xxx for switches and a 4102 for the spindle
ethercat drivers: www.hybridservos.com/ethercat-bus-step-servo-drive-ehs-580 with closed loop steppers
I am pretty much done with the hardware plans,
but I don't even think I grasp what needs to be done on the software and configuration side of things, a mentor would be pretty useful.

Finally last question, I read the website here:
www.simplerobot.net/2018/06/rpi-ethercat-master-picat.html
and got some level of communication with a W5500 and the few beckhoffs I have, but I don't see how to use the W5500 with linuxCNC. I have not seen many threads on it nor on SOEM. Would the generic drivers work ok for a hobby CNC machine?
Last edit: 01 May 2020 01:38 by theshade.

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

More
03 May 2020 17:00 #166516 by chimeno
Replied by chimeno on topic Ethercat HAL driver
Hello @theshade,

dpkg-source: error: can't build with source format '3.0 (quilt)': no upstream tarball found at ../etherlabmaster_1.5.2+20190904hg33b922p8ea394.orig.tar.{bz2,gz,lzma,xz}
dpkg-buildpackage: error: dpkg-source -b . subprocess returned exit status 255



This error is related to "MERCURIAL", you will have to add the extension

solucion
edit the mercurial configuration file
sudo hg config --edit
Add
[extensions]
mq =
then you can recompile ec-debianize

Greeting
Chimeno
The following user(s) said Thank You: Nico2017, theshade

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

More
04 May 2020 03:07 #166565 by CORBETT
Replied by CORBETT on topic Ethercat HAL driver
I kept working over and over on TwinCAT 2.11 to get the ethernet card working and never could, but I downloaded TwinCAT 3.1 and it loaded the intel based ethernet card on the first try. I had already checked Beckhoff's website to make sure the ethernet card was compatible, but it just would never work in TC2.

So now I can see the EL5151 terminal in TwinCAT 3 config mode, but I am not quite sure what to do. I had read so much about TC2 that I am lost in TC3. I am just glad to finally see the thing show up in TwinCAT so I can try to get it working.

@ chimeno Albert, I will have to go back and review all that you stated in the past since I can finally see the terminal in TC3

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

More
04 May 2020 17:02 #166640 by theshade
Replied by theshade on topic Ethercat HAL driver
Thank you, that was it..!!!!!

Except that (maybe because it's a pi... doing it as the "pi" user (without sudo) seemed to work better..
running
hg config --debug helped me figuring this out...

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

More
05 May 2020 10:33 - 05 May 2020 11:14 #166754 by theshade
Replied by theshade on topic Ethercat HAL driver
Still trying to compile on a raspberry,
I think I compiled everything but it seems the tool doesn't match the kernel module... and I don't know how to debug, configure or change what I did to make them match:
pi@raspberrypi:~/etherlabmaster/etherlabmaster-code/tool $ ./ethercat master
Failed to get master information: Inappropriate ioctl for device

found this related link from Florian but it's pretty old...
lists.etherlab.org/pipermail/etherlab-users/2009/000437.html

pi@raspberrypi:~/etherlabmaster/etherlabmaster-code/tool $ ./ethercat version
IgH EtherCAT master 1.5.2 0c011dc6dbc4+

the service is loaded:
pi@raspberrypi:~/etherlabmaster/etherlabmaster-code/tool $ systemctl status ethercat.service
* ethercat.service - EtherCAT Master Kernel Modules
Loaded: loaded (/etc/systemd/system/ethercat.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2020-05-05 10:47:20 CEST; 1h 13min ago
Main PID: 2751 (code=exited, status=0/SUCCESS)
Tasks: 0 (limit: 4915)
Memory: 0B
CGroup: /system.slice/ethercat.service
May 05 10:47:20 raspberrypi systemd[1]: Starting EtherCAT Master Kernel Modules...
May 05 10:47:20 raspberrypi systemd[1]: Started EtherCAT Master Kernel Modules.

module are here:
pi@raspberrypi:~/etherlabmaster/etherlabmaster-code/tool $ modinfo ec_master
filename: /lib/modules/4.19.58-rt22-v7l+/updates/dkms/ec_master.ko
version: 1.5.2 unknown
license: GPL
description: EtherCAT master driver module
author: Florian Pose <This email address is being protected from spambots. You need JavaScript enabled to view it.>
srcversion: 39580AF71CC604526D48086
depends:
name: ec_master
vermagic: 4.19.58-v7l SMP preempt mod_unload modversions ARMv7 p2v8
parm: main_devices:MAC addresses of main devices (array of charp)
parm: backup_devices:MAC addresses of backup devices (array of charp)
parm: debug_level:Debug level (uint)

pi@raspberrypi:~/etherlabmaster/etherlabmaster-code/script $ modinfo ec_generic
filename: /lib/modules/4.19.58-rt22-v7l+/updates/dkms/ec_generic.ko
version: 1.5.2 unknown
license: GPL
description: EtherCAT master generic Ethernet device module
author: Florian Pose <This email address is being protected from spambots. You need JavaScript enabled to view it.>
srcversion: 1AE486D6201500C92B67C63
depends: ec_master
name: ec_generic
vermagic: 4.19.58-v7l SMP preempt mod_unload modversions ARMv7 p2v8



so I redid a (not sure why) :
sudo apt-get install etherlabmaster
( I also checked the log when I use ec-debianize to build it and get the same errors)
Which resulted in this:
Warning: Spoiler!

Warning: Spoiler!




I did put:
MASTER0_DEVICE="eth0" in ethercat.conf
and
echo "ENABLE_CYCLES = NO" > configure/CONFIG_OPTIONS.local
and run
./configure --enable-generic --disable-8139too

recompiled and then did that (forum.linuxcnc.org/27-driver-boards/3559...uxcnc-how-to-install):
Open etc/default/ethercat as root : $ sudo thunar
Find your mac adres : $ ip link show (output = link/ether ....)
Type in MASTER0_DEVICE="lo:ve:me:te:nd:er" (your mac adres my dear)
Type in DEVICE_MODULES="generic"
$ sudo update-ethercat-config (reboot, or restart your pc)

I think I missed some configuration steps or maybe having both ec-debianized dpkg installed after the igh etherlabmaster.... but I don't know where... still trying things... but mostly getting lost...

Thank you in advance and sorry if I am slow and don't yet grab the essence of it... maybe I should start again from scratch (
Last edit: 05 May 2020 11:14 by theshade.

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

More
06 May 2020 00:06 #166822 by theshade
Replied by theshade on topic Ethercat HAL driver
well tonigh I restarted from a fresh raspbian image and logged everything I did:

# Starting from fresh 2020-02-13-raspbian-buster-full.img install
# configure language, keyboard, wifi, enable VNC

#install subversion (svn)
sudo apt-get install subversion
# just because I forgot (it's the first thing to do)
sudo apt-get update
sudo apt-get upgrade

svn checkout github.com/sgawad/rpi4-4.19.58-rt/trunk/prebuilt
cd prebuilt/
chmod +x deploy.sh
./deploy.sh

# the pi will reboot by itself... at the end of deploy.sh
uname -a
Linux raspberrypi 4.19.58-rt22-v7l+ #1 SMP PREEMPT RT Fri Nov 1 14:58:37 KST 2019 armv7l GNU/Linux

git clone github.com/sittner/ec-debianize
cd ec-debianize/

# install mercurial with mq extensions (thx chimeno)
sudo apt-get install mercurial
hg config --edit
#PRESS 1
#ADD under
#[extensions]
mq =
save file /home/pi/.hgrc
./get_source.sh
cd etherlabmaster
dpkg-checkbuilddeps
sudo apt-get install debhelper
sudo apt-get install dkms
sudo apt-get install quilt

# end of output looks like
# dpkg-genbuildinfo
# dpkg-genchanges >../etherlabmaster_1.5.2+20190904hg33b922p8ea394-1_armhf.changes
#dpkg-genchanges: info: including full source code in upload
# dpkg-source --after-build .
#dpkg-source: info: unapplying 40_safe_rt_mutex_enable.patch
#dpkg-source: info: unapplying 30_relax_al_state_change_timeout.diff
#dpkg-source: info: unapplying 20_fix_read_pdo_count.diff
#dpkg-source: info: unapplying 10_fix_distclean.diff
#dpkg-buildpackage: info: full upload (original source is included)
# signfile etherlabmaster_1.5.2+20190904hg33b922p8ea394-1.dsc
#gpg: keybox '/home/pi/.gnupg/pubring.kbx' created
#gpg: skipped "Sascha Ittner <This email address is being protected from spambots. You need JavaScript enabled to view it.>": No secret key
#gpg: dpkg-sign.K_Eus86w/etherlabmaster_1.5.2+20190904hg33b922p8ea394-1.dsc: clear-sign failed: #No secret key
#dpkg-buildpackage: error: failed to sign .dsc file
# but apparently it's all normal !!!

#running
sudo dpkg -i etherlabmaster_1.5.2+20190904hg33b922p8ea394-1_armhf.deb

#gives errors looking at the log... so had to fix acrroding to this


#The kernel headers are cross compiled and there's a bug in deb-pkg that packs the build host #executables rather than the target executables. Thankfully, the sources are also included with #the headers so you just have to recompile the header scripts.

#There are 4 steps needed to do this:
#1) Change to the Linux header directory:
cd /usr/src/linux-headers-`uname -r`
#1) Install the necessary dependencies:
sudo apt-get install -y build-essential bc bison flex libssl-dev
#2) Apply the byteshift patch to the headers:
wget raw.githubusercontent.com/armbian/build/...bian-byteshift.patch -O - | sudo patch -p1
#3) Compile the scripts:
sudo make scripts
#Now DKMS should work like normal. This is useful for adding Realtek wireless devices and other #drivers.

sudo dpkg -i etherlabmaster_1.5.2+20190904hg33b922p8ea394-1_armhf.deb
(Reading database ... 230473 files and directories currently installed.)
Preparing to unpack etherlabmaster_1.5.2+20190904hg33b922p8ea394-1_armhf.deb ...


Deleting module version: 1.5.2+20190904hg33b922p8ea394
completely from the DKMS tree.
Done.
Unpacking etherlabmaster (1.5.2+20190904hg33b922p8ea394-1) over (1.5.2+20190904hg33b922p8ea394-1) ...
Setting up etherlabmaster (1.5.2+20190904hg33b922p8ea394-1) ...
Loading new etherlabmaster-1.5.2+20190904hg33b922p8ea394 DKMS files...
Building for 4.19.58-rt22-v7l+
Building initial module for 4.19.58-rt22-v7l+
Error! Bad return status for module build on kernel: 4.19.58-rt22-v7l+ (armv7l)
Consult /var/lib/dkms/etherlabmaster/1.5.2+20190904hg33b922p8ea394/build/make.log for more information.
dpkg: error processing package etherlabmaster (--install):
installed etherlabmaster package post-installation script subprocess returned error exit status 10
Processing triggers for libc-bin (2.28-10+rpi1) ...
Errors were encountered while processing:
etherlabmaster

the log content is now as follow and the first error is gone... others are still there tough...

Warning: Spoiler!

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

Time to create page: 0.194 seconds
Powered by Kunena Forum