If I got it right, the IBM version uses only the DIO 0-2 pins on SX1276 while the Semtech implementation uses all DIO 0-5 pins.
The custom schematic with SX1276 I have uses only DIO 0-2 pins so using of IBM stack seems to be natural. However, the Semtech stack provides ping-pong example between two nodes which I would like to use (IBM stack’s examples seem to work only with gateway).
So my questions are:
how hard will it be to adapt Semtech LoraMac-node stack so that it uses only DIO 0-2 pins?
I guess a simple DIO remapping will not do the job and one will have to modify all those parts of the LoraMac-node stack where DIO 3-5 pins are used?
how hard will it be to adapt Semtech LoraMac-node stack so that it uses only DIO 0-2 pins?
SX1276 has the following usages on the pins in LoRa mode (which is used most of the time):
ModeReady (IRQ)
ClkOut
PllLock (IRQ)
ValidHeader (IRQ)
PayloadCrcError (IRQ)
The IRQ’s can however be read from the SX1276 by reading register 0x12 (LoRa) or register 0x3e or 0x3f (FSK/OOK). So it should be possible to access all status bits without these pins only perhaps some timing issues may occur.
I am not so much into LoRaMac-node code to help you any further, I have only used LMiC. So this is not of much help I guess.
I guess a simple DIO remapping will not do the job and one will have to modify all those parts of the LoraMac-node stack where DIO 3-5 pins are used?
Just asking, but how many uses of these IRQ’s are there in LoRaMac-node code? My guess: not so many.
In the last lines of this file are the functions:
SX1276OnDio3Irq, SX1276OnDio4Irq and SX1276OnDio5Irq. In these functions lie the clue to what the DIO’s are used for.
May I ask why have you chosen LMiC instead of LoraMac? I know that LMiC got available earlier than LoraMac and this is one of the reasons that many people started using LMiC.
Just wanted to make sure that people selected LMiC not because the current version of LoraMac has drawbacks or is buggy/inconsistent.
Thanks very much again for your very helpful comments.
I chose to use LMiC because it was very clear to me how to implement this in my project, also there is a clear discription on how to create the HAL. LoRaMAC-node gave so many files I was kind of lost and didn’t know how to use it.
Thanks a lot for your comments.
I agree that LMiC code is simpler and probably better documented.
May I also ask whether you tried a node-to-node connection with LMiC (i.e. without gateway)?
All the examples of LMiC involve gateway while LoraMac has a ping-pong example.
I think that missing of ping-pong example in LMiC has nothing to do with its way of implementation of the stack (i.e. it is just an unfortunate omission). Could you please also comment on this?
I didn’t do node-to-node communication, if you mean talking in LoRaWAN protocol but then node-to-node?
I did do node-to-node communication with raw LoRa, spi register writes. But not in combination with LoRaWAN, so I didn’t actually combine the code. You would have to build in this behaviour, since the library assumes total control over the SX1272/6.
I have never seen the DIO3 interrupt being called, so I guesss this should work
I looked at both LMIC and the SemTech code. The Semtech code looked clearer to me. It has very clear identifiable HAL, radio and MAC layers and I had things working in a very short time. The availability of the simple node to node examples helped a lot.
But as always YMMV
Likely this question isn’t relevant any longer, but to handle an inAir9b that only uses DIO0 to DIO3, there’s an mbed Semtech stack library available at www.pyocd.org/users/modtronix/code/SX1276Lib_modtronix/.The library itself is now somewhat out of date but can at least be used to help identify the code changes needed. Best wishes, Ron.
Guys,
just for information I’ve made a PR, now LMIC can works with absolutely NO DIO connection or even 1 instead of 3 (making a diode OR between DIO0/DIO1/DIO2) You can read about this here
My understanding is both LoRaWAN and LMIC only use DIO0 (Tx-Done or Rx-Done) or DIO1 (Time-outs); and though LoRaWAN has call-backs for the other interrupts, they aren’t used. Indeed, even DIO1 is not necessary in LoRaWAN as it uses software timers (timeServer.c in the Utilities directory calls HW_RTC_GetTimerElapsedTime() which ultimately gets the time from the RTC clock). I apologise if there is no interest in this due to a stale topic.