adafruit feather 32u4 lora ota
1.0.0
这是Thomas Telkamp和Matthijs Kooijman的Adafruit Feather 32U4的TTN-OTAA示例的改编。
用Arduino IDE版本1.8.5对此进行了测试。

// Uncomment this to disable all code related to ping
#define DISABLE_PING
// Uncomment this to disable all code related to beacon tracking.
// Requires ping to be disabled too
#define DISABLE_BEACONS 在“事物”网络控制台中注册新设备,您将获得一个
现在,您必须在源代码中添加这些值:
static const u1_t PROGMEM APPEUI [ 8 ] = { 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
void os_getArtEui ( u1_t * buf ) { memcpy_P ( buf , APPEUI , 8 );}
// This should also be in little endian format, see above.
static const u1_t PROGMEM DEVEUI [ 8 ] = { 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };
void os_getDevEui ( u1_t * buf ) { memcpy_P ( buf , DEVEUI , 8 );}
// This key should be in big endian format (or, since it is not really a
// number but a block of memory, endianness does not really apply). In
// practice, a key taken from ttnctl can be copied as-is.
// The key shown here is the semtech default key.
static const u1_t PROGMEM APPKEY [ 16 ] = { 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 };请注意,必须以“小endian格式”指定应用程序和设备EUI。 TTN控制台中有一些按钮可帮助您将数字序列转换为LSB格式。

注意:不建议使用所谓的单渠道通道,因为它仅支持三个联接频率之一。因此,您只有1:3连接操作实际击中单个支持的频率的机会。此外,目前尚不清楚这些网关是否支持从TTN回到设备的通信,因此您可能永远不会收到连接操作成功的反馈。