Big ESP32 + SX127x topic part 2

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.

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

2 Likes

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

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:

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

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.

1 Like

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?

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.

1 Like

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.

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

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.

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)

1 Like

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.

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.

??? 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.

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.

4 Likes

All,

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?

Thanks,

J

I am looking for the same things. Currently i am experimenting with the following firmware: https://github.com/whitecatboard/Lua-RTOS-ESP32

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

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.

J