const lmic_pinmap lmic_pins = {
.nss = 8,
.rxtx = LMIC_UNUSED_PIN, // (5) should be foreseen for later release (ok for A, needed for C)
.rst = 4,
.dio = {3, 1, 2}, // DIO0, DIO1, DIO2
};
Hi @kgbvax, Just take a look at my previous post in answer to Sean. The needed DIO pins of the RFM95 are not all connected on the Adafruit board. It is unclear which ones really are needed, but connecting DIO0, 1 and 2 brings a good result for me. I only changed the stated lmic_pinmap statement (and some soldering). Cheers.
Referring to the Adafruit docs only DIO0, CS and Reset are connected: Since not all pins can be brought out to breakouts, due to the small size of the Feather, we use these to control the radio module #8 - used as the radio CS (chip select) pin #3 - used as the radio GPIO0 / IRQ (interrupt request) pin. #4 - used as the radio Reset pin Since these are not brought out there should be no risk of using them by accident! There are also breakouts for 3 of the RFM’s GPIO pins (IO1, IO2, IO3 and IO5). You probably wont need these for most uses of the Feather but they are available in case you need 'em!
That is why you have to connect DIO1 and DIO2 to free D pins, and fill in this ports in the lmic_pinmap statement. IF these pins where connected, to which dataport? That is not in the schematic. But measuring is ‘proof of the pudding’. Cheers
Note that only one of DIO1 and DIO2 is needed for LoRa communication, the other is needed for FSK mode (IIRC the README of my lmic repository states which is which). DIO0 is needed for both.
I know the struggle. Try to help you.
First: use ONE library, and drop all others: https://github.com/matthijskooijman/arduino-lmic
I use Arduino 1.6.7, it works for 1.6.9 now as well
Put the right DIO pinning in the main code (as stated before). The numbers are the digital port numbers (that is a mapping in the arduino platform to the real port pins).
Decide for ‘the new platform’ or the ‘old croft’. It works for me for the new OTAA platform.
For OTAA: Follow the instructions of ‘ernestospace’ in Over-the-air-activation OTAA with LMIC (so create an application, get the APPEUI, decide/choose an DEVEUI and get the APPKEY from ttnctl)
Use the ttn.ino example.
For me, the code did NOT work, no joining (which is needed in OTAA). To original code:
// Start job
do_send(&sendjob);
}
So i Did add a runloop once statement to get things working. Insert Serial debug statements to test the flow. I still think there are stability issues with the M0. Maybe because of the USB / serial emulation in code, may be because of the OSticks. No interrupts are used, because, well say: too difficult. At the end the hal should be re-engineered on the M0.
Cheers
Thanks everybody for sharing info on the Feather M0! I got the ttn-example working after wiring up DIO1 and decreasing the SPI clock speed.
I’m however getting RSSI values around -100, which is lower than I expected… I’m using a 1/4 wave wire antenna and the gateway is about 5 m away, through a wall. Is this normal?
My other sensor with a SX1276MB1MAS mbed shield gives about RSSI -50 in the same spot (proper antenna on that one though)
Very good catch. :)wink:
This is a hardware bug in the silicon of ATSAMD21G18A (in fact for all D21 chip if I’m not mistaken) for revision A, B & C. Maximum SPI clock is limited to 8 MHz both as master or slave. If your chip has marking D or newer, it should be able to run at half of the processor clock (48 MHz/2 = 24 MHz).
Has anyone actually gotten the Adafruit LoRa Feather working? I’m using the code of the great @matthijs but my board gets thrashed if the startup function includes os_init().
Hi Everyone,
I have a FeatherM0 lora module and a Multitech conduit Gateway.
I have installed the following library and trying to run the example code
I have made the required hardware and code changes as given in the previous posts.
I am using the US frequencies.
I get the following error when I compile the ttn code on Arduino IDE - ‘DR_SF12’ was not declared in this scope
Can someone please guide me how to rectify the error?