daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest May 21st, 2017 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top