The Lora32u4 board seems useless

Every time I upload the example sketch LMIC-Arduino / ttn-otaa to the Lora32u4 V1.3 board, the connection on the USB port is lost after upload. Only after many attempts to upload a simple sketch such as Blynk (frequently press the reset button during upload) will “reset” the board and reconnect the port. Thereafter things went well until the next upload :frowning:

I use the latest version of Arduino IDE and chose the Adafruit Feather 32u4 as a board. On this forum I have read several (old) messages about this problem, but no solution that works for me. The ttn-otaa example sketch does not use a sleep function so this cannot be the cause of this issue.

As suggested on several fora I have soldered a wirebridge between pin DIO1 and pin 6.

Is it better to throw this board away or does someone have a solution?

LoRa32u4 II v1.1 Top

I’d try following this:

as Jac @kersing is a frequent visitor to the forum.

However as this was created before the LMIC library became a bit over-weight and the Arduino compiler added some code-bloat, it may well be that you did everything right but the code fills RAM, we get the stack hitting the heap and it all grinds to a halt.

See https://github.com/descartes/Arduino-LMIC-example which is my working setup - you’ll notice I’m using an older LMIC and an older IDE.

1 Like

Thanks for helping Nick! It seems that uploading succeeds after I press reset twice in quick succession shortly after compiling and immediately before uploading the sketch. After uploading, the connection to the port is often broken again, so it could very well be that this problem is caused as described by you. I will not throw the board away yet :wink:

Maybe off topic, but i said goodbye to the Arduino IDE long time, have a look at sloeber which is a lot better …

(most) sketches who go into sleep mode disable the USB port …

I’ll check if Sloeber is a better choise, thanks! You’re right about sleeping mode, in my opinion the lack of a CH-340 chip is a bad choice.

Hold up on the Sloeber IDE - you’d be compiling the same code with pretty much the same result and you have to learn a new IDE which may add some complications.

The 32u4 has USB support built in to the chip - which is why it’s not got a CH340 and it works just fine - the original Arduino Uno uses it to provide the USB interface to the ATmega328.

Concentrate on the basics - does the module work (flash LED, read ADC, etc) without filling its brain to capacity with a LoRaWAN setup.

Just out of interest does what does the error say when you lose the port? I am getting similar issues with a Feather M0 on Windows. Also and I don’t know if this makes any difference as I think pin 6 is fine, but there are also suggestions for connection to pin 5 instead - don’t know if that is worth trying?

Generally you don’t get an error message - the whole device runs out of memory and locks up.

Changing which pin you connect to the RFM95 doesn’t matter as long as you change it in the software - which will crash very shortly after you download it unless you slim the code down.

The board disconnects from the USB port and Arduino IDE/Windows does not show any to connect with. So I can upload as described above but often the serial monitor cannot be used thereafter.

Perhaps another way of putting it:

You insert code in to your brain via a spike in to your ear - and lose the ability to talk.

Stop worry about the big code base grinding the 32u4 to a halt - this is sort of normal. Concentrate on getting the code base smaller.

Seems like routine 32u4 behavior when the device has to go into sleep mode. For my projects using that controller, I add a 10sec delay in the setup. In this time, the USB is active. However once it goes into sleep mode or restarts after that, USB is not detected unless the board is reset.

Unfortunately, the 32u4 has much less program space than the 328. To if or not you are running out of memory, check what percentage, it shows you, is utilized after the sketch is uploaded.

Thanks all for helping! In my opinion the Lora32u4 board is not the best choice. It turned out it can be used when accepting above issues but there a better LoRa boards.