esp32-ogn-tracker/README.md

85 wiersze
2.8 KiB
Markdown
Czysty Zwykły widok Historia

2020-04-19 21:00:35 +00:00
# ESP32 OGN-Tracker
OGN Tracker implementation on ESP32 devices.
It works with HELTEC and TTGO boards with sx1276 RF chip for 868/915MHz
The quickest board to run is the T-Beam from TTGO as it includes GPS, RF chip, battery circuit and holder, optionally as well a small OLED display. Yout to solder BMP280 or BME280 pressure/temperature/humidity sensor.
The initial code is written for and tested on HALTEC LoRa 32 module with sx1276 and 128x64 OLED display.
Most likely it can be easily ported to other ESP32 devices, as these are very flexible for the I/O assignement.
If you need to change the pins assigned to various periferials, see the top of the hal.cpp file.
2020-04-19 21:39:34 +00:00
## To compile the code: install the ESP-IDF
To compile and flash the ESP32 board you need to install the ESP-IDF v4.0
Start with:
2020-04-19 21:00:35 +00:00
```
2020-04-19 21:39:34 +00:00
cd
2020-04-19 21:00:35 +00:00
git clone -b v4.0 --recursive https://github.com/espressif/esp-idf.git
2020-04-19 21:39:34 +00:00
cd esp-idf
./install.sh
2020-04-19 21:00:35 +00:00
```
2020-04-19 21:39:34 +00:00
If you are doing this on a Raspberry PI and see error messages about *virtualenv* you may need the following:
2020-04-19 21:21:48 +00:00
```
pip install --upgrade virtualenv==16.7.9
```
2020-04-19 21:39:34 +00:00
Then, in order to be able to *make* projects you need to run
```
source ~/esp-idf/export.sh
```
To get the OGN-Tracker source code from this github repository:
```
cd
git clone https://github.com/pjalocha/esp32-ogn-tracker.git
2020-04-20 13:18:33 +00:00
cd esp32-ogn-tracker
2020-04-19 21:39:34 +00:00
```
2020-04-20 13:18:33 +00:00
If you want to use the OLED display with the U8g2 library you need to install it in *components* in the project directory:
2020-04-19 21:00:35 +00:00
```
mkdir components
cd components
git clone https://github.com/olikraus/u8g2.git
cd ..
```
2020-04-19 21:39:34 +00:00
To choose the configuration file for the T-Beam
```
cp T-Beam.cfg main/config.h
```
To compile and flash the board
```
make
make flash
```
2020-04-20 13:18:33 +00:00
To see the console output and thus to check if the ESP32 is alive
```
minicom
```
For minicom setup use 115200bps /dev/ttyUSB0 serial port and turn hardware and software handshake OFF. It is important, otherwise if you type something it won't be sent to the ESP32.
Press *Ctrl-C* to list the internal state and parameters. To change parameters, use $POGNS like this:
```
$POGNS,AcftType=1,Pilot=YourName
```
2020-04-19 21:39:34 +00:00
## Wiring the GPS
2020-04-19 21:00:35 +00:00
For the original HELTEC board you need to wire the UART GPS follow the pins defined in the hal.cpp
2018-01-29 12:57:27 +00:00
```
// wire colours for VK2828U GPS
#define PIN_GPS_TXD GPIO_NUM_12 // green
#define PIN_GPS_RXD GPIO_NUM_35 // blue
#define PIN_GPS_PPS GPIO_NUM_34 // white
#define PIN_GPS_ENA GPIO_NUM_13 // yellow -> well, I had a problem here, thus I tied the enable wire to 3.3V for the time being.
2018-01-29 12:57:27 +00:00
```
Note the yellow wire: put it to 3.3V to start with.
An attempt to control it from the CPU did not work, to be followed.
Note: I have seen GPSes where red was ground and black was power thus be carefull !
2020-04-19 21:39:34 +00:00
Note: If you use MTK GPS check the definitions in the hal.cpp accordingly if you want higher baud rates on the GPS UART