@@ -46,32 +46,32 @@ SX1276 module requires a number of standard SPI pins (CS, SCK, MOSI and MISO), a
46
46
import utime
47
47
from ulora import TTN , uLoRa
48
48
# Refer to device pinout / schematics diagrams for pin details
49
- LORA_CS = const(18 )
50
- LORA_SCK = const(5 )
51
- LORA_MOSI = const(27 )
52
- LORA_MISO = const(19 )
53
- LORA_IRQ = const(26 )
54
- LORA_RST = const(14 )
55
- LORA_DATARATE = " SF9BW125" # Choose from several available
56
- # From TTN console for device
57
- DEVADDR = bytearray ([0x 00 , 0x 00 , 0x 00 , 0x 00 ])
58
- NWKEY = bytearray ([0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ,
59
- 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ])
60
- APP = bytearray ([0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ,
61
- 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ])
49
+ LORA_CS = const(18 )
50
+ LORA_SCK = const(5 )
51
+ LORA_MOSI = const(27 )
52
+ LORA_MISO = const(19 )
53
+ LORA_IRQ = const(26 )
54
+ LORA_RST = const(14 )
55
+ LORA_DATARATE = " SF9BW125" # Choose from several available
56
+ # From TTN console for device
57
+ DEVADDR = bytearray ([0x 00 , 0x 00 , 0x 00 , 0x 00 ])
58
+ NWKEY = bytearray ([0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ,
59
+ 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ])
60
+ APP = bytearray ([0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ,
61
+ 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 , 0x 00 ])
62
62
TTN_CONFIG = TTN(DEVADDR , NWKEY , APP , country = " EU" )
63
- FPORT = 1
64
- lora = uLoRa(
65
- cs = LORA_CS ,
66
- sck = LORA_SCK ,
67
- mosi = LORA_MOSI ,
68
- miso = LORA_MISO ,
69
- irq = LORA_IRQ ,
70
- rst = LORA_RST ,
71
- ttn_config = TTN_CONFIG ,
72
- datarate = LORA_DATARATE ,
73
- fport = FPORT
74
- )
63
+ FPORT = 1
64
+ lora = uLoRa(
65
+ cs = LORA_CS ,
66
+ sck = LORA_SCK ,
67
+ mosi = LORA_MOSI ,
68
+ miso = LORA_MISO ,
69
+ irq = LORA_IRQ ,
70
+ rst = LORA_RST ,
71
+ ttn_config = TTN_CONFIG ,
72
+ datarate = LORA_DATARATE ,
73
+ fport = FPORT
74
+ )
75
75
# ...Then send data as bytearray
76
76
lora.send_data(data, len (data), lora.frame_counter)
77
77
0 commit comments