packages icon indicating copy to clipboard operation
packages copied to clipboard

basicstation, sx1302_hal: initial commit

Open mars642 opened this issue 2 years ago • 4 comments

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 avatar Aug 17 '22 08:08 mars642

ping @aparcar

mars642 avatar Aug 17 '22 08:08 mars642

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.

aparcar avatar Aug 18 '22 15:08 aparcar

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.

mars642 avatar Aug 19 '22 07:08 mars642

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?

Hurricos avatar Aug 21 '22 17:08 Hurricos

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 avatar Aug 23 '22 12:08 mars642

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 https://github.com/openwrt/packages/commit/21992344b54144dae1b73ad7145540328e7ed0bb and adopted it to this package. Is it OK like that?

mars642 avatar Aug 30 '22 13:08 mars642

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...

BKPepe avatar Aug 30 '22 13:08 BKPepe

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

mars642 avatar Sep 01 '22 07:09 mars642

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

mars642 avatar Sep 07 '22 11:09 mars642

Well then let's try it

feckert avatar Sep 08 '22 14:09 feckert