Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Conversion Timeout Error

2031 Views - Created 26/06/2018

26/06/2018

Posted by:
Jochem

Jochem Avatar

Hi ABElectronics,

I've used your ADCPi boards (ADC PI Plus) for a few projects (raspberry pi 2 & 3) and and I like them. However, in two of my recent uses I've been getting the error:

'TimeoutError: read_raw: channel xx conversion timed out' (where xx is any of the channels)

The error can be thrown after running for a few seconds or after a few hours. It also happens when I run your 'demo_readvoltage.py' code.

Any suggestions?

Rgds,

Jochem

26/06/2018

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

Hello Jochem

I have updated the ADC Pi library to increase the timeout period. Hopefully, this should stop your code from timing out when reading from the ADC. Please can you try downloading the new version from GitHub and see if this fixes the problem?

https://github.com/abelectronicsuk/ABElectronics_Python_Libraries/tree/master/ADCPi

04/07/2018

Posted by:
Jochem

Jochem Avatar

Thanks Andrew,

I'd fiddled with this in your library and it does work. Thanks for updating the library. Out of interest - how have you arrived at the 4/15, 1/15. 1/60, 1/240 times for bit rates of 18, 16, 14, 12?

Kind regards,

Jochem

05/07/2018

Posted by:
andrew

andrew Avatar

Location:
United Kingdom

andrew Twitter  andrew Website  

The different time values would be the sample time needed for a single sample of the ADC at each bit rate. So for example at 12 bits the ADC can take 240 samples per second so 1 second is divided by 240 to get the time needed for a single sample.

I expect what was happening is a process on the Raspberry Pi was holding up the CPU for slightly longer than the ADC library was allowing for a timeout period which caused it to throw an exception. By increasing the timeout period from 5x the single sample time to 10x it is allowing enough time for Linux to carry out any processes that are being run alongside the python script.

Sign in to post your reply

Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view, download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.