Big ESP32 + SX127x topic part 2

(Biermi) #431

Thanks for the help, it seems to be working, but i can not decode the data from the GPS, i guess it is a problem in the Garmin Geko or my RS232-TTL Max3232 Board is defect. I have ordered a GY-GPS6MV2 for checking.

(Linar) #432

Not sure if it was published here before:
Schematics of TTGO Lora-32 V2

(Russ Nelson) #433

I’m using this charger, which automatically cuts off the power when the voltage gets too low.

(LoRaTracker) #434

I have built a ESP32 board and in deep sleep mode the current is 7uA.

However it appears that not all the GPIO pins maintain their set state in deep sleep making it rather difficult to put the LoRa device into low current mode.

Is there a way to have (all) the GPIO pins maintain their set state in deep sleep ?


could you tell us, what board you used and what configuration gets you 7uA
thanks :slight_smile:

(LoRaTracker) #436

My own design board, ESP32 WROOM module and a HT7333 regulator.

(Pele) #437

If anyone needs a copy of ESP-1ch-Gateway-v5.0 by kersing that compiles with PlatformIO and runs on lora32 v2 (as tested) I’ve just completed modifying the existing code (it was a helluva CHALLENGE, as they say…):

If someone knows a brief list of updates that have been implemented in the things4u’s version that are missing from kersing’s code please advise and I’ll see that it gets implemented here as well.

(Pele) #438

I’ve also modified and compiled TTN TTGO LoRa32 BLE BRIDGE and that works too but the thing is it only ever sends one message. Anyone have any clues?


Where was the challenge?
What is different from kersing’s code in your code, what changes did you make?

(Pele) #440

Code written in arduino ide doesn’t really want to compile in platformio since the way arduino ide concatenates and compiles code, so pretty much anything is possible with arduino ide, whereas platformio is more strict at adhering to standards. What I did was chop it up somewhat and re-arrange some definitions into header files (there were loads of global variables around) - this alone took me a whole day(!). I am thinking the code needs to be restructured a little, at least to try and get rid of all the globals if nothing else; make it more functional. Anyways, github repository is there for you to have a look at. I hope someone finds use for it.


That is not my experience. I usually have no problems with compiling and uploading Arduino code with PlatformIO. But it helps if the board, framework (Arduino) and platform (ESP32) are supported which is the case for TTGO v2 (just select Heltec Wifi LoRa 32 as board for the TTGO v2 (or maybe even a TTGO v2 board definition has already been added).
PlatformIO is even more flexible than Arduino IDE as it allows separate libraries per project to be installed (and automatically).

I often drop existing Arduino sketches into the src directory of a freshly created PlatformIO project, remove the default main.c, add library dependencies (names) to platformio.ini and it is good to go. Referenced libraries are automatically downloaded as soon as platformio.ini is saved.

I tried kersing’s version before and did have issues with it (but have not used it since). The issues occurred both in the Arduino IDE an PlatformIO. I doubt they were PlatformIO related.

@pele You are correct. I had forgotten what the ESP-sc-gway sources actually looked like.

(Pele) #442

A simple example would be to try to use a “global” variable defined somewhere at the beginning of ESP-sc-gway like, for example, MAC_array, anywhere inside txRx or wwwServer and see compilation fail miserably. Why you ask? Because it hasn’t been defined as such as per C (or C++) way of doing things. It should be declared extern by all “modules” that wish to use it and then properly initialised by the actual “module” that “owns” it (i.e. ESP-sc-gway in this case). And many more examples like this. Same applies to functions. Within arduino ide you define your global variable at the beginning (or pretty much anywhere outside of a function) of your main .ino and it magically works pretty much anywhere you’d care to use it.

As much as arduino ide may be good for beginners it is also very bad for them for the many reasons discussed elsewhere on the www (simply put it teaches wrong coding practices to kids). Take String for example. Slow death by heap (asphyxiation or poisoning, take your pick). Recently having written 2MB worth of multi-threaded firmware with i2c, spi, ble and tcp/ip (all at the same time) for esp32, my experience tells me a different story to yours.

(Jac Kersing) #443

I just made the minimal changes required to allow building for the esp32 controller. Please feed any improvements back to the original author. (Btw, that would easier if you cloned the repo and committed updates in stead of starting a new repository. Now you can’t create a pull request)


Yes you are correct on the globals. I did not interpret it as that at first.
The libraries get compiled separately and won’t see the globals of your main source file, if I’m not mistaking.

(Pele) #445

Actually I tried to send them back to you but I couldn’t find a way of contacting you. Anyway, this builds just fine on esp32.

(Jac Kersing) #446

??? Private message on this forum? It is not like I am hiding… However, please contact the original author.

As mentioned, I just did a quick hack to enable basic functionality on the cheap ESP32 modules to allow (our local) community members to quickly setup a single channel gateway. I am not a fan of single channel gateways (to put it mildly) but do appreciate not everyone has a couple of hundred euros to spend on a full gateway (and a lot of people live outside current TTN coverage)

If everyone agrees your project fulfills their needs (and that probably means it should be buildable in the Arduino IDE as well because PlatformIO is a step too far for a lot of people) I will remove my repository.

(LoRaTracker) #447

I can reply to this question myself.

When you put the ESP32 into deep sleep the GPIO pins go into high impedance mode, which is not good for devices on the SPI bus, such as LoRa.

With the SPI bus high Z the LoRa device (also in sleep mode) takes the sleep current up to 120uA, not good.

If you add pullup resistors on the 3 SPI pins and the LoRa device select pin, sleep current of an ESP32 and LoRa device is 7uA.

Also note that although you should be able to leave the LoRa NRESET pin floating (it has its own internal pullup) if your driving it with the ESP32 then add an external pullup resistor, the ESP32 in deep sleep drags this pin low.

(Jhetrick) #448


New to LoRa here, but excited. I’m working with some TTGO ESP32 V1 boards and confirm that they’ll talk to one another, and since I’m not near a gateway, I would like to stand up a single-channel for my own use while I test.

I’ve been battling kersing’s single-channel fork of the ESP8266 code and have something I haven’t found in the monolithic threads yet!

I can build it, debug/serial shows that the gateway joins wifi, and starts WWW on 80. I can ping the address but I cannot get any response on port 80… so web services aren’t actually running, but I can’t quite see why they aren’t.

Has anyone else seen this and can toss me a breadcrumb?



(Bytebang) #449

I am looking for the same things. Currently i am experimenting with the following firmware:

Looks promising. I have not tried to run one TTGO board as gateway but I am able to communicate with my TTN gateway

best regards from Austria

(Jhetrick) #450

Hey byte…

That does look interesting; what are you using for a gateway? Fortunately for playing with node-code, I have a borrowed multitech conduit, but, I won’t have it for long. I’m also the only LoRa gateway in my area so having a test-setup when I’m at home is useful.

I’ll spend a bit more time today banging on the SC gateway, I need to toss some debug into the webserver bits and see if I can figure out where it’s going sideways.