Wireless tracker display

does anyone have a sketch that makes the display work for the wireless tracker, examples dont work, v1.2

what have you tried? specifically?

on which program(Arduino IDE, VSCODE , other?)

ive tried simple demo and drawing demo from heltec wireless tracker examples. they download but no display output. heres the simple demo sketch using arduino ide
// For a connection via I2C using the Arduino Wire include:

#include <Wire.h>

#include “HT_SSD1306Wire.h”

#include “images.h”

static SSD1306Wire display(0x3c, 500000, SDA_OLED, SCL_OLED, GEOMETRY_128_64, RST_OLED); // addr , freq , i2c group , resolution , rst

#define DEMO_DURATION 3000

typedef void (*Demo)(void);

int demoMode = 0;

int counter = 1;

void setup() {

Serial.begin(115200);

Serial.println();

Serial.println();

VextON();

delay(100);

// Initialising the UI will init the display too.

display.init();

display.setFont(ArialMT_Plain_10);

}

void drawFontFaceDemo() {

// Font Demo1

// create more fonts at http://oleddisplay.squix.ch/

display.setTextAlignment(TEXT_ALIGN_LEFT);

display.setFont(ArialMT_Plain_10);

display.drawString(0, 0, "Hello world");

display.setFont(ArialMT_Plain_16);

display.drawString(0, 10, "Hello world");

display.setFont(ArialMT_Plain_24);

display.drawString(0, 26, "Hello world");

}

void drawTextFlowDemo() {

display.setFont(ArialMT_Plain_10);

display.setTextAlignment(TEXT_ALIGN_LEFT);

display.drawStringMaxWidth(0, 0, 128,

  "Lorem ipsum\n dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore." );

}

void drawTextAlignmentDemo() {

// Text alignment demo

char str[30];

int x = 0;

int y = 0;

display.setFont(ArialMT_Plain_10);

// The coordinates define the left starting point of the text

display.setTextAlignment(TEXT_ALIGN_LEFT);

display.drawString(x, y, “Left aligned (0,0)”);

// The coordinates define the center of the text

display.setTextAlignment(TEXT_ALIGN_CENTER);

x = display.width()/2;

y = display.height()/2-5;

sprintf(str,“Center aligned (%d,%d)”,x,y);

display.drawString(x, y, str);

// The coordinates define the right end of the text

display.setTextAlignment(TEXT_ALIGN_RIGHT);

x = display.width();

y = display.height()-12;

sprintf(str,“Right aligned (%d,%d)”,x,y);

display.drawString(x, y, str);

}

void drawRectDemo() {

  // Draw a pixel at given position

for (int i = 0; i < 10; i++) {

  display.setPixel(i, i);

  display.setPixel(10 - i, i);

}

display.drawRect(12, 12, 20, 20);

// Fill the rectangle

display.fillRect(14, 14, 17, 17);

// Draw a line horizontally

display.drawHorizontalLine(0, 40, 20);

// Draw a line horizontally

display.drawVerticalLine(40, 0, 20);

}

void drawCircleDemo() {

for (int i=1; i < 8; i++) {

display.setColor(WHITE);

display.drawCircle(32, 32, i*3);

if (i % 2 == 0) {

  display.setColor(BLACK);

}

display.fillCircle(96, 32, 32 - i* 3);

}

}

void drawProgressBarDemo() {

int progress = (counter / 5) % 100;

// draw the progress bar

display.drawProgressBar(0, 32, 120, 10, progress);

// draw the percentage as String

display.setTextAlignment(TEXT_ALIGN_CENTER);

display.drawString(64, 15, String(progress) + “%”);

}

void drawImageDemo() {

// see http://blog.squix.org/2015/05/esp8266-nodemcu-how-to-create-xbm.html

// on how to create xbm files

display.drawXbm(34, 14, WiFi_Logo_width, WiFi_Logo_height, WiFi_Logo_bits);

}

void VextON(void)

{

pinMode(Vext,OUTPUT);

digitalWrite(Vext, LOW);

}

void VextOFF(void) //Vext default OFF

{

pinMode(Vext,OUTPUT);

digitalWrite(Vext, HIGH);

}

Demo demos[] = {drawFontFaceDemo, drawTextFlowDemo, drawTextAlignmentDemo, drawRectDemo, drawCircleDemo, drawProgressBarDemo, drawImageDemo};

int demoLength = (sizeof(demos) / sizeof(Demo));

long timeSinceLastModeSwitch = 0;

void loop() {

// clear the display

display.clear();

// draw the current demo method

demosdemoMode;

display.setTextAlignment(TEXT_ALIGN_RIGHT);

display.drawString(10, 128, String(millis()));

// write the buffer to the display

display.display();

if (millis() - timeSinceLastModeSwitch > DEMO_DURATION) {

demoMode = (demoMode + 1)  % demoLength;

timeSinceLastModeSwitch = millis();

}

counter++;

delay(10);

}

Try inverting the Vext logic—set Vext HIGH to turn the power ON and LOW to turn it OFF. The Vext logic changed with the revised power circuitry on the later revisions of the V3 boards, which I believe includes the Wireless Tracker (as best I can tell from the board schematic for the v1.1 board).

But yes, the documentation relating to such matters is woeful…

The lack of documentation for new versions really is concerning… what now would be a Wireless Tracker v1.2? @ashley are you around?

I got the GPS and display working with this sketch. I used the Arduino IDE to upload it, and I’m not using the Wireless Tracker board – instead, I selected ESP32S3 Dev Module and set USBCDN to Boot Enable to get serial output.

#include <Arduino.h>

#include <Adafruit_ST7735.h>

#include <TinyGPSPlus.h>

#include <RadioLib.h>

// ===================================================

// — KONSTANTER & PINOUT —

// ===================================================

// LED och Vext

#define LED_BUILTIN 18

#define VEXT_CTL 3

// GPS

#define GPS_RX 33

#define GPS_TX 34

// TFT Display

#define TFT_LED 21

#define TFT_CS 38

#define TFT_RST 39

#define TFT_DC 40

#define TFT_SCLK 41

#define TFT_MOSI 42

// Batterimätning

#define VBAT_PIN 1 // ADC pin

#define ADC_MAX 4095.0

#define REF_VOLT 3.3

#define DIVIDER_RATIO 2.0 // Spänningsdelare 2:1

// LoRa-pinnar (SX1262 – Heltec Wireless Tracker v1.1)

#define RADIO_DIO_1 14

#define RADIO_NSS 8

#define RADIO_RESET 12

#define RADIO_BUSY 13

#define LORA_CLK 9

#define LORA_MISO 11

#define LORA_MOSI 10

// LoRa inställningar

#define LORA_FREQ 867.1 // MHz

#define LORA_BW 125.0 // kHz

#define LORA_SF 12 // Spreading Factor

#define LORA_CR 5 // Coding Rate 4/5

#define LORA_TX_POWER 20 // dBm

// ===================================================

// — OBJEKT —

// ===================================================

TinyGPSPlus gps;

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);

// SPI och RadioLib-modul

SPIClass radioSPI(FSPI);

SX1262 radio = new Module(RADIO_NSS, RADIO_DIO_1, RADIO_RESET, RADIO_BUSY, radioSPI);

// ===================================================

// — BATTERIFUNKTIONER —

// ===================================================

float readBatteryVoltage() {

int raw = analogRead(VBAT_PIN);

float voltage = (raw / ADC_MAX) * REF_VOLT * DIVIDER_RATIO;

return voltage;

}

int voltageToPercent(float voltage) {

if (voltage >= 4.2) return 100;

if (voltage <= 3.0) return 0;

return (int)((voltage - 3.0) * 100 / (4.2 - 3.0));

}

void drawBatteryBar(int percent) {

int barWidth = map(percent, 0, 100, 0, 50);

int x = 80;

int y = 0;

// Bakgrund + ram

tft.fillRect(x, y, 50, 8, ST77XX_BLACK);

tft.drawRect(x, y, 50, 8, ST77XX_WHITE);

// Färg baserad på nivå

uint16_t color = ST77XX_GREEN;

if (percent <= 20) color = ST77XX_RED;

else if (percent <= 50) color = ST77XX_YELLOW;

// Rita stapel

if (barWidth > 2) {

tft.fillRect(x + 1, y + 1, barWidth - 2, 6, color);

}

}

// ===================================================

// — DISPLAY & GPS SETUP —

// ===================================================

void setup_gps() {

Serial1.begin(115200, SERIAL_8N1, GPS_RX, GPS_TX);

Serial.println(“GPS init klar…”);

}

void setup_tft() {

pinMode(TFT_CS, OUTPUT);

pinMode(TFT_RST, OUTPUT);

tft.initR(INITR_MINI160x80_PLUGIN);

tft.setRotation(1);

tft.fillScreen(ST77XX_BLACK);

tft.setTextColor(ST77XX_WHITE, ST77XX_BLACK);

// Sätt på bakljus

pinMode(TFT_LED, OUTPUT);

digitalWrite(TFT_LED, HIGH);

delay(50);

}

// ===================================================

// — LORA SETUP —

// ===================================================

bool setup_lora() {

Serial.println(“Initierar LoRa…”);

// Initiera SPI

radioSPI.begin(LORA_CLK, LORA_MISO, LORA_MOSI, RADIO_NSS);

// Initiera LoRa

int state = radio.begin(LORA_FREQ, LORA_BW, LORA_SF, LORA_CR, LORA_TX_POWER, 0);

if (state != RADIOLIB_ERR_NONE) {

Serial.print("LoRa init misslyckades, kod: ");

Serial.println(state);

return false;

}

Serial.println(“LoRa init OK!”);

return true;

}

// ===================================================

// — SETUP —

// ===================================================

unsigned long lastSend = 0;

void setup() {

Serial.begin(115200);

delay(500);

Serial.println(“Startar…”);

pinMode(LED_BUILTIN, OUTPUT);

digitalWrite(LED_BUILTIN, HIGH);

// Slå på Vext

pinMode(VEXT_CTL, OUTPUT);

digitalWrite(VEXT_CTL, HIGH);

setup_tft();

setup_gps();

setup_lora();

tft.setCursor(0, 0);

tft.print(“Söker GPS…”);

digitalWrite(LED_BUILTIN, LOW);

}

// ===================================================

// — GPS-LOOP & UTSKRIFT —

// ===================================================

void run_tasks(uint32_t ms) {

unsigned long start = millis();

do {

while (Serial1.available()) {

  char c = Serial1.read();

  gps.encode(c);

  Serial.write(c); // Debug NMEA

}

} while (millis() - start < ms);

}

// ===================================================

// — LOOP —

// ===================================================

void loop() {

run_tasks(1000); // Läs GPS i 1 sekund

// Batterivärden

float battVoltage = readBatteryVoltage();

int battPercent = voltageToPercent(battVoltage);

// Rensa skärmen

tft.fillScreen(ST77XX_BLACK);

// Visa GPS-data om giltig

if (gps.location.isValid() && gps.date.isValid() && gps.time.isValid()) {

// Tid och datum

tft.setCursor(0, 0);

tft.printf("%04u-%02u-%02u %02u:%02u:%02u",

           gps.date.year(), gps.date.month(), gps.date.day(),

           gps.time.hour(), gps.time.minute(), gps.time.second());

// Lat / Lon

tft.setCursor(0, 14);

tft.printf("Lat: %3.6f", gps.location.lat());

tft.setCursor(0, 26);

tft.printf("Lon: %3.6f", gps.location.lng());

// Alt

tft.setCursor(0, 38);

tft.printf("Alt: %3.1f m", gps.altitude.meters());

// Sänd var 10:e sekund

if (millis() - lastSend > 10000) {

  lastSend = millis();

  // Bygg payload

  String payload = String(gps.location.lat(), 6) + "," +

                   String(gps.location.lng(), 6) + "," +

                   String(gps.altitude.meters(), 1) + "," +

                   String(battVoltage, 2) + "V," +

                   String(battPercent) + "%";

  Serial.print("Sänder LoRa: ");

  Serial.println(payload);

  int state = radio.transmit(payload);

  if (state == RADIOLIB_ERR_NONE) {

    Serial.println("Sändning OK");

  } else {

    Serial.print("Fel vid sändning: ");

    Serial.println(state);

  }

}

} else {

tft.setCursor(0, 0);

tft.print("Ingen GPS-signal...");

}

// Visa batteri (spänning + procent + stapel)

tft.setCursor(0, 54);

tft.printf(“Batt: %.2fV %d%%”, battVoltage, battPercent);

drawBatteryBar(battPercent);

}

@duhlin is your board a Wireless Tracker v1.2?

No

I have Wireless tracker 1.1

The question of OP is how to make an apparent v1.2 work :wink: so there will likely be some incompatibility between your code and the hardware of OP.