Heltec Lora 32 V3 with micropython

Hi everyone, I just recently got a couple of these v3 modules and went through a bit of a struggle getting micropython to work on them and get pretty good functionality.

Given this I figured a writeup was in store since I have yet to find another that gave me all the info I need in one place.

Some general board info that seemed to be a pain to locate:

screen io:
scl pin is 18
sda pin is 17
and the “reset” pin that needs to stay high to write to the screen is pin 21

radio io:
chip is SX1262
uPy lib for chip: https://github.com/git512/micropySX126X
chip pins
SS (CS)= 8
SCK (CLK)= 9
MOSI = 10
MISO = 11
RST = 12
BUSY = 13
DIO (also irq) = 14

the onboard led is gpio pin 35

To start I loaded the esp32s3 micropython image

I’m currently running windows with the username of admin and the anaconda distribution of python so using the anaconda prompt and esptool already installed via pip it went something like:

esptool --chip esp32s3 --port com3 erase_flash

to clear the flash on the board and then

esptool --chip esp32s3 --port com3 write_flash -z 0 c:\Users\admin\Downloads\ESP32_GENERIC_S3-20231005-v1.21.0.bin

to write uPython to the board

then i can run rshell and once in that prompt can connect to the board (on com3 on my machine) with

connect serial com3

Hopefully this helps someone else out. Any questions are welcome. Hopefully I typed it all right…

Also if anyone is interested I could put a pair of basic Lora tx/rx scripts that use the radios and screens as a proof of concept up on my GitHub repo.

So far I’ve been able to hit about 2000 ft of transmit/receive range with the 2 inch antennas that came with my kit from Amazon.

I am not using micropy now, but I want to in the future.

Thanks a bunch for posting your repo on github.

Hey I would be highly interested in that if you don’t mind. I just bought two of the V3 boards and am having a hard time with them.

hey @jad82, sorry I missed your post coming in. I’ve uploaded my current code to my github at https://github.com/git512/loraboards with my notes for the project. I’d be happy to answer any questions you may have about it. Sorry for the lack of commenting. My code isn’t great but hopefully it at least helps get you started. Might try to get ChatGPT to clean it up.

@shadowwolf225 That link doesn’t seem to work. Since my last post I managed to get this far with a pair of V3 kits.

I can transmit a counter value to be displayed on the Tx and Rx device, as well as the RSSI value on the Rx device. I am using the same driver as you (micropySX126X) and your post with the correct pins helped me get it working. Starting out with the basic code as part of that Github, I modified it to have a counter, show the display, and grab the RSSI.

One thing that took time to figure out is that the way the send and receive methods are defined in the driver, it has to be encoded. So sending just an integer value wouldn’t work. I had to do the following:

encodedCounter = str(Counter).encode('ASCII')

Then that final variable, encodedCounter, is what is sent.

I don’t have a GitHub yet but I will soon learn how all that works and put the stuff I’ve been working on out there and hope it helps someone.