EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
<== Date ==> <== Thread ==>

Subject: RE: mcaAIM and nmcDemo not finding AIM 556 on new linux install
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: Hank Ball <hank at wv7u.com>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 20 Mar 2024 12:41:02 +0000

Folks,

 

Hank and I worked on this issue offline, and I have fixed it.

 

The problem was that the behavior of specifying 0 for the packet buffer delay in pcap has changed on recent versions of pcap on Linux.  It now causes pcap to wait until enough packets arrive to fill the buffer, which prevents the AIM search logic from working.

 

This is the change I made:

 

diff --git a/mcaApp/CanberraSrc/nmc_comm_subs_1.c b/mcaApp/CanberraSrc/nmc_comm_subs_1.c

index dfbe6da..18f8605 100644

--- a/mcaApp/CanberraSrc/nmc_comm_subs_1.c

+++ b/mcaApp/CanberraSrc/nmc_comm_subs_1.c

@@ -114,11 +114,12 @@

#endif

 

/* PCAP timeout in ms */

-/* On Windows we can use -1, but on Linux that leads to 100% CPU utilization */

+/* On Windows we can use -1 to receive packets immediately, but on Linux that is not valid.

+   On Linux we use 10 ms for the packet_bufffer_delay. */

#if defined(_WIN32)

   #define PCAP_TIMEOUT -1

#else

-  #define PCAP_TIMEOUT 0

+  #define PCAP_TIMEOUT 10

#endif

 

This is the git commit message:

 

commit c238622b8bbce11f242a392eb13ae727e6374a7a

Author: Mark Rivers rivers at cars.uchicago.edu

Date:   Wed Mar 20 07:15:20 2024 -0500

 

    Fix problem on Linux.

    Packet buffer timeout was set to 0 (ms).

    On recent versions of pcap on Linux that causes packets not to

    be delivered until the buffer is full, which is very long delay

    when searching for AIMS.

    Change to 10 ms.

 

I have pushed the fix to the master branch on  Github.

 

Mark

 

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Hank Ball via Tech-talk
Sent: Friday, March 15, 2024 10:42 AM
To: tech-talk at aps.anl.gov
Subject: Re: mcaAIM and nmcDemo not finding AIM 556 on new linux install

 

Hi Andrew,

I don't have any iptables or firewall rules on any of these computers. I can reach other computers, webistes, etc, just fine over the network.

I can control an Amptek DP5 mcaAmptekApp over the network on the Debian 12 computer. I can also run an IOC/mca on the Debian 9 computer which connects to the AIM 556, and retrieve the data from that via medm, caget, etc, running on the Debian 12 computer.

So it seems the ethernet interface is working, but I may have done something wrong when building one of the EPICS components, or I'm missing a library or something. But I'm not sure where to look since all the EPICS modules built without errors.

Thanks

Hank

On 3/15/24 08:55, Johnson, Andrew N. wrote:

Hi Hank,

 

I'm not a Debian or mcaAIM user, but I'm just checking the obvious: Have you found out whether Debian 12 sets up a firewall by default, and if so configured that to allow communication over whatever network ports you need for these devices? It looks like you might not be getting any response over the network at all, and a firewall is the first thing I would look at in that case.

 

- Andrew

 

 

On 3/14/24, 10:31 PM, "Tech-talk" <tech-talk-bounces at aps.anl.gov> wrote:

 

I've been working on building EPICS on a Debian 12 system with the
latest releases of mca (7-10) and base (7.0.8).

I'm hoping someone can help me please with mca ethernet connection
problem I'm having.

When I try to connect to a Canberra AIM 556 with nmcDemo I get this
response:

root@debian:/home/hank/epics# nmcDemo enp2s0 0x205
Using AIM-Module 205
Calling nmc_initialize ...
(nmc_initialize): waiting returned 1
Calling nmc_build_enet_addr ...
Calling nmc_findmod_by_addr ...

I get a similar result when using mcaAIM:

......
AIMConfig("AIM1/1", 0x205, 2, 512, 1, 1, "enp2s0")
(nmc_initialize): waiting returned 1
AIMConfig ERROR: cannot find module on the network!
.......

It may be helpful to add that mcaAmptekApp does work correctly and
communicates fine with an Amptek DP5.

As evidence that the AIM 556 is working, I have an older system running
Debian 9 and built with base-3.14.12.4 and mcaR7-6 that has no problems
with either nmcDemo or mcaAIM.  (This computer has a different ethernet
interface name, enp3s0 vs enp2s0.)

root@lab1:/home/hank/epics# nmcDemo enp3s0 0x205
Using AIM-Module 205
Calling nmc_initialize ...
Calling nmc_build_enet_addr ...
Calling nmc_findmod_by_addr ...
Calling nmc_buymodule ...
Calling nmc_show_modules ...
Module     Type  HW rev.  FW rev.  Owner name      Owner ID Status     
Memory size Free address
NI00801c    1       2        7                 00:00:00:00:00:00
Reachable     262140      00000000
NI000205    1       0        6       lab1      90:2B:34:13:12:C0
Reachable     261116      00000000
Calling nmc_addeventsem ...
Calling nmc_acqu_setup ...
Calling nmc_acqu_setstate(0) ...
Calling nmc_acqu_erase ...
Calling nmc_acqu_setelapsed ...
Calling nmc_setstate(1) ...
Waiting for event flag or timeout.  Should complete in 10 seconds.
Calling nmc_statusupdate ...
Calling nmc_acqu_getmemory_cmp ...
Time for nmc_acqu_getmemory_cmp = 0.071970
Calling nmc_acqu_getmemory ...
Time for nmc_acqu_getmemory = 0.191984
Total counts were 0; Real time = 10.00, Live time=9.99
Calling nmc_freemodule ...
Calling nmc_show_modules ...
Module     Type  HW rev.  FW rev.  Owner name      Owner ID Status     
Memory size Free address
NI00801c    1       2        7                 00:00:00:00:00:00
Reachable     262140      00000000
NI000205    1       0        6                 00:00:00:00:00:00
Reachable     261116      00000000

Thanks for any suggestions,

Hank



References:
mcaAIM and nmcDemo not finding AIM 556 on new linux install Hank Ball via Tech-talk
Re: mcaAIM and nmcDemo not finding AIM 556 on new linux install Johnson, Andrew N. via Tech-talk
Re: mcaAIM and nmcDemo not finding AIM 556 on new linux install Hank Ball via Tech-talk

Navigate by Date:
Prev: Control device via epics-snmp White via Tech-talk
Next: Re: Control device via epics-snmp Priller, John via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
Navigate by Thread:
Prev: Re: mcaAIM and nmcDemo not finding AIM 556 on new linux install Mark Rivers via Tech-talk
Next: [no subject] saleem khan via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  <2024
ANJ, 20 Mar 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·