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.
You are probably taking the complex approach Please note that the Go compiler toolchain already supports cross-compiling (no need to cross-compile the Go toolchain). Just modify this file:
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.
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?
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.
Hello LuWi, hello Mr. Brocaar,
I’ve been following this thread with great hope because I would really need an *.ipk for OpenWRT. Is there any news about this package availability ?
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 -
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.
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 ) : 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).
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.