Thanks for the reply. The gateway is located an arm-length away within line of sight. I tried to OTAA all day long but the same problem persists, unless I re-upload the tracker sketch and put in my keys with commands, then it works. Besides, the only error message I get is "OTAA setup failed!" "There was no response from the device" after it resets my keys.
This happens after I unplug the power. It just forgets the keys and I can't put the keys back in with the basic sketch. I need to use the tracker sketch to put in the keys, after which I can upload the basic sketch. Otherwise it doesn't work.