
www.dragino.com
LoRa Gateway User Manual ---Update:2017-02-21
28 / 44
5
Bridge Library
The bridge library is the most important part of LG01. Bridge library defines a mechanism how
the MCU talk to the CPU (ar9331). With the bridge library, the MCU can send data to CPU, get
commands result from CPU or call commands in CPU.
The bridge Library use UART port to communicate between MCU and ar9331. Below is the block
diagram shows the bridge connection between the Mega328P MCU and Linux.
Detail instruction of how to use the bridge library can be found in
Arduino Bridge Library
.
Due
to hardware difference, there are some points when we read and use the Bridge Examples from
Arduino site:
We recommend user to tried the examples under
Arduino IDE --> Files --> Examples -->
Dragino
first
.
When use the Bridge class, user need to call Bridge.begin(115200) in the sketch for LG01.
In the default bridge examples from Arudino IDE, it uses Serial class to print debug info. This
doesn’t work in LG01. Because the
Serial Class
will call Mega328P's hardware serial port , it
will be conflict with the Bridge Library. If user needs to print debug info, please use the
console class.