Skip to content

Commit f453d3e

Browse files
committed
Merge branch 'uartTest'
2 parents 49e0709 + 0b17a39 commit f453d3e

File tree

8 files changed

+19
-0
lines changed

8 files changed

+19
-0
lines changed

UART_files/README.txt renamed to serialTest/README.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
The "serialTest.py" script sends a "hello" message over ttyO4.
2+
3+
If serial is not working run the "serialSetup.sh", which performs the commands discussed below.
4+
15
http://www.armhf.com/index.php/beaglebone-black-serial-uart-device-tree-overlays-for-ubuntu-and-debian-wheezy-tty01-tty02-tty04-tty05-dtbo-files/
26

37
Copy the following .dtbo overlay files to the /lib/firmware directory and apply them after each boot with the command: echo ttyO1_armhf.com > /sys/devices/bone_capemgr*/slots

serialSetup.py renamed to serialTest/serialSetup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/python
22
import Adafruit_BBIO.UART as UART
33
import serial
4+
45
UART.setup("UART1")
56
UART.setup("UART2")
67
UART.setup("UART4")

serialTest/serialTest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/python
2+
import Adafruit_BBIO.UART as UART
3+
import serial
4+
5+
UART.setup("UART4")
6+
7+
ser = serial.Serial(port = "/dev/ttyO4", baudrate=9600)
8+
ser.close()
9+
ser.open()
10+
if ser.isOpen():
11+
print "Serial is open!"
12+
ser.write("Hello from BBB!\n")
13+
ser.close()

setupScript.sh renamed to serialTest/setupScript.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
cp *.dtbo /lib/firmware
23
echo ttyO1_armhf.com > /sys/devices/bone_capemgr*/slots
34
echo ttyO2_armhf.com > /sys/devices/bone_capemgr*/slots
45
echo ttyO4_armhf.com > /sys/devices/bone_capemgr*/slots
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)