Coder Social home page Coder Social logo

OTTA implementation about dragino HOT 11 CLOSED

Technickfreak avatar Technickfreak commented on August 16, 2024
OTTA implementation

from dragino.

Comments (11)

Technickfreak avatar Technickfreak commented on August 16, 2024 1

I've now tested it with the loop
and now works.

my script was probably too impatient beforehand.

many thanks for your help.

from dragino.

pjb304 avatar pjb304 commented on August 16, 2024

Do you mean OTAA (over the air activation) which is already implemented in the code base? Or something else, in which case feel free to implement and submit a pull request.

from dragino.

ossonts avatar ossonts commented on August 16, 2024

what are you needing? got an example

from dragino.

BNNorman avatar BNNorman commented on August 16, 2024

I find this conversation strange. As pjb304 said, OTAA is already supported and that is what I am using. You simply need to edit the lines at the end of the dragino.ini file:-

##Valid auth modes are ABP or OTAA
##All values are hex arrays eg devaddr = 0x01, 0x02, 0x03, 0x04
#auth_mode = "abp"
#devaddr = 
#nwskey = 
#appskey =

auth_mode = "otaa"

deveui =[insert your own]
appeui =[insert your own]
appkey =[insert your own]

This works for me.

from dragino.

Technickfreak avatar Technickfreak commented on August 16, 2024

yes I mean OTAA, I copied it incorrectly from the script.

AUTH_ABP = "ABP"
AUTH_OTTA = "OTTA"

Die send_bytes-Methode ist nur für ABP optimiert und ich habe keine andere für OTAA gefunden.

dragino/dragino/dragino.py

Lines 195 to 201 in 55b56af

def send_bytes(self, message):
"""
Send a list of bytes over the LoRaWAN channel
"""
attempt = 0
if self.network_key is None or self.apps_key is None: # either using ABP / join has run
raise DraginoError("No network and/or apps key")

from dragino.

Technickfreak avatar Technickfreak commented on August 16, 2024

##Valid auth modes are ABP or OTAA
##All values are hex arrays eg devaddr = 0x01, 0x02, 0x03, 0x04
#auth_mode = "abp"
#devaddr =
#nwskey =
#appskey =

auth_mode = "otaa"

deveui =[insert your own]
appeui =[insert your own]
appkey =[insert your own]

I did that.

dragino/dragino/dragino.py

Lines 200 to 201 in 55b56af

if self.network_key is None or self.apps_key is None: # either using ABP / join has run
raise DraginoError("No network and/or apps key")

only if appskey is empty then sending is aborted at the point. (the appskey from abp)

from dragino.

BNNorman avatar BNNorman commented on August 16, 2024

Looks like your JOIN_REQUEST may have failed. Any chance of us seeing your log file? Be aware though, in DEBUG mode the logfile will include your devui, appeui and appkey - so edit those lines before posting.

In my app I use a loop to wait for a join before trying to send anything.

DRAGINO = Dragino(DRAGINO_INI,logging_level=logging.DEBUG)
logger.info("Waiting for JOIN to TTN")
DRAGINO.join()
while not DRAGINO.registered():
    pass
logger.info("JOINED to TTN")

Have you made any changes to the dragino.py code? The standard code works fine if you don't need downlinks. (I modified rx_done() to pass those on to my code).

from dragino.

ossonts avatar ossonts commented on August 16, 2024

@BNNorman yes same -- this is key

while not DRAGINO.registered():
    pass

Also: you may want to slow the loop down a bit :-)

from dragino.

RaghavRao avatar RaghavRao commented on August 16, 2024

Hey, dumb question, but do I copy all the values as big-endian? I remember raspi-lmic needed some little-endian

from dragino.

BNNorman avatar BNNorman commented on August 16, 2024

Just copy paste from ttn is all i did.

from dragino.

pjb304 avatar pjb304 commented on August 16, 2024

I just copy and paste from ttn console well - having changed the mode to output the correct array format

from dragino.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.