Skip to content
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

How to cross-compile? #387

Open
dangbo08 opened this issue Nov 27, 2024 · 8 comments
Open

How to cross-compile? #387

dangbo08 opened this issue Nov 27, 2024 · 8 comments

Comments

@dangbo08
Copy link

Hello, I want to cross-compile this project into my arm single chip computer to achieve the effect of nvr in openipc. Since the video display interface of nvr is not the effect I want, I want to cross-compile and then redesign the video display and reasonably plan the data display of flight control. However, I always encounter the problem of cross-compilation environment when compiling, so I have been unable to succeed, so I would like to ask if you have relevant solutions, please teach me if you have, thank you very much !!!

@svpcom
Copy link
Owner

svpcom commented Nov 27, 2024

User docker + qemu-static. See deb_docker target in the makefile. But default it do cross-build for RPI (arm32)
Also see .github/workflows/build*.yml. It do automatic cross-builds for all support platforms

@dangbo08
Copy link
Author

dangbo08 commented Dec 9, 2024

I cross-compile according to your method, but there are some errors in the end, so I asked chatgpt about the reason for the port. Then I checked that the generated binary file is indeed a file that can run on the arm platform. May I ask how I should put it on the embedded device? On Linux x86 systems there is a systemctl start wifibroadcast@gs command to boot, how to boot on embedded platforms?
QQ图片20241209162816
QQ图片20241209162825
Above is the compilation of the final error picture, and the format of the binary file. Is my operation correct? If there are any mistakes, please comment, thank you very much !!!!

@svpcom
Copy link
Owner

svpcom commented Dec 9, 2024

Use bunded qemu or disable tests during build, because standard qemu doen't implement some system calls needed for test run.

Docker cross build requires patched QEMU!
Apply ./scripts/qemu/qemu.patch to qemu-7.2.0 and build it:
  ./configure --prefix=/opt/qemu --static --disable-system && make && sudo make install

@dangbo08
Copy link
Author

Hello, may I ask, if my arm system supports the WiFi network card and the related dependency library of wfb, do I only need to cross-compile the three files wfb_tx.wfb_rx,wfb_keygen, and then I can design the relevant ways of receiving and sending files? Thank you!!

@svpcom
Copy link
Owner

svpcom commented Dec 11, 2024

wfb-ng deals with udp packets. If you want to send files then you have two ways:

  1. Setup ipv4 tunnel on top of wfb-ng. If you use full version (with python) it works out of box. If you want to use C-only then you need to setup it yourself using wfb_tun program. See OpenIPC project sources for reference
  2. Write your own program and implement custom file transfer protocol on top of udp

Hello, may I ask, if my arm system supports the WiFi network card and the related dependency library of wfb, do I only need to cross-compile the three files wfb_tx.wfb_rx,wfb_keygen, and then I can design the relevant ways of receiving and sending files? Thank you!!

@dangbo08
Copy link
Author

dangbo08 commented Jan 3, 2025

Hello, I cross-compiled your project, put the generated binary files wfb_keygen,wfb_tx,wfb_rx,wfb_tun,wfb_tx_cmd these five binary files into my environment to use, and copied the openipc edit related script files such as wifibroadcast, I ran the file and did not receive data and was prompted that I had error data. May I ask if the five binaries migrated above can only use them to receive data? Thank you!!
image
2 block overrides
3 packets lost
41 block overrides
15603 packets lost
40 block overrides
15335 packets lost
40 block overrides
14435 packets lost
image

image

@svpcom
Copy link
Owner

svpcom commented Jan 3, 2025

Use full version (deb packet from make deb). I don't know how openipc startup scripts work

@dangbo08
Copy link
Author

dangbo08 commented Jan 8, 2025

I recompiled my arm environment, downloaded some related configuration files, and then compiled your project in this system has been successful, thank you very much for the ideas provided before, and the understanding of your project has deepened a lot, thank you very much!!
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants