-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for openwrt and mips #65
Comments
The binary size can still be decreased a bit (using compile flags, no code changes required). Also it would be really easy to cross-compile to MIPS. See https://golang.org/doc/install/source#environment. What would be needed / do you know the capabilities of these gateways you're mentioning? (e.g. available memory) |
BTW, if the size is the problem, I have been using upx for some time now to decrease the size to ~2MB for the ARM version. |
One of the gateways I have has only 10Mb RAM disk and 5Mb ROM, But if you could build a lora-gateway-bridge for a ar71xx, that would be fantastic. |
I made an attempt to compile it for mips, mipsle, mips64 and mips64le. mips64 and mips64le: worked! mips, mipsle gave error: |
Golang has the feature called build tags. This could be be used for a number of things, including for performance critical sections that could be re-written in the most efficient way. Unfortunately for the crypto lib there is no implementation for mips CPUs. Maybe you can ask the authors of the library if they can provide one. |
@ivajloip would that be as easy as adding mips to the build tags, looking at the change you made last year? jacobsa/crypto@181e0c0 |
I think so, but this time I don't have the hardware to test it. I imagine the only thing to change is to add mips and mipsle to this line. @carlberg74 if you will be able to test it on mips and misple, we can try to make a build and if all works well, make a pull request. |
@ivajloip added mips to some of the files and it compiled without any error.. thanks. Found https://github.com/gomini/go-mips32 and where able to compile that as well.. any suggestions? Update: and I just realize that the go version is probably wrong.. |
|
@ivajloip suddenly there is hope again. :) thanks. The reason I thought I needed go runtime, was that I got error: 'Illegal instruction' on a simple helloworld sample. Can I disable the need of FPU when building the go app or are there maybe another reason for this? |
Unfortunately here I can not help you... I suppose you mean FPU, because according to the official release notes, FPU is needed (I don't know what is the exact difference between them). In any case, you need a kernel that supports it/can emulate it if you are to be able to run a program written in go. |
FPU emulation is a config option in OpenWRT :-)https://forum.openwrt.org/viewtopic.php?id=25972 |
@ivajloip or @carlberg74 if you confirmed that the mips fix works in the https://github.com/jacobsa/crypto source, could you create a pull request for this? :-) |
Go 1.10 beta has been announced: https://beta.golang.org/doc/go1.10
This will make it much easier to deploy the LoRa Gateway Bridge onto a mips gateway I believe! |
I cant confirm its working yet, still struggling with getting the image to compile having the kernel flag set with FPU. These are the files in: hash_32bit.go:// +build 386 arm,!arm64, mips Really good news about Go 1.10! |
Did you get the kernel to compile with FPU? |
Yes, I did. |
I have enabled MIPS FPU in three separate places, but it still is not activated. Is there some secret involved you could share? I'm working on OpenWrt on an ar71xx. |
Just got it working. The last option enabled was not clean compiled, now it is working. |
Please note again that Go 1.10 will make this much easier: Basically add the Once Go 1.10 is out, I'm happy to provide pre-compiled MIPS binaries with this set :-) |
Excellent news here also! |
Adding the MIPS architecture to goreleaser is easy but goreleaser does not have support for the GOMIPS env variable, so the binary can only be compiled with hardfloat (default), not softfloat. I have the Gemtek Femto gateway here and it's running OpenWrt on a MT7620A. The kernel probably has hardfloat emulation because the hardfloat binary is working just fine (no need for softfloat), so I think the hardfloat binary is worth adding. |
Whats the status of openwrt support? I'd like to get the lora-gateway-bridge running on my RAK7242 gateway, which is running openwrt. root@6phr_por:/# cat /proc/cpuinfo |
Please have a try with my OpenWRT feed https://github.com/xueliu/lora-feed, where I try to integrate loraserver softwares into OpenWRT. |
^^ that will include MIPS as build target for the next release :) This will be used to support the Dragino LG308 gateway (https://www.dragino.com/products/lora-lorawan-gateway/item/140-lg308.html). |
If one of the designs is to have the lora-gateway-bridge running on the gateway itself
and use MQTT instead of UDP.
It would be nice if the lora-gateway-bridge would support platforms like OpenWrt (mips, ar71xx),
as some gateway uses it.
(edit: just learn that the go application compiled is pretty large, maybe the lora-gateway-bridge running on a OpenWrt gateway is better written in C?)
Cheers!
The text was updated successfully, but these errors were encountered: