-
Notifications
You must be signed in to change notification settings - Fork 219
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
unable to setup ADC #127
Comments
I agree. I add that for me, if I lauch it once connected by SSH, it is working. But if i lauch it by a service, it doesn't work. But when I launched it with a sleep 40 on the serivce, it worked. Need to find out the cause (I add also that once it worked, the UART started to bug saying typeError in the serialposix) |
@ManMan88 Please paste the contents of Adafruit_BBIO expects cape-universal to be in use for Linux 4.1+ kernels. Also, I noticed that you are using Ubuntu. Where did the image you are using come from? I only test Adafruit_BBIO with the official BeagleBoard.org Debian images created by @RobertCNelson: The kernels are built using this repo: |
@LudovicGuerra It sounds like you are describing a different problem. Please open up a new issue for it. |
@pdp7 I used the image from this link: https://rcn-ee.com/rootfs/2016-11-10/flasher/BBB-eMMC-flasher-ubuntu-16.04.1-console-armhf-2016-11-10-2gb.img.xz The contents of
And the contents of
|
@ManMan88 I've tried to keep the ubuntu target as close to the debian target for overlays, so this should still work on ubuntu.. (Sadly, other then booting, i really don't test ubuntu) What is shown by:
after this occured:
Regards, |
@ManMan88 I believe the issue is that cape-universal overlay isn't loaded. You can try to load with:
You should then see:
If that fails, then please install the latest Device Tree overlays from: Also, if you don't explicity need Ubuntu, then I'd recommend switching to one of the official BeagleBoard.org Debian images |
@RobertCNelson, this is the output to what you asked me to do:
@pdp7 , your first suggestion worked :) thanks! I very appreciate the fast help! |
@pdp7 just ran into this today, both the elinux.org images ubuntu/debian, lack "cape_universal=enable" option in /boot/uEnv.txt /boot/uEnv.txt: (current)
/boot/uEnv.txt: (needed)
with that change, things should work out of the box. .;) Background, at some point a while back i make cape_universal a run time option in my generation script, the elinux images didn't get that memo.. Regards, |
@ManMan88 Is this issue resolved? |
Yes, it is resolved. Thanks. I have another issue with PWM that might be similar to this problem. However, I'll post a new issue on it. |
I have same problem when calling from crontab. This code works from terminal but gives these results when calling from crontab.
Here is my crontab code
On my Beaglebone Black device, I want to run a python code at startup which is shared here https://github.com/acseckin/hmrid. The pyhton code requires super user privilages. The debian version I used on the device was installed with the image "Debian 8.7 2017-03-19 4GB SD IOT". The code works fine from the terminal like.
debian users and roots crontab does not work when I append the following line.
But other code that does not require a super user is working perfectly when I add a crontab for a debian user like
|
@acseckin I've been able to replicate this problem and am investigating. |
I'm still investigating but I noticed that issue seems to be
I am thinking the library may need to have a delay added to wait for |
I think the uEnv.txt configurations begin little bit after from crontab. How can we wait for enough time? |
@acseckin I added a delay of 1 second after loading the ADC overlay and that seems to have resolved the issue. The script does now run OK at bootup. Here is what I changed:
For now, I've created a branch I'm looking at if this delay should be moved to the |
Here is my new message after
init.py** code |
@acseckin Could you paste the output of Please run |
@acseckin Please run this to upgrade to the latest 4.9 kernel build by @RobertCNelson: This is the ADC fix that I referenced above: |
I've just tried
|
Same results for my settings. |
@acseckin I've found that delay of 30 seconds resolves the issue. Add --- init.py.orig 2017-07-01 05:37:39.696002694 +0000
+++ init.py 2017-07-01 10:15:37.641031199 +0000
@@ -62,7 +62,15 @@
#print self.rxoff,self.ryoff
def setupPins(self):
self.log2file("ADC")
+
+ print("setupPins: sleep")
+ time.sleep(30)
+ print("setupPins: call ADC.setup()")
ADC.setup()
+ print("setupPins: ADC.setup() complete")
+ os.system("cat /sys/devices/platform/bone_capemgr/slots")
+ os.system("cat /sys/bus/iio/devices/iio:device0/in_voltage1_raw")
+
self.log2file("digital pins")
GPIO.setup("P9_11", GPIO.IN)
GPIO.setup("P8_17", GPIO.IN)
@@ -93,7 +101,7 @@
for i in [5,4,3,2,1,0]:
self.lcddisp("Reboot:"+str(i))
time.sleep(1)
- os.system("sudo reboot")
+ #os.system("sudo reboot")
elif GPIO.input("P8_17")|GPIO.input("P8_15")|GPIO.input("P8_11")|GPIO.input("P8_9"):
break
elif GPIO.input("P8_17"):
cronlog.out
root crontab:
|
Thank you a lot. Now it is working. Here are steps as a summary: |
@acseckin great to hear! OK to close this issue? |
Yes you can close. |
Hi, adding this line to uEnv.txt also works cape_enable=bone_capemgr.enable_partno=BB-UART2,BB-ADC |
Platform/operating system: BeagleBoneBlack with Ubuntu 16.04.1 LTS (GNU/Linux 4.4.34-ti-r69 armv7l)
Python version : Python 2.7.12
Error message:
installing:
in python:
The text was updated successfully, but these errors were encountered: