In Part-1 of this post I explored my attempt to get a LoRa gateway (RAK Wireless 2247) and end node (Heltec LoRa CubeCell) connected to TheThingsNetwork (TTN). After two days of deep ‘funstration’ , I was about to give up. But ‘Ole Sopwith NEVER gives up. Up, over, or around – this experiment was going to work.
Many Makers at this point would strongly believe they were sold bum hardware. You know the drill, “When in doubt – blame the hardware.” I do not subscribe to this theory. In all my years of Making, I cannot recall the last time I was shipped a Maker device that was DOA. Yes, it happens, but it is very, very, very rare. The QC in modern factories is excellent, and if something does not work out of the box, I blame the hardware last.
My problem was how to tell if the CubeCell connection problem was the CubeCell or the gateway – or both.
I spent a lot of time messing around with the devEui, appEui, and appKey arrays. Lots of documentation and videos suggest if your device does not connect, you should reverse the array entries to account for endian differences in the transport layer.
In fact, the TTN configuration page has a handy reversing capability that makes copying the entries in either order. Changing the endian order did not fix the issue.
As i continued to review the source code of the Heltec SendReceive.ino example app, I saw this code in the Setup() function: