Heltec Lora V3 RadioHead

Does anyone know if the lora V3 module works with the RadioHead library? . I have seen this:


What pins should be used if is possible.

I was using RadioLib: https://github.com/JJJS777/Hello_World_RadioLib_Heltec-V3_SX1262 , but with the latest Arduino IDE it has stopped working for me.

With the factory test example of the V3 module, it works fine for me, but I don’t know anything about the operation of the sketch, because I am very newbie. All I want is to send a message and go into receive mode to receive delivery confirmation.
I would greatly appreciate your help.

Hello, do you mean you are using the Heltec WiFi LoRa 32 V3 ? I am a newbie also and trying to get to grips with this board and also learning C / C++ at the same time. The RattyDAVE library you listed supports a previous version of the LORA chip, the one used on the V3 board is the SX1262 and is completely different to the previous devices. Apart from the basic Heltec support, RadioLib supports the board and also beegee-tokyo does. If you want to look on a very professional web site for some use of this board, I would point you at Peter Harrisons web site http://digitalconcepts.net.au/arduino/index.php?op=lora where he has spent a lot of time and energy on using the Heltec Lora boards. Also, if you want just simple send and receive there examples in the Lora folder where you found the factory test example.

Hope this helps

1 Like

Yes, I am using the V3 board model, and I understand that this model is not used on the website you mentioned. And from what I’ve read in this forum, the examples from the Heltec library don’t work with the module at the moment. Could someone who uses radiolib on the latest Arduino IDE provide me with a sketch that works for them? Regards and thanks.

I am in the process of adding the relevant details for V3 boards to the website referenced above. The LoRa details, which are based on the Heltec LoRaWan_APP library (but just the LoRa bit), rather than the previous Sandeep Mistry LoRa library, are much the same as for the CubeCell sketches, which also use this library. I have encountered a couple of minor variations, but I do have working sketches for the cases discussed on the website.

It’s been a while now since I started working with the V3 boards, but my recollection was that once the correct software libraries etc were installed, accepting that this was no mean feat in itself, the factory test sketch, at least, which supports basic LoRa communications, worked OK.

So, when you say “radiolib”, are you referring to the Heltec ‘radio’ functions, that are effectively provided in the LoRaWan_APP (previously also the LoRa_APP) library, or something else? [EDIT: OK, I see now from @franky1835’s comment below, and rereading your earlier posting, that you are probably referring to the RadioHead library. As @franky1835 suggests, you need to be using a library that supports the SX1262 LoRa Node chip, and the LoRaWan_APP library does this]. And if this is the case, what is it that you want in a sketch that’s not, for example, in the factory test sketch? Or do you just want the factory test sketch to work?

I think that several people posting in this and other related threads now have this stuff working. It has been frustrating, but the key seems to be in the setup of the software development environment (that’s the Arduino IDE for most of us).

1 Like

Hi,

First of all “Heltec Lora 32 V3” uses SX1262 chip.
Radio head library by sandeepmistry does not support SX1262 chip.
RadioLib Library by RattyDAVE also does not supoort SX1262 chip. (Check Readme file)

Did you check the Factory test examples from Heltec ?

Kindly,
Franky

1 Like

"Thank you very much for replying. My interest in using the RadioHead library is because I have used it before and found it easier to use. Now I understand that the RadioHead is not compatible with the SX1262 chip. Thank you.

The factory test sketch with LoRaWan_APP library, works correctly for me , but the problem is that I don’t understand how it works and I can’t adapt it to the program I want to create. I am interested in simply sending a message and then changing the state, and having the module wait to receive a message. I have removed everything from the example program that is not related to Lora, and I managed to send a message, but I don’t know how to change to the reception state on the module. Sorry if I am not making myself clear. In any case, I will continue to keep an eye out for updates on your website. Thank you very much for your help."

1 Like

Sorry, I didn’t put the correct link.

This worked with the old version of the Arduino IDE but not with the latest version :

The factory test sketch does exactly what you want—it is designed to play ‘ping pong’ with another similarly configured module. It sends a message then goes into receive mode waiting for a response. When it receives a response, it transmits another message and goes back into receive mode.

As you probably note, the critical part of the main loop of the sketch, the switch statement at the end, effectively defines a state machine. The machine has three valid states: transmit (STATE_TX), receive (STATE_RX) and ‘idle’ (LOWPOWER). On completion of the lora_init() function, towards the end of the setup() function, the machine is set in the TX state and executes that part of the switch statement in the main loop.

In my opinion, the code in the main loop could be better structured so that its function was more obvious (in my view, the only code in the main loop should be the state machine switch statement) but, be that as it may, the code before the switch statement just performs some additional functions that are associated with the different states.

Now, I can’t explain exactly why some of the code is written like it is, or is even there, and for my own application I’ve had to restructure things as suggested above, leaving out some things that appear to be unnecessary as I’ve tried to unravel the logic that’s been used.

Nonetheless, having transmitted a message (twice, actually, it seems if you work through the code, and I’ll comment on this in a moment), the state machine looks like it goes into the LOWPOWER state, although my immediate expectation would be that it would go into the RX state, as per the instruction in the TX_Done function. Either way, the sketch then waits for input, either because it’s in the RX state waiting (Radio.Rx()), or an interrupt (Radio.irqProcess()) is triggered. When data is received, the RxDone() function is executed and the sketch goes back into TX state.

Because of my confusion here with what state the machine was actually in, I initially used only two states in my own application: if the machine wasn’t transmitting a message, it was in receive state waiting for one.

It looks like the sketch sends out a message twice to begin with and, if no response is received, it goes into deep sleep waiting for another node to send it a message (one node will always start up first and, until the second node starts up, there’ll be no one to play ping pong with). But this sending the message twice, and there’s also also code in there checking whether or not two messages have been received, is one thing I don’t currently understand, although, in my own application, I’ve had to implement a ‘resend policy’ because the first transmission of a packet is often not received. I’ve got a bit more work to do on that front, but I offer the comment here just in case anyone else encounters a similar problem.

If it helps, the following is my state machine:

  switch ( state ) {
    case TX_State: {
      Serial.println("[loop] Into TX Mode...");
      
      [ assemble message content ]
      
      sendMessage();
      state = RX_State;
      break;
    }
    case RX_State: {
      if( lora_idle ) {
        lora_idle = false;
        Serial.println("[loop] Into RX Mode...");
        Radio.Rx(0);
      }
      Radio.IrqProcess( );
      break;
    }
    default: {
      state = RX_State;
      break;
    }
  }

Because my application spends most of its time in the RX state, waiting for messages, the lora_idle boolean, which is set to true in the TxDone() and TxTimeout() functions after sleeping the radio, is used to check whether or not the receiver needs to be initialised.

My application works the opposite way around to yours, in that I start in receive state and respond to particular messages, returning to the receive state after sending the response. As I’ve suggested above, however, this application is not yet fully developed and will ultimately go into low power mode when waiting for incoming messages.

Thank you very, very much. That’s just what I needed to be able to do what I want. I appreciate your time so much. As soon as I return from my trip, I will start testing again. Regarding the case of the two messages at the beginning, I realized that if I turned on my two modules exactly at the same time, they wouldn’t work. I had to turn one on first and then the other.