Raspberry Pi Pico with LoRaWAN and The Things Network - Makerverse LoRa-E5 Module - Transmit Weather Data into IoT

I love this design.

I am curious though if these need to connect to TTN or IoT?

I have an application where I don’t want this to be or need to be linked to a 3rd party or sent to the Internet. Is it possible to be setup on a closed “network” or create a closed network with one of these?

Hi Tim

Is there a document on the AT commands for the LoRa-E5-HF module?

Regards Gordon

Hi @Gordon15296

Google offered up this document

cheers
Murray

I’m pretty new to this, but I got 2x Raspberry Pi Picos, and 2x Makerverse LoRa-E5 Breakout boards. I just want to be able to transmit a small amount of data from one to the other, so Point-to-Point (P2P), not using any LoRaWAN Gateways (there aren’t any anywhere nearby, I live on Christmas Island, Australia), not using any The Things Network or any of that, just directly between the two boards:

While some of the examples do provide basic code for P2P sort of as a side note (Makerverse LoRa-E5 Breakout | Core Electronics Australia), that code doesn’t seem to work for me? I have since explored deeper and read the AT commend booklet and stepped my way through all the stages and all seems OK just… after sending ‘AT+TEST=RXLRPKT\n’ to turn it into receive mode, I get a confirmation response of just ‘+TEST: RXLRPKT’ (which is stripped off in the sample code, so all I actually see is a blank line printed to the shell every time it checks if there’s anything to receive).

My Pi Pico connects to the LoRa Breakout board fine using UART, I can send AT commands and seem to get the correct confirmation responses from the board (Only after noting David​6581’s comment that the wires to the LoRa should go to TX and RX not TX1 and RX1 as is in the photos/tutorial) saying things like it transmitted ok, so I feel like the basic hardware setup is probably OK, but when I unplug that transmitting version of the device from my computer and power it from a USB battery bank (and it sits there flashing away seemingly presumably transmitting), and then plug in my other identical setup and run the receive code, as noted above, I receive nothing…?

Any ideas? Has anyone got P2P working from this Breakout board?

Hi Chris,

Just to make sure, I assembled a Pico and Pico W on the bench with 2 E5 modules, and ran the p2p example code, and it worked fine:


Could you send a photo of your setup, and share some details about your development environment? I think a good idea is to get the “known good” code working to make sure your hardware is functional, then we can help with your deep dive into the AT commands and the like.

G’day James! THANK YOU so much for your time on this. It’s great to know that code must work. Ok so here’s a photo of my setup. Both hardware setups are identical (Pi Pico, connected to Lora Breakout, power, gnd, and the comms going to Tx and Rx on the breakout, not to Tx1 Rx1). I program one with the Tx code exactly from your website, save it as main.py to the chip and test run it connected to laptop and it displays the expected lines counting upwards in the shell… eg:

Send data: 6
+TEST: TX DONE

I then unplug it, and plug it into a USB battery bank, and set it aside, presumably transmitting. The power light comes on the LoRa anyway, but in previous tests I modified the Tx code to blink the Pico’s light after each TX to prove to me it was actually running, which it apparently was.

I then connect the other identical hardware setup, and program it with your provided RX code, and run it, connected to laptop. As you can see in the screenshot, it just sits there, with the shell output displaying:

+MODE: TEST
+TEST: RFCFG F:915000000, SF7, BW125K, TXPR:8, RXPR:8, POW:14dBm, CRC:ON, IQ:OFF, NET:OFF

and that’s it. Nothing more… it sits there waiting, forever.

The environment: I’m using a MacBook Pro running OS Ventura (13.3.1), running Thonny 4.0.2, with Python 3.10.0 (64 bit). The interpreter settings are MicroPython (Raspberry Pi Pico). I have no library folders or any other files on the Pico chips. When I first plugged in the Pico to my laptop, it loaded as an empty drive as expected, and I used Thonny to install MicroPython on both of them, seems to be as expected. I am connecting my pico’s to laptop USBC port via an apple USB-USBC adaptor (seen in photo) but doesn’t seem to be causing issues…



Any ideas would be really invaluable! Thanks James!

Hi Chris

Bingo, I think I’ve figured this out!


That bit there, “run editor content” doesn’t actually upload the code it just runs it as a temporary file more or less. Have you hit upload on your main file after pasting in and saving the demo code? When just plugged into power, the pico will run what’s stored on its flash as main, rather than what’s in the editor like when you’re plugged into a PC

EDIT: i.e. this button:
image

Hi James - I was uploading the files correctly to the Pico’s flash. The code is for sure on the Pico… (both the Tx and the Rx chip) I just triple checked. That screen capture was just when running Rx one while still attached to laptop, I was editing the [main.py] on the chip in Thonny. But even if I close Thonny, and plug in the Rx setup, open Thonny, open up the code from the attached Pico and view it, it is the correct code… it’s on there… So… Any other ideas?

1 Like

Hi Chris,

There were many signs in your first post you were flashing correctly, so apologies for missing them.

Are you able to test with both plugged into the PC? Or swapping which device is in each role (i.e. see if the fault follows a pico/modem around)?

Maybe resetting both modems is an idea?
image

I’m stumped for now :confused:. But I’m looking into the datasheet to see if there are any settings that may prevent one module talking to another.

No luck. The FDEFAULT is executed correctly, returns ‘+FDEFAULT: OK’ but then when loaded with TX and RX code, still behaves as before. The pic/lora pair are hard wired and I haven’t swapped them internally, but I have used one pair as TX and then swapped it to be RX and same result… =( Hmmm

Success although partial: I can get it working, if I have two laptops, both running Thonny, one running the Tx code (just running the main.py that was on the chip already from failed attempts, so the code is for sure on the chip) and the other running the Rx code (also just straight off the chip). The Tx is sending (and reporting to shell) and the Rx is now receiving and printing to shell.

So for some reason, the Tx code/setup is only running properly when connected to a laptop, not when it tries to run from battery. So either a) there’s an issue re powering from the USB battery bank (doesn’t seem so, the Vbus voltage when operating is exactly the same 5.1V that I measure when connected to computer), or b) there’s something preventing the code booting/running correctly when not connected to the computer. But the code does seem to run, I put in a heartbeat led toggle using:
led = Pin(25, Pin.OUT)
just under the UART line near the top of my code, and a led.toggle() line inside the loop every time new data is transmitted, and when I run the pico from the battery bank, that led does indeed toggle, so the code is running…? Must be some aspect of the code that’s not running properly but not causing it to crash either… maybe like the UART bit isn’t being imported correctly or something? Ideas? Im sure the same would apply to the Rx code, just that I always run that connected to the laptop to be able to see if it’s receiving the data or not. I put a led.toggle() in the:
while uart.any() > 0:
loop of the ‘echo’ function, and it flashes when running connected to laptop for each confirmation of transmission (as expected), but when running from USB battery bank, no flashing, so there’s never anything coming back from the breakout board, as if the uart isn’t working unless connected to laptop? Am I missing something, maybe I needed to install some module or something?

2 Likes

SOLVED: As mentioned on this random video: Fix A Raspberry Pi Pico That Won't Run Code TUTORIAL - YouTube for some reason all I needed to do to fix this was add a 1 second sleep before the UART line:

sleep_ms(1000)
uart = UART(1, baudrate=9600, tx=Pin(4), rx=Pin(5))

Almost like it needed some time after power on before the UART could be loaded properly. Anything less than 1000 ms wasn’t enough. Odd.

But… solved! yay! Works fine now every time when connected to my USB battery bank!

3 Likes

Hey that’s a great result :slight_smile: What an obscure failure mode though!
It’s very unintuitive that the delay might be necessary. During product development I had Picos connected to different instances of Thonny and so never came across this perplexing issue.

I’ll add startup delays to the demo code, just in case somebody else comes across this. Thanks @Chris236191, great detective work.

2 Likes

Good morning Tim,

Excellent Video.

Would like to build the device, referred here

please advise how I may obtain the sample code?

Thanks in Advance Andrew

1 Like

Hi @Andrew253894 - follow the link to the written guide where you can download all the resources at the bottom

1 Like

Thanks

1 Like

Hi Support, i just wondering if you have any tutorial to connect Lora E5 to Raspberry Pi 4 ? I am trying to have my raspberry PI 4 as gateway that receives plenty of data stream from many rp picos via Lora .
regards.

Hi Gunawan,

As this is a Makerverse Labs product, we don’t have the usual complement of tutorials, more of just a “hello world” with the Pico. The good news though is that this board communicates over UART, so a USB-to-serial converter and some Python code that sends and interprets AT commands should be all you need to get on your way.

However, I don’t think this product is intended to act as a LoRaWAN gateway, as it is single-channel to my knowledge. Something like this would be more appropriate:

Hi Tim,

I too am having this problem but my device send a request but doesnt receive the join request

image
image

I even moved my device closer to the gateway (local one)

Hello,
can someone shed some light on this for me please, i am stuck and can’t figure out why i can’t recevie the join-accept message, i thought i might of had a DOA MKR so i bought a fresh one but still no luck, i have followed the guide from start to finish several times. any insite would be fanstic

1 Like