YMMV

* your mileage may vary

Tuesday, 29 December 2015

Beaglebone Black (BBB) UART2 with ESP8266


Setting up the BBB with the ESP8266 using the UART2 of the BBB.  I've misplaced my USB serial debug cable so I just used the BBB UART instead. Normally UART2 is used by HDMI so it is necessary to disable the HDMI on boot.
BBB Environment
root@beaglebone:~# uname -r && cat /etc/dogtag
4.1.13-ti-r33BeagleBoard.org Debian Image 2015-11-12 

changed /boot/uEnv.txt to disable HDMI:
##BeagleBone Black: HDMI (Audio/Video) disabled:
dtb=am335x-boneblack-emmc-overlay.dtb

Reboot

Setup the UART2
export SLOTS=/sys/devices/platform/bone_capemgr/slots
echo 'BB-UART2' > $SLOTS

Check the setup
cat $SLOTS 
0: PF----  -1
1: PF----  -1
2: PF----  -1
3: PF----  -1
4: P-O-L-   0 Override Board Name,00A0,Override Manuf,BB-UART2

root@beaglebone:~# ls /dev/ttyO*
/dev/ttyO0  /dev/ttyO2


Setup the serial port
root@beaglebone:~# stty -F /dev/ttyO2 115200 raw -echo

Wire the BBB and the ESP8266
BBB <=========>  ESP8266
P9.1 (GRD) ======  GRD  (leave off for now)
P9.3 (3v3) ======= VCC
P9.4 (3v3) ======= CH_PD
P9.21 (TXD) ====== RXD
P9.22 (RXD) ====== TXD

Putty Session 1
cat /dev/ttyO2

Connect the GRD on the ESP8266 => should see the ESP initialize with "ready" message

Putty Session 2
run some AT commands
root@beaglebone:~# echo $'AT\r' > /dev/ttyO2
root@beaglebone:~# echo $'AT+GMR\r' > /dev/ttyO2



No comments:

Post a Comment