Hi David,
Well, I don’t have a Wireless Stick but I do have a Wireless Stick Lite V3 and can confirm that I see the same behaviour that you describe when I try to run the sketch on this board.
I must also confess that I do not have a deep understanding of what is going on, either specifically in the Heltec code or even more generally. I just modified the code as I originally described and it worked, pretty much first time round (so I didn’t have to go digging around for any ‘deeper meaning’ in what I was doing).
I pored over the respective schematics (the various ESP32 and ASR650x boards) at the time and was troubled that I couldn’t see any connection to what I thought might have been an interrupt pin on the ASR650x configuration (there’s no mention of DIO0 and DIO1 seems to be explicitly noted with ‘no connection’), so I really didn’t expect things to work—although the processor and LoRa chip on the ASR650x seem to be more closely integrated than do the processor and LoRa chips on the ESP32 boards.
I still can’t see any real correlation between the configuration on the ESP32 boards and the ASR650x boards. I see the connection between DIO0 and GPIO26 on the original Wireless Stick schematic, as you also note, and a similar connection between DIO0 and GPIO14 on the ESP32 (Wifi LoRa 32, Wireless Stick and Wireless Stick Lite) V3 boards, but nothing like that on the ASR650x schematics, which has me wondering whether the two might not be the same at the [LoRa] hardware integration level and so might, logically enough, require different programming, if indeed they could be encouraged to behave the same way at all. I can see no good reason why they shouldn’t be able to behave the same way, if the hardware was configured appropriately…
As far as the Radio.IRQProcess function is concerned, I could never really understand how that worked. As you describe, I would have expected it to simply go off and check to see if an interrupt had been triggered. Indeed, I’ve just gone and had a look at the code and that is what it does. The curious thing is that there is also a function RadioOnDioIrq which does exactly what you might expect of an ISR, it sets a flag indicating that an interrupt has been triggered. The first thing that RadioIrqProcess does is check this flag.
But there’s a curious difference between the radio.c libraries used for the ASRT650x and ESP32 boards. The ASR650x version contains the following:
void RadioOnDioIrq( void )
{
IrqFired = true;
RadioIrqProcess();
}
but the ESP32 version contains:
void RadioOnDioIrq( void )
{
IrqFired = true;
// RadioIrqProcess();
}
I wouldn’t actually expect the ISR to do anything more than set a flag, but the ASR650x version calls the RadioIrqProcess function, which begs the question of what the call in my code is actually doing (and may well make me feel a bit better about never really understanding what it was doing). This might also explain why the two processors are behaving differently.
Anyway, I’ve not had the opportunity to investigate this further at this point, but later this evening I will see what happens if I include the call to RadioIrqProcess in the ESP32 version of RadioOnDioIrq. I have also noted that the default settings for the DIO pins appear to be incorrectly specified in the config file—they appear to still be set to what they were on the original ESP32 modules (e.g. DIO0 on GPIO26), not the V3 versions (where DIO0 in on GPIO14, which appears to be configured as the RST pin, which should be GPIO12 on the V3 modules…!).
EDIT: Yep, that’s all it took, just uncomment the call to RadioIrqProcess in RadioOnDioIrq, that’s line 1128 in the file Library > Arduino15 > packages > Heltec-esp32 > hardware > esp32 > 0.0.7 > libraries > LoraWan102 > src > radio > radio.c (on my Mac, although note that I’m still using the 0.0.7 software release). I didn’t have to change any of the default pin definitions—they must be set elsewhere.
Now, what impact that might have on other things, I don’t know at this stage, but it does indicate that the ESP32/SX1262 combination also works this way.