From 7cf2e63d3dbeba00f9f451a18c37cc9523e3f6db Mon Sep 17 00:00:00 2001 From: spirkelmann Date: Sat, 30 Nov 2019 21:04:43 +0100 Subject: [PATCH] removed files --- micropython/lorawan_example.py | 42 ---------------------------------- micropython/main.py | 16 ------------- 2 files changed, 58 deletions(-) delete mode 100644 micropython/lorawan_example.py delete mode 100644 micropython/main.py diff --git a/micropython/lorawan_example.py b/micropython/lorawan_example.py deleted file mode 100644 index 96092d1..0000000 --- a/micropython/lorawan_example.py +++ /dev/null @@ -1,42 +0,0 @@ -from lora_transceiver import LoRaTransceiver - -from uPySensors.ssd1306_i2c import Display - -import uLoRaWAN -from uLoRaWAN.MHDR import MHDR - -d = Display() - -# create transceiver for LoRaWAN frequency (channel 0 = 868.1 Mhz) -lora = LoRaTransceiver(frequency=868.1E6, syncword=0x34, display=d) - -# change the spreading factor -lora.setSpreadingFactor(9) - -# set address and keys for LoRaWAN -devAddr = [0x26, 0x01, 0x16, 0x5C] # ir_test_device_01 -#devAddr = [0x26, 0x01, 0x18, 0x52] # ir_test_device_02 -#devAddr = [0x26, 0x01, 0x1E, 0x4F] # ir_test_device_03 - -nwkSKey = [0x9D, 0x95, 0x0F, 0xAB, 0xCB, 0x63, 0xD3, 0x04, 0xBC, 0x09, 0xC4, 0x9E, 0xC5, 0xDF, 0x3C, 0x37] -appSKey = [0xC9, 0x6C, 0x00, 0xD1, 0xB0, 0x1C, 0x2E, 0x42, 0x11, 0xBA, 0x32, 0x6F, 0x2F, 0xC2, 0x75, 0x6A] - -devAddr_hex = " ".join(list(map(lambda x: "{0:02x}".format(x), devAddr))).upper() -nwkSKey_hex = " ".join(list(map(lambda x: "{0:02x}".format(x), nwkSKey))).upper() -appSKey_hex = " ".join(list(map(lambda x: "{0:02x}".format(x), appSKey))).upper() -print("devAddr: ", devAddr_hex) -print("nwkSKey: ", nwkSKey_hex) -print("appSKey: ", appSKey_hex) - -# lorawan object for conversion of data in LoRaWAN message format -lorawan = uLoRaWAN.new(nwkSKey, appSKey) - -def send_lorawan(message, frame_cnt=0): - lorawan.create(MHDR.UNCONF_DATA_UP, {'devaddr': devAddr, 'fcnt': frame_cnt, 'data': list(map(ord, message)) }) - payload = lorawan.to_raw() - - lora.send(payload) - - print("lorawan message sent") - -send_lorawan("Hello world!") diff --git a/micropython/main.py b/micropython/main.py deleted file mode 100644 index cad2f2c..0000000 --- a/micropython/main.py +++ /dev/null @@ -1,16 +0,0 @@ -from lora_transceiver import LoRaTransceiver - -# create transceiver for LoRaWAN frequency (channel 0 = 868.1 Mhz) -lora = LoRaTransceiver(frequency=868.1E6, syncword=0x34) - -# change the spreading factor -lora.setSpreadingFactor(7) - -# sending string data -lora.send_string('imaginaerraum') - -# sending raw data -lora.send([0x61, 0x62, 0x63]) - -# receiving data -lora.recv()