Mips 32r2 binary of the Lora-Gateway-Bridge

Hello,

I am currently trying to compile the Lora-Gateway-Bridge for a MIPS32r2 architecture. I try to build the cross-compiler toolchain for MIPS with vagrant and buildroot. I will need a little longer to try doing that, but I wanted to know if maybe someone has already done that?
The Dragino LG01-P Gateway is based on the MIPSr2. It is only a single channel gateway, but I already have it here so why not adding it to the network as well.

Best regard,

LuWi

2 Likes

Did you have any luck corss compiling for the LG01? Can you please reference the docuementation you used to do so? Thanks!

You are probably taking the complex approach :wink: Please note that the Go compiler toolchain already supports cross-compiling (no need to cross-compile the Go toolchain). Just modify this file:

Then run make build-snapshot

See also for a complete list of options: https://golang.org/doc/install/source#environment.

Hello,

So far I was not successful with the first approach yet. But you suggestion seems a lot earsier. I will try your method, and if it works, I can build an ipk from it. This way you will be able to provide it as an additonal pre-compiled binary if you want.

Best regards,

LuWi

Hello,

by the way, this thread on the same topic on github was very usefull:

Best regards

LuWi

And here is the result:

Just have to try running it on the gateway next. Now I only have to pass the config via the -c option. Is the binary by default checking /etc/lora-gateway-bridge/lora-gateway-bridge.toml?

Best regards

LuWi

Please see the configuration documentation :slight_smile:

Hi,

it works like a charm:

I used:

./lora-gateway-bridge -c lora-gateway-bridge.toml

The issue with Dragino is now that it only has enough memory in its /tmp which is deleted on every reboot.

@brocaar: Do you want me to provide a pre-compiled binary? Is there even any interest in a *.ipk file as a pre-compile package?

Best regards,

LuWi

Yes, please share a precompiled package in this topic :slight_smile:

@brocaar

I want to provide a nice *.ipk but I will first have time for that after the 10th of June. I have very busy schedule right now, but I would be happy to help were I can. I would also write a setup description for your doc section of the gateways.

Best regards,

LuWi

2 Likes

Hello LuWi, hello Mr. Brocaar,
I’ve been following this thread with great hope :smile: because I would really need an *.ipk for OpenWRT. Is there any news about this package availability ?
Cheers !
Luc

Hi @lucdioc and @brocaar,

I will have more time now and will provide a package as soon as possible. Just finished a huge project, which was eating all my time. :stuck_out_tongue:

Best regards,

LuWi

Hi @LuWi,
Thanks a lot, waiting for it !
Cheers and a have great week,
Luc

Hello LuWi,
Did you had time to make this package as you planned ?
Thanks and cheers,
Luc

I was able to build for OpenWRT.
Steps was - Cross compiling using the docker file on the separate machine.
Copied the binary from the container and run on openWRT. This was the easiest way which i was able to do.
Dockerfile -

FROM golang:1.11-alpine AS development

ENV PROJECT_PATH=/go/src/github.com/brocaar/lora-gateway-bridge
ENV PATH=$PATH:$PROJECT_PATH/build
ENV CGO_ENABLED=0
ENV GO_EXTRA_BUILD_ARGS="-a -installsuffix cgo"

RUN apk add --no-cache ca-certificates make git bash
RUN mkdir -p $PROJECT_PATH
WORKDIR $PROJECT_PATH
COPY lora-gateway-bridge .
RUN ls -la
RUN pwd
RUN make dev-requirements requirements
RUN make
WORKDIR /root/
COPY forever.go .
RUN go build
RUN ls -la

FROM alpine:latest AS production

WORKDIR /root/
RUN apk --no-cache add ca-certificates
COPY --from=development /go/src/github.com/brocaar/lora-gateway-bridge/build/lora-gateway-bridge .
COPY --from=development /root/root .
RUN ls -la
ENTRYPOINT ["./root"]

Run the container, and below command to copy from container.

docker cp container-id:/root/lora-gateway-bridge .

Hello everybody, hello Mr Brocaar,

I managed to compile the lora-gateway-bridge for Gemtek Femto gateway (OpenWRT on Mipsel
architecture).

I did it simple : git clone the repository, make the dev-requirements and requirements and cross compiled using arch=mipsel.

The lora-gateway-bridge is running on the gateway, everything would be just fine BUT, because there is a big BUT (ahah :slight_smile: ) : the Semtech packet forwarder and the Lora-gateway-bridge are not talking to each other !!!

In technical words : the semtech packet forwarder is sending the packets to “localhost” and port “1700” (up and down). I check, it works, and there are packets arriving.
When I set the lora-gateway-bridge to listen to 0.0.0.0:1700, nothing happens, even after a long period of time : the lora-gateway-bridge is running but does not seem to receive any packet from the Semtech packet forwarder.
When I set the lora-gateway-bridge to listen to 127.0.0.1 or to localhost, I have the following message (that I don’t understand to be honest) :
FATA[0020] could not setup gateway backend: listen udp 127.0.0.1:1700: bind: cannot assign requested address

I need help, because I’m lost and I don’t understand the problem !!! (I already have about 10 gateways with the lora-gateway-bridge running on them, Debian architecture, no problem, so I’m quite sure it is not a simple typing mistake).

Thanks in advance
Luca

Hello all,
Problem solved, it was only the localhost that was not reachable.

The binary is working perfectly well on Gemtek Femto gateway.

If anybody is interested in the detailed steps to get this binary, please don’t hesitate to ask here and I will explain how I managed it.

Cheers,
Luca

Hi, i would be very interested to know how you did this. I have got some RAKwireless gateways, that are MIPS. I’m not that conversent with go/docker unforuantly.

Hi,
It was very simple indeed. I downloaded the latest release of Golang from their site and I unpacked it (check on Golang site, getting started). I Then I just compiled the lora-gateway-bridge using the environment variable GOOS (in my case linux) and GOARCH (in my case mipsle). https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63

I got a binary of 11.3 MB, which was, in my case, perfectly ok for my gateway.

Feel free to ask more but it is very easy with the latest release of Golang.

Lucs

thanks, thats really helpful!