Closed LimesKey closed 3 weeks ago
Could not mange to get this to work, I got,
Did you upload the sketch after compiling it with the chagned options?
There's a wiki page called Troubleshooting guide, I suggest following it. Especially the part about different SPI interfaces. I would also check the connections with a multi-meter, to ensure there really is an electrical connection. The soldering on the radio module pads looks a bit suspicious. Also, sometimes these jumper cables are very unreliable, if they are loose on the pins there is not a good connection.
TL;DR It looks to be a hardware issue, especially if you also got these errors from different libraries.
Did you upload the sketch after compiling it with the changed options?
Of course
There's a wiki page called Troubleshooting guide, I suggest following it.
I've already looked very deeply at that and tried changing the SPI interface. On this library, it's VSPI so I wouldn't have to change it but on other libraries, it differed and was HSPI.
check the connections with a multi-meter
Did you not notice the multimeter in the second photo? I've done a continuity test on both the LORA to PCB and LORA to ESP32 and it's all fine.
TL;DR It looks to be a hardware issue, especially if you also got these errors from different libraries.
I'll offer to ship you or someone else a LORA module, the PCB, an antenna and wires, for if you'd like to test it yourself. I can ship anywhere in North America.
Of course
Well, what was the output in the serial monitor? Or was there no output? That seems unlikely considering that basic info (the same as shown during build) gets printed at the beginning regardless of any successes or fails in communication with the module, so if that is the case, I would double-check you have actually uploaded the correct thing.
Did you not notice the multimeter in the second photo
I did not actually, though I did not care much to play Where's Waldo at that point. You did not mention checking it, hence I suggested to do so. It's the most basic thing, yet still quite a few people skip that crucial step.
I'll offer to ship you or someone else a LORA module, the PCB, an antenna and wires, for if you'd like to test it yourself
I'm going to have to pass on that offer. I'm sure there are some freelancing services available somewhere - not here though.
Well, what was the output in the serial monitor?
Ah sorry I thought you were talking about the default Arduino, I also thought that the note: '#pragma message:
message was an error code. I have the output. debug-mode-SPI-RadioLib.txt
Here is a new sketch I tried, radiolib-sketch.zip
I also thought that the note: '#pragma message: message was an error code.
No, it is what is says it is - a message. Neither an error, nor a warning.
The debug output shows strange behavior - sometimes MISO returns zeroes, sometimes ones, sometimes what seems to be random garbage. Because it is so unstable, it's probably not a bad SPI configuration, but it strengthens the case for hardware or wiring problem. So I'm afraid I can't help you beyond suggesting to check the wiring again. Another step would be to use an oscilloscope or a logic analyzer if you have access to that.
After a long, troublesome time with a logic analyzer, I found that the library uses HSPI and not the normal and default VSPI like other libraries. I had definitely thought this might be an issue and for other libraries, I manually change it to VSPI but I don't think I did this for RadioLIB. Here's a quick screenshot of my logic analyzer for some pins of HSPI, while for VSPI there was nothing the entire time.
It no longer seems like a SPI communication issue but now I'm receiving,
rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
invalid header: 0xffffffff
ets Jul 29 2019 12:21:46
One interesting thing to note, that my USB-C cable that can display wattage, it is now displaying 4W of power being used with the fixed SPI connection rather than 0W without the SPI working.
Oh shoot the LORA module is burning hot and is starting to smell like burning plastic - that's why the USB connector is saying 4W... How is this possible, the only real thing I changed is the SPI pins???
Sorry, I accidentally swapped VCC with GND and GND with VCC, I will replace the module and try again... :facepalm:
After a long, troublesome time with a logic analyzer, I found that the library uses HSPI and not the normal and default VSPI like other libraries.
It uses whatever your platform defines as the default SPI
. This is also covered in the Troubleshooting guide and even the Basics page ...
Not sure what happened there, I read and did that but something went wrong. Anyways though, I made a little more progress today, it appears with the default HSPI pin configuration, when MISO
is connected to Pin 12, the module spits out a flashing error message
Traceback (most recent call last):
File "/home/ryan/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool.py", line 37, in <module>
esptool._main()
File "/home/ryan/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/__init__.py", line 1064, in _main
main()
File "/home/ryan/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/__init__.py", line 859, in main
operation_func(esp, args)
File "/home/ryan/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/cmds.py", line 466, in write_flash
flash_end = flash_size_bytes(
File "/home/ryan/.arduino15/packages/esp32/tools/esptool_py/4.6/esptool/util.py", line 37, in flash_size_bytes
if "MB" in size:
TypeError: argument of type 'NoneType' is not iterable
Failed uploading: uploading error: exit status 1
This appears to be because pin 12 is connected to some sort of internal voltage regulator and by pulling the pin high during boot, the wrong voltage is being used causing flashing errors.
Secondly, connecting the NSS pin from the LLCC68 module to the microcontroller on either Pin 15 (HSPI) or 5 (VSPI) following the ESP32 SPI CS pin guide here, this causes the module to lock up and does not allow for flashing or for a serial output as far as I know.
I later tried to define the SPI config with custom pins but I don't think this work as it would just immediately spit out the -2
spi error instead of a few second delay like it normally does,
SPISettings settings( 16000000, MSBFIRST, SPI_MODE0); //
SPI.begin(14, 32, 13, 5);
Serial.begin(115200);
One small thing to note, I know that this specific LORA module does not allow for a faster SPI communication speed than 16MHz so I tried defining the max speed as that.
This is after soldering on a new LORA module straight from LCSC instead of the AliExpress module I was using earlier, I've also replaced the Dupont cables as they were feeling loose. I'm just using this issue now as a personal recollection of the steps I've been trying in case anyone else can get it to work. I'm about ready to give up though, it's terrible doing the same operational steps over and over and without getting much farther than either a generic Invalid Header
issue or a SPI communication issue.
I later tried to define the SPI config with custom pins but I don't think this work as it would just immediately spit out the -2 spi error instead of a few second delay like it normally does,
Your sketch shows you are using SX1262
as the radio class, yet you seem to actually be using LLCC68. Those two are not the same, and RadioLib will actively check whether the hardware matches the software. Result of that check is shown in the debug output with RADIOLIB_DEBUG_BASIC
enabled.
Sketch that is causing the module fail
Hardware setup
I have the LORA module attached to a custom PCB like this,
I'm using standard Dupont wires and connecting the appropriate pins to the microcontroller,
![IMG_2958](https://github.com/jgromes/RadioLib/assets/85136735/2e8c5b9a-5169-4b1c-ad63-5220901e1f31)
Debug mode output
Could not mange to get this to work, I got,
Additional info (please complete):
DreamLNK DL-LLCC68-S-915
linkI've tried many many LORA libraries to try to get my module to work but with no success. It's some issue with SPI but I've checked all the wiring and pinouts and it looks good. I've tried many different wire configurations and I've even switched to different SPI pinouts but still no difference.
Without any pins connected, I get,
With the appropriate pins connected,
I have never gotten another error code other than
-2
. I have gotten similar errors trying other libraries.