Advertisement
Guest User

Untitled

a guest
May 21st, 2017
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. from network import LoRa
  2. import time
  3. import pycom
  4.  
  5. pycom.heartbeat(False)
  6. pycom.rgbled(0x7f0000) #red
  7. lora = LoRa()
  8. lora.init(mode=LoRa.LORAWAN, frequency=923000000, sf=7, public=1)
  9.  
  10. app_eui = binascii.unhexlify('1234567890ABCDEF')
  11. app_key = binascii.unhexlify('1234567890ABCDEF1234567890ABCDEF')
  12.  
  13. lora.join(activation=LoRa.OTAA, auth=(app_eui, app_key), timeout=0)
  14.  
  15. while not lora.has_joined():
  16.     pycom.rgbled(0x7f7f00) #yellow
  17.     time.sleep(2.5)
  18.     print('Trying to join TTN Network!')
  19.     pass
  20.    
  21. print('Network joined!')
  22. pycom.rgbled(0x007f00) #green"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement