Lora32U4 Port doesnt show up

Hi everyone, I have a lora32u4 II module.
I want to make a basic program to transmit and receive a word to see if the module works...
When I first connected the module to the PC, the corresponding port of the module appeared, but after loading the program the port disappeared and now it doesn't appear anymore.

What could be happening?

The code is as follows

#include <SPI.h>
#include <LoRa.h>

#define SCK   5
#define MISO  6
#define MOSI  7
#define SS    8   // Chip Select
#define RST   4   // Reset
#define DIO0  3   // IRQ (Interrupción)


#define LORA_FREQ 915E6
int counter = 0;

void setup() {
  pinMode(RST, OUTPUT);
  digitalWrite(RST, HIGH);

  Serial.begin(9600);
  while (!Serial);

  // Reiniciar el módulo LoRa
  digitalWrite(RST, LOW);
  delay(10);
  digitalWrite(RST, HIGH);
  delay(10);

  // Inicializar LoRa
  if (!LoRa.begin(LORA_FREQ)) {
    Serial.println("Fallo al inicializar el módulo LoRa");
    while (1);
  }
  Serial.println("LoRa Transmisor inicializado");
}

void loop() {
  // Componer mensaje
  String message = "Numero: " + String(counter);
  counter++;

  // Enviar mensaje
  LoRa.beginPacket();
  LoRa.print(message);
  LoRa.endPacket();

  Serial.println("Enviado: " + message);
  
  delay(5000);
}

Please post a link to the product page, and check the with the seller for a manual, a "Getting Started" guide, or instructions on how to upload code.

Hi! Here is the link: Amazon.com: LoRa32u4 II Lora Módulo de placa de desarrollo LiPo SX1276 HPD13 915MHZ con antena para Arduino DIYmall : Electrónica.

i dont think there is a product page directly, but i can say that...

I have already followed the basic steps to set up the board. Initially, the board was recognized by my PC, and I was able to see the corresponding COM port. However, after uploading a first program, the COM port disappeared, and now the board is not recognized anymore.

I also tried:

  • Using different USB cables and ports.
  • Resetting the board by double-pressing the reset button.
  • Checking the Device Manager (it doesn’t show up, not even as an unrecognized device).
  • Reinstalling drivers and trying it on another computer.

And where did you learn about those steps? There does not seem to be any setup information on the web page you linked.

It is typical for USB serial bootloaders that different serial ports are emulated during the boot process, and for running your code.

There appears to be a reset button on the board that puts it in boot mode. Try pushing it. Without decent instructions, all anyone can do is guess.

That should give you a port for a couple of seconds (usually 8) in Windows device manager. If not, you can stop reading, if yes you can continue reading.

Which board did you select in the IDE when you programmed? If the answer is Leonardo or Micro, that is the cause of your problem. From your link:

It's a 8 MHz board and if you program it as a 16 MHz board the board detection and reaction on the software reset issued by the IDE just before the actual upload will not work.

You can invoke the boot loader manually using the reset button as you tried and as mentioned by @jremington; depending on the actual boot loader it's either a single tap (press/release) of the reset button or a double-tap.

Did the board come with instructions? If yes, does it state that you have to install a specific board package?

  1. If it instructed to use a specific board package, did you install it? Please provide the additional board URL that you added in file/preferences.
  2. If it did not instruct to use a specific board package, follow the instructions on https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/all#windows_boardaddon to install the SparkFun AVR board package which supports the 8MHz Pro Micro.

With the relevant board package installed, you can now select the correct board and frequency. Below for the SparkFun Pro Micro.

Start an upload of an innocent sketch like blink. When the IDE reports the memory statistics, double-tap the reset button.
Upload should succeed and you're problem should have been solved.


If the above did not work, here are some questions

  1. After double-tapping the reset button, does the L-LED pulsate (if the board has a L-LED) for approx 8 seconds?
  2. Which version of the IDE are you using?
  3. Do you have an other Arduino like Uno, Nano or Mega? Or do you have a dedicated serial-to-usb converter?

the board you linked to in post 3 looks similar to the Adafruit Feather 32u4 RFM95 LoRa Radio- 868 or 915 MHz
have a look at adafruit-feather-32u4-basic-proto/arduino-ide-setup

when using the device with the Arduino IDE I select Tools>Board Adafruit AVR Boards>Adafruit Feather 32u4
I have several of the 32u4 LoRa modules and once setup never had any problems when connecting to a Windows PC copnnecting to both LoRaWAN and using LoRa P2P

Thanks for your answers!

I was able to solve the problem after installing the sparkfun and choosing the 8MHz micro

As you said before, when I press the reset button on the board twice the port appears for about 8s.

The thing was that I had to press the reset button twice "Only when the white led is on" for the port to appear, since this led was constantly turning on and off. After pressing it twice when the white led is on, it will do a different effect (like a fade in and fade out), letting me know that the port is open for a few seconds, then I quickly uploaded the blink code and now it recognizes the port

Thanks everyone.

Hi Horace!, let me ask you a question...
If I want to connect two LoRa modules, should I use P2P mode as you mentioned? I’m having trouble getting one board to work as a transmitter and the other as a receiver. I’ve been using the example codes from the LoRa library, specifically the LoRaSender and LoRaReceiver examples, but I can’t get a properly communication between them.

As I mentioned in the last post, I’m using the SparkFun Pro Micro for the board and configuring the ATmega32u4 at 8 MHz as the processor.

The LoRa modules are connected to the Pro Micro using the following pin configuration:

LoRa.setPins(8, 4, 7); // SS, RST, DIO0

For the frequency, I have set it to 915 MHz using the following definition:

#define BAND 915E6

The transmitter theoretically transmits, but the receiver never seems to catch anything. I’m still trying to figure out what could be causing this issue.

thanks

yes, use the sandeepmistry arduino-LoRa library which the code in post 1 included

#include <LoRa.h>

however, I am confused as to which microcontroller and LoRa modules you are using?
are you using a pair of the LoRa32u4 II Lora Development Boards you referenced in post 3? if so they should be able to communicate using LoRaSender and LoRaReceiver

where does the pro micro come in?
are you connecting a LoRa module to the pro micro? if so which one?
e.g. here I have a RFM95 LoRa modsule connected to a Pro Micro

EDIT: LoRa modules generally use 3.3V logic - avoid connection one directly to a Pro micro which uses 5V logic you could damage the LoRa module - I tend to use 3.3V logic pro micros

I advised to compile/upload using the pro micro 8MHz option in the IDE. See post #5.

if a pair or the 32u4 LoRa modules are being used for LoRa P2P I could not see what the pro mico was doing
e.g. pair of Feather 32u4 modules running File>Examples>LoRa>LoRaReceiver and LoRaSender

LoRaSender serial monitor output

LoRa Sender
Sending packet: 0
Sending packet: 1
Sending packet: 2
Sending packet: 3
Sending packet: 4
Sending packet: 5
Sending packet: 6
Sending packet: 7
Sending packet: 8

LoRaReceiver serial monitor output

LoRa Receiver
Received packet 'hello 0' with RSSI -53
Received packet 'hello 1' with RSSI -56
Received packet 'hello 2' with RSSI -53
Received packet 'hello 3' with RSSI -57
Received packet 'hello 4' with RSSI -55
Received packet 'hello 5' with RSSI -54
Received packet 'hello 6' with RSSI -57
Received packet 'hello 7' with RSSI -53
Received packet 'hello 8' with RSSI -56
Received packet 'hello 9' with RSSI -57
Received packet 'hello 10' with RSSI -52

I only solved OP's problem where the board was no longer detected by the operating system after the first upload. OP can now upload without problems to his 32U4 board by selecting the Pro Micro 32U4 8MHz.

It's similar to what you suggested in post #6.

for my 32u4 LoRa boards setup I select Tools>Board Adafruit AVR Boards>Adafruit Feather 32u4

however, I tried Tools>Board and selected Sparkfun Pro Micro and "Processor (ATmege32u4 (3.3V 8Mhz)" and programmed the following LoRaSender code OK

#include <SPI.h>
#include <LoRa.h>

int counter = 0;

void setup() {
  Serial.begin(115200);
  while (!Serial);
  Serial.println("LoRa Sender");
  LoRa.setPins(8,4,7);   // for Lora 32u4
  if (!LoRa.begin(866E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  Serial.print("Sending packet: ");
  Serial.println(counter);

  // send packet
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;

  delay(5000);
}

transmits to LoRaReceiver OK similar serial output to post 11

apart from a change of frequency the OP's LoRaSender and LoRaReceiver should work

perhaps a photo of setup would help?

Just for the fun try to program your board as a Leonardo or Micro and not as a Feather (which as far as I understand is a 8MHz board). Your board will no longer be recognised and you will not be able to upload again without the double-tap reset trick.

so long as I select Tools>Board Sparkfun Pro Micro and "Processor (ATmege32u4 (3.3V 8Mhz)" it programs the Feather 32u4 board and runs OK

I have several Pro Micros both 5V and 3.3V and am careful to set up the board settings correctly when programming
did once get it wrong and had to reset a 3.3V board

Although OP did not confirm, I'm 99.99% sure that OP's orginal problem was caused by the fact that he did not compile for an 8 MHz board (compiled for a Leonardo) and did upload that code. As a result the board was no longer recognised.

Thanks for the replies
Here are images of my modules

A closer look

I tried to use the options you recommended as follows:

in the lora sender code y added LoRa.setPins(8,4,7);
For the transmitter I can see that it transmits (or at least I think it does)

In the reciever i used the Lora reciever code adding LoRa.setPins(8,4,7); too, but it doesnt recieve anything

both of them are powered by usb from a pc

where did you call setpins()
should be before the LoRa.begin() where you set the frequency

 LoRa.setPins(8,4,7);   // for Lora 32u4
  if (!LoRa.begin(866E6)) {

is before LoRa.begin

how close together are the modules? if too close the transmitter can overload the receiver