Big ESP32 + SX127x topic part 3

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.