Big ESP32 + SX127x topic part 3

Without link to the code running on your Heltec board there won’t be any answers possible here.

Hello Verkehrsrot,

Even with the OLED_LoRa_Receiver and OLED_LoRa_Sender examples I’m having this kind of problem.
Problem 1:
My receive just stops to receive, it’snt blocked, but LoRa.parsePacket() just return zero after a while, when a reset the module it start to receive again.
Problem 2:
For the size of the packet how many bytes is the maximum? I saw in the datasheet of SX1276 that we could send a packet with 256 bytes but Im not even close and the receive start to lose a lot of packages when the package has a size like 15 bytes.

Dou you guys think that it could be my board? How many bytes did u send whitout a considerable packet loss.

Hello all,
First thanks to bluejedi and all the other contributors, I am new to arduino and believe i have made a massive stuff up! In my eagerness to test i have missed changing the pin settings in my ttn-otaa sketch setup, for TTGO v1 and believe this has now killed my access from the mounted USB port.
Are my assumptions correct? if so could i use a ftdi adapter to recover the device?

I have configured my spare TTGO Lora V1 with correct pins and have worked out frequency for AU and now have it showing up on ttn site as a activation attempt it dose not appear to activate.

image

Why is the Dev addr: different each time?

would appreciate a point in a direction as i now seam to be stuck in a loop

Thanks Oztechgeek

they seem all failed OTAA attempts. Is the node functioning correctly with ABP? Are you using a real gateway or a single channel?

1 Like

No it is not, all i get is garbage from the console, i have noted that SPI.h is showing red and wonder if this has something to do with it…

It is a real gateway.

ABP:
image

Thanks

No, that’s fine; that’s just bad syntax highlighting triggered by the leading uppercase character in the name. This works for me (for a different device):

includes

As for garbage in the console: does the baud rate of 9600 match the value in the code?

Your OTAA example indeed shows that the node transmits the Join Request just fine, and that TTN received and accepted it, as it assigned a DevAddr (which indeed will be different for each accepted join). In the gateway’s Traffic page in TTN Console you should also see a green icon for the Join Accept, for the gateway that TTN selected to transmit that, but I’m afraid your node did not receive that downlink.

What SF is the Join Request using? Do you see the green Join Accept? Please show its details. As the OTAA Join Request works, ABP should work too, as ABP does not need any downlinks at all. Be sure to keep at least a few meters between node and gateway. And see LMIC_setClockError: Over-the-air-activation OTAA with LMIC - #36 by matthijskooijman.

FYI: Each (most) Arduino libraries have a keywords.txt file which is used by the editor for syntax highlighting.
The syntax highlighting is rather dumb however. It is based on text compare and involves no or little intelligence from the compiler about the actual source code structure and therefore also highlights in the wrong places (like in the include statements).

1 Like

Hi,
Thanks for that magnificent thread.

I’ve encountered a problem with the TTGO Lora32 V2 while trying to use it as a node (it said Failure on serial port), finally I solve it tweaking the code in the library “hap.cpp”, I had to manually put the pins for “SPI.begin(5,19,27,18);”.

Is that a normal case scenario? Any workaround without having to touch library code?.

Thanks

2 Likes

What library is hap.cpp part of?


Having to modify library source code like this is not normal and indicates a design smell. In practice however, many libraries for the Arduino framework suffer from this problem.

Initializing shared resources like the I2C and SPI busses is the responsibility of the application, not the responsibility of some library (e.g. for sensors or displays).

Well designed libraries shall adhere to design principles like separation of concerns and dependency inversion to prevent these types of issues. One should be able to use a library only through it’s API, without having to modify its source code for external dependencies.

Many existing libraries initialize (hard-coded) the I2C and SPI bus, while these communication busses are shared external resources. Such libraries act like they own these resources while they do not. In practice I2C and SPI busses are often shared with other peripherals (that use other libraries).

The Arduino platform itself is not exactly of help here. For instance Wire.begin() can be called with different parameters for initializing the Wire library (I2C) but there is no option to check if the Wire library (i.e. the global Wire instance of the TwoWire class) was already initialized before (but is not an excuse for other libraries to call Wire.begin()).
The Wire and SPI libraries can even be hardware platform (with related Arduino core) dependent. Meaning that there may be different parameter (options) for different platforms. The average library shall (must) not (have to) be aware of such details.
(E.g. on AVR MCU’s Wire.begin() has a single optional parameter ‘slaveid’ which is required to let the MCU act as client on the I2C bus (instead as a master), but on the ESP8266 and ESP32 platforms clientmode is not supported but parameters can be specified for which (alternate) pins to use for SCL and SDA.)

Libraries should not initialize the I2C and SPI busses and leave that responsibility to the application. If not this will cause incompatibilities that may require ugly hacks as workarounds. Incompatibilities that can be prevented by proper design.

Hi,

I would like to say BIG THANKS to all commenting on this thread. I finally achieved to tweak the code and let run my ESP32 TTGO V1 working with TTN (sending DHT sensor data) and a Single Channel GW.

I shared a short video showing working on my Twitter account: https://twitter.com/AlexCorvis84/status/1101208767339945989

Thank you all!! Awesome helpful thread!

4 Likes

Has someone try to use ULP core ?

Tried the suggested lib here : https://www.youtube.com/watch?v=-QIcUTBB7Ww

but the lib is kind of a not ready… e.g. did not managed to install it and make it work wit latest ESP32 core…

Any one with suggestion with reasonable 3G/4G module for ESP32 ?
Trying to build a 3G/4G Gateway…

Has anyone been able to use an external device over the SPI bus ? I have a Heltec 32 Lora v2 and am trying to use MAX7219 led matrix. I had it working on an esp8266 based board but I can’t get it to work on the this Lora board. There appears to be two spi busses VSPI and HSPI. I tried to use the VSPI bus but it didn’t work. I also tried using pins gpio 36,37,38 for CLK, MOSI, CS and that didn’t work either. I know in theory I would have to use the led matrix and the LoRa functions one at a time because they would be on the same bus but it’s confusing because according to the pinout V_SPI_CLK is used as the LoRa_CS pin and the V_SPI_CSO is used for the LoRa_ SCK. Seems backwards to me.

I have had a LoRa device and a micro SD card working on the same bus.

Which LoRa TTN library are you using ?

I designed my own pcb for the ESP32 + RFM95 for the Lorawan network. My design is based on using the Lolin D32 combined with a RFM95.

I managed to get a deep sleep current for around 240uA while deep sleeping. I’m pretty happy with the first results. It should still be possible to achieve lower results, because Lolin D32 alone uses around 70uA while in deep sleep.

So the remaining 170uA is being used by the RFM95 while the ESP32 is in deep sleep. I hope I can bring it further down. I already tried to putting the SS pin (GPIO4) to HIGH before going to deep sleep and holding it HIGH with the use of the RTC part of the ESP32:

LMIC.shutdown();
digitalWrite(4, HIGH);
esp_err_t rtc_gpio_hold_en(GPIO_NUM_4);

The library I am using to control the RFM95 is this one which support deep sleep:

Anybody got any suggestions what I could try more?

1 Like

mmm, much easier to strive for low current when your checking the design out on breadboard.

There are some comments about reducing power consupmtion of ESP32 and LoRa devices in the posts below;

http://www.loratracker.uk/?p=810
http://www.loratracker.uk/?p=817

1 Like

I am working with a TTGO Lora32 V2 and have tried the examples from the Arduino-LIMC library by Matthijs Kooijman. It looks like I have the board working: with both the ABP and OTAA examples I see action on my gateway. In ABP mode only one hit, in OTAA mode I see a join request, a join accept and then an uplink. However: this happens only once on power up or when I hit the reset button. I assumed that I would see a continuous series of messages. The code says that the TX interval is 60 seconds, but nothing happens. To be clear: in both ABP and OTAA only once a packet is handled by the gateway.

When I go to the application I can see how long ago the board was powered on, but both the Frames up/Down counters say “0”

Am I wrong in my assumption that I should see a message every 60 seconds? My gateway is made of a iC880A-SPI concentrator board with a Raspberry. I know that the gateway works since when I power up another node (a LSN50 I see a continuous stream of packets coming in.

Thanks! I tried what he did in the link. I tried adding 20k pull-up resistors on Mosi, Miso, SS and CLK. I now got the standby consumption reduced to 154uA!

Should I use higher or lower resistors?

Try it and see.