• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

What card to chose for the TTGO V2.1 in Arduino IDE?

Q&A Forum › Category: ESP32 › What card to chose for the TTGO V2.1 in Arduino IDE?
0 Vote Up Vote Down
svein.utne asked 6 years ago
Question Tags: Arduino IDE, ESP32, LORA, TTGO V2.1_1.6
11 Answers
0 Vote Up Vote Down
svein.utne answered 6 years ago

I choosed TTGO LoRaOLED V1, and the Arduino IDE compiled and uploded the code OK.
When I tried to run the code: https://github.com/RuiSantosdotme/ESP32-Course/blob/master/code/LoRa_RFM95/LoRa_Sender/LoRa_Sender.ino
Starting Lora failed. Maybe I need to change the values for the pins used for LoRa?
//define the pins used by the transceiver module
#define ss 5
#define rst 14
#define dio0 2
I got TTGO V2.1_1.5 and TTGO V2.1_1.6

0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

Hi.
If you’e using a board with built-in LoRa, the pin definition for the LoRa module is different.
I think this is the pinout you need to follow:
https://primalcortex.files.wordpress.com/2017/11/ttgolorapinout_v2.jpg
use the following pin definition instead:

#define ss 18
#define rst 14
#define dio0 26

Let me know if it works.
Regards,
Sara

0 Vote Up Vote Down
svein.utne answered 6 years ago

Thank you Sara. It worked on firs try. Very good. I am now using TTGO T3 V2.1_1.5
Soon I will get from China TTGO T3 V2.1_1.6 I wonder if it will work with the same pin numbers or if I will have to change something?
Thanks again, and I will let you know when I get the 1.6 verson.
 

0 Vote Up Vote Down
svein.utne answered 6 years ago

Did a siple test and put the sender in my window, and drove around. Thesignal was OK ina radiuse of about 500 meters, but when Igot to a spot withline of site about 1000 meters away I got the signal with RSSI -117 so this is promising.

0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

Hi.
The pinout of the new version should be the same, I think. You’ll have to try when you receive it.
LoRa is great for long range. You’ll get better results in open fields (without buildings around).
Our RSSI was around -110 at 130 meters. So, you’re getting way better results.
 
Regards,
Sara

0 Vote Up Vote Down
svein.utne answered 6 years ago

Now I am looking for arduino code for comunication with The Things Network. We have 14 base stations in the city, and several are in reach from my sailboat. That is my goal for the LoRa project, to send data from my sailboat when it is laing in its bay. I know a lot of friends would like the same, but I need to find arduino code I can modify for sending the date I need.

0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

We don’t have any example that connects to TTN.
I’ve found this tutorial that you might found helpful for your projects: https://primalcortex.wordpress.com/2017/11/24/the-esp32-oled-lora-ttgo-lora32-board-and-connecting-it-to-ttn/
Also, Andreas Spiess has a great video building a cheap LoRa gateway with the ESP32. It’s not very intuitive, but it should work.
Regards,
Sara

0 Vote Up Vote Down
svein.utne answered 6 years ago

Thank you for your help. I finely manage to get the LoRa program running. The pin mapping was my problem.
For The TTGO T3 V2.1_1.5 this works:

// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = 12,
.dio = {26, 33, 32},
};
The second problem was to put in the EUIs right.
// Set your AppEUI and DevEUI
They have to be backwords. When I got it right it started to work. Now I can sit at my kitchen table and program with the TTGO attached to the PC, and communicate with 5 different gatways in the city 3 till 5 km away.
My house is placed 150 meters above sealevel, so that helps on the long reach.
Now I am looking at CayenneLPP.h I got som code examples and they compile OK, but I need to make som modification to make it work. Do you know where I can find the info I need?
This is the code I am looking at:
#include <TheThingsNetwork.h>
#include <CayenneLPP.h>
// Set your AppEUI and AppKey
const char APPEUI[8] = { 0xA3, 0x8D, 0x…………………. 0xB3, 0x70 };
const char *appEui = APPEUI;
const char APPKEY[16] = { 0xB4, 0x1B, 0x05, 0x36, 0x………………x7A, 0x60, 0xAA, 0xCD, 0xDB, 0x71 };
const char *appKey = APPKEY;
#define loraSerial Serial1     / / <–  I think this is the important conection that I need to modify
#define debugSerial Serial
// Replace REPLACE_ME with TTN_FP_EU868 or TTN_FP_US915
#define freqPlan TTN_FP_EU868
TheThingsNetwork ttn(loraSerial, debugSerial, freqPlan);
CayenneLPP lpp(51);
void setup()
{
loraSerial.begin(57600);
debugSerial.begin(9600);
// Wait a maximum of 10s for Serial Monitor
while (!debugSerial && millis() < 10000)
;
debugSerial.println(“– STATUS”);
ttn.showStatus();
debugSerial.println(“– JOIN”);
ttn.join(appEui, appKey);
}
void loop()
{
debugSerial.println(“– LOOP”);
lpp.reset();
lpp.addTemperature(1, 22.5);
lpp.addBarometricPressure(2, 1073.21);
lpp.addGPS(3, 52.37365, 4.88650, 2);
// Send it off
ttn.sendBytes(lpp.getBuffer(), lpp.getSize());
delay(10000);
}
 

0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

That’s great that you got it working.
I’ve never worked with CayenneLPP.h, so I don’t have any experience with that.
I can only recommend the following documentation.
https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload
https://www.thethingsnetwork.org/docs/devices/arduino/api/cayennelpp.html
https://hackmd.io/s/H1lA3HLrb
I hope it helps.
Let me know if you need anything else.
Have a great weekend.
Sara

0 Vote Up Vote Down
svein.utne answered 6 years ago

Thanks again. Now it is working.
bilde

0 Vote Up Vote Down
Sara Santos Staff answered 6 years ago

That’s great!
I’m glad it’s working. We’ll have to take a look at that in the future.
I’ll close this topic. If you have any more questions just open a new question in the forum.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.