Could someone provide some hints (or maybe even a working code snippet) of how to establishe a node-to-node connection and do a simple sent-receive using LMIC library (i.e. without any gateway)? At the moment I am not interested in LoraWan so a transaction on just Lora physical layer would do the job.
LMiC being “LoRaWAN in C” (named when LoRaWAN was still called LoRaMAC), I doubt it should be your library of choice when you don’t want to use LoRaWAN.
For plain LoRa, see Adafruit Learning System for some Arduino examples. Note that duty cycle limitions still apply, but I don’t know if the Adafruit libraries enforce that.
The reason for using Lora is simply because I want to check our custom board with SX1276 that the hardware assembly is compliant with LoRa. So I thought that it should be possible to use two such identical boards to check the communication between them. At the moment I do not have a gateway at hand which I thought is not necessary to test just compliance to LoRa.
That’s quite disappointing that one cannot use LMIC for such purpose as I will need to rewind all the work of adapting LMIC to our board.
Still hope that a more positive verdict could be given to LMIC for node-to-node communication.
I adapted the LoRaMac-node (Semtech’s) stack to our hardware for the P2P communication.
When running the ping-pong example I continuously face the TxTimeout problem. With oscilloscope I can see that periodically the DIO1 pin is triggered as well as the RXTX pin of sx1276. But the DIO0 and DIO2 are silent. In our realization of hardware the antenna switch is controlled by the sx1276’s RXTX pin which seems to function well as it periodically jump to high level.
Could somewhat suggest what might be wrong or what can be checked to find the problem? One would expect that DIO0 and DIO2 to also go high at some point, but they don’t.
A timeout could probably be caused by some leftover LoRaWAN code; something expecting something LoRaWAN specific but not getting that? But plain LoRa is really not my cup of tea… (And maybe even out of scope for this very forum?)
Eventually I succeeded obtaining DIO0 interrupt indication TxDone, although, for this to work I just put a 10 ms delay between SX1276SetOpMode( RF_OPMODE_SLEEP ); and the registers’ initialization loop in SX1276Init function.
However, the problem now is with the RX, i.e. its absence. The RX part ends with RxTimeout. So the DIO0 does not go high during the RX part. I have two identical devices both of which shows TxDone but neither of them reaches RxDone.
I understand that this information is too abstract to suggest anything specific, but will be very grateful for any hint.
In order to get LMIC or LoraWan end nodes talking to each other RX node must change polarity of I/Q as Gateway uses reverse polarity.
The reason I mention Gateway is the fact that LMIC and LoRaWan are implemented to get downstream data from Gateways and they Tx at reverse I/Q polarity to the one end node does.
Bit of an old topic, but my lmic arduino port has a raw.ino example that makes two nodes talk to each other. It does somewhat abuse the lower-level functions of LMIC and bypasses the higher level, but it does work currently.
I started with your raw.ino example and it’s working perfect with 3 nodes talking to each other. Does this mean that all hardware connections in const lmic_pinmap lmic_pins are OK?