TTGO T-Beam topic

Sure, but I never modified it and I am using a version that is a couple of months old.

*// clang-format off*

#ifndef _TTGOBEAM_H

#define _TTGOBEAM_H

#include <stdint.h>

*// Hardware related definitions for TTGO T-Beam board*

*// (only) for older T-Beam version T22_V05 eternal wiring LORA_IO1 to GPIO33 is needed!*

*//*

*// pinouts taken from* http://tinymicros.com/wiki/TTGO_T-Beam

#define HAS_LED GPIO_NUM_14 *// on board green LED, only new version TTGO-BEAM V07*

*//#define HAS_LED GPIO_NUM_21 // on board green LED, only old verison TTGO-BEAM V05*

#define HAS_LORA 1 *// comment out if device shall not send data via LoRa*

#define CFG_sx1276_radio 1 *// HPD13A LoRa SoC*

#define BOARD_HAS_PSRAM *// use extra 4MB external RAM*

#define HAS_BUTTON GPIO_NUM_39 *// on board button (next to reset)*

#define HAS_BATTERY_PROBE ADC1_GPIO35_CHANNEL *// battery probe GPIO pin -> ADC1_CHANNEL_7*

#define BATT_FACTOR 2 *// voltage divider 100k/100k on board*

#define HAS_GPS 1 *// use on board GPS*

#define GPS_SERIAL 9600, SERIAL_8N1, GPIO_NUM_12, GPIO_NUM_15 *// UBlox NEO 6M or 7M with default configuration*

*// enable only if device has these sensors, otherwise comment these lines*

*// BME680 sensor on I2C bus*

*//#define HAS_BME SDA, SCL*

*//#define BME_ADDR BME680_I2C_ADDR_PRIMARY // !! connect SDIO of BME680 to GND !!*

*// display (if connected)*

*//#define HAS_DISPLAY U8X8_SSD1306_128X64_NONAME_HW_I2C*

*//#define MY_OLED_SDA SDA*

*//#define MY_OLED_SCL SCL*

*//#define MY_OLED_RST U8X8_PIN_NONE*

*//#define DISPLAY_FLIP 1 // use if display is rotated*

*// user defined sensors (if connected)*

*//#define HAS_SENSORS 1 // comment out if device has user defined sensors*

*//#define DISABLE_BROWNOUT 1 // comment out if you want to keep brownout feature*

#endif

Thanks, I see it is the same, Ive tuned a little bit, maybe my T_Beams are really weird when I added the BME680. BR.

Hello @connectix,
do you made any progress to post the code? On GitHub you just go to the original project, click on fork, edit the code in your forked project and create a pull request.

1 Like

I found the https://github.com/kizniche/ttgo-tbeam-ttn-tracker sketch almost perfect. Kyle Gabriel
altered the sketch in a way it loads the new power board. Maybe you can give it a try.

I also made a case for the new version T22 V1.0 20190612 wich you can download on thingiverse:

Thanks for this hints. So there is some more programming required, thatmn changing some pinouts.

Can anyone here make pullrequest for paxcounter software to integrate AXP192 logics?

Specific AXP192 code to turn on all devices…

#include "axp20x.h
AXP20X_Class axp;
.
.
.
void setup() {
Wire.begin(21, 22);
if (!axp.begin(Wire, AXP192_SLAVE_ADDRESS)) {
Serial.println(“AXP192 Begin PASS”);
} else {
Serial.println(“AXP192 Begin FAIL”);
}

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);

This should/will kick your GPS into life etc, works perfect for me.

4 Likes

Yes, the ESP32 including WiFi, Bluetooth, and LoRa work fine. No problem.

One can send packets back and forth over LoRa between a pair of T-Beams. One can use the T-Beam as a BlueTooth GPS. Squack the GPS serial UART traffic over BT. All this works fine.

It is the LoRaWAN stack (lmic) that is broken. It does not support the TTGO T-Beam board.

I use LMIC+LoRaWAN all the time with a couple of TTGO T-beams. Mostly for ttnmapping.

However, I am in the US, so I did have to modify some frequency values. I also am using PlatformIO which ships with a version of lmic. I didn’t do any modifications beyond changing some of the configuration values.

I am also using this rev of the board: https://www.aliexpress.com/item/32875743018.html?spm=a2g0s.9042311.0.0.6e4c4c4d3XWhXi

However I have found lmic to be a bit finicky in general.

There is no doubt lmic works. The trick is to find the proper version of lmic for the T-Beam.

There are a pair of local dudes using ttnmapper with T-Beams on 915 MHz here in Canada. They gave me their copy of lmic, or so they thought… It produced a compile time WARNING saying board (T-Beam) not supported. Its only a warning. The IDE compiles the program source. Running the code, it loops in an error state: board not supported.

The local dudes have lost code control. They understand they are using one version of lmic, the version they gave me. In fact their build is using a t-beam compatible version picked somewhere on their system during the build process. They are not using what they think they are using, the code they gave me. No code control.

Now the t-beam is an elegant board featuring an esp32 with WiFi, Bluetooth, a GPS, a sx1276 Lora transceiver, and li-polymer battery socket complete with associated charging circuitry. I like. I like it a lot.

I think this version is working good with my ttgo-tbeam v7 and oled display.
I search a log time for a working solution to use it with ttn mapper without paxcounter.

I want a small software for arduino ide without the interference of wifi and bluetooth.

I think the biggest problem i had is to understand that i should use ABP activation and
disable the “frame counter checks” in TTN Backend (Device section).

Alternativeley you can tweak the software to reset the counter. I think the software is generaly broken in this part because i found no software where the tracker work on the second day after flashing the keys.

But have a look at the TX intervall because of the fair frequency use policy.

I use the version of LMIC that “ships with” PlatformIO with my T-Beam. You should just need to change lmic_config.h. However, there is really no code control there either, since you are assuming whoever is in charge of the LMIC version doesn’t break it.

I added AXP192 experimental code to the paxcounter software, you find it in the development branch:

Could you please test on your device? Thanks.

1 Like

@Linar can you post the complete schematic here? Would be quite useful for software development. Thanks.

https://github.com/Xinyuan-LilyGO/TTGO-T-Beam/blob/master/schematic/T_BeamV1.0.pdf

2 Likes

Hello,

I’m a newbie so I apologize for the fool question. What board should I choose in the board list of Arduino IDE when I program the ttgo t-beam?

Thank you

I use the “T-Beam” board.

First you have to update the board list and add: https://dl.espressif.com/dl/package_esp32_index.json

Thank you very much. Another doubt is: “should I modify anything in the " Lora-TTNMapper-T-Beam.ino” file in order to make ttgo t-beam work as TTN Mapper node? (I have already put in config.h file the Nwks and App keys and andress of my device.

Depends on your T-Beam “band”.
My code was tested with 868 Mhz T-Beams since this is what is possible in my country.
For 915Mhz have a look at what someone submitted : https://github.com/DeuxVis/Lora-TTNMapper-T-Beam/pull/11/commits/23bd9b04bb335daf32a2c8aafc485cd54d278381#diff-11634892e8a26e85cab0ec7c5fda9c8bR165

First of all thank you for the answer. I’m from Italy so the band is the 868 Mhz. The problem I observe is that when I open the serial monitor in order to see if device is working or not, “dirty” byte are printed such as that in the figure. serial_monitor

The baud rate in the serial monitor (9600) does not match the baud rate in the sketch you linked to (115200).