installing an ipk package and incompatible with the architecture error
-
Hello all,
I would like to install chirpstack gateway bridge application on my gateway which has Omega2S+.
I follow the instructions below:
wget https://artifacts.chirpstack.io/vendor/dragino/LG308/chirpstack-gateway-bridge_3.11.0-r1_mips_24kc.ipk
opkg install chirpstack-gateway-bridge_3.11.0-r1_mips_24kc.ipk
Result is:
Unknown package 'chirpstack-gateway-bridge'. Collected errors: * pkg_hash_fetch_best_installation_candidate: Packages for chirpstack-gateway-bridge found, but incompatible with the architectures configured * opkg_install_cmd: Cannot install package chirpstack-gateway-bridge.
I see architecture is mipsel_24kc for both system and package.. What would be the reason of this issue?
root@OpenWrt:~# opkg print-architecture arch all 1 arch noarch 1 arch mipsel_24kc 10
the conf file "/etc/opkg.conf" :
dest root / dest ram /tmp lists_dir ext /var/opkg-lists option overlay_root /overlay option check_signature
-
@optech
The executable in chirpstack-gateway-bridge_3.11.0-r1_mips_24kc.ipk is big endian$readelf -h ./opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge
ELF Header:
Magic: 7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, big endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: MIPS R3000
Version: 0x1
Entry point address: 0x3de3b0
Start of program headers: 52 (bytes into file)
Start of section headers: 0 (bytes into file)
Flags: 0x50001004, cpic, o32, mips32
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 2
Size of section headers: 40 (bytes)
Number of section headers: 0
Section header string table index: 0
-
@optech @tjoseph1 is correct, this ipk is mispackaged. An IPK is just a set of tgz inside a tgz, so you can extract the files and run the binary and the error becomes self-evident. Best to contact the author or recompile the code.
-
I have the sources here:
https://www.chirpstack.io/gateway-bridge/community/source/I recompiled it but it compiles as big endian as you said. So do you think is there a way to compile as little endian?
By the way, i also ask this issue to author in chirpstack community forum. no answer yet.
-
mipsel ipk is here:
https://disk.yandex.com/d/bDtdR4j251cKIQ
Filename: chirpstack-gateway-bridge_3.11.0_mipsel_24kc.ipkI couldn't find the "3.11.0-r1" in the github repo
..
v3.1.0
v3.10.0
v3.10.0-test.1
v3.11.0
v3.11.0-test.1
v3.2.0
..
so, I picked 3.11.0omega# /etc/init.d/chirpstack-gateway-bridge status
Syntax: /etc/init.d/chirpstack-gateway-bridge [command]
Available commands:
start Start the service
stop Stop the service
restart Restart the service
reload Reload configuration files (or restart if service does not implement reload)
enable Enable service autostart
disable Disable service autostartThanks.
-
@tjoseph1 Thank you for packing for me the information you gave me was useful.. Thanks again...
-
@tjoseph1 I tried to run follows:
/etc/init.d/chirpstack-gateway-bridge enable
/etc/init.d/chirpstack-gateway-bridge start
It says "Starting chirpstack-gateway-bridge" but there is no start an instance as proccess.. Could you had a chance to test it on Omega after compiling?
-
@optech Type logread and see what the service is reporting.
-
@crispyoz said in installing an ipk package and incompatible with the architecture error:
logread
I did but nothing about chirpstack gateway bridge
-
@optech add PROCD_DEBUG=1 to the top of your init script to log more info about the process
-
I did it but still there is nothing about chirpstack gateway bridge !
-
@optech Post your init script please, it will log whatever the script results are. Check the log again using:
logread | grep -i chirpstack
-
I downloaded the file again from yandex drive and installed. Pls see below.
Omega# # onion os version
=== Version Info ===
Omega firmware: v0.3.3 b247
onion-os - 1.0.6-1Omega# opkg install ./chirpstack-gateway-bridge_3.11.0_mipsel_24kc.ipk
Installing chirpstack-gateway-bridge (3.11.0) to root...
Configuring chirpstack-gateway-bridge.Omega# opkg files chirpstack-gateway-bridge
Package chirpstack-gateway-bridge (3.11.0) is installed on root and has the following files:
/etc/init.d/chirpstack-gateway-bridge
/opt/chirpstack-gateway-bridge/LICENSE
/opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge
/etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml
/opt/chirpstack-gateway-bridge/README.mdOmega# free
total used free shared buffers cached
Mem: 124784 56492 68292 72 5536 28884
-/+ buffers/cache: 22072 102712Omega# /etc/init.d/chirpstack-gateway-bridge start
Starting chirpstack-gateway-bridgeOmega# free
total used free shared buffers cached
Mem: 124784 58644 66140 76 5536 28892
-/+ buffers/cache: 24216 100568Omega# ps
2092 root 658m S /opt/chirpstack-gateway-bridge/chirpstack-gateway-brOmega# logread
Mon Feb 22 22:35:13 2021 user.info chirpstack-gateway-bridge[2092]: time="2021-02-22T22:35:13.255502795Z" level=info msg
="starting ChirpStack Gateway Bridge" docs="https://www.chirpstack.io/gateway-bridge/" version=3.11.0
Mon Feb 22 22:35:13 2021 user.info chirpstack-gateway-bridge[2092]: time="2021-02-22T22:35:13.257726475Z" level=info msg
="backend/semtechudp: starting gateway udp listener" addr="0.0.0.0:1700"
Mon Feb 22 22:35:13 2021 user.warn chirpstack-gateway-bridge[2092]: time="2021-02-22T22:35:13.268847616Z" level=warning
msg="[store] memorystore wiped" module=mqtt
Mon Feb 22 22:35:13 2021 user.info chirpstack-gateway-bridge[2092]: time="2021-02-22T22:35:13.269861713Z" level=info msg
="integration/mqtt: connected to mqtt broker"Omega# netstat -atunp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 1610/mosquitto
tcp 0 0 127.0.0.1:51116 127.0.0.1:1883 ESTABLISHED 2092/chirpstack-gat
tcp 0 0 127.0.0.1:1883 127.0.0.1:51116 ESTABLISHED 1610/mosquitto
tcp 0 0 :::9001 :::* LISTEN 1610/mosquitto
udp 0 0 :::1700 :::* 2092/chirpstack-gatOmega# /etc/init.d/chirpstack-gateway-bridge stop
Stopping chirpstack-gateway-bridge
stopped process in pidfile '/var/run/chirpstack-gateway-bridge.pid' (pid 2092)Omega# netstat -atunp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 1610/mosquitto
tcp 0 0 127.0.0.1:1883 127.0.0.1:51116 TIME_WAIT -
tcp 0 0 :::9001 :::* LISTEN 1610/mosquitto
-
root@OpenWrt:/# opkg files chirpstack-gateway-bridge Package chirpstack-gateway-bridge (3.11.0) is installed on root and has the following files: /etc/init.d/chirpstack-gateway-bridge /opt/chirpstack-gateway-bridge/LICENSE /opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml /opt/chirpstack-gateway-bridge/README.md root@OpenWrt:/# free total used free shared buff/cache available Mem: 124860 14664 96916 312 13280 79712 Swap: 0 0 0 root@OpenWrt:/# /etc/init.d/chirpstack-gateway-bridge start Starting chirpstack-gateway-bridge root@OpenWrt:/# free total used free shared buff/cache available Mem: 124860 14668 96912 312 13280 79708 Swap: 0 0 0
root@OpenWrt:/# ps | grep chirpstack 2048 root 1212 S grep chirpstack
root@OpenWrt:/# logread | grep chirpstack root@OpenWrt:/#
What could be the reason of this difference? what do you think? By the way, i loaded a custom build openwrt firmware 19.07.. Is that can be the reason?
-
@optech
"a custom build openwrt firmware 19.07 ..Is that can be the reason"
May be..You could flash the omega2 with onion build and try. I have provided my onion os version; any recent version should work.
"/opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge" is the only "arch dependent" (binary) file in the ipk.
$ file build/chirpstack-gateway-bridge
build/chirpstack-gateway-bridge: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, Go BuildID=0A8....You can also try running it from command prompt using the options that "/etc/init.d/chirpstack-gateway-bridge" script uses with "start" parameter.
("/etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml" contains the settings, it seems)
Thank you.
-
@tjoseph1 thank you very much for your help.
I loaded onion build firmware and tried it again then it works.But it doesn't work on openwrt 19.07 custom build.. I really wonder what would be the reason of this issue?
Here is the build which chirpstack gateway bridge doesnt work on..:
https://drive.google.com/file/d/1i5PeBWMF-9kke3xLXnlwJIylrfxVHWhm/view?usp=sharing
-
@optech
Can you pls replace the /opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge in your openwrt 19.07 with this file:
https://disk.yandex.com/d/C_6-fmcDtqXIGA and then try running it?It is a zip file, that unzips to "chirpstack-gateway-bridge" exe.
Thank you.
-
@tjoseph1 Thank you for your help. I was on a vacation sorry for late...
I replaced "/opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge" with the file that you sent. But result is same, dont work and so no ram change(on openwrt 19.07)..
Do you have another idea to find the reason of this issue?
-
I recompiled chirpstack gateway bridge as following the steps below:
export GOARCH=mipsle export GOOS=linux make build
root@OpenWrt:~# file /opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge /opt/chirpstack-gateway-bridge/chirpstack-gateway-bridge: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), statically linked, Go BuildID=VcvuifmDnNysO-WpZUz5/FGFca5Lt5vpptRtlLTBo/l2QuqgekGwKVygyjsXAL/6lmuYGmDGU2RDGrxxamU, stripped
The result is the same doesn't work on openwrt 19.07...
-
@optech
Ok. Let us start simple.
Are you able to cross-compile the "hello_world.go" and run it in the 19.07 Omega2 with GOARCH,GOOS parameters set as above ?package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}If not, you may want to try GOMIPS=softfloat or some other options in addition to those two. Once that thing prints \"Hello, World!\", try the same options to build chirpstack-gateway-bridge.
Thanks.
-
@tjoseph1 Thank you again for your help.
I compiled the hello world go app as following...:
export GOARCH=mipsle export GOOS=linux export GOMIPS=softfloat go build hello.go
if i dont use "GOMIPS=softfloat", it works on openWRT 18.06 but dont work on openWRT 19.07 as giving following error:
root@OpenWrt:~# ./hello Illegal instruction
with "GOMIPS=softfloat" option, it works on openWRT 19.07..
But after seeing that, i compiled chirpstack-gateway-bridge app with same options. But it still doesnt work on openWRT 19.07
chirpstack-gateway-bridge$ export GOARCH=mipsle chirpstack-gateway-bridge$ export GOOS=linux chirpstack-gateway-bridge$ export GOMIPS=softfloat chirpstack-gateway-bridge$ make build
i feel near to solution but i have no idea for now.