Giter VIP home page Giter VIP logo

dragino-1's People

Contributors

bnnorman avatar jeroennijhof avatar liyaojiang1998 avatar pjb304 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dragino-1's Issues

Errors in log file

I am have some code that is using your library and is reading Atlas Scientific sensors installed on a raspberry pi every 15 minutes.

I am seeing error in the error log and have listed this below. The error seems to result in the data packet not being transmitted to my lorawan gateway When I view the logs on my own lorawan gateway and on the TTN console I am seeing quite of lot of missing fcnt counts and thought this error might be the cause of it.

2022-04-13 07:15:01,225 - registered - 550 - INFO - checking if already registered.
2022-04-13 07:15:01,225 - registered - 556 - INFO - devaddr [38, 11, 58, 184] len 4.
2022-04-13 07:15:01,226 - registered - 572 - INFO - Already registered
2022-04-13 07:15:01,226 - getSendSettings - 259 - DEBUG - using send settings: freq 867.9 sf 9 bw 7
2022-04-13 07:15:01,226 - configureRadio - 173 - INFO - freq=867.9 sf=9 bw=7
2022-04-13 07:15:01,229 - getFOpts - 560 - INFO - check for FOpts to attach to uplink len=0 FOpts=bytearray(b'')
2022-04-13 07:15:01,230 - getFOpts - 565 - INFO - no FOpts
2022-04-13 07:15:01,230 - saveCache - 489 - INFO - Saving MAC settings
2022-04-13 07:15:01,237 - _sendPacket - 644 - DEBUG - Sending packet raw payload = [64, 184, 58, 11, 38, 0, 191, 7, 1, 14, 248, 251, 131, 225, 101, 102, 200, 119, 19, 229, 196, 194, 233, 173, 57, 24, 100, 209, 220, 122, 177, 168, 158, 94, 128, 198, 244, 193, 26, 167, 63, 54, 125, 172, 137]
2022-04-13 07:15:01,549 - on_tx_done - 426 - INFO - switching to RX1
2022-04-13 07:15:01,550 - getRX1Settings - 278 - DEBUG - RX1 settings : freq 867.9 sf 9 bw 7
2022-04-13 07:15:01,550 - configureRadio - 173 - INFO - freq=867.9 sf=9 bw=7
2022-04-13 07:15:01,553 - on_tx_done - 432 - INFO - setting timer delay {delay} to switch to RX2
2022-04-13 07:30:06,175 - registered - 550 - INFO - checking if already registered.
2022-04-13 07:30:06,175 - registered - 556 - INFO - devaddr [38, 11, 58, 184] len 4.
2022-04-13 07:30:06,176 - registered - 572 - INFO - Already registered
2022-04-13 07:30:06,176 - _sendPacket - 664 - ERROR - list index out of range
Traceback (most recent call last):
File "/home/pi/water-quality-lorawan-dragino-pi/dragino/dragino.py", line 601, in _sendPacket
self.configureRadio(radioSettings.SEND)
File "/home/pi/water-quality-lorawan-dragino-pi/dragino/dragino.py", line 167, in configureRadio
freq,sf,bw=self.MAC.getSendSettings()
File "/home/pi/water-quality-lorawan-dragino-pi/dragino/MAChandler.py", line 254, in getSendSettings
freq=self.cache[CHANNEL_TX_FREQS][self.currentChannel]
IndexError: list index out of range
2022-04-13 07:45:10,805 - registered - 550 - INFO - checking if already registered.
2022-04-13 07:45:10,806 - registered - 556 - INFO - devaddr [38, 11, 58, 184] len 4.
2022-04-13 07:45:10,806 - registered - 572 - INFO - Already registered
2022-04-13 07:45:10,806 - getSendSettings - 259 - DEBUG - using send settings: freq 867.3 sf 9 bw 7
2022-04-13 07:45:10,807 - configureRadio - 173 - INFO - freq=867.3 sf=9 bw=7
2022-04-13 07:45:10,810 - getFOpts - 560 - INFO - check for FOpts to attach to uplink len=0 FOpts=bytearray(b'')
2022-04-13 07:45:10,810 - getFOpts - 565 - INFO - no FOpts
2022-04-13 07:45:10,811 - saveCache - 489 - INFO - Saving MAC settings
2022-04-13 07:45:10,818 - _sendPacket - 644 - DEBUG - Sending packet raw payload = [64, 184, 58, 11, 38, 0, 192, 7, 1, 69, 38, 121, 70, 183, 134, 70, 218, 89, 24, 112, 138, 157, 254, 67, 18, 49, 180, 165, 190, 181, 131, 171, 181, 38, 9, 173, 213, 19, 241, 221, 77, 6, 20, 150, 25]
2022-04-13 07:45:11,131 - on_tx_done - 426 - INFO - switching to RX1
2022-04-13 07:45:11,131 - getRX1Settings - 278 - DEBUG - RX1 settings : freq 867.3 sf 9 bw 7
2022-04-13 07:45:11,131 - configureRadio - 173 - INFO - freq=867.3 sf=9 bw=7
2022-04-13 07:45:11,135 - on_tx_done - 432 - INFO - setting timer delay {delay} to switch to RX2

OTAA Connection Issue

Dear @BNNorman,

I am experiencing difficulties in establishing an OTAA connection using the library. Below are the logs captured during my attempt to connect with test.py :

2024-04-22 21:46:00,582 - __init__ - 78 - INFO - __init__ starting
2024-04-22 21:46:01,223 - setCacheDefaults - 413 - INFO - Setting default MAC values using user config values
2024-04-22 21:46:01,223 - getFrequencyPlan - 342 - INFO - loading frequency plan
2024-04-22 21:46:01,223 - getFrequencyPlan - 345 - INFO - Frequency Plan is EU_863_870_TTN
2024-04-22 21:46:01,224 - getFrequencyPlan - 354 - INFO - Frequency Plan loaded ok
2024-04-22 21:46:01,224 - setCacheDefaults - 479 - INFO - MAC default settings finished
2024-04-22 21:46:01,224 - __init__ - 104 - DEBUG - Setting self.cache[fCntUp] to 0
2024-04-22 21:46:01,225 - __init__ - 104 - DEBUG - Setting self.cache[fCntDn] to 0
2024-04-22 21:46:01,225 - __init__ - 104 - DEBUG - Setting self.cache[rx1_delay] to 5
2024-04-22 21:46:01,225 - __init__ - 104 - DEBUG - Setting self.cache[rx2_delay] to 1
2024-04-22 21:46:01,225 - __init__ - 104 - DEBUG - Setting self.cache[rx1_DR] to 3
2024-04-22 21:46:01,226 - __init__ - 104 - DEBUG - Setting self.cache[rx2_DR] to 3
2024-04-22 21:46:01,226 - __init__ - 108 - INFO - missing TTN section key rx1_freq_fixed ignored
2024-04-22 21:46:01,227 - __init__ - 108 - INFO - missing TTN section key rx1_frequency ignored
2024-04-22 21:46:01,227 - __init__ - 104 - DEBUG - Setting self.cache[rx2_frequency] to 869.525
2024-04-22 21:46:01,227 - __init__ - 108 - INFO - missing TTN section key duty_cycle ignored
2024-04-22 21:46:01,227 - __init__ - 104 - DEBUG - Setting self.cache[data_rate] to 3
2024-04-22 21:46:01,228 - __init__ - 116 - DEBUG - Setting self.cache[devaddr] to [0, 0, 0, 0]
2024-04-22 21:46:01,228 - __init__ - 116 - DEBUG - Setting self.cache[deveui] to [112, 179, 213, 126, 208, 6, 110, 35]
2024-04-22 21:46:01,228 - __init__ - 119 - INFO - Missing OTAA TTN key nwkskey ignored
2024-04-22 21:46:01,229 - __init__ - 119 - INFO - Missing OTAA TTN key appskey ignored
2024-04-22 21:46:01,229 - __init__ - 116 - DEBUG - Setting self.cache[appeui] to [170, 170, 170, 170, 170, 170, 170, 170]
2024-04-22 21:46:01,229 - __init__ - 116 - DEBUG - Setting self.cache[appkey] to [5, 164, 28, 178, 1, 211, 183, 215, 203, 94, 232, 60, 155, 89, 238, 86]
2024-04-22 21:46:01,230 - loadCache - 524 - INFO - Loading MAC settings
2024-04-22 21:46:01,230 - loadCache - 542 - INFO - cached settings load failed [Errno 2] No such file or directory: 'cache.json'. Saving current defaults
2024-04-22 21:46:01,230 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:01,232 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:01,234 - __init__ - 141 - INFO - __init__ done
2024-04-22 21:46:01,235 - __init__ - 97 - WARNING - Not enabling GPS (see enableGPS param)
2024-04-22 21:46:01,236 - __init__ - 134 - INFO - __init__ done
2024-04-22 21:46:01,237 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:01,237 - registered - 563 - INFO - devaddr [0, 0, 0, 0] len 4.
2024-04-22 21:46:01,237 - registered - 571 - DEBUG - devaddr not assigned 
2024-04-22 21:46:01,238 - join - 491 - INFO - Performing OTAA Join
2024-04-22 21:46:01,238 - getJoinSettings - 230 - DEBUG - using join settings: freq 868.5 sf 9 bw 7
2024-04-22 21:46:01,238 - configureRadio - 174 - INFO -  freq=868.5 sf=9 bw=7
2024-04-22 21:46:01,241 - _tryToJoin - 504 - INFO - trying to join TTN
2024-04-22 21:46:01,241 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:01,242 - registered - 563 - INFO - devaddr [0, 0, 0, 0] len 4.
2024-04-22 21:46:01,242 - registered - 571 - DEBUG - devaddr not assigned 
2024-04-22 21:46:01,242 - _tryToJoin - 514 - DEBUG - App key = [5, 164, 28, 178, 1, 211, 183, 215, 203, 94, 232, 60, 155, 89, 238, 86]
2024-04-22 21:46:01,243 - _tryToJoin - 515 - DEBUG - App eui = [170, 170, 170, 170, 170, 170, 170, 170]
2024-04-22 21:46:01,243 - _tryToJoin - 516 - DEBUG - Dev eui = [112, 179, 213, 126, 208, 6, 110, 35]
2024-04-22 21:46:01,243 - _tryToJoin - 517 - DEBUG - Devnonce= [69, 132]
2024-04-22 21:46:01,246 - _tryToJoin - 528 - DEBUG - sending packet [0, 170, 170, 170, 170, 170, 170, 170, 170, 35, 110, 6, 208, 126, 213, 179, 112, 69, 132, 128, 42, 207, 219]
2024-04-22 21:46:01,248 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:01,248 - registered - 563 - INFO - devaddr [0, 0, 0, 0] len 4.
2024-04-22 21:46:01,248 - registered - 571 - DEBUG - devaddr not assigned 
2024-04-22 21:46:01,454 - on_tx_done - 427 - INFO - switching to RX1
2024-04-22 21:46:01,455 - getRX1Settings - 278 - DEBUG - RX1 settings : freq 868.5 sf 9 bw 7
2024-04-22 21:46:01,455 - configureRadio - 174 - INFO -  freq=868.5 sf=9 bw=7
2024-04-22 21:46:01,457 - on_tx_done - 433 - INFO - setting timer delay {delay} to switch to RX2
2024-04-22 21:46:03,251 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:03,252 - registered - 563 - INFO - devaddr [0, 0, 0, 0] len 4.
2024-04-22 21:46:03,252 - registered - 571 - DEBUG - devaddr not assigned 
2024-04-22 21:46:05,255 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:05,255 - registered - 563 - INFO - devaddr [0, 0, 0, 0] len 4.
2024-04-22 21:46:05,256 - registered - 571 - DEBUG - devaddr not assigned 
2024-04-22 21:46:06,703 - on_rx_done - 350 - DEBUG - Received message...
2024-04-22 21:46:06,705 - on_rx_done - 366 - DEBUG - raw payload [32, 124, 35, 143, 135, 113, 126, 151, 212, 149, 21, 34, 28, 23, 89, 140, 97, 2, 114, 4, 234, 237, 216, 150, 144, 23, 14, 228, 154, 203, 6, 54, 206]
2024-04-22 21:46:06,705 - process_JOIN_ACCEPT - 218 - DEBUG - Trying to process JOIN_ACCEPT
2024-04-22 21:46:06,707 - process_JOIN_ACCEPT - 226 - DEBUG - decoded JOIN_ACCEPT payload [15, 0, 0, 19, 0, 0, 61, 89, 11, 38, 3, 5, 24, 79, 132, 232, 86, 132, 184, 94, 132, 136, 102, 132, 88, 110, 132, 0]
2024-04-22 21:46:06,708 - setLastSNR - 149 - INFO - last SNR value 50.5
2024-04-22 21:46:06,708 - setRX1Delay - 169 - INFO - set RX1 delay 5
2024-04-22 21:46:06,709 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:06,712 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:06,717 - setDLsettings - 376 - INFO - DL settings rx1_dr_offset0 rx1_DR 3 rx2_DR 3
2024-04-22 21:46:06,719 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:06,724 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:06,729 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:06,734 - process_JOIN_ACCEPT - 269 - DEBUG - devaddr: [38, 11, 89, 61]
2024-04-22 21:46:06,734 - process_JOIN_ACCEPT - 270 - DEBUG - nwkskey: [152, 85, 14, 179, 75, 201, 101, 250, 245, 50, 1, 230, 104, 39, 137, 56]
2024-04-22 21:46:06,735 - process_JOIN_ACCEPT - 271 - DEBUG - appskey: [211, 201, 209, 25, 141, 23, 253, 4, 69, 39, 66, 148, 125, 255, 59, 206]
2024-04-22 21:46:06,735 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:06,739 - saveCache - 489 - INFO - Saving MAC settings
2024-04-22 21:46:07,258 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:07,259 - registered - 563 - INFO - devaddr [38, 11, 89, 61] len 4.
2024-04-22 21:46:07,260 - registered - 583 - INFO - whilst checking devaddr [38, 11, 89, 61] error was 'devaddr'
2024-04-22 21:46:09,262 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:09,263 - registered - 563 - INFO - devaddr [38, 11, 89, 61] len 4.
2024-04-22 21:46:09,263 - registered - 583 - INFO - whilst checking devaddr [38, 11, 89, 61] error was 'devaddr'
2024-04-22 21:46:11,266 - registered - 557 - INFO - checking if already registered.
2024-04-22 21:46:11,266 - registered - 563 - INFO - devaddr [38, 11, 89, 61] len 4.
2024-04-22 21:46:11,267 - registered - 583 - INFO - whilst checking devaddr [38, 11, 89, 61] error was 'devaddr'
2024-04-22 21:46:13,269 - registered - 557 - INFO - checking if already registered.
...

It appears that despite receiving a JOIN_ACCEPT packet, the device does not seem to be properly registered, as indicated by the repeated 'devaddr' error.

Could you please advise if there are specific configurations or steps I might have missed? Any help in resolving this issue would be greatly appreciated.

Thank you for your time and assistance.

Best regards,

Issue with Missing Method in Dragino Library

Dear @BNNorman,

I hope this message finds you well. I am currently working with the Dragino library on a Raspberry Pi project, and I have encountered this error that seems to stem from a missing method within the library.

Here is the error message:

Traceback (most recent call last):
  File "/home/pi/dragino-1/./test.py", line 27, in <module>
    D.join()
  File "/home/pi/dragino-1/dragino/dragino.py", line 493, in join
    self.configureRadio(radioSettings.JOIN)
  File "/home/pi/dragino-1/dragino/dragino.py", line 185, in configureRadio
    self.set_spreading_factor(sf)
  File "/home/pi/dragino-1/dragino/SX127x/LoRa.py", line 663, in set_spreading_factor
    self.set_low_data_rate()
AttributeError: 'Dragino' object has no attribute 'set_low_data_rate'

The issue arises when trying to configure the radio settings using the set_spreading_factor method, which in turn attempts to call set_low_data_rate. However, it appears that the set_low_data_rate method does not exist in the Dragino class.

Could you please provide guidance on whether there is a fix or a workaround for this issue? Alternatively, if there is an updated version of the library that addresses this, could you point me in the right direction?

Thank you for your assistance.

Best regards,

Impossible to Set a Fixed SF

Hi, Am I the only one unable to set a fixed SF to 7? If I set it into the Toml file (ADR = 5), then the node can't join the TTN network, while if I keep it at ADR = 3, then it joins the network correctly but with SF9. I need to use SF7, ADR is not enabled in TTN but the problem persist, where am I wrong?
Thank you for your work

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.