micropython/lora, simple_rxtx.py how to tell modem_send and modem_receive work #12964
-
Using a Hope Radio RFM96W on a STM32F411 BlackPill. I modified the while True:
print("Sending...")
retval = modem.send(f"Hello world from MicroPython {counter}".encode())
print (f'return value from modem.send = {retval}') and I get:
the value changes each loop. Looking at edit: that value changes by about 7000 each loop so it looks like the return value is maybe the time between loops. Any suggestions appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 12 replies
-
Hi @davefes, Glad to hear you're working with lora driver, sorry to hear you've run into some issues. I haven't heard of anyone using the HopeRF modules with our driver yet, it'll be great if you can get them working!
The return value of
This tells you that the modem thought it sent a packet. It doesn't mean the transmitter is necessarily working - there might be antenna output selections or RF switches that have to be set correctly, or the antenna might not be suitable for the transmit frequency, etc, etc. One place to start, the SX1276 has three possible transmit power amplifiers, RFO_LF, RFO_HF and PA_BOOST and they are connected to different antenna pins. The default setting is RFO_LF or RFO_HF depending on frequency. If your antenna is connected to PA_BOOST, you need to set the "tx_ant": "PA_BOOST" in the lora_cfg dict. I'm also not very familiar with HopeRF products but from what I understand the RFM96W is only unofficially SX1276 compatible, not guaranteed to work the same (although it uses SemTech silicon). I'm sure it can be made to work with the driver, but there might be some other RFM96W-specific setting that is not needed on the SemTech-branded chips. Please let us know how you get on! If you're still stuck, please share the |
Beta Was this translation helpful? Give feedback.
-
Thank you for getting back. The RFM96W is on the 433MHz band. The two units are beside each other with 50 Ohm dummy loads on the one antenna port. Actually, the chip is called RF96. The RFM96W-V2.0.pdf shows only one antenna connection. The datasheet also has the name I am setting TX power to 0dBm in case there are antenna switching issues. I have been using Wei's LoRa implementation at:
I wonder as there is no PA_BOOST pin showed as a connection on the module that the high-power PA is connected to the |
Beta Was this translation helpful? Give feedback.
-
@davefes That sounds familiar. I used a SDR receiver for Lora, like one of these: https://www.sdrplay.com/ |
Beta Was this translation helpful? Give feedback.
-
Sure, I am using the simple_rxtx.py from the examples directory, with a filled-in get_modem function:
`` and I have it configured for US915 United States 915Mhz (902 which listens on these channels:
|
Beta Was this translation helpful? Give feedback.
-
Dear Angus,
I appreciate your help - and I have more data.
First, I have a couple of TTGO Lora32 boards that I put 1.21 MicroPython on, used mip to install lora-sync and lora-sx127x, and with a little fiddling (for version 1.0 of this board, one needs to pull pin 16 high to enable the OLED), got them to see one another using simple_rxtx.py HOWEVER, my Lora gateway still doesn't log this traffic, so it probably filters and doesn't log what it perceives a non-uplink traffic. I may try to form uplink-formatted messages to see if this is true.
In any event, when I try simple_rxtx.py (on the same frequency) with the STM32WL and Micropython, I do not see anything on my TTGO Lora32 units, so for whatever reason, it doesn't seem to be transmitting anything they recognize (even though they can communicate with each other. Makes me believe the Micropython basic lora stuff is OK, but the STM32WL doesn't work.
One question, I didn't mip lora-sync onto the STM32WL - do I need to?
Early times, but I thought I would report.
Duane
…----- On Nov 28, 2023, at 4:43 PM, Angus Gratton ***@***.***> wrote:
Thanks [ https://github.com/DuaneKaufman | @DuaneKaufman ] . I can't explain why
this doesn't work, but I have a LoRa concentrator here that I've meaning to
hook up. Will try and make some time to reproduce.
—
Reply to this email directly, [
#12964 (reply in thread)
| view it on GitHub ] , or [
https://github.com/notifications/unsubscribe-auth/ABK2PQBP5Y55KX6TSUCVRXTYGZSIZAVCNFSM6AAAAAA7JXAJ32VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMOJXHAZTC
| unsubscribe ] .
You are receiving this because you were mentioned. Message ID: <
***@***.*** >
|
Beta Was this translation helpful? Give feedback.
Hi @davefes,
Glad to hear you're working with lora driver, sorry to hear you've run into some issues. I haven't heard of anyone using the HopeRF modules with our driver yet, it'll be great if you can get them working!
The return value of
modem.send()
is the time.ticks_ms() timestamp of the time that the send completed, it's intended for protocols that have specific timing requirements.This tells you that the modem thought it sent a packet. It doesn't mean the transmitter is necessarily working - there might be antenna output selections or RF switches that have to be set correctly, or the antenna mi…