Commit 59233d7d authored by null pointer's avatar null pointer
Browse files

* add KC-specific notes

* implement fix for slow joins
  https://www.thethingsnetwork.org/forum/t/how-long-is-an-otaa-activation-join-supposed-to-take/5299/7
* code cleanup (minor)
parent 5f82205f
No related merge requests found
Showing with 13 additions and 7 deletions
+13 -7
/*******************************************************************************
* Copyright (c) 2015 Thomas Telkamp and Matthijs Kooijman
*
* (+KC) Changes 2017 Null Pointer / Kinabalu Coders
*
* Permission is hereby granted, free of charge, to anyone
* obtaining a copy of this document and accompanying files,
* to do whatever they want with them without any restriction,
* including, but not limited to, copying, modification and redistribution.
* NO WARRANTY OF ANY KIND IS PROVIDED.
*
* This example sends a valid LoRaWAN packet with payload "Hello,
* world!", using frequency and encryption settings matching those of
* (+KC) This example sends a valid LoRaWAN packet with a abitrary string
* payload using frequency and encryption settings matching those of
* the The Things Network.
*
* This uses OTAA (Over-the-air activation), where where a DevEUI and
......@@ -25,7 +26,10 @@
* Multiple devices can use the same AppEUI, but each device has its own
* DevEUI and AppKey.
*
* Do not forget to define the radio type correctly in config.h.
* (+KC) Use the forked copy of the LMIC arduino library from
* https://github.com/CytronTechnologies/RFM-LoRa-Shield-Examples/
* arduino-lmic.zip contains the working src/lmic/config.h
* configured for: us915, sx1276_radio
*
*******************************************************************************/
......@@ -149,11 +153,12 @@ void do_send(osjob_t* j){
}
void setup() {
Serial.begin(9600);
Serial.begin(115200);
Serial.println(F("Starting"));
// LMIC init
os_init();
// Reset the MAC state. Session and pending data transfers will be discarded.
LMIC_reset();
......@@ -163,6 +168,9 @@ void setup() {
// Disable link check validation
LMIC_setLinkCheckMode(0);
// This tells LMIC to make the receive windows bigger, in case your clock is 1% faster or slower.
LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);
// TTN uses SF9 for its RX2 window.
LMIC.dn2Dr = DR_SF9;
......@@ -176,5 +184,3 @@ void setup() {
void loop() {
os_runloop_once();
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment