Hi,
Whithin one of the ERAS projects we are trying to make use of the events in PyTango.
We are doing something rather simple as having a tango server generating events then in a python script we do something like:
device = PyTango.DeviceProxy(args.tango_server)
try:
event_id = device.subscribe_event(
'writablecmd', PyTango.EventType.CHANGE_EVENT, event_callback,
filters=[], stateless=True
)
def event_callback(event):
"""Callback function used to receive Tango events."""
if event.errors:
print(event.errors)
return
try:
msg = event.attr_value.value
............
When we run this python script on the same machine were the tango server is running then everythin is perfectly fine and run as expected.
If we instead run the script on a remote machine (were we set accordingly the TANGO_HOST) then, when we generate an sigle event like this:
dev.writablecmd = 'MOVE Cube -5 -5 -5'
we get those kind of errors:
received MOVE Cube -5 -5 -5
(DevError(desc = 'Event channel is not responding anymore, maybe the server or event system is down', origin = 'EventConsumer::KeepAliveThread()', reason = 'API_EventTimeout', severity = PyTango._PyTango.ErrSeverity.ERR),)
received MOVE Cube -5 -5 -5
(DevError(desc = 'Event channel is not responding anymore, maybe the server or event system is down', origin = 'EventConsumer::KeepAliveThread()', reason = 'API_EventTimeout', severity = PyTango._PyTango.ErrSeverity.ERR),)
received MOVE Cube -5 -5 -5
So what is happening is that the event triggered only once is then periodically received every 10 sec (which seems corresponding to the keep alive thread).
If we run the same script at the same time on the local machine then everything is fine.
Changing from stateless: True <-> False does not change much this behaviour.
Below some more tracing obtained via printing the whole event.
Thanks a lot for your help
Regards
Franco
EventData[
attr_name = 'tango://10.202.104.51:10000/c3/testtango/testtango/writablecmd'
attr_value = None
device = PyTestTango(c3/testtango/testtango)
err = True
errors = (DevError(desc = 'Event channel is not responding anymore, maybe the server or event system is down', origin = 'EventConsumer::KeepAliveThread()', reason = 'API_EventTimeout', severity = PyTango._PyTango.ErrSeverity.ERR),)
event = 'change'
reception_date = TimeVal(tv_nsec = 0, tv_sec = 1412364160, tv_usec = 839816)]
EventData[
attr_name = 'tango://10.202.104.51:10000/c3/testtango/testtango/writablecmd'
attr_value = DeviceAttribute(data_format = PyTango._PyTango.AttrDataFormat.SCALAR, dim_x = 1, dim_y = 0, has_failed = False, is_empty = False, name = 'writablecmd', nb_read = 1, nb_written = 1, quality = PyTango._PyTango.AttrQuality.ATTR_VALID, r_dimension = AttributeDimension(dim_x = 1, dim_y = 0), time = TimeVal(tv_nsec = 0, tv_sec = 1412364160, tv_usec = 889623), type = PyTango._PyTango.CmdArgType.DevString, value = 'MOVE Cube 0 0 0', w_dim_x = 1, w_dim_y = 0, w_dimension = AttributeDimension(dim_x = 1, dim_y = 0), w_value = 'MOVE Cube 0 0 0')
device = PyTestTango(c3/testtango/testtango)
err = False
errors = ()
event = 'change'
reception_date = TimeVal(tv_nsec = 0, tv_sec = 1412364160, tv_usec = 847228)]
It sounds like you are not getting events across the network. What version of PyTango are you running? With which patches? How many network interfaces are there on your hosts?
We do are getting the events over the network, even too many! as a said, a single event on the tango server side, trigger an infinite loop of events with 10 sec periodicity.
We are running on both machines:
Ubuntu 14.04 were we replace ZeroMQ 4 (the default on Ubuntu 14.04) with ZeroMQ 3 via dpkg (othervise events do not work at all, not event on the same machine)
PyTango.version
'8.1.1'
on python3 and installed via plain: "apt-get install python3-pytango"
we only apply the attached patch (that should have nothing to do with this behaviour)
In our host we have only one interface active at the time. We tried using only wifi on both machines or using only wired connection to a router. Behaviour is exactly the same.
I should add that all the rest is running fine, in the sense that if I run jive I can see correctly the database on the remote machine and I can launch indifferently tango servers in the local (TANGO_HOST) or remote machine without problems
The problem occur in a completely simmetric way, in the sense that if I swap the local (TANGO_HOST) and the remote machine the behaviour is exactly the same.
On 04/10/2014 08:24, IMS ERAS wrote:
Hi Franco,
I see. It sounds like a bug to me. If you send only one event (did you
send it using a push event call?) then you should not receive anymore
until you push a new event. The 10 second periodicity comes from the
keep_alive thread. It should just check that the server is still alive
and throw an exception/error if not. If the server is alive it should
remain silent. It should not send an event. Strangely I heard of a
similar problem yesterday from someone else running the same version of
Tango. I wonder if this is not a bug. I let the experts comment on this.
If I have time I will try to reproduce your problem. It must be
reproducible if I install the same versions as you.
Regards
Andy
Hi Franco,
I confirm your bug. I can reproduce it with python 2.7 and python3. I don't know where the problem lies but I hope the experts can give us the answer tomorrow.
Regards
Andy
Hi Andy,
Thanks for your prompt support.
Looking forward to get some good news about a possible quick fix.
We are putting together an immersive Mars exploration virtual simulation
and planning soon our first virtual mission (see here: V-ERAS-14 Call
for Volunteers
http://www.erasproject.org/index.php?option=com_content&view=article&id=15&Itemid=150)
All is tango based and the multiplayer support is supposed to be built
on top of tango events (so we need it working asap......)
Thanks!
Regards
Franco
PS:
As soon as we will be out of this ectic phase we will share with the
tango community all the things we are doing
On 05/10/2014 17:47, Andy Gotz wrote:
--
Franco Carbognani
Science and Technology Coordinator
Italian Mars Society
E-mail: franco.carbognani@marssociety.it
Tel: +39 050 936038
Cell: +39 3669826503
Related
Bugs:
#689Franco,
this sounds exciting, we will do our best to fix this.
I think the problem is related to the libzmq v4 not being compatible
with v3 but Ubuntu does not made a difference between the two. This
issue has been raised on the mailing list before. I will try to find the
solution and send it to you.
I am compiling the code from source with zmq v3 but this is more work
and I prefer to find a solution for you which does not involve this if
possible.
In fact I don't think any events are going over the network. The ones
you see are the result of a synchronous call when subscribing for the
first time and after every error.
Regards
Andy
On 05/10/2014 19:56, IMS ERAS wrote:
Franco,
what is strange is that to this email on the mailing list:
http://www.esrf.eu/mail_archives/tango/archive/msg07056.html
this problem should be fixed in the libtango8-8.1.2c+dfsg-3ubuntu0.1
which is the one in the Ubuntu repository.
Strange. Maybe there is a mix up in the repository or a new problem. We
will keep you informed.
Andy
Dear Franco,
I have checked with the experts here and it appears the bug mentioned in the email above is not the same. In that bug listed in the email the subscribe_event hung. In y/our case the event does not arrive on a remote host. At present we cannot reproduce it here at the ESRF using the latest patched libraries on Debian. We do not have Ubuntu 14.10 available here. I will continue debugging this evening. In the meantime can you try the following:
In the shell window where you start the server, define environment variables:
ORBtraceLevel=40
ORBtraceFile=file
ORBtraceTime=1
In the shell window where you start the client, define the same variables but specify a different trace file.
Start the server, then start the client, send and receive an event and wait for one minute before killing the server
In the file, you should see the server receiving a ZmqEventSubscriptionChange command
Interesting things should start at that point in file
It will help us debug the problem.
Regards
Andy + Manu
Last edit: Andy Gotz 2014-10-06
Dear Andy,
Please find attached the log files created as you suggested. Server and
Client are running on two separate machines.
I can see the traced the ZmqEventSubscriptionChange
http://sourceforge.net
Hope this help
Regards
Franco
On 06/10/2014 14:56, Andy Gotz wrote:
--
Franco Carbognani
Science and Technology Coordinator
Italian Mars Society
E-mail: franco.carbognani@marssociety.it
Tel: +39 050 936038
Cell: +39 3669826503
Related
Bugs:
#689Dear Franco,
the log files are not attached. Can you send them seprately please.
Have you followed the thread since Monday? I have solved my problem by
changing the /etc/hosts file on the client host. Can you send me your
hosts file so I can see if we spot an error. The version of Tango in
Ubuntu 14.04 is working for me since I changed the hosts file.
Regards
Andy
On 07/10/2014 22:43, IMS ERAS wrote:
Hi Franco,
can you try to specify the network interface to use to the device server
using the ORBendPoint parameter when starting the device server like this:
YourServer name -ORBendPoint giop:tcp:<ip_address>:</ip_address>
Where ip_address is the network on which you will communicate with the
client. I presume this is the wlan address e.g. 10.202.104.50 in the
example log file you sent.
Replace YourServer and name with your device server values.
Andy
On 07/10/2014 22:42, Franco Carbognani wrote:
Related
Bugs:
#689Franco,
I had a look at your log files. It seems to me that something is wrong in event names.
The device server process send the heartbeat event "tango://v-eras-0:10000/dserver/xxxx" while the client is waiting for "tango://10.202.104.50:10000/dserver/xxxx"
What are the values of your TANGO_HOST env. variables on both the client and server sides?
Good luck
Emmanuel
Dear Emmanuel,
I have set on the local machine:
TANGO_HOST v-eras-0:10000 (were v-eras-0 is the name of the local machine)
on the remote machine I have set:
TANGO_HOST 10.202.104.50:10000
were that address correspond to the v-eras-0 machine IP address.(I have not DNS available)
With this setting the rest of tango functionalities, like the exploration of the v-eras-0 database from the remote machine via jive is working fine.
This evening I will try to set on both machines the use of explicit IP address (that may imagine is your implicit suggestion)
Regards
Franco
From: "Emmanuel Taurel" taurel@users.sf.net
To: "[tango-cs:bugs] " 689@bugs.tango-cs.p.re.sf.net
Cc:
Date: Wed, 08 Oct 2014 09:15:31 +0000
Subject: [tango-cs:bugs] #689 Problems while getting events on a remote machine
Franco Carbognani
Science and Technology Coordinator
Italian Mars Society
E-mail: franco.carbognani@marssociety.it
Tel: +39 050 936038
Related
Bugs:
#689Hi everybody,
I have set my two machines so that
on the local machine:
TANGO_HOST 192.168.1.100:10000 (address of the local machine)
on the remote machine:
TANGO_HOST 192.168.1.100:10000 (same IP address)
And now everything is running fine, I can se the events received correctly in both machines and our Blender simulations move sincronously the test cube around.
So we can proceed now further in our tests
Thanks a lot for your support, this ticket can be closed
Dear Franco,
great news that problem is solved by specifying TANGO_HOST with the same syntax on client and server.
For your information the reason for this behavior is the fully qualified name (i.e. including the TANGO_HOST) is used as an identifier for the zmq events. If the TANGO_HOST's are specified differently the events will be filtered out by zmq and not be sent to the client due to the different names.
We are discussing how to change this behaviour for example by converting all TANGO_HOST names to ip addresses. This is a larger change because the event name is used in different places so we cannot promise anything soon. In the meantime the solution is to ensure TANGO_HOST has the same all over. You could use /etc/hosts to resolve ip names if you prefer them to ip addresses and don't have DNS.
Thanks for the bug report it will help other people to avoid this problem in the future.
Andy
According to reporter the ticket can be closed.
I move the Category to miscellaneous since it is not PyTango specific.