-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
device.open() => self.send_packet_sync_and_get_response(packet_to_send) # raises TimeoutException #7
Comments
Shouldn't this have also fixed
|
Hello pdtwonotes, In order to help you try to find this problem you are seeing, we would need to know more information about your setup:
Regards. |
These are all ZigBee devices in API2 mode, firmware 405F, but I think I found the problem. XCTU works fine. Doing some testing, I found that the timeouts happened only some of the time. This made me think that it is just an unreliable form of communication and that all I need to do is retry it. So I put a loop around each synchronous |
I am using this library and sending packets in asynchronous mode and am getting the following error at random times. It repeats many time and then goes back to operating as it should. Traceback (most recent call last): I thought I had installed the "fix" mentioned here, but maybe not. My XBee's are using API mode 2 and have been rock solid until now. How exactly does one install the fix? Maybe I did something wrong and only thought I fixed it. Maybe this has nothing to do with it. I don't know. The program does what it's supposed to, I just get a log full of errors.... |
Hi @MYeager1967, The fix we mentioned in this issue is included in the latest release, 1.1.1 (https://github.com/digidotcom/python-xbee/releases/tag/1.1.1). If you installed the library through pip, make sure that you have the latest version: Regards. |
I only installed it about a week ago. Just did the upgrade but it looks as though I was already running 1.1.1. 😊
From: Rubén Moral
Sent: Monday, May 28, 2018 3:34 AM
To: digidotcom/python-xbee
Cc: MYeager1967; Mention
Subject: Re: [digidotcom/python-xbee] device.open() =>self.send_packet_sync_and_get_response(packet_to_send) # raisesTimeoutException (#7)
Hi @MYeager1967,
The fix we mentioned in this issue is included in the latest release, 1.1.1 (https://github.com/digidotcom/python-xbee/releases/tag/1.1.1). If you installed the library through pip, make sure that you have the latest version: pip install digi-xbee --upgrade.
Regards.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Well, even after the fix was applied per directions, I have the issue still. Anything I can provide to help figure out what the issue is? I’m running asynchronous so I don’t believe I should have this issue. I tried to catch the exception but I’m having no luck there either.
From: Rubén Moral
Sent: Monday, May 28, 2018 3:34 AM
To: digidotcom/python-xbee
Cc: MYeager1967; Mention
Subject: Re: [digidotcom/python-xbee] device.open() =>self.send_packet_sync_and_get_response(packet_to_send) # raisesTimeoutException (#7)
Hi @MYeager1967,
The fix we mentioned in this issue is included in the latest release, 1.1.1 (https://github.com/digidotcom/python-xbee/releases/tag/1.1.1). If you installed the library through pip, make sure that you have the latest version: pip install digi-xbee --upgrade.
Regards.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Alright @MYeager1967, then we need more information in order to investigate the issue in depth.
Thanks. |
Well, I can’t pull the network down at the moment to provide the hardware and firmware versions, but the rest of the questions I can try to answer.
There are 5 of these little buggers running at the moment. One coordinator and 4 others running as routers. I don’t run any as endpoints. The code is as follows:
def sendPacket(where, what): # I'm only going to send the absolute minimum.
try:
xbee_network = device.get_network()
remote_device = xbee_network.discover_device(where)
if remote_device is not None:
device.send_data_async(remote_device, what)
time.sleep(0.25) # Keep multiple packets from choking devices
else:
print("X", end=' ')
except TimeoutException:
print("E", end=' ')
but it doesn’t actually fail from what I can see. The script doesn’t crash or exit, it keeps right on plugging along. I never get the ‘E’ so I’m either not doing the catch right or something else is wrong. As I said before, this thing will go for hours without throwing a single error. I’m going to try again to hard code the addresses, which is what I had before with a previous library under Python 2. My first attempt didn’t go so well and I needed this back up, so I used what worked. I took this straight from the example code for async…
From: Rubén Moral
Sent: Tuesday, May 29, 2018 3:04 AM
To: digidotcom/python-xbee
Cc: MYeager1967; Mention
Subject: Re: [digidotcom/python-xbee] device.open() =>self.send_packet_sync_and_get_response(packet_to_send) # raisesTimeoutException (#7)
Alright @MYeager1967, then we need more information in order to investigate the issue in depth.
• What type of modules do you have (hardware version, firmware version)?
• How many do you have in the network?
• Could you please send us the code snippet that is failing?
Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi @MYeager1967, After taking a look at the code and exception you get, I realized that that exception is produced because the library cannot read the network discovery timeout (NT parameter), which is used to know the maximum time the library should be trying to discover that specific remote device (in If that time cannot be read, as in your case, a default timeout of 20 seconds is used and the Regards. |
Hi @rubenmoral I do have the same problem however in my case :
this exception is shooted upon execution of IO sampling for like 4-20 times(it varies almost all the time) I did increase NT value the result remains the same. Post printing of this exception the program seems to be stuck and doesnt execute or close. If you say NT cannot be read by the timeout exception then there should be manual way of entering the time out period am I right here ? If not how can I solve this? My code goes like this:
|
Rubenmoral, is there any way I can hide that warning? Better would be to do away with it altogether by increasing the timeout but it makes a log EXTREMELY large. Had to go back to the Python 2 version of this program as I can't be eating up that much space with a log. Sorry it's taken me so long to get back to this, work has been hectic... Thanks!!! |
Ok, I'm now available to dig into this as far as I need to. What can be done to correct this? I've had no luck going back to the Python 2 method of using the hard coded device addresses. The current code polls the network for the address and then uses it. I can print the address and see it, but I haven't had a lot of luck with reproducing the results. I'm assuming that the timeout is during the lookup of the address, so this would be the easiest way to eliminate that. The NT variable is set on the devices, so I'm at a loss there... |
Hi @Hitheshkaranth, Sorry for the late response. The exception you are getting might be caused by a known issue when obtaining IO samples very frequently. Could you please verify that the Also, as a suggestion, I would change the
Here is why:
Regards. |
Hi @MYeager1967, Sorry for the late response. The Python's
You can find more information at https://docs.python.org/3/library/logging.html#logging.disable. Regards. |
No problem on the time issue @rubenmoral . This will reduce the log size and allow me to see if it's actually interfering with the function of the script itself. Moving things into a virtual environment has bee a challenge. Do you know if it's possible to run the graphical python (IDLE) in the virtual environment??? |
@MYeager1967 I'm not very familiar with IDLE, but I think what you want is possible by running Regards. |
Hello,
I'm not sure if it is the good place to post my problem..
I try to use this library with a xbee S2C 2.4ghz digimesh, plugged on a sparkfun usb explorer.
Xbee configured on API2 with XCTU.
I try to make the delivered example of receive data. So I write the python script and run it.
But when it enter in device.open() I have this error :
File "C:\Program Files (x86)\Python36-32\lib\site-packages\digi_xbee-1.0.0-py3.6.egg\digi\xbee\devices.py", line 1290, in open
self.read_device_info()
File "C:\Program Files (x86)\Python36-32\lib\site-packages\digi_xbee-1.0.0-py3.6.egg\digi\xbee\devices.py", line 309, in read_device_info
self._hardware_version = HardwareVersion.get(self.get_parameter("HV")[0])
File "C:\Program Files (x86)\Python36-32\lib\site-packages\digi_xbee-1.0.0-py3.6.egg\digi\xbee\devices.py", line 1028, in dec_function
return func(self, *args, **kwargs)
File "C:\Program Files (x86)\Python36-32\lib\site-packages\digi_xbee-1.0.0-py3.6.egg\digi\xbee\devices.py", line 1336, in get_parameter
response = self.send_packet_sync_and_get_response(packet_to_send) # raises TimeoutException
File "C:\Program Files (x86)\Python36-32\lib\site-packages\digi_xbee-1.0.0-py3.6.egg\digi\xbee\devices.py", line 2450, in send_packet_sync_and_get_response
raise TimeoutException("Response not received in the configured timeout.")
digi.xbee.exception.TimeoutException
I have same error on Windows7 or on Raspbian. I try different settings of Baud_rate but same error.
Could anyone help me to understand if I make a configuration error ?
Thank you
The text was updated successfully, but these errors were encountered: