[etherlab-users] Slave lost forever after power cycling

Graeme Foot Graeme.Foot at touchcut.com
Thu Mar 5 22:58:25 CET 2020


Hi Joachim,

When you have the problem are you power cycling the slave modules only, or the master as well?  If it's just the slave modules being repowered then you may have run into a bug that I have submitted a patch for, but has not yet made it into Gavin's patchset.  I have attached an email with the patch, although it is for the previous patchset so it may not line up well.

Prior to the patch, if you hot power a slave module, the master can start reading the slave information (including the alias) before the slave has finished reading it's EEPROM and alias dip switches.  If it does then it can return an invalid alias and the configuration no longer matches up.

The patch waits until the slave has finished reading the EEPROM (and other information such as alias dip switches) before continuing to request the alias and further information.  This has been confirmed as required by ETG.

Setting the --diable-sii-cache flag may be hiding the issue by slowing down initial communications with the modules enough for your slave to have read enough of the EEPROM and dip switches to allow it to return valid information.


If you repower your whole system (including the master) then there is plenty of time for the slave to have fully initialised before the master is started up and starts communicating.  Another way to test it is to:
- start the system up normally and confirm it is configured correctly
- stop your application
- stop the EtherCAT master daemon
- turn off power to the slaves
- turn on the power to the slaves
- start the EtherCAT master daemon

All of the slaves should be correct as they are fully initialised before the master starts requesting information for configuration.

Of course the only way to fully confirm if it is this problem is to trawl through wireshark logs of the startup communications from a hot power and confirm whether the "EERPOM not loaded" flag is set (Register 0x0502 bit 12) while reading the alias and other information from the slave.


Regards,
Graeme Foot.


From: Joachim Sällvin <joachim.sallvin at corpowerocean.com>
Sent: Friday, 6 March 2020 3:56 AM
To: Gavin Lambert <gavin.lambert at tomra.com>; Graeme Foot <Graeme.Foot at touchcut.com>; etherlab-users at etherlab.org
Subject: Sv: Slave lost forever after power cycling

Hi,

Problem seems to have been solved!

Gavin's suggestion:

"If you are using the unofficial patchset, something else you could try is to add --disable-sii-cache to your configure options and rebuild"

did the trick. Thank you so much for this!

So this is what I did:

cd /usr/src/etherlab
sudo ./configure --disable-sii-cache --enable-generic --disable-8139too prefix=/opt/etherlab
sudo make
sudo make modules
sudo make modules_install
sudo make install
sudo update-grub
sudo reboot now

$ ethercat version
IgH EtherCAT master 1.5.2 35e7f0841303

Best Regards,

Joachim Sällvin




________________________________
Från: Gavin Lambert <gavin.lambert at tomra.com<mailto:gavin.lambert at tomra.com>>
Skickat: den 17 februari 2020 23:39
Till: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>; Joachim Sällvin <joachim.sallvin at corpowerocean.com<mailto:joachim.sallvin at corpowerocean.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org> <etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>>
Ämne: RE: Slave lost forever after power cycling


While I'm not disputing that it might work like that, this sounds a bit backwards.  Assuming that the "parameters" are SDOs, these are usually temporary until reboot while "ethercat alias" updates the EEPROM and is usually permanent.





Actually, it seems quite suspicious that in the example below there are still four slaves after power cycling, but that you appear to now have a duplicate AL1930.



If you're not using the unofficial patchset, it might be worthwhile trying that out.



If you are using the unofficial patchset, something else you could try is to add --disable-sii-cache to your configure options and rebuild.  The cache is something which (if it goes wrong) could possibly cause apparently duplicated slaves when aliases are used - although I can't think of how it could be going wrong at the moment, it doesn't hurt to try.



Another thing that might be useful to try is to use larger and/or more widely spaced alias addresses (if supported by your slaves) - I usually prefer to avoid the low numbers to avoid confusion with relative addressing.



Gavin Lambert
Senior Software Developer


[cid:image001.png at 01D5F3A0.66D88340]
[TOMRA]<http://www.compacsort.com/>[Facebook]<https://www.facebook.com/Compacsort>[Linkedin]<https://www.linkedin.com/company/compac-sorting-equipment/>[Youtube]<https://vimeo.com/compacsort>[twitter]<https://twitter.com/compacsort>[instagram]<https://www.instagram.com/compacsort/>

COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand
Switchboard: +64 96 34 00 88 | tomra.com<http://www.tomra.com>

The information contained in this communication and any attachment is confidential and may be legally privileged. It should only be read by the person(s) to whom it is addressed. If you have received this communication in error, please notify the sender and delete the communication.


From: Graeme Foot <Graeme.Foot at touchcut.com<mailto:Graeme.Foot at touchcut.com>>
Sent: Tuesday, 18 February 2020 08:31
To: Joachim Sällvin <joachim.sallvin at corpowerocean.com<mailto:joachim.sallvin at corpowerocean.com>>; Gavin Lambert <gavin.lambert at tomra.com<mailto:gavin.lambert at tomra.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: RE: Slave lost forever after power cycling



Hi,



Is it this module here (or similar)?

https://www.nord.com/cms/media/documents/datasheets/TI_275281117_SK_TU4-ECT_EN_4217_screen.pdf<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.nord.com%2Fcms%2Fmedia%2Fdocuments%2Fdatasheets%2FTI_275281117_SK_TU4-ECT_EN_4217_screen.pdf&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828861389&sdata=n5wFADx0ilnO7IaNF%2FVCjns%2BUOgM2PTQyv86%2FXw1wT8%3D&reserved=0>



The back of this unit has dip switches:

Second Address (DIP 2..10)

The "Second Address" can be set via this switch and controlled in parameter P181.

If all DIP switches 2..10 are moved to the "OFF" position, the "Second Address" can be set via parameter P160.



This means that if you set an alias on this slave via the "ethercat alias" command it will only remain active until the unit is repowered.  If the dip switches are set it will apply an alias based on the dip switches.  If the dip switches are all off it will use the P160 parameter.



Use the dip switches or P160 to set your alias for this unit, not the "ethercat alias" command.



Regards,

Graeme Foot.



From: etherlab-users <etherlab-users-bounces at etherlab.org<mailto:etherlab-users-bounces at etherlab.org>> On Behalf Of Joachim Sällvin
Sent: Tuesday, 18 February 2020 6:01 AM
To: Gavin Lambert <gavin.lambert at tomra.com<mailto:gavin.lambert at tomra.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: Re: [etherlab-users] Slave lost forever after power cycling



Thank you very much for your reply.



It seems like the position on the slave network doesn't matter. What matters i the alias addressing of this particular slave. When I don't give the TU4 slave any alias address I can power-cycle it without loosing it. But as soon as I've given it an alias address and power-cycle it is lost (not every time but almost).



What might cause this? It seems like the EEPROM/Sii of the slave overwritten at start-up when it has been given an alias address. Is there a way to prevent this? How does this work "under the hood"?

I use "sudo ethercat -p1 alias 2" for example to give the slave on position 1 the alias address 2. Nothing wrong here I presume since it seems to work for other slaves.



I've been in contact with the vendor of the TU4 module and they claim that this module is working in big volumes (thousands) on the market. All their other customers use TwinCAT and they haven't heard of this problem. I have also tried three different TU4 modules to exclude the possibility of one failing individual.



Examples:



1.All slaves have alias addresses => TU4-ECT lost after power-cycling.

$ sudo ethercat slaves

0  1:0  PREOP  +  AXL F BK EC, Axioline EtherCAT Fieldbus coupler

1  2:0  PREOP  +  TU4-ECT

2  3:0  PREOP  +  ifm IO-Link Master AL1930

3  4:0  PREOP  +  ifm IO-Link Master AL1332



Power-cycling...

$ sudo ethercat slaves

0  1:0  PREOP  +  AXL F BK EC, Axioline EtherCAT Fieldbus coupler

1  2:0  PREOP  +  ifm IO-Link Master AL1930

2  3:0  PREOP  +  ifm IO-Link Master AL1930

3  4:0  PREOP  +  ifm IO-Link Master AL1332



2. No slave has an alias address => No problem after power-cycling.

$ sudo ethercat slaves

0  0:0  PREOP  +  AXL F BK EC, Axioline EtherCAT Fieldbus coupler

1  0:1  PREOP  +  ifm IO-Link Master AL1930

2  0:2  PREOP  +  ifm IO-Link Master AL1332

3  0:3  PREOP  +  TU4-ECT



Power-cycling...

$ sudo ethercat slaves

0  0:0  PREOP  +  AXL F BK EC, Axioline EtherCAT Fieldbus coupler

1  0:1  PREOP  +  ifm IO-Link Master AL1930

2  0:2  PREOP  +  ifm IO-Link Master AL1332

3  0:3  PREOP  +  TU4-ECT



3. All slaves but the TU4 has alias addresses => No problem



$ sudo ethercat slaves

0  1:0  PREOP  +  AXL F BK EC, Axioline EtherCAT Fieldbus coupler

1  2:0  PREOP  +  ifm IO-Link Master AL1930

2  3:0  PREOP  +  ifm IO-Link Master AL1332

3  3:1  PREOP  +  TU4-ECT



Power-cycling...

$ sudo ethercat slaves

0  1:0  PREOP  +  AXL F BK EC, Axioline EtherCAT Fieldbus coupler

1  2:0  PREOP  +  ifm IO-Link Master AL1930

2  3:0  PREOP  +  ifm IO-Link Master AL1332

3  3:1  PREOP  +  TU4-ECT





Best regards,



Joachim Sällvin



________________________________

Från: Gavin Lambert <gavin.lambert at tomra.com<mailto:gavin.lambert at tomra.com>>
Skickat: den 16 februari 2020 23:58
Till: Joachim Sällvin <joachim.sallvin at corpowerocean.com<mailto:joachim.sallvin at corpowerocean.com>>; etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org> <etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>>
Ämne: RE: Slave lost forever after power cycling



Have you tried putting it in different positions on the slave network?  Perhaps it only vanishes when downstream of a particular slave; then the problem might be with that slave's configuration.



Etherlab typically assumes that all slaves are configured with DL auto-open mode (so that slaves that are connected or rebooted are automatically brought into the virtual ring network), but it's possible that one of your upstream slaves has been configured in the explicit open mode instead.



Gavin Lambert
Senior Software Developer


[cid:image001.png at 01D5F3A0.66D88340]
[TOMRA]<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.compacsort.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828871381&sdata=Z5OTZ6wuSh62BRkCy4b%2BDaemW5FJUuclcSDwSrTeL24%3D&reserved=0>[Facebook]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.facebook.com%2FCompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828871381&sdata=2C3PsHsumk9zPRERP6QeAt4dHJgBsQNMQDNNinxFi7E%3D&reserved=0>[Linkedin]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fcompac-sorting-equipment%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828881375&sdata=dKCRCMe%2FX85S8VC9ed9%2F7GslHVOmiRoBXu%2Fuo0duT9U%3D&reserved=0>[Youtube]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fvimeo.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828881375&sdata=X7%2BK25olptXT%2B3G5FftkXXrePlkJAA1bvP%2Fw7hQn%2BjM%3D&reserved=0>[twitter]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Ftwitter.com%2Fcompacsort&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828891372&sdata=P7spjxnfBjlVllgrihwlBkFYxIEpRdOseylzJokqFr4%3D&reserved=0>[instagram]<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.instagram.com%2Fcompacsort%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828891372&sdata=oxz99rg6YRF5xqDilRlpnrhDWMjCdlHpr%2FHmKUVQaJQ%3D&reserved=0>

COMPAC SORTING EQUIPMENT LTD | 4 Henderson Pl | Onehunga | Auckland 1061 | New Zealand
Switchboard: +64 96 34 00 88 | tomra.com<https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.tomra.com%2F&data=02%7C01%7Cgavin.lambert%40tomra.com%7C932a5056e524439f3e9308d7b3dff73a%7C4308d118edd143008a37cfeba8ad5898%7C0%7C1%7C637175646828891372&sdata=EUarHvo%2B4mqVn9VIoeSBd8Zod%2B%2BghZUPDQ%2BgyoXZj4Y%3D&reserved=0>

The information contained in this communication and any attachment is confidential and may be legally privileged. It should only be read by the person(s) to whom it is addressed. If you have received this communication in error, please notify the sender and delete the communication.


From: Joachim Sällvin
Sent: Friday, 14 February 2020 22:34
To: etherlab-users at etherlab.org<mailto:etherlab-users at etherlab.org>
Subject: [etherlab-users] Slave lost forever after power cycling



Hi all,



I loose contact with my TU4-ECT (freq inverter from Nord Drive) slave after power-cycling it when there are other slaves on the bus. This happens intermittently. Only a EEPROM reset (I use TwinCAT for this ) can make it accessible again. When it is the only slave on the bus it seems as I can power-cycle and always access again.



Has anyone experienced the same problem? What might cause this? Workarounds?



Example:



Before power-cycling the TU4-ECT (all slaves have been given alias addresses):



$ sudo ethercat slaves

0  1:0  PREOP  +  EK1100 EtherCAT-Koppler (2A E-Bus)

1  2:0  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A

2  3:0  PREOP  +  ifm IO-Link Master AL1332

3  4:0  INIT   E  TU4-ECT



After power-cycling the TU4-ECT:



$ sudo ethercat slaves

0  1:0  PREOP  +  EK1100 EtherCAT-Koppler (2A E-Bus)

1  2:0  PREOP  +  EL2004 4K. Dig. Ausgang 24V, 0.5A

2  3:0  PREOP  +  ifm IO-Link Master AL1332

3  8:0  PREOP  +  ifm IO-Link Master AL1332



Lost!!!



I'm using Linux kernel 4.13.13-rt5, Ubuntu 18.04 and EtherCAT master 1.5.2.







Joachim Sällvin
















-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0003.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 11438 bytes
Desc: image001.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0028.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1629 bytes
Desc: image002.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0029.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1750 bytes
Desc: image003.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0030.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1855 bytes
Desc: image004.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0031.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1970 bytes
Desc: image005.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0032.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 20278 bytes
Desc: image006.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0033.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image007.png
Type: image/png
Size: 1506 bytes
Desc: image007.png
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0034.png>
-------------- next part --------------
An embedded message was scrubbed...
From: Graeme Foot <Graeme.Foot at touchcut.com>
Subject: Re: [etherlab-dev] Hot plugged modules failing to read DC register
Date: Fri, 18 Oct 2019 01:26:14 +0000
Size: 308831
URL: <http://lists.etherlab.org/pipermail/etherlab-users/attachments/20200305/8b8b75fb/attachment-0003.eml>


More information about the Etherlab-users mailing list