The problem comes when I insert an SD card. I need an SD card in my proyect to log the data i send to the TTN. However, just inserting the card causes the program to fail. I get the following error int he Serial monitor:
The feather M0 adalogger SD card uses pin 7 as card detect and pin 4 as chip select. As soon as I insert an SD card, both pins (7 and 8) go high. could that be the problem?
Do I have to define that I am using a “user configuration” when it comes to the pin mapping used my LMIC library?
Now, it does not work anymore, even without the SD card. This started to happen after I inserted the SD card. How to know if the radio hardware is OK? What means the error 923??
After some reading, I suspected of a hardware problem. As SD card is also SPI, I used a voltmeter to monitor the LoRa radio CS pin. That solved the problem! At least, while I was holding the multimeter probes on GND and LoRa radio CS pins. How to fix this? Could it be that my SPI frequency is too high? Could the CS pin be bouncing? I do not have at oscilloscope at hand. Considering my setup, it is hard to imagine that it is a hardware problem, but it seems that it is. Here is a picture of my setup: No long wires. Why is this happening this? how to solve it?
Update: I reduced the SPI frequency to 1MHz. Now, I do not get the FAILURE message, but the program does not passes the “Starting” string. Measuring CS pin with the multimeter still fixes the problem. I also tested my setup with the Adafruit M0 Basic proto board. It works just fine! Even at 8 MHZ.
Now, it works, but I changed few things. I was using SDfat library, which by default uses a dedicated SPI bus. I changed that; I still use SDfat, but with a shared SPI. Also, I am using now a radio already integrated with the microcontroller in the same board (Adafruit 3178) and a RTC and SD card slot in a separate wing (Adafruit 2922). According to Adafruit, I need to manually set high the radio CS pin when not in use as it does not come with a pull up resistor.
I still want to make it work with the separate radio. I will try with a new one as I suspect now that one I have is damaged.
By the way, the TTN is changing to V3 servers. Would the MCCI library still works with the new TTN servers?
It’s working for us. The difference in receiving timing is noticeable and may affect your sketches; the LMIC stays active for up to six seconds after an uplink (rather than 2 seconds as with TTN V2).