Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a feature to be able to work even with no DIO pin connected #14

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

hallard
Copy link

@hallard hallard commented Jan 26, 2017

If the three DIO pin are declared as LMIC_UNUSED_PIN, then pool IRQ register from radio Module to detect changes. This permit working only with SPI connections.
You just need to declare 3 .dio to LMIC_UNUSED_PIN, in your sketch and LMIC stack will do the job for you.

// Example with NO DIO pin connected
const lmic_pinmap lmic_pins = {
    .nss = 16,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = LMIC_UNUSED_PIN,
    .dio = {LMIC_UNUSED_PIN, LMIC_UNUSED_PIN, LMIC_UNUSED_PIN},
};

@chrismerck
Copy link
Member

How bad is the performance hit here? Have you tested downlink? (Both RX windows?) and what polling rate?

@hallard
Copy link
Author

hallard commented Jan 26, 2017

Hi Chris
Thanks for your quick answer, I've done test and posted results on this Original LMIC Pull Request, you'll see them following the discussion.

But polling occurs only if there is no DIO connection (all 3 DIO pins declared as LMIC_UNUSED_PIN), in all other cases, nothings change.

Charles

@hallard
Copy link
Author

hallard commented Jan 27, 2017

Chris,
I just added printf wrapper (printf was not working on Arduino Zero) and remapped Serial to SerialUSB for Arduino Zero, I can now see log on Zero.

Now this stack works perfectly, downlink also (without any DIO connected) on

Here my sketch serial output ;-)

Starting on Arduino Mega
Compiled with RFM95 / SPI=8MHZ / AES=ORIGINAL
Pinout :  DIO0=None DIO1=None DIO2=None
Flash CHIP Found, listing flash content
ch2i-appeui[8]
sp2mi-appeui[8]
appkey[16]
deveui[8]
Trying to read LoraWAN Config from flash
Reading file sp2mi-appeui
Reading file deveui
Reading file appkey
AppEUI : ****************
DevEUI : **************** 
AppKey : ********************************
RXMODE_RSSI
00:00:00 (00:00:00) EV_JOINING
2297: engineUpdate, opmode=0x4
180018: engineUpdate, opmode=0x4
00:00:02 (00:00:02) EV_TXSTART
180225: engineUpdate, opmode=0x884
180309: TXMODE, freq=868100000, len=23, SF=7, BW=125, CR=4/5, IH=0
493226: RXMODE_SINGLE, freq=868100000, SF=7, BW=125, CR=4/5, IH=0
501118: Setup channel, idx=3, freq=867100000
501170: Setup channel, idx=4, freq=867300000
501293: Setup channel, idx=5, freq=867500000
501538: Setup channel, idx=6, freq=867700000
501782: Setup channel, idx=7, freq=867900000
00:00:08 (00:00:06) EV_JOINED First packet will be send in 6s
502364: engineUpdate, opmode=0x800
00:00:14 Packet queued => '1284p-0x01'
877413: engineUpdate, opmode=0x808
00:00:14 (00:00:06) EV_TXSTART
877706: engineUpdate, opmode=0x888
877847: TXMODE, freq=867500000, len=23, SF=7, BW=125, CR=4/5, IH=0
943264: RXMODE_SINGLE, freq=867500000, SF=7, BW=125, CR=4/5, IH=0
946494: Received downlink, window=RX1, port=-1, ack=1
00:00:15 (00:00:01) EV_TXRX_COMPLETE Received ACK in RX1 / Next in 120s
946863: engineUpdate, opmode=0x800
00:02:15 Packet queued => '1284p-0x01'
8446913: engineUpdate, opmode=0x808
00:02:15 (00:02:00) EV_TXSTART
8447207: engineUpdate, opmode=0x888
8447357: TXMODE, freq=868300000, len=23, SF=7, BW=125, CR=4/5, IH=0
8512769: RXMODE_SINGLE, freq=868300000, SF=7, BW=125, CR=4/5, IH=0
8516002: Received downlink, window=RX1, port=-1, ack=1
00:02:16 (00:00:01) EV_TXRX_COMPLETE Received ACK in RX1 / Next in 120s
8516376: engineUpdate, opmode=0x800
00:04:16 Packet queued => '1284p-0x01'
16016426: engineUpdate, opmode=0x808
00:04:16 (00:02:00) EV_TXSTART
16016729: engineUpdate, opmode=0x888
16016881: TXMODE, freq=867700000, len=23, SF=7, BW=125, CR=4/5, IH=0
16082293: RXMODE_SINGLE, freq=867700000, SF=7, BW=125, CR=4/5, IH=0
16085460: Received downlink, window=RX1, port=-1, ack=1
00:04:17 (00:00:01) EV_TXRX_COMPLETE Received ACK in RX1 / Next in 120s
16085840: engineUpdate, opmode=0x800
00:06:17 Packet queued => '1284p-0x01'
23585884: engineUpdate, opmode=0x808
00:06:17 (00:02:00) EV_TXSTART
23586187: engineUpdate, opmode=0x888
23586339: TXMODE, freq=868500000, len=23, SF=7, BW=125, CR=4/5, IH=0
23651753: RXMODE_SINGLE, freq=868500000, SF=7, BW=125, CR=4/5, IH=0
23713997: RXMODE_SINGLE, freq=869525000, SF=9, BW=125, CR=4/5, IH=0
23723986: Received downlink, window=RX2, port=-1, ack=1
00:06:19 (00:00:02) EV_TXRX_COMPLETE Received ACK in RX2 / Next in 120s
23724367: engineUpdate, opmode=0x800
00:08:19 Packet queued => '1284p-0x01'
31224412: engineUpdate, opmode=0x808
00:08:19 (00:02:00) EV_TXSTART
31224716: engineUpdate, opmode=0x888
31224868: TXMODE, freq=867900000, len=23, SF=7, BW=125, CR=4/5, IH=0
31290285: RXMODE_SINGLE, freq=867900000, SF=7, BW=125, CR=4/5, IH=0
31293512: Received downlink, window=RX1, port=-1, ack=1
00:08:20 (00:00:01) EV_TXRX_COMPLETE Received ACK in RX1 / Next in 120s
31293893: engineUpdate, opmode=0x800
00:10:20 Packet queued => '1284p-0x01'
38793941: engineUpdate, opmode=0x808
00:10:20 (00:02:00) EV_TXSTART
38794252: engineUpdate, opmode=0x888
38794394: TXMODE, freq=868100000, len=23, SF=7, BW=125, CR=4/5, IH=0
38859810: RXMODE_SINGLE, freq=868100000, SF=7, BW=125, CR=4/5, IH=0
38863036: Received downlink, window=RX1, port=-1, ack=1
00:10:21 (00:00:01) EV_TXRX_COMPLETE Received ACK in RX1 / Next in 120s
38863417: engineUpdate, opmode=0x800

And set a downlink
image

Received fine

00:16:24 (00:02:00) EV_TXSTART
61502831: engineUpdate, opmode=0x888
61502978: TXMODE, freq=867300000, len=23, SF=7, BW=125, CR=4/5, IH=0
61568393: RXMODE_SINGLE, freq=867300000, SF=7, BW=125, CR=4/5, IH=0
61630637: RXMODE_SINGLE, freq=869525000, SF=9, BW=125, CR=4/5, IH=0
61643215: Received downlink, window=RX2, port=1, ack=1
00:16:26 (00:00:02) EV_TXRX_COMPLETE Received ACK in RX2 Received Payload[5] => 01 02 03 04 05  in RX2 / Next in 120s
61643834: engineUpdate, opmode=0x800

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants