If you’re saying that you did not change the values for NWKSKEY
and APPSKEY
(along with DEVADDR
) then: indeed, that won’t work as those won’t match the values for your device in TTN Console. You’ll need to change 3 values in the code to match the values in TTN Console; see Format of Keys and ID’s for Arduino LMIC libraries [HowTo].
Also, that old code is for EU868, but is missing the settings for RX2 to support downlinks, but you’re not using downlinks right now.
(Please see also How do I format my forum post? [HowTo] — your last post didn’t really invite people to pay any attention to it, I’d say.)