Skip to content

Instantly share code, notes, and snippets.

@rbricheno
Created May 30, 2019 22:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbricheno/da259e7fe1009ef051dd67f17bb9b199 to your computer and use it in GitHub Desktop.
Save rbricheno/da259e7fe1009ef051dd67f17bb9b199 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from rak811 import Mode, Rak811
import time
lora = Rak811()
lora.hard_reset()
lora.mode = Mode.LoRaWan
lora.band = 'EU868'
lora.set_config(dev_eui='xxxxxxxxxxxxxxxx',
app_eui='xxxxxxxxxxxxxxxx',
app_key='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx')
lora.join_otaa()
lora.dr = 5
while True:
lora.send('1')
time.sleep(30)
lora.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment