Änderungen
Aus Hackerspace Ffm
LoRaWAN
,/* LoRaWAN */
* [https://github.com/mcci-catena/arduino-lorawan MCCI Catena Arduino-Lorawan]
<pre>
// Enable data rate adaptation
Kurzer LMIC Code: [https://github.com/SensorsIot/LoRa/blob/master/Nodes/Dragino/HelloWorld/HelloWorld.ino]
=== Packete empfangen ===
<pre>
case EV_TXCOMPLETE:
Serial.print(F("EV_TXCOMPLETE: "));
if (LMIC.txrxFlags & TXRX_ACK) {
rxcounter++;
Serial.println(F("Received ack."));
}
if (LMIC.dataLen) {
Serial.print(F("Received "));
Serial.print(LMIC.dataLen);
Serial.print(F(" bytes of payload: "));
for(int d=0; d<LMIC.dataLen; d++) {
Serial.print(*(uint8_t *)(LMIC.frame+LMIC.dataBeg+d), HEX);
Serial.print(" ");
}
rxcounter2 += LMIC.dataLen;
}
// Schedule next transmission
Serial.print(F(" txChn1 "));
Serial.print(LMIC.txChnl);
Serial.print(F(", datarate "));
Serial.println(LMIC.datarate);
os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
break;
</pre>
== Fertige Hardware (Boards) ==