Building Chirpstack 4.8.1 for mt7688

Hi - I’ve been working on compile chirpstack 4.8.1 to run on a ramips mt7688 board (Onion Omega2+).

Using the docker-compose devshell from the chipstack-gateway-os repo, I was able to compile a base version without the chirpstack NS, and was able to run it on the board. Haven’t tested much, but was able to boot-up and check the configuration using luci web interface.

Next, I entered make menuconfig and marked (*) the chirpstack package to be built and included in the final image. But during the compiling process, an error regarding rquick-js was thrown. The error was related to the definition of the FE_UPWARD and FE_DOWNWARD values. I understood that those values were not defined as the CPU implements only software floating point.

I then forced the definition to -1 for both, changing the bits/fenv.h header of the toolchain, and was able to compile rquick-js.

Now I’m stuck on an error on the final compilation of the chirpstack’s rust code.

error[E0277]: the trait bound u32: EncodeCounterValue is not satisfied:

Here is the main part of the building error log: https://pastebin.com/k0A2ZpuM

I’ve tried to modify part of the prometheus rust lib and implement the u32 EncoderCounterValue, but I don’t have enough rust experience to fix everything that might solve the error.

If anyone have managed to compile chirpstack 4.8.1 to the mt76x8 processor or have any other suggestion…

Any help would be appreciated.

BR.

I have never tried it, but I’m not sure if the MT7688 is suitable for running ChirpStack. For the ChirpStack MQTT Forwarder + Concentratord it might be fine, but I think ChirpStack itself needs a little bit more resources.

i have fixed this error, and the compile complete,
but when startup , the postgresql have a error

running bootstrap script … 2024-07-08 07:50:04.560 UTC [5521] FATAL: invalid spinlock number: 134

i have the same probem , did you resolve it ?

I managed to compile, but had not found the error you posted before “…invalid spinlock…”

To compile, I had to change the quickjs.c to include the definitions for FE_DOWNWARD and FE_UPWARD.

I also had to change the Prometheus RUST library to implement functions for 32bit counter type. That was the part that took me a while to figure, as I never programed in RUST.

But at the end, as @brocaar pointed out, the MT7688 lacks resources to run the whole Chirpstack OS. The OS runs really slow and when I was able to connect to it through SSH, using linux’s “top” I could see that the processor use was always at 100% and never going down.

As suggested, I will be using only the MQTT Forwarder + Concentratord on the MT7688.