LoRa module on a 'Leonardo' Beetle clone?

I have two LoRa modules. One is set up against a Nano clone and seems to work (transmitter). A spectrum analyzer does say, I am transmitting something in the correct frequency area with a spectrum that looks like FSK.

Now, due to extremely limited space I want to use a BadUSB Beetle as receiver. This board has on previous tests worked fine when programmed as a Leonardo. (Mainly the Blink ex.) (Board can be found here: https://www.ebay.com/itm/ESP12E-ATMEGA32U4-Beetle-BadUSB-Development-Virtual-Keyboard-SS-Micro-Module/123434780034?ssPageName=STRK%3AMEBIDX%3AIT&var=423850995313&_trksid=p2057872.m2749.l2649)

Compilation and upload of the receiver program work fine, but initialization of the LoRa module fails.

I have descriptions on how to connect a Nano and an Uno. Same thing, actually. All the various pins are the same. D2 + D9-13. (like this: https://circuitdigest.com/fullimage?i=inlineimages/u1/Transmitting-Side-Connecting-LoRa-SX1278-with-Arduino-UNO.png)

Now, on the BadUSB SPI seems to be placed at pins D14-16 (not D11-13). The SPI pins (MISO, MOSI and SCK) are all dual marked along with the standard digital I/O names (D14-16) for the pins. D12 and 13 do not seem to be externally accessible on a BadUSB Beetle.

I am using some standard SPI module. Heaven knows which and where it may be located. I have found several in the arduino-1.6.5-r5 directory structure.

The one I have looked into (hardware\arduino\avr\libraries\SPI\, the only one being spi.cpp) does not seem to issue pins for SPI at all. No matter processor, board or what ever.

Has anybody successfully tried a Leonardo or BadUSB Beetle with a LoRa? What am I not doing right? Would an upgrade to a newer IDE help?

I am, of course, using Chinese clones all over, but should that be a problem?

Has anybody successfully tried a Leonardo or BadUSB Beetle with a LoRa?

You failed to provide information about the LoRa board you're using. With the Leonardo it works if the SPI connection is made by the ICSP header. It seems that your Beetle has the ICSP pins broke out on the right side of the board (marked MI, MO and SCK). So connect the SPI bus signals there and use another free pin for the CS, same for the LoRa reset signal. The interrupt signal (DIO0) should go to D2/D3 (SDA/SCL). Be sure to adapt the software accordingly.

I am, of course, using Chinese clones all over, but should that be a problem?

Yes, because they are usually missing any useful documentation! For example, post a link to the schematics of your BadUSB Bettle board! You cannot? That's what I mean.

walker1: I am, of course, using Chinese clones all over, but should that be a problem?

As a general point, then taking the risk with 'Chinese clones' is fine if you are familiar with the stuff you nare buying.

LoRa module in use: https://www.ebay.com/itm/433M-Lora-Ra-02-Long-Distance-RF-Wireless-Module-SX1278-IPEX-Socket-for-Arduino/263740378859?ssPageName=STRK%3AMEBIDX%3AIT&var=562937429375&_trksid=p2057872.m2749.l2649

NSS, Reset and DIO0 pins are connected to D10, D9 and D2. As specified in the LoRa.h file. All three SPI signals connected as they are marked on both units.

Found some wiring errors, but still no joy. LoRa still fails initialization.

Will dig further into it tomorrow.

Have just found out, that on a Leonardo the SPI has a special connector, as Shannon also pointed out.

Maybe I should program the Beetle as a Pro Micro instead? It has SPI and D14-16 placed on the same accessible pins. (and still the same processor!)

At least something to try, when I get back from work.

I have not yet been able to find out which actual processor pins are in use for SPI on the various boards. It does seem to be on Port B pin 1-3, however. So maybe it does not matter, which 32u4 based board I simulate when programming a Beetle.

Have just found out, that on a Leonardo the SPI has a special connector, as Shannon also pointed out.

Maybe I should program the Beetle as a Pro Micro instead? It has SPI and D14-16 placed on the same accessible pins. (and still the same processor!)

It doesn't make a difference. Your device isn't a Leonardo nor a Micro, it just uses the same processor. Given that pin labels are correct, your wiring should work.

LoRa module in use:

That module runs on 3.3V. If you connected the signals directly to the 5V signals of your Leonardo clone you might have destroyed the module already. You must have a level converter in between.

I got it to work! Turned out to be my well used breadboard that did not hold one or two of the wires from the LoRa module well enough.

Programming the Beetle as a Leonardo it is!

Next step will be implementing CRC. The manual for LoRa does say CRC is default enabled, but what I got through when 'squeezing' the connection did have errors. Alternatively the module still issues interrupts, if the CRC is wrong. That would also be different from default. I can not see any access to CRC setup in the code. Commented out and not the correct calls, when looking into the LoRa.cpp file.

Of course, Mr Chinaman can have made modules with different default setups. or with CRC completely unavailable. I do have spare bits in my protocol to implement something in that case.

There are no known chinese clones of the LoRa devices themselves. So you wont find any that magically behave differently as far as CRC goes.

The manual for LoRa does say CRC is default enabled

If by that you mean one of the SX127X Semtech datasheets then thats not correct, the default state (at LoRa device reset) is CRC check disabled.

What a particular software library for a LoRa device does might well be different.

If your using Sandeep's LoRa library, the documentation clearly states that CRC is off by default, and tells you how to implement it.