For those niche devs using Micropython, I found that you’ll need to set GPIO2 (FEM_EN on pinout) and GPIO46 (FEM_PA on pinout, for tx) as output and high to get any good tx/rx out of the V4. With the V3 I did not need to do this. I thought I had defective boards, but after running the Factory Test example and not having the issue I realized it was a ‘me’ problem.
Initially when trying to build the Factory Test I got an error regarding undefined values during compilation. Lines 148-152:
pinMode(LORA_PA_POWER,ANALOG);
pinMode(LORA_PA_EN,OUTPUT);
pinMode(LORA_PA_TX_EN,OUTPUT);
digitalWrite(LORA_PA_EN,HIGH);
digitalWrite(LORA_PA_TX_EN,HIGH);
This raised an eyebrow, but it wasn’t until after I had gotten a response from Richard about needing the newer libraries, compiling, testing, and fiddling; that it dawned on me what was up.
Looking at the defines in driver/board-config.h (54-58):
#if defined(WIFI_LORA_32_V4)
#define LORA_PA_POWER 7
#define LORA_PA_EN 2
#define LORA_PA_TX_EN 46
#endif
I’m not versed enough in LoRa or these devices to know what the LORA_PA_POWER is yet, and didn’t test it. But as soon as I enabled the two on pins 2 and 46 I went from not being able to walk across the room without losing connection to having what appears to be great tx and rx. I didn’t have terrible tx before, but after enabling 46 it went way up. The rx was my biggest problem. At about 1ft away my RSSI was in the -100’s, and if I went 20ft it completely fell off.
I couldn’t find anything in the SX1262 library resembling the PA I was looking for, so I just gave them some juice and ‘TADA!’
The conditional define explains why I didn’t need this for the V3. My assumption (quite possibly wrong), is that it has something to do with the increase in the advertised tx on the datasheet.
I wasn’t sure if I should make this a separate topic or post in the ongoing thread about Arduino (growing pains issue, but also different language and topic). Hope this might be helpful to that probable one other person in the world wracking their brain about this. For those writing in C++ it is still relevant, as you’ll probably need to do so as well. The quick look in the API didn’t reveal that secret. It mentions a PA_BOOST_PIN that defaults to 1 in Lora.h and can have a value from 2-17.
ps. Sorry if this looks like garbage, I was posting from my phone lol