T-Beam V1.1 GPS Access

I have a working T-Beam V1.1 running with Meshtastic, but I’m at a loss getting access to the onboard GPS via a passthrough sketch. In short I know the GPS is powered but I don’t seem to be able to see any data from the receiver using pins 34 and 12.

Is there magic I’m missing?

Overall I’m curious to know if SBAS is configured given wander in the coordinates.

1 Like

I have had success here which may help. GPS configuration / Firmware update access

1 Like

In fact I started with your sketch flashing it after meshtastic initialized the hardware such that the GPS is powered. But Serial1.available() always returns zero. Overall I’m left confused given what you published is consistent with what I would expect, as well as information found elsewhere. Also I looked through the Meshtastic source to see if something unique is happening. Didn’t find anything.

I guess the next step is put a scope on the GPS’s Tx pin to ensure something is coming out of the GPS when the sketch is running. If all else fails, perhaps setting the ESP32’s pins to inputs and tack a FTDI cable to the GPS’s pins such that I can get direct access for uBlox’s application.

That said this is silly. Your sketch should work.

Have you tried connecting with UCenter at 9600 baud? If the GPS is configured for the UBX protocol (meshtastic default) then I think you get nothing out of it unless it is polled for info.

Indeed I have tried UCenter at 9600 baud. I know UCenter is otherwise working given I have a NEO-8M in an ongoing development.

As cited this is making no sense.

Could you try some form of serial loopback test with other hardware pins to confirm that aspect is working? Or its possible you have a fake UBlox module however I would expect it then to be at least spitting out NMEA.

If I remeber correctly you have to enable the gps modules on the t-beams first. I don’t have a t-beam my self, but I am 100% sure I have read this somewhere here in the forum.

try this sketch it’s the axp which has to be enabled to enable the gps.

Actually I did try that sketch yesterday without success. Tried again right now with no better success though the substantive additional code ensures the AXP powers the GPS receiver. But I initially ran Meshtastic to get the receiver powered, then flashed the other sketch.

All said, Meshtastic has no problem getting data from the receiver. Let me drag out the scope and see what is on the Tx pin on the uBlox.

This is my new sketch. I used this library https://github.com/lewisxhe/AXP202X_Library/releases/tag/V1.1.2.1

Blue LED flashes on serial activity.

#include <axp20x.h>

AXP20X_Class axp;

void setup() {
  Serial.begin(9600);
  Serial1.begin(9600, SERIAL_8N1, 34, 12, false, 1000);   //TBeam GPS defaults
  Wire.begin(21, 22);

  axp.begin(Wire, AXP192_SLAVE_ADDRESS);  //initialise the AXP192

  axp.setChgLEDMode (AXP20X_LED_OFF);
  //  Enable power on the TBeam.
  axp.setPowerOutPut(AXP192_LDO2, AXP202_ON);
  axp.setPowerOutPut(AXP192_LDO3, AXP202_ON);
  axp.setPowerOutPut(AXP192_DCDC2, AXP202_ON);
  axp.setPowerOutPut(AXP192_EXTEN, AXP202_ON);
  axp.setPowerOutPut(AXP192_DCDC1, AXP202_ON);
}

void loop() {
  if (Serial.available()) {      // If anything comes in from the PC,
    axp.setChgLEDMode (AXP20X_LED_LOW_LEVEL);
    Serial1.write(Serial.read());   // read it and send it out to the GPS.
    axp.setChgLEDMode (AXP20X_LED_OFF);
  }

  if (Serial1.available()) {     // If anything comes in from the GPS,
    axp.setChgLEDMode (AXP20X_LED_LOW_LEVEL);
    Serial.write(Serial1.read());   // read it and send it out to the PC.
    axp.setChgLEDMode (AXP20X_LED_OFF);
  }
}
2 Likes

Also SBAS disabled by default by the looks. image

That worked to get things straight. Either Lilygo or Meshtastic had the receiver programmed into an odd state. But I was able to force a reset to factory defaults. Thank you for your help!

With everything now working normally in uCenter, I was able to enable SBAS. It’s getting late, thus in the morning I’ll see if differential GPS results in more stable results with respect to Meshtastic.

3 Likes

Great to hear! I’m sure one day we will be able to change some of the GPS features through Meshtastic.

1 Like

Perhaps useful to others I initially had a pair of t-beam boards where one board would never acquire anything including just time. I sent that board back…

Today I received a new pair of boards, where the GPS wouldn’t acquire, but in uCenter I reset to factory defaults and setup the GNSS configuration for something that makes sense, along with SBAS on. The receiver quickly acquired the constellation set in the GNSS configuration.

There have been a number of other comments about GPS receivers not working. At this juncture I’m betting that the board I returned was in fact ok from a hardware perspective and would have worked after establishing a sane setup. I noticed in the Meshtastic source commented out code to do a factory reset if the receiver isn’t working. Maybe that code makes sense…

1 Like

There’re chances that your module is “recycled” one from shenzhen so they are not in factory mode they should be…

2 Likes

That makes a lot of sense!

2 Likes

Hi,

First post and i searched forums for this exact issue.

I have 2 LilyGO T-Beam T22 v1.0 units, one is fine, but when i use the code above on the other identical unit, it spits out AXP192 failed to initialize on powerup. I used an I2C scanner code but I only get the 0x3c address of the OLED. It doesn’t see the GPS or the AXP addresses. I am using lewisxhe’s AXP library in Arduino.

I tried flashing the firmware but it fails to communicate and write. It just says FINISHED without doing anything.

Any help would be appreciated.

Hmm. It sounds like something is busted with that second unit. If it can’t find the axp192 then the axp is probably not powering the GPS.

I’ve heard that putting the battery in backwards will fry the axp chip. If you put your finger on the axp is it warm? It should be ice cold.

TBH, i have reversed my 18650 in the past on other devices (when i was dumb and young) and seen the consequences so i was 100% sure i have never done it again, even with this unit. Ice cold, btw. The OLED works fine and i can send code via arduino so i’m confused.
So here’s what i can see is not working:
Can’t use Espressif firmware programmer to flash firmware
No blue charging LED
No GPS LED
No I2C addresses except for the OLED 0x3C
No communication with AXP192 chip

***** UPDATE *****
Okay, so i can now flash via the Espressif flasher. AXP and uBlox GPS still not communicating via I2C (GPS is spitting out “$PFLAU,0,0,0,1,0,0,*4F”). LORA and OLED working via SoftRF 1.08 firmware.

1 Like

hmm - so even if you set it outside for say 30 minutes, the red led doesn’t start flashing (this led is controlled by the GPS)? puzzling.

I also checked the e-fuses: “Efuse CONSOLE_DEBUG_DISABLE is already burned.” is the only one i see. it looks like the AXP chip is shutdown somehow which has the battery charging and GPS shut off. ideas??