zephyr icon indicating copy to clipboard operation
zephyr copied to clipboard

drivers: lora: reyax rylr module

Open DaWei8823 opened this issue 1 year ago • 13 comments

writing a driver that implements the lora api for reyax lora rylr series modules using the zephyr modem utilities.

Note: the bulk of this driver is implemented in drivers/lora/rylrxxx.c which must be opened manually (marked by "Large diffs are not rendered by default" warning)

I tested with two modules: one connected to my board and the other connected to my PC via uart adapter.

I built the samples/hello_world project

west build -b cy8ckit_062s4 --pristine -- -DSHIELD=reyax_lora -DCONFIG_LOG=y -DCONFIG_SHELL=y -DCONFIG_LORA_SHELL=y
west flash

in the zephyr shell, I sent:

uart:~$ lora config pre-len 7
uart:~$ lora config freq 865100000
uart:~$ lora send HELLO

on the serial console in my PC, I saw:

+RCV=1,5,HELLO,-41,36

then I ran this command in the zephyr terminal:

uart:~$ lora recv 

and I sent this command to the PC-connected module:

AT+SEND=0,3,sup

I saw this output in zephyr terminal:

00000000: 73 75 70                                         |sup              |
RSSI: 208 dBm, SNR:38 dBm

Signed-off-by: David Ullmann [email protected]

DaWei8823 avatar Feb 21 '24 04:02 DaWei8823

Hi, new modems should not use the old modem libraries like modem_cmd_handler and modem_iface_uart. See https://github.com/zephyrproject-rtos/zephyr/tree/main/include/zephyr/modem and https://github.com/zephyrproject-rtos/zephyr/blob/main/drivers/gnss/gnss_quectel_lcx6g.c :)

bjarki-andreasen avatar Feb 21 '24 06:02 bjarki-andreasen

@JordanYates and @bjarki-trackunit, thank you for taking a look earlier! I have addressed your comments and updated the PR

DaWei8823 avatar Feb 27 '24 21:02 DaWei8823

@Mani-Sadhasivam @ifyall @galak @nashif could you take a look at your earliest convenience? thanks!

DaWei8823 avatar Feb 29 '24 16:02 DaWei8823

@cfriedt could you take a look when you get a chance?

DaWei8823 avatar Mar 04 '24 20:03 DaWei8823

@JordanYates just wanted to follow up on this!

DaWei8823 avatar Mar 25 '24 19:03 DaWei8823

@DaWei8823 - def want to build the driver in CI as Jordan suggested. The sample application sounds like a good spot.

cfriedt avatar Mar 27 '24 00:03 cfriedt

Only thing missing now is to ensure this driver is built by CI in some form. Ideally samples/drivers/lora/send and samples/drivers/lora/receive

@JordanYates, can you please point me to some resources for adding a CI job that would do something like west build -b cy8ckit_062s4 --pristine -- -DSHIELD=reyax_lora -DCONFIG_LOG=y -DCONFIG_SHELL=y -DCONFIG_LORA_SHELL=y

DaWei8823 avatar Mar 28 '24 17:03 DaWei8823

Only thing missing now is to ensure this driver is built by CI in some form. Ideally samples/drivers/lora/send and samples/drivers/lora/receive

@JordanYates, can you please point me to some resources for adding a CI job that would do something like west build -b cy8ckit_062s4 --pristine -- -DSHIELD=reyax_lora -DCONFIG_LOG=y -DCONFIG_SHELL=y -DCONFIG_LORA_SHELL=y

Something like this: https://github.com/zephyrproject-rtos/zephyr/blob/main/tests/drivers/build_all/rtc/testcase.yaml

  sample.driver.lora.rylr.send:
    extra_args: SHIELD=the_shield
    platform_allow: the_platform

You should be able to validate whether it works locally with zephyr/scripts/twister --all -T zephyr/samples/drivers/lora/send. You might need to move the depends_on: lora part from common, I'm not sure how depends_on interacts with shields.

JordanYates avatar Mar 29 '24 00:03 JordanYates

@cfriedt, @JordanYates I've made the requested changes. Thanks for your comments! Please take a look when you can

DaWei8823 avatar Mar 29 '24 17:03 DaWei8823

@JordanYates, just following up on this

DaWei8823 avatar Apr 30 '24 17:04 DaWei8823

Please add an entry in the release notes mentioning this new driver

@aescolar done

DaWei8823 avatar May 01 '24 21:05 DaWei8823

@cfriedt can this be merged now that's it's been approved?

DaWei8823 avatar May 21 '24 23:05 DaWei8823

@cfriedt can this be merged now that's it's been approved?

@DaWei8823 - it needs a rebase unfortunately because there are merge conflicts. But given all of the approvals, it should be quick after that.

cfriedt avatar May 21 '24 23:05 cfriedt

@kartben done

DaWei8823 avatar Jun 14 '24 01:06 DaWei8823

@aescolar @nashif there was no change besides minor formatting/comments since assignee @JordanYates approved last so it should be ready to go. Thanks!

kartben avatar Jun 14 '24 18:06 kartben

@kartben ack, should go with the next batch

aescolar avatar Jun 14 '24 19:06 aescolar