<< return to Pixycam.com

pixy uart beaglebone black

hi, i’m trying to connecto over uart my beaglebone black(bbb) and the pixy cam, but i don’t know how can i do it.

I have been tryig this, but i can’t get the output from pixy cam

  1. setup bbb angstrom linux
  2. setup pixy CMUcam5
  3. connect pixy GND to BBB’s GND
  4. connect pixy’s TX uart to BBB’s RX uart
  5. use the adafruit_BBIO to setup the BBB’s uart4 with python

import Adafruit_BBIO.UART as UART
import serial

UART.setup(“UART4”)

ser = serial.Serial(port = “/dev/ttyO4”, baudrate=57600)

ser.close()
ser.open()

while ser.isOpen():
buff = ser.read(ser.inWaiting())
print buff

ser.close()

whe i try to read the buff there is nothing. So i don’t know what i have to do to get the pixy’s uart infomation in my bbb.

i hope you can help me

thx

Ok i have gotten something. The manual says that you have to configure pixy to use uart

http://cmucam.org/projects/cmucam5/wiki/Pixymon_Configuration_Parameters

Data out port
Selects the port that’s is used to output data. 0=SPI, 1=I2C, 2=UART, 3=analog/digital x, 4=analog/digital y
default: 0

so i did it with Pixmon and also i did a small change in my program


import Adafruit_BBIO.UART as UART
import serial

UART.setup(“UART4”)

ser = serial.Serial(port = “/dev/ttyO4”, baudrate=19200 )

ser.close()
ser.open()

while ser.isOpen():
buff = ser.read(13)
if len (buff) > 0:
print buff
else:
print “Nothing”

ser.close()


The maual about pixy’s uart says that each block of data sent are 13 bits, so, i put this in the line buff = ser.read(13), but i don’t know if that is correct

so when i do it, the uart is now working, and i can see the data output with my python code, but i don’t know how can i read the output, please see the attach image and give me any feedback about it

Hi,

A few things to note:

The original color blocks are actually 14 bytes (not bits) and color code blocks are 16 bytes. The byte numbers are listed as 0-13 (and 0-15), so that is likely what confused you. Also keep in mind that printing the buffer data directly to the screen as you are doing will not result in readable data. You should extract the data from the packet first and print it, similar to what is done in “hello_pixy.cpp”:https://github.com/charmedlabs/pixy/blob/master/src/host/hello_pixy/hello_pixy.cpp.

Good luck!

Scott