zhgzhg / LoRaPacketForwarder

LoRa single channel packet forwarder based on the Semtech UDP protocol v2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to execute the program

Pr-Jay opened this issue · comments

Hello,
So I found out that the ./LoRaPktFwrd should be the command to execute the program, not ./LoRaPktFwd. But even then it outputs "Unable to open SPI device: No such file or directory". I do have SPI enabled on my Raspberry Pi 3, can you help me find out why it's not working?
Here is the full output:

PlatformInfo:

ID (EUI-64): b8:27:eb:ff:ff:bc:f7:3a

(WiringPI) Pins:
nss_cs=4
dio0=5
dio1=6

LoRa SX127x Chip:
Freq=434.000000 MHz
BW=125.000000 KHz
SF=7
CR=4/5
SyncWord=0x34
PreambleLength=8

Meta Information:
Latitude=0.000000
Longtitude=0.000000
Altitude=10 meters
Name/Definition: 1chan_uplink_pkt_fwd
E-mail: contact@email.com
Description: OPiPC LoRa 1-Ch GW

Unable to open SPI device: No such file or directory

Hello @Pr-Jay ,

Does the following command show your SPI device:
ls -la /dev/spi*

Also can you please provide the output of those commands as well:
dmesg | grep spi
lsmod

Also @Pr-Jay, please try executing LoRaPktFwd with sudo to check whether it will make any difference.

@zhgzhg Thanks for replying,
Neither ./LoRaPktFwd nor sudo ./LoRaPktFwd executes the program. But both ./LoRaPktFwrd and sudo ./LoRaPktFwrd do.
Capture1
Capture2
Here is the result from ls -la /dev/spi*, dmesg| grep spi and lsmod
Capture3
Also, here is the screenshot of the directory, in case something is wrong.
Capture4
Thanks!

Hmm. your environment seems to be fine.
With sudo ./LoRaPktFwrd do you see the same error message?

@zhgzhg Yes, it has the same problem
Capture5

Weird indeed. Currently I have no clue. Looks like for some reason although the SPI device is available there's no access to it. To make sure that it's at least operable I'd suggest testing it in the following way:

https://www.raspberrypi.org/documentation/hardware/raspberrypi/spi/README.md#troubleshooting

Please let me know whether you observe different results.

@zhgzhg I think it turned out ok
Capture7
Could it be that OrangePi and Pi3 WiringPi libaries are slightly different for SPI be the culprit?
Capture6

@Pr-Jay , yes they should differ, and its possible that might be the case. But I am also assuming you are using the proper wiringPi version - the one provided by Raspbian, and not the one bundled in this project, right?

Another idea - I have noticed that LoRaLib attempts to transfer SPI data with higher than the usual clock speed, so reducing it might have a positive effect. @Pr-Jay , could please execute the following command into the project's directory:

sed -i 's/SPISettings(2000000/SPISettings(500000/' ./LoRaLib/src/Module.cpp

and then recompile the project with make and try again?

@zhgzhg I'm not sure if I'm doing this correctly, it didn't return anything.
Capture8
I don't think I'm using wiringPi that came with the project, as I didn't do anything with the wiringPi folders.

Thanks @Pr-Jay. The sed command executed just fine. I am starting to think that wiringPi is not even addressing the correct SPI path.

Could you please install the strace program:

sudo apt-get install strace

and then run LoRaPktFwrd with it redirecting the output to text file in the following way:

sudo strace -o stacktrace.txt ./LoRaPktFwrd

and attach the trace log from the newly created stacktrace.txt file here?

@zhgzhg Hi,
Here is the content of stacktrace.txt:

execve("./LoRaPktFwrd", ["./LoRaPktFwrd"], [/* 15 vars /]) = 0
brk(NULL) = 0x7b9000
uname({sysname="Linux", nodename="raspberrypi", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f74000
access("/etc/ld.so.preload", R_OK) = 0
open("/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0
mmap2(NULL, 42, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x76f73000
close(3) = 0
open("/usr/lib/arm-linux-gnueabihf/libarmmem.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210\5\0\0004\0\0\0"..., 512) = 512
lseek(3, 20868, SEEK_SET) = 20868
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000
lseek(3, 20540, SEEK_SET) = 20540
read(3, "A,\0\0\0aeabi\0\1"\0\0\0\0056\0\6\6\10\1\t\1\n\3\f\1\22\4\24"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=21868, ...}) = 0
mmap2(NULL, 86080, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76f30000
mprotect(0x76f35000, 61440, PROT_NONE) = 0
mmap2(0x76f44000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x76f44000
close(3) = 0
munmap(0x76f73000, 42) = 0
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=85828, ...}) = 0
mmap2(NULL, 85828, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76f1b000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/libwiringPi.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0x,\0\0004\0\0\0"..., 512) = 512
lseek(3, 69628, SEEK_SET) = 69628
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080
lseek(3, 51803, SEEK_SET) = 51803
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=70708, ...}) = 0
mmap2(NULL, 121320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76efd000
mprotect(0x76f09000, 65536, PROT_NONE) = 0
mmap2(0x76f19000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x76f19000
mmap2(0x76f1a000, 2536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f1a000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0000\332\6\0004\0\0\0"..., 512) = 512
lseek(3, 1268340, SEEK_SET) = 1268340
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1280) = 1280
lseek(3, 1267740, SEEK_SET) = 1267740
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=1269620, ...}) = 0
mmap2(NULL, 1341504, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76db5000
mprotect(0x76ee4000, 65536, PROT_NONE) = 0
mmap2(0x76ef4000, 28672, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12f000) = 0x76ef4000
mmap2(0x76efb000, 6208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76efb000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0`=\0\0004\0\0\0"..., 512) = 512
lseek(3, 451032, SEEK_SET) = 451032
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1120) = 1120
lseek(3, 450676, SEEK_SET) = 450676
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0644, st_size=452152, ...}) = 0
mmap2(NULL, 516220, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d36000
mprotect(0x76da3000, 65536, PROT_NONE) = 0
mmap2(0x76db3000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6d000) = 0x76db3000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\200\321\0\0004\0\0\0"..., 512) = 512
lseek(3, 115292, SEEK_SET) = 115292
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080
lseek(3, 114944, SEEK_SET) = 114944
read(3, "A,\0\0\0aeabi\0\1"\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 45) = 45
fstat64(3, {st_mode=S_IFREG|0644, st_size=116372, ...}) = 0
mmap2(NULL, 180536, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d09000
mprotect(0x76d25000, 61440, PROT_NONE) = 0
mmap2(0x76d34000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1b000) = 0x76d34000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0@h\1\0004\0\0\0"..., 512) = 512
lseek(3, 1231820, SEEK_SET) = 1231820
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2880) = 2880
lseek(3, 1228284, SEEK_SET) = 1228284
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1234700, ...}) = 0
mmap2(NULL, 1303872, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76bca000
mprotect(0x76cf4000, 61440, PROT_NONE) = 0
mmap2(0x76d03000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x129000) = 0x76d03000
mmap2(0x76d06000, 9536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76d06000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\I\0\0004\0\0\0"..., 512) = 512
lseek(3, 125740, SEEK_SET) = 125740
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1560) = 1560
lseek(3, 90536, SEEK_SET) = 90536
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=127300, ...}) = 0
mmap2(NULL, 164432, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76ba1000
mprotect(0x76bb7000, 61440, PROT_NONE) = 0
mmap2(0x76bc6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x76bc6000
mmap2(0x76bc8000, 4688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76bc8000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0 \27\0\0004\0\0\0"..., 512) = 512
lseek(3, 25352, SEEK_SET) = 25352
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1280) = 1280
lseek(3, 24940, SEEK_SET) = 24940
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=26632, ...}) = 0
mmap2(NULL, 90640, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76b8a000
mprotect(0x76b90000, 61440, PROT_NONE) = 0
mmap2(0x76b9f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x76b9f000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\20\10\0\0004\0\0\0"..., 512) = 512
lseek(3, 29156, SEEK_SET) = 29156
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1120) = 1120
lseek(3, 28804, SEEK_SET) = 28804
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=30276, ...}) = 0
mmap2(NULL, 254300, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76b4b000
mprotect(0x76b52000, 61440, PROT_NONE) = 0
mmap2(0x76b61000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x76b61000
mmap2(0x76b63000, 155996, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76b63000
close(3) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f72000
set_tls(0x76f72e70, 0x76f73568, 0x76f77050, 0x76f72e70, 0x76f77050) = 0
mprotect(0x76d03000, 8192, PROT_READ) = 0
mprotect(0x76b61000, 4096, PROT_READ) = 0
mprotect(0x76bc6000, 4096, PROT_READ) = 0
mprotect(0x76b9f000, 4096, PROT_READ) = 0
mprotect(0x76d34000, 4096, PROT_READ) = 0
mprotect(0x76db3000, 4096, PROT_READ) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76f70000
mprotect(0x76ef4000, 20480, PROT_READ) = 0
mprotect(0x76f30000, 20480, PROT_READ|PROT_WRITE) = 0
mprotect(0x76f30000, 20480, PROT_READ|PROT_EXEC) = 0
cacheflush(0x76f30000, 0x76f35000, 0, 0x15, 0) = 0
mprotect(0x76f44000, 4096, PROT_READ) = 0
mprotect(0x41000, 4096, PROT_READ) = 0
mprotect(0x76f76000, 4096, PROT_READ) = 0
munmap(0x76f1b000, 85828) = 0
set_tid_address(0x76f72a18) = 952
set_robust_list(0x76f72a20, 12) = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x76ba52b0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x76bf66c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x76ba5390, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x76bf66c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
ugetrlimit(RLIMIT_STACK, {rlim_cur=8192
1024, rlim_max=RLIM_INFINITY}) = 0
brk(NULL) = 0x7b9000
brk(0x7de000) = 0x7de000
open("/proc/cpuinfo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "processor\t: 0\nmodel name\t: ARMv7"..., 1024) = 1024
read(3, "ariant\t: 0x0\nCPU part\t: 0xd03\nCP"..., 1024) = 112
llseek(3, 0, [0], SEEK_SET) = 0
read(3, "processor\t: 0\nmodel name\t: ARMv7"..., 1024) = 1024
read(3, "ariant\t: 0x0\nCPU part\t: 0xd03\nCP"..., 1024) = 112
close(3) = 0
open("/proc/cpuinfo", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "processor\t: 0\nmodel name\t: ARMv7"..., 1024) = 1024
read(3, "ariant\t: 0x0\nCPU part\t: 0xd03\nCP"..., 1024) = 112
close(3) = 0
open("/dev/mem", O_RDWR|O_SYNC|O_CLOEXEC) = 3
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x3f200000) = 0x76f6f000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x3f20c000) = 0x76f6e000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x3f101000) = 0x76f6d000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x3f100000) = 0x76f6c000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0x3f00b000) = 0x76f6b000
clock_gettime(CLOCK_MONOTONIC_RAW, {tv_sec=76, tv_nsec=508090856}) = 0
futex(0x76efb290, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x76efb294, FUTEX_WAKE_PRIVATE, 2147483647) = 0
socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) = 4
ioctl(4, SIOCGIFHWADDR, {ifr_name="eth0", ifr_hwaddr=b8:27:eb:bc:f7:3a}) = 0
open("./config.json", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=637, ...}) = 0
read(5, "{\n "pin_nss_cs": 4,\n "pin_dio0"..., 65536) = 637
read(5, "", 61440) = 0
close(5) = 0
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
write(1, "\n", 1) = 1
write(1, "PlatformInfo:\n", 14) = 14
write(1, "------------\n", 13) = 13
write(1, "\n", 1) = 1
write(1, "ID (EUI-64): b8:27:eb:ff:ff:bc:f"..., 38) = 38
write(1, "(WiringPI) Pins:\n", 17) = 17
write(1, " nss_cs=4\n", 11) = 11
write(1, " dio0=5\n", 9) = 9
write(1, " dio1=6\n\n", 10) = 10
write(1, "LoRa SX127x Chip:\n", 18) = 18
write(1, " Freq=434.000000 MHz\n", 22) = 22
write(1, " BW=125.000000 KHz\n", 20) = 20
write(1, " SF=7\n", 7) = 7
write(1, " CR=4/5\n", 9) = 9
write(1, " SyncWord=0x34\n", 16) = 16
write(1, " PreambleLength=8\n\n", 20) = 20
write(1, "Meta Information:\n", 18) = 18
write(1, " Latitude=0.000000\n", 20) = 20
write(1, " Longtitude=0.000000\n", 22) = 22
write(1, " Altitude=10 meters\n", 21) = 21
write(1, " Name/Definition: 1chan_uplink
"..., 40) = 40
write(1, " E-mail: contact@email.com\n", 28) = 28
write(1, " Description: OPiPC LoRa 1-Ch G"..., 35) = 35
open("/dev/spidev0.0", O_RDWR) = 5
ioctl(5, SPI_IOC_WR_MODE, 0x7e8313b0) = 0
ioctl(5, SPI_IOC_WR_BITS_PER_WORD, 0x76f0868a) = 0
ioctl(5, SPI_IOC_WR_MAX_SPEED_HZ, 0x7e8313b4) = 0
open("/dev/spidev0.500000", O_RDWR) = -1 ENOENT (No such file or directory)
write(2, "Unable to open SPI device: No su"..., 53) = 53
exit_group(1) = ?
+++ exited with 1 +++

I think I have found the issue (in LoRaLib port for linux), and it should be fixed now.
@Pr-Jay , you can try pulling the latest changes, or cloning and compiling this project from scratch.

Thanks, @zhgzhg , there is another problem though. It's now saying "Unable to open SPI device: Too many open files"
Capture9

Thanks for the feedback, @Pr-Jay . Hopefully this should be fixed now. Currently I don't have access to real hardware setup to validate properly, but in the following days I'll have that opportunity.

@zhgzhg Yes, the program is running now. I haven't test it properly with TTN yet, I will do that as soon as I'm able. Btw, can I print out the incoming loraDataPacket on to the terminal?
Much thanks for your commitment to resolve this issue.

You are welcome, @Pr-Jay , and thanks for contributing! Regarding your question about terminal logging - yes, it does that by default - when a packet is received it will log its payload content in the terminal along with signal stats like RSSI and SNR.
If you have a spare SX1278 module and ESP8266/ESP32/Arduino you can flash the Transmit project to generate some LoRa packets.

@zhgzhg I believe the LoRa functionality is running fine now.
s1
A tiny note is that the default Transmit.ino wasn't written to send at SF 7, and CR 5 like the gateway.
s2
Also, I have tried to registered the gateway on TheThingsNetwork, but they don't have support for 434MHz. How did you overcome this?

Great to see that! Obviously I need to correct the comments/config in the Transmit sketch, or to clarify that I've meant the Transmit sketch embedded in this repository. Regarding 433 MHz band - the standardization process is not complete yet, hence TTN does not provide that option. However this is just a meta-data, thus you are able pick another option (although it is not a great practice, but for testing purposes I suppose it's fine as long as the country you are located in permits the frequency).

@zhgzhg Thanks so much for the support! I just uploaded a few first packages to TTN. I would say that this is case closed.