starnight / lora Goto Github PK
View Code? Open in Web Editor NEWLoRa device driver as a kernel module
License: Other
LoRa device driver as a kernel module
License: Other
Hello,
I'm trying to install the drivers on a Raspberry Pi (Linux LoraPi 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l GNU/Linux) and I'm having the following error while trying to make. This is the current error:
make -C /lib/modules/6.1.21-v7+/build M=/home/lora/LoRa/LoRa modules
make[1]: *** /lib/modules/6.1.21-v7+/build: No such file or directory. Stop.
make: *** [Makefile:8: all] Error 2
Any advice?
Thanks!
Victor
In SX1276/77/78/79 DATASHEET , page 86 said G5 is -26 db, page 95 said G5 is -36 db, page 109 didn't describe G5.
this repository use -25 db
some repository on github.com use -36 db , e.g.
and
https://github.com/chisl/SX1272-py2/blob/5ab7fa581c40376bd5e2a3406b13c8bb47b2c014/SX1272_FSK.py#L226
Could you take some time to ensure if it's necessary to use -36 db instead of -26 db in this repository?
make
make -C /lib/modules/5.4.51-v7l+/build M=/home/pi/sahilsoni/lora/LoRa/LoRa modules
make[1]: *** /lib/modules/5.4.51-v7l+/build: No such file or directory. Stop.
make: *** [Makefile:8: all] Error 2
Hi,
can you guide me cross-compiling the module for armhf against Linux 4.19?
i try to integrate it to https://github.com/frank-w/BPI-R2-4.14/tree/4.19-main
i have put it into utils/lora and modified Makefile
KERNEL_LOCATION=../..
BUILDDIR=$(KERNEL_LOCATION)
and tried running make like this:
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
regards Frank
Merge the lora_spi header and source to sx1278 header and source.
Move the lora header and source to LoRa-SPI folder, than modify Makefile.
Finally the patch will be new files lora.h, lora.c, sx1278.h, sx1278.c, Makefile.
I'm using Dragino LoRa / GPS HAT which includes sx1276/8.
I installed and loaded the device driver according to the manual posted by the author.
But the LoRa module does not work properly.
Are there any settings other than the manual posted by the author?
I've got a Hoperf RF95 ( SX1276 compatible module ) connected to a Beaglebone SPI port , Driver loads, wpan0 and lowpan0 is created.
dmesg output shows
sx1278 spi2.0: add an IEEE 802.15.4 over LoRa SX1278 compatible device
but when client is run ( or ping6 ) I do not see ant RF on the spectrum analyser.
iwpan phy phy0 set tx_power also reports as
"command failed: Not supported (-95)"
Devicetree
sx1278@0{
compatible = "semtech,sx1276";
spi-max-frequency = <2000000>;
reg = <0>;
clock-frequency = <32000000>;
center-carrier-frq = <868000000>;
rf-bandwidth = <125000>;
spreading-factor = <7>;
minimal-RF-channel = /bits/ 8 <0>; // 0 : 868.3 MHz
maximum-RF-channel = /bits/ 8 <10>; // 1-10 :902 - 928 MHz
};
iwpan phy0 info output :
wpan_phy phy0
supported channels:
page 0: 0,1,2,3,4,5,6,7,8,9,10
current_page: 0
current_channel: 0, 868.3 MHz
capabilities:
iftypes: node,monitor
channels:
page 0:
[ 0] 868.3 MHz, [ 1] 906 MHz, [ 2] 908 MHz,
[ 3] 910 MHz, [ 4] 912 MHz, [ 5] 914 MHz,
[ 6] 916 MHz, [ 7] 918 MHz, [ 8] 920 MHz,
[ 9] 922 MHz, [10] 924 MHz
min_be: 3
max_be: 5
csma_backoffs: 4
frame_retries: 3
lbt: false
iwpan dev wpan0 info
Interface wpan0
ifindex 3
wpan_dev 0x1
extended_addr 0x8adb36432912159c
short_addr 0xffff
pan_id 0xbeef
type node
max_frame_retries 3
min_be 3
max_be 5
max_csma_backoffs 4
lbt 0
When I run client and expect to see RF emissions but none are seen on spectrum analyser I do not see any
client fe80::88db:3643:2912:159c%lowpan0 fe80::88db:3643:2912:1
69d 200 test
Send test with in 4 bytes
Do you know why this could be or how I could track down the issue ?
Hi, I just cross compile the driver and install successful, if I type "ifconfig" cmd I can found the wpan0 site like this
`[root@TW-G01] /mnt/sda1/twiot/ko/lora# ifconfig
eth0 Link encap:Ethernet HWaddr EE:58:73:D1:B7:C3
inet addr:192.168.1.108 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth1 Link encap:Ethernet HWaddr BA:93:D3:5D:F4:F0
inet addr:192.168.0.108 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wpan0 Link encap:UNSPEC HWaddr E0-BB-B3-C3-DF-CA-88-87-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING NOARP MTU:127 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:300
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
`
How can I test the communication between two devices? Can anyone tell me the steps to use the test application? Thanks!
uploaded my staging here:
https://github.com/frank-w/BPI-R2-4.14/tree/4.19-lora_new
created a separate dts for bpi-r2 where only spi0 is defined (no spidev), so only the top-node (fragment 0) brings this warning
make CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
dtc -I dts -O dtb -@ -o bpi-r2-lora-spi.dtbo bpi-r2-lora-spi-overlay.dts
bpi-r2-lora-spi.dtbo: Warning (unit_address_vs_reg): Node /fragment@0 has a unit name, but no reg property
I. got same warnings if i try compiling rpi dts
Hi,
I am trying to bring up sx1278 with the file-ops branch and observing an issue with data reception. we are not able to read data from the device. I am observing data on MOSI. Please find the below capture. could you please help me to resolve the issue?
logs:
[ 729.421470] sx1278: init SX1278 compatible kernel module
[ 729.421476] lora: register sx1278
[ 729.421485] lora: sx1278 driver(major 240) installed
[ 729.421523] lora: sx1278 class created
[ 729.421740] lora: probe a LoRa SPI device
[ 729.421790] sx1278 spi0.0: init sx127X
[ 729.424079] sx1278 spi0.0: chip version 1.2
[ 729.425304] sx1278 spi0.0: the original OP mode is 0xF
[ 729.426516] sx1278 spi0.0: before setting state to sleepmode to 0x8
[ 729.429436] sx1278 spi0.0: after setting state to sleepmode to 0xF
[ 729.430653] sx1278 spi0.0: op mode before change: 8f
[ 729.433075] sx1278 spi0.0: after write current OP mode is 0xF
[ 729.434288] sx1278 spi0.0: before setting state to sleepmode to 0x9
[ 729.436708] sx1278 spi0.0: after setting state to sleepmode to 0xF
[ 729.437931] sx1278 spi0.0:the current OP mode is 0xF
[ 729.440351] sx1278 spi0.0: going to set RX base address
[ 729.446376] sx1278 spi0.0: before setting state to sleepmode to 0xD
[ 729.448802] sx1278 spi0.0: after setting state to sleepmode to 0xF
[ 729.448807] lora: probe a LoRa SPI device with chip ver. 1.2
"regmap" is a proportion of I2C and SPI device drivers in the kernel contain some very similar code for accessing the register maps of hardware connected to those buses.
Use regmap can make the driver more portable.
I would like to communicate with 6LoWPAN using 2 raspberry pies and 2 sx1278 modules.
Do you know how to communicate using global addresses?
I look forward to your reply.
Thank you!!
when i type "make"...
make -C /lib/modules/4.9.59+/build M=/tmp/LoRa/LoRa modules
make[1]: Entering directory '/lib/modules/4.9.59+/build'
make[1]: *** No rule to make target 'modules'. Stop.
make[1]: Leaving directory '/lib/modules/4.9.59+/build'
Makefile:8: recipe for target 'all' failed
make: *** [all] Error 2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.