About Us Knowledge Base Community Forum Electronics Toolbox FAQ Shipping & Delivery

Community Forum

Share your projects and post your questions

Search
Register or Sign In
Forum

Conversion Timeout Error

574 Views - Created 26/06/2018

26/06/2018

Posted by:
Jochem

Users 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

Users Avatar

Location:
United Kingdom

Users Twitter  Users 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

AB Electronics UK Tech Support

04/07/2018

Posted by:
Jochem

Users 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

Users Avatar

Location:
United Kingdom

Users Twitter  Users 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 takes 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 along side the python script.

AB Electronics UK Tech Support

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.