Big ESP32 + SX127x topic part 3

you let TTN generate it in the console and after you add this to your code

1 Like

[Solved]

Hi, after reading quite a bit and trying everything I could I decided to ask for help here to see if we can make the node work…

I have a TTGO Lora32 V2 board, I have the “Heltec WiFi LoRa 32” selected on my arduino IDE and I’m using the following library: GitHub - mcci-catena/arduino-lmic: LoraWAN-MAC-in-C library, adapted to run under the Arduino environment

The pin mapping is

.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = 14,
.dio = {26, 33, 32}‘’

I’m trying to make the “hello world” example work.

ABP
In the serial monitor I can see:
EV_TXSTART
Packet queued
4135922: EV_TXCOMPLETE (includes waiting for RX windows)

SOLVED: By setting the frecuency correctly on /project_config/lmic_project_config.h

OTAA
In serial monitor apears:

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 188777542, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:1100
load:0x40078000,len:9232
load:0x40080400,len:6412
entry 0x400806a8

The payload is delivered correctly but nothing appears on the serial monitor, only the message above, is that right?

Is that library known to work with ESP32 ?

For the avoidance of doubt, that question was posted as a question.

Which I would like to know the answer to …

Yes, it works. I used to use the “ESP32 Dev Kit” but sometimes (depending on which LMIC library I was using I needed to set the SPI pins manually on hal.cpp).
Later I found out that “Heltec Wifi Lora 32” is working fine.

Yes, this has shown to be a pitfall in the MCCI LoRaWAN LMIC library and should be fixed.
A problem is that the user is not (made) aware of the issue.

See my remarks (and tip for PlatformIO) in this linked post.

1 Like

Have you checked there is an issue logged for this on github and if not logged one? Or even better submitted a pull request for the project?

Yes

Yes

Yes

No

2 Likes

For TTGO LoRa32 V2 you can also use (recently added) board definition “TTGO LoRa32-OLED V1” which is similar (not identical) to “Heltec Wifi Lora 32” but better matches the board type/name.

With board definition “TTGO LoRa32-OLED V1”, similar to board definition “Heltec Wifi Lora 32”, the definition of LED_BUILTIN is incorrect for TTGO LoRa32 V2.
(The builtin LED for the V2 board is practically useless anyway because it uses GPIO22 which is already used for OLED SCL.)

1 Like

Hi. So I have a Heltec V2. Says it on the back of the board, along with the other signs mentioned earlier. I am trying to get it to work with a RasPi3 with a Dragino Shield. Both match for frequencies (according to what I’ve ordered. I’m in the UK so both are on 868.). For now they’re extremely close together. The Dragino would pick up raw LoRa connectivity from the Heltec, as I can see a change every time I run that code, which appears on the ‘single_chan_pkt_fwd’ program running on the Pi. The issue is when I actually try to get anything using ANY of the LoRaWAN sketches everyone on here has provided for the HeltecV2. Not only that, but I’ve tested the sketches and not only does the Pi not see anything, my little SDR dongle doesnt see anything in that frequency range. At all. I have 3 of these Heltecs and tried all 3 of them. None seem to work with the provided sketches. Please don’t redirect me to the dragino shield topic because I’ve read through the whole thing and not only have I not found a single thing useful for my case, I don’t believe that there is an issue with the dragino shield. I can also mention I followed the famous Andreas Spiess, regarding that shield.

The pinout of my HeltecV2 is:
.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = 14,
.dio = {26, 35, 34}

I’ve tried 2 different LMIC libraries I’ve found and neither of them have made a difference. I have seen something about ‘connecting pins physically’ on this board, but found absolutely zero information on which pins to connect, why and how etc. I’m trying to get the ttn-abp going, by the way. Oh and the dragino is showing as connected on TTN, but has never seen a single packet come in according to the site. I’ve made sure that my firewall has the port 1700 open.

I am very close to giving up as I seem to have covered every place that’s relevant to my predicament in any way and still I’ve absolutely nothing. All I want to do is just receive data from the heltec, via the dragino+pi to be posted to TTN. That is it for now.

Oh, and I’ve checked if the boards transmit with the simple lora sketch using the example provided by heltech. It’s VERY visible on my SDR, so the boards aren’t broken.

Hi,

I am triying to get a very basic setup to work but i have not had any success.

The node i am using is a heltec v2 the one with the v2 printed on the board next to the antenna. the configuration i am using is this:

const lmic_pinmap lmic_pins = {
.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = 14,
.dio = { 26, 35, 34 },
// .rxtx_rx_active = 0,
// .rssi_cal = 0,
// .spi_freq = 0
};


on the config.h i made a change

//#define CFG_eu868 1

#define CFG_us915 1

changed the Eu frequency for the US one since my gateway is 915.

the commented lines are used but when i try to compile with them it said that they were not defined. the sketch compiles but i have some questions.

the question i have is what frequency do i need to set in the sketch since it says this:

#elif defined(CFG_us915)
// NA-US channels 0-71 are configured automatically
// but only one group of 8 should (a subband) should be active
// TTN recommends the second sub band, 1 in a zero based count.
// https://github.com/TheThingsNetwork/gateway-conf/blob/master/US-global_conf.json
LMIC_selectSubBand(1);

so from what i can see the frecuency it is going to use is 904.1 MHZ but i am not sure.

the configuracion on my single channel dragino hat 1.4 is:

/*******************************************************************************
*

  • Configure these values!

*******************************************************************************/

// SX1272 - Raspberry connections
int ssPin = 6;
int dio0 = 7;
int RST = 3;

// Set spreading factor (SF7 - SF12)
sf_t sf = SF7;

// Set center frequency
uint32_t freq = 904100000; // in Mhz! (904.1)

// Set location
float lat=6.2;
float lon=71.6;
int alt=1600;

/* Informal status fields /
static char platform[24] = “Single Channel Gateway”; /
platform definition /
static char email[40] = "lucas.restrepogil@gmail.com"; /
used for contact email /
static char description[64] = “este es my gateway”; /
used for free form description */

// define servers
// TODO: use host names and dns
#define SERVER1 “52.169.76.203” // The Things Network: croft.thethings.girovito.nl
//#define SERVER2 “52.169.76.255” // local
#define PORT 1700 // The port on which to send data

// #############################################
// #############################################

i can see that the gateway registers with the ttn network but i dont see any messages going from the node to the console of the application.

Please help me because i dont know what else to do.

thank you very much.

I tried to connect a BME280 to a TTGO lora32 v2.0 but it seems that it doesn’t work (others I2C sensors seem to work fine). Could someone tell me how to do it? Any help is extremely welcome. Thanks in advance.

If ‘other’ I2C sensors are working with your TTGO, then it seems TTGO has a working I2C.

Run an I2C scan to see if the BME280 is detected.

Hi, thanks for your reply! I’ve already use an I2C scanner sketch, some of my BME280 don’t show any address but the ones I’m using now show the right I2C address. I have used the BME280s in many projects but with the TTGO LoRa32 v2.0 they seem not to work in any way.

This turned up in a forum search for TTGO BME280;

1 Like

Hey everyone!

Last night I was working on my TTGO LoRa32 (V2.1_1.6) and I’m used to using the tinyLoRa library instead of LMIC as it’s a much smaller library and tends to result in a simple sketch. I’ve managed to successfully port the library over for use with the ESP32.

There are three example sketches, a “Hello World!” for broadcasting on all channels, the same example but you can specify a channel and the third implements a DHT sensor reading.

Unfortunately tinyLoRa only supports ABP authentication with no support for OTAA. The repo default region is currently set to AU915, however this can easily be changed by editing the TinyLoRa.h file

If you want to contribute pin mappings for different board versions I’m open to pull requests! More basic examples would be great to see too.

https://github.com/GreensladeNZ/TinyLoRa

Thank you, but seems to be a little different for the TTGO T-Beam . I’ve already used a BME280 with the T-Beam without any effort. But how to make the BME280 work with the TTGO LoRa32 v2.0 for me is still a mistery. I have always used the BME280s via I2C in many other projects. The TTGO seems to recognize all the other I2C sensors except for the BME280s (I2C scanner show the correct addresses of the sensors but 0 or -1 values are shown for temperature, pressure and humidity) .

Check pullup resistors on the i2c bus.

Did you use the OLED I2C bus or etablished a second I2C?
I couldn’t get the last scenario to run without problems. Therefore I switched to the native OLED I2C bus without further pullup resistors.
It is a Heltec V2 with BME280 icombined layout for SPI and I2C and it runs as test environment for TTN and dragino Pi Hat two channel.
It works stable with LMIC and SSD1306 (not adafruit) libraries.