Big ESP32 + SX127x topic part 2

Congratulations. You appear to have found another error in the TTGO documentation.
CLX2 and CLX3 should be CLK2 and CLK3, or to be more correct: CLK_OUT2 and CLK_OUT3.

CLK_OUT1 to CLK_OUT3 are used as clock out signals for the I2S interface.
Pins can be used for different interfaces. I2S is not used (unless explicitly used by yourself) so you should be able to use the TX (U0_TXT / GPIO1) and RX (U0_RXD / GPIO3) pins.

1 Like

Is there any TTN Mapper software for ESP32 and LMIC ?

I tried the Draginio TTN mapper but that wont compile for ESP32 or indeed ATMEGA 1284P which was another option I was looking at.

The issue appears to be that the LMIC library mixes data types in a few places; artkey for instance is defined as u1_t and then used in LMIC_setSession() as xref2u1_t.

For more recent Arduino IDEs, I use 1.8.5, the -fpermissive complier flag is not enabled for some hardware type, so the ‘invalid’ conversions cause compiler errors.

When I was putting on the Batteryconnector I accidently broke the small SMD resistor, it seems this SMD resistor was regulating the power, now the microcontroller is asking too much power. I don’t have any spare SMD resistors. Anyone has any ideas how to fix it, maybe without it? Or is replacing the SMD resistor the only way?
TTGOv1-Back-broke-resistor

You could search for the schematic diagram of the board and verify the function of that capacitor.
If you break a component it usually needs to be repaired/replaced. Is the PCB itself (soldering pads / PCB traces) still undamaged?
There are no real alternatives, i.e. not reparing (except for replacing the complete board).

Can’t be fixed… :disappointed:

Is there any TTN Mapper software for ESP32 and LMIC ?

About a week ago I was looking for an answer on the same question…
I have not found anything directly applicable.
There is a design published there, but the author did not give any comments on how to build it.

Finally, I’ve written my own code. It was easier than I expected.
I took reference ttn-abp and ttn-otaa LMIC examples first, then altered payload to match values I need to send to comply with TTN Mapper input data.

Then I’ve integrated the ttn-abp example and now it is a part of my project:

Thanks for the comment, I saw the design you linked too, but as you say no code.

I am keen to keep such a program within a standard Arduino environment, and for me the least painfull way of doing that is perhaps a LMIC fork that does not expect the compiler to fix the datatype miss-matches.

I thought of trying to make the changes starting from a known working example, so I loaded up the Dragino TTN Mapper and whilst that sends LoRa packets through the gateway I have here it does not appear to be sending a join request.

One of the difficulties I am having is locating some documentation that explains what happens when nodes communicate with a Gateway, what packets are sent and received during the different join requests and normal data gathering and their respective formats.

.

I am not 100% sure because I did this clone a year ago, but likely I took this repo as a reference source and can’t remind if I had any difficulties of building it either for ESP8266 or ESP32 Arduino Core.
There is also a branch there that is known to run well on Raspberry Pi in command line environment.

That library produces the same missmatch as the other LMIC library I was using.

It shows as a compiler warning;

warning: invalid conversion from ‘uint8_t {aka unsigned char}’ to ‘xref2u1_t {aka unsigned char*}’ [-fpermissive]

I am not saying the ‘fix’ is difficult and you could claim that its only a warning and the compiler can make the ‘fix’ for you. But that is only the case if for the hardware you are using the -fpermissive flag is set, and it is not for ESP32 and ATMEAG1284. Not difficult to add the --fpermissive but it does involve a manual edit of a text file. Fixing the core issue seems to make more sense to me.

Just curious, when/where do you get this warning?:
– In Arduino IDE or PlatformIO?
– Using arduino-esp32 or esp32-idf?
– Do you get the warning only with Dragino TTN Mapper or also with the standard LMIC TTN examples?

I’ve been working with the M5Stack platform (ESP32-based) and just shared with you my work so far. I think it could be a great platform for all sorts of moving nodes, including a TTNMapper node.

I am using the Arduino IDE, with the Dragino TTN mapper and another ESP32 TTN mapper I found, when compliling for ESP32.

The standard TTN-ABP example compliles OK, although it appears to use memcpy_p to copy the NWKSKEY from one area of memory (buffer) to another.

Maybe I just dont understand C\C++ well enough.

I was wondering where the error occurs because I had not seen it with the LMIC TTN examples.
So the error occurs ‘only’ with the TTN Mapper programs(?).
Because they use LMIC-Arduino features that are not used by the LMIC TTN examples?

Possibly, I noticed that in oslmic.h there are quite a few typdefs, such as;

typedef const u1_t* xref2cu1_t;

So you can loose track of what going on if you have -fpermisive set.

Hello Verkehrsrot,

Looking at your v2.1 picture, I don’t see any wiring for the DIO pins like on earlier TTGO v2 or v1 devices.
Does that mean LMIC code will work without any wiring on the TTGO v2.1 or is it something specific to paxcounter?

Cheers.

Yes, TTGO v2.1 has DIO0, DIO1 and DIO2 wired on pcb. No need for external cabling when using lmic.

You can use my ESP32 Paxcounter software, it has GPS support now. Just disable the counter features, then you have a ESP32 device ready to use for ttnmapper.

1 Like

And how do I get this code into an ESP32 ?

äähm - flash it into?