Adafruit_BBIO.ADC, ADC.read_raw()

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
kag634
 
Posts: 4
Joined: Wed Jun 19, 2019 2:01 pm

Adafruit_BBIO.ADC, ADC.read_raw()

Post by kag634 »

Hi all,

I have been working on the Adafruit_BBIO.ADC library for reading high frequency vibrational data from a sensor. This requires a sampling rate of about 3kHz, and hence, the ADC.read() function is being called several thousand times a second to store this data. However, after a random amount of time, the program gets "stuck" on ADC.read_raw(). There is no value displayed on print, and the data also fails to be recorded. Even the KeyboardInterrupt (ctrl + c) doesn't succeed in terminating the operation. The program only ceases once the process has been terminated by closing the window or resetting the connection with the beagle bone. (or by logging into a different ssh session and re-running the program).

Is there any bug in the library as the webpage claims? https://learn.adafruit.com/setting-up-i ... io-library

What can be done to address this issue? is there any way to use a timeout function for the read/read_raw() methods, so that after a specific time it can be re-started when it is stuck. Do timeout functions like https://stackoverflow.com/questions/228 ... -to-finish work in resolving such issues? Since it happens after a random amount of time, it is very difficult to recreate the scenario.

What causes the program to be stuck? Is it because of the high sampling rate or because of the ADC library issues? What can be the alternatives?

I am running it on a BeagleBone Black which is running on Ubuntu Xenial. (16.04.5 LTS (Xenial Xerus))

Code: Select all

import Adafruit_BBIO.ADC as ADC
ADC.setup() 
val = ADC.read_raw() # called several thousand times/ second

User avatar
silver2row
 
Posts: 180
Joined: Sat Jan 30, 2016 3:42 pm

Re: Adafruit_BBIO.ADC, ADC.read_raw()

Post by silver2row »

Hello,

What is the entire source? https://adafruit-beaglebone-io-python.r ... t/ADC.html is what I found. I can try to recreate the issue while reading a value and printing to file if necessary.

Seth

P.S. What kernel are you using?

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”