Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basicstation, sx1302_hal: initial commit #19188

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

mars642
Copy link
Contributor

@mars642 mars642 commented Aug 17, 2022

Maintainer: me
Compile tested: x86_64, lantiq_xrx200, latest openwrt-21.02, latest openwrt-22.03
Run tested: x86_64, lanitq_xrx200, latest openwrt-21.02, latest openwrt-22.03

Description:
(LoRa) Basicstation is an implementation of a LoRa packet forwarder and is intended to be run on the host of a LoRa-based gateway. Basicstation forwards RF packets recieved by a concentrator to a LoRaWAN network server (LNS). It also transmits RF packets received from the LNS to one or multiple LoRa end devices.
Further information: https://lora-developers.semtech.com/build/software/lora-basics/lora-basics-for-gateways

The SX1302 hardware abstraction layer is required by the basicstation to control the concentrator based on SX1302/SX1303 chip.

Testing:
Several Class-A end devices from different manufactures were used. TTN and ChirpStack were tested as LNS servers. The concentrator card used is based on Semtech's SX1302/SX1303 corecell reference design and does not have GPS. Currently only concentrator cards with USB interface are supported. (no SPI support)

Inspired by lora-feed from @xueliu

Signed-off-by: Marcus Schref [email protected]

@mars642
Copy link
Contributor Author

mars642 commented Aug 17, 2022

ping @aparcar

@aparcar
Copy link
Member

aparcar commented Aug 18, 2022

Looks excellent to me, amazing first time contribution!

I don't have hardware at hand to test this, do you have a recommendation? That's not a blocker for this PR but I'm keen to test it on real hardware.

@mars642
Copy link
Contributor Author

mars642 commented Aug 19, 2022

Thank you for your feedback!

I have selected the n-fuse LRWCC3-MPCI concentrator card for testing. It is based on the SX1303 chip from Semtech and most importantly, it is in stock right now.
Here is a link: https://www.n-fuse.co/de/devices/SX1303-LoRaWAN-Concentrator-Card-mini-PCIe.html
Make sure to select the USB version.

In my opinion, you can choose any end-devices, as Class-A support is mandatory.

libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
libs/sx1302_hal/patches/000-edit_cflags.patch Show resolved Hide resolved
net/basicstation/Makefile Outdated Show resolved Hide resolved
net/basicstation/Makefile Outdated Show resolved Hide resolved
net/basicstation/Makefile Outdated Show resolved Hide resolved
net/basicstation/Makefile Outdated Show resolved Hide resolved
net/basicstation/Makefile Outdated Show resolved Hide resolved
@Hurricos
Copy link
Contributor

Currently only concentrator cards with USB interface are supported. (no SPI support)

Hi there,

I have an older MTCDT with an SPI-based SX1302 in it which I'm working on standing OpenWrt onto. Is there a reason you're not providing SPI support in this package -- is it a matter of basicstation configuration?

@mars642
Copy link
Contributor Author

mars642 commented Aug 23, 2022

Hi @Hurricos,

at the moment i don't have suitable hardware to test SPI-based devices. Maybe you could add SPI support in future versions since you have the necessary hardware. If so, I could review your contribution.

@mars642 mars642 requested a review from BKPepe August 23, 2022 12:45
Copy link
Member

@BKPepe BKPepe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about adding test.file to be run tested inside CI to check versioning and if it works?

libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
libs/sx1302_hal/patches/000-edit_cflags.patch Show resolved Hide resolved
net/basicstation/Makefile Outdated Show resolved Hide resolved
net/basicstation/Makefile Show resolved Hide resolved
libs/sx1302_hal/Makefile Outdated Show resolved Hide resolved
@mars642 mars642 force-pushed the feature_lorawan branch 2 times, most recently from bf8ead1 to 3a8fb34 Compare August 30, 2022 13:30
@mars642
Copy link
Contributor Author

mars642 commented Aug 30, 2022

What about adding test.file to be run tested inside CI to check versioning and if it works?

I saw the test.sh file you authored at 2199234 and adopted it to this package. Is it OK like that?

@BKPepe
Copy link
Member

BKPepe commented Aug 30, 2022

Seems good for basicstation. See output in test build:

Configuring basicstation.
Use package specific test.sh
Station: 2.0.6 
Test successful
Removing package basicstation from root...
Failed to connect to ubus
Not deleting modified conffile /etc/config/basicstation.
Testing package sx1302_hal-tests in version 2.1.0 from sx1302_hal
Unknown package 'sx1302_hal-tests'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency sx1302_hal for sx1302_hal-tests
 * pkg_hash_fetch_best_installation_candidate: Packages for sx1302_hal-tests found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package sx1302_hal-tests.
No test.sh script available
No packages removed.
Testing package sx1302_hal-utils in version 2.1.0 from sx1302_hal
Unknown package 'sx1302_hal-utils'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency sx1302_hal for sx1302_hal-utils
 * pkg_hash_fetch_best_installation_candidate: Packages for sx1302_hal-utils found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package sx1302_hal-utils.
No test.sh script available
No packages removed.
Testing package sx1302_hal in version 2.1.0 from sx1302_hal
Installing sx1302_hal (2.1.0-1) to root...
Configuring sx1302_hal.
No test.sh script available
Removing package sx1302_hal from root...

@mars642 mars642 force-pushed the feature_lorawan branch 3 times, most recently from 1412f1b to cec80b4 Compare September 1, 2022 07:08
@mars642
Copy link
Contributor Author

mars642 commented Sep 1, 2022

Seems good for basicstation. See output in test build:

Configuring basicstation.
Use package specific test.sh
Station: 2.0.6 
Test successful
Removing package basicstation from root...
Failed to connect to ubus
Not deleting modified conffile /etc/config/basicstation.
Testing package sx1302_hal-tests in version 2.1.0 from sx1302_hal
Unknown package 'sx1302_hal-tests'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency sx1302_hal for sx1302_hal-tests
 * pkg_hash_fetch_best_installation_candidate: Packages for sx1302_hal-tests found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package sx1302_hal-tests.
No test.sh script available
No packages removed.
Testing package sx1302_hal-utils in version 2.1.0 from sx1302_hal
Unknown package 'sx1302_hal-utils'.
Collected errors:
 * pkg_hash_check_unresolved: cannot find dependency sx1302_hal for sx1302_hal-utils
 * pkg_hash_fetch_best_installation_candidate: Packages for sx1302_hal-utils found, but incompatible with the architectures configured
 * opkg_install_cmd: Cannot install package sx1302_hal-utils.
No test.sh script available
No packages removed.
Testing package sx1302_hal in version 2.1.0 from sx1302_hal
Installing sx1302_hal (2.1.0-1) to root...
Configuring sx1302_hal.
No test.sh script available
Removing package sx1302_hal from root...

I added a test file for sx1302_hal packages and fixed the errors.
grafik

Copy link
Member

@BKPepe BKPepe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from one thing, Makefiles looks good! Test files were added. Much appreciated. Patches were submitted to upstream repositories for review. I am satisfied. 😊

net/basicstation/Makefile Outdated Show resolved Hide resolved
The SX1302 hardware abstraction layer is required by the basicstation
to control the concentrator based on SX1302/SX1303 chip.

Signed-off-by: Marcus Schref <[email protected]>
(LoRa) Basicstation is an implementation of a LoRa packet forwarder and is
intended to be run on the host of a LoRa-based gateway. Basicstation forwards
RF packets recieved by a concentrator to a LoRaWAN network server (LNS).
It also transmits RF packets received from the LNS to one or multiple LoRa
end devices. Further information: https://lora-developers.semtech.com/build/
software/lora-basics/lora-basics-for-gateways

Signed-off-by: Marcus Schref <[email protected]>
@mars642
Copy link
Contributor Author

mars642 commented Sep 7, 2022

Glad to hear that! I replaced the installation macro, so it should be fine now.

@feckert feckert requested a review from BKPepe September 8, 2022 12:35
Copy link
Member

@BKPepe BKPepe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing was addressed and my last comment still stands. :)

@feckert
Copy link
Member

feckert commented Sep 8, 2022

Well then let's try it

@feckert feckert merged commit 99a659c into openwrt:master Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants