Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

Dotstar python library on BBB
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Dotstar python library on BBB

by mrburns42 on Tue Oct 04, 2016 12:27 pm

Ok, major red herring. The "pip search spidev" Is searching the entire Internet repositories and not my BBB! So much for advice from that PI forum. I went back to a week-old SDCard image. I removed the Adafruit-BBIO since it was old. I removed all the python stuff. Then I reinstalled the python stuff and reinstalled the Adafruit-BBIO. The operation is the same. I then used pip to install spidev(3.2) . The operation is still the same. Below is the list of stuff that pip knows about.
Code: Select all | TOGGLE FULL SIZE
root@beaglebone:~# pip list
Adafruit-BBIO (1.0.0)
astroid (1.2.1)
blinker (1.3)
bmap-tools (3.2)
cffi (0.8.6)
chardet (2.3.0)
colorama (0.3.2)
cryptography (0.6.1)
Flask (0.10.1)
html5lib (0.999)
itsdangerous (0.24)
iw-parse (0.0.2)
Jinja2 (2.7.3)
logilab-common (0.62.0)
MarkupSafe (0.23)
ndg-httpsclient (0.3.2)
numpy (1.8.2)
pip (8.1.2)
ply (3.4)
pyasn1 (0.1.7)
PyBBIO (0.10)
pycparser (2.10)
Pygments (2.0.1)
pygobject (3.14.0)
pygpgme (0.3)
pyinotify (0.9.4)
pylint (1.3.1)
pyOpenSSL (0.14)
pyserial (3.0.1)
requests (2.10.0)
serbus (1.0.4)
setuptools (5.5.1)
six (1.8.0)
smbus (1.1)
spidev (3.2)
urllib3 (1.9.1)
Werkzeug (0.9.6)
wheel (0.24.0)


I guess I will get the image from beaglebone.org again to build a completely clean SD Card. If that cannot access SPI, then I may have to revert to just bit-banging everything.
mrburns42
 
Posts: 20
Joined: Tue Jan 01, 2013 11:31 pm

Re: Dotstar python library on BBB

by mrburns42 on Tue Oct 04, 2016 1:37 pm

OK, burnt the image from the .org to a SD Card and expanded it. I removed the Adafruit_BBIO since an older version appears to be in the image file. I ran the following three commands:
Code: Select all | TOGGLE FULL SIZE
sudo apt-get update
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus -y
sudo pip install Adafruit_BBIO


Notice that I updated the header info, but did not perform an upgrade. My system info is now.
Code: Select all | TOGGLE FULL SIZE
root@beaglebone:/sys/devices/platform/bone_capemgr# uname -a
Linux beaglebone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 UTC 2016 armv7l GNU/Linux
root@beaglebone:/sys/devices/platform/bone_capemgr# cat /etc/debian_version
8.4
root@beaglebone:/sys/devices/platform/bone_capemgr# cat /etc/dogtag
BeagleBoard.org Debian Image 2016-05-13


My pip list is:
Code: Select all | TOGGLE FULL SIZE

root@beaglebone:/sys/devices/platform/bone_capemgr# pip list
Adafruit-BBIO (1.0.0)
astroid (1.2.1)
blinker (1.3)
bmap-tools (3.2)
cffi (0.8.6)
chardet (2.3.0)
colorama (0.3.2)
cryptography (0.6.1)
Flask (0.10.1)
html5lib (0.999)
itsdangerous (0.24)
iw-parse (0.0.2)
Jinja2 (2.7.3)
logilab-common (0.62.0)
MarkupSafe (0.23)
ndg-httpsclient (0.3.2)
numpy (1.8.2)
pip (8.1.2)
ply (3.4)
pyasn1 (0.1.7)
PyBBIO (0.10)
pycparser (2.10)
Pygments (2.0.1)
pygobject (3.14.0)
pygpgme (0.3)
pyinotify (0.9.4)
pylint (1.3.1)
pyOpenSSL (0.14)
pyserial (3.0.1)
requests (2.10.0)
serbus (1.0.4)
setuptools (5.5.1)
six (1.8.0)
smbus (1.1)
urllib3 (1.9.1)
Werkzeug (0.9.6)
wheel (0.24.0)


My simple SPI test script and my attempt at porting DotStar both still fail with the same error messages as I previously reported. All I can conclude is that the Adafruit-BBIO 1.0.0 has either drastically changed the SPI interface or has broken that interface.
mrburns42
 
Posts: 20
Joined: Tue Jan 01, 2013 11:31 pm

Re: Dotstar python library on BBB

by drewfustini on Tue Oct 04, 2016 9:24 pm


drewfustini
 
Posts: 920
Joined: Sat Dec 26, 2015 1:19 pm

Re: Dotstar python library on BBB

by mrburns42 on Wed Oct 05, 2016 8:14 am

Ok, I took the image file and burned it to a SD Card. I expanded the file system, but did not install anything else. Below are the versions.
Code: Select all | TOGGLE FULL SIZE
root@beaglebone:/home/steve# uname -a
Linux beaglebone 4.4.9-ti-r25 #1 SMP Thu May 5 23:08:13 UTC 2016 armv7l GNU/Linux
root@beaglebone:/home/steve# cat /etc/debian_version
8.4
root@beaglebone:/home/steve# cat /etc/dogtag
BeagleBoard.org Debian Image 2016-05-13

The Adafruit Python IO library is apparently already part of the image. It is at version Adafruit-BBIO (0.0.30). I opened the environment file and removed the universal cape. Below is the file contents after rebooting. ( I used three ### to flag to me what I changed.)
Code: Select all | TOGGLE FULL SIZE
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.4.9-ti-r25
#uuid=
#dtb=

##BeagleBone Black/Green dtb's for v4.1.x (BeagleBone White just works..)

##BeagleBone Black: HDMI (Audio/Video) disabled:
#dtb=am335x-boneblack-emmc-overlay.dtb

##BeagleBone Black: eMMC disabled:
#dtb=am335x-boneblack-hdmi-overlay.dtb

##BeagleBone Black: HDMI Audio/eMMC disabled:
#dtb=am335x-boneblack-nhdmi-overlay.dtb

##BeagleBone Black: HDMI (Audio/Video)/eMMC disabled:
#dtb=am335x-boneblack-overlay.dtb

##BeagleBone Black: wl1835
#dtb=am335x-boneblack-wl1835mod.dtb

##BeagleBone Green: eMMC disabled
#dtb=am335x-bonegreen-overlay.dtb

###cmdline=coherent_pool=1M quiet cape_universal=enable

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M quiet cape_universal=enable video=HDMI-A-1:1024x768@60e

##Example v3.8.x
#cape_disable=capemgr.disable_partno=
#cape_enable=capemgr.enable_partno=

##Example v4.1.x
#cape_disable=bone_capemgr.disable_partno=
#cape_enable=bone_capemgr.enable_partno=

##enable Generic eMMC Flasher:
##make sure, these tools are installed: dosfstools rsync
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh


If I cat the slots, there are no capes loaded. If I run my simple SPI script, it fails with the following:
Code: Select all | TOGGLE FULL SIZE
root@beaglebone:/home/steve# ./SPI_Test.py
Traceback (most recent call last):
  File "./SPI_Test.py", line 5, in <module>
    spi = SPI(0,0)      #/dev/spidev1.0
IOError: [Errno 2] No such file or directory

If I again, cat the slots, there are none loaded. Therefore, I cannot get SPI to work out of the box with 8.4 image. That is why I started a new thread. The issues are not with porting the Dotstar library. The issues are more overlay and SPI interface related.
In Summary here is what my current findings are: With the older 7.X releases which use a 3.8.X Kernel, SPI works and the overlays work, but I get an IOCTL crash attempting to the SPI transfer detailed in the posts above. If I use the newer 8.X release with the 4.X Kernel, then I cannot get a working SPI transfer. However, the IOCTL call for a SPI transfer does not crash, it just throws a confusing error message.
I will post back to this thread, if I get something working from python running the Dotstar LEDs. Otherwise, I believe the SPI discussions are best documented in the other thread.
mrburns42
 
Posts: 20
Joined: Tue Jan 01, 2013 11:31 pm

Please be positive and constructive with your questions and comments.