Forgive me if this is all really, really elementary. We're developing a few big projects where the Omega will be a bridge between ethernet and a handful of fast SPI chips. Python almost certainly won't be fast enough to keep up with everything, so it looks like cross-compilation from C is required.
I'm not a linux ninja, but can get around reasonably well with a search window on my second monitor:
Here's a list of rabbit holes I've been down over the past week:
-
On a Windows 10 workhorse machine, I installed Hyper-V and spun up a new Ubuntu 18.04 LTS image. Then tried working through all these steps: https://docs.onion.io/omega2-docs/cross-compiling.html I gave up after being error'd for more missing files and libraries than I can remember.
-
Disabled Hyper-V. Installed Docker Desktop for Windows 10. Tried working through these steps, including make menuconfig and selecting the proper processor, etc.:
https://docs.onion.io/omega2-docs/cross-compiling.html
https://onion.io/2bt-cross-compiling-c-programs-part-1/
https://onion.io/2bt-cross-compiling-programs/
Make -J6 fails, again, missing files and libraries.
-
Disabled Hyper-V. Somewhere in these forums someone shared a .vbox virtual disk image, 6 GB, hosted on Microsoft One Drive, a year or two ago. I downloaded it and spun it up. Make menuconfig showed that only the Omega 2 was selected, so I added the 2+. Make quits after a couple hours with errors.
-
Discovered this thread from July 2019:
http://community.onion.io/topic/3666/plans-to-update-the-onion-omega2-source-docker-container
Which mentions this new brand-new Docker image openwrt-18.06 b228:
https://hub.docker.com/r/onion/omega2-source/tags
So I started from scratch just now:
Microsoft Windows [Version 10.0.18362.356]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\ThinkStation>docker pull onion/omega2-source:latest
latest: Pulling from onion/omega2-source
Digest: sha256:6bf05eb531ece478c1f22e3e7a9a522466e2a48f781c06a52df01afec2f10904
Status: Image is up to date for onion/omega2-source:latest
docker.io/onion/omega2-source:latest
C:\Users\ThinkStation>docker run -it onion/omega2-source
root@ea7a8942a075:~/source# git pull
remote: Enumerating objects: 68, done.
remote: Counting objects: 100% (68/68), done.
remote: Total 97 (delta 68), reused 68 (delta 68), pack-reused 29
Unpacking objects: 100% (97/97), done.
From https://github.com/OnionIoT/source
ddd04310cb..52a1594fbb openwrt-18.06 -> origin/openwrt-18.06
- [new branch] openwrt-18.06-dev -> origin/openwrt-18.06-dev
Updating ddd04310cb..52a1594fbb
Fast-forward
.config.O2 | 67 +-
.config.O2-minimum | 15 -
.config.O2Dash | 6051 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
CHANGELOG.md | 30 +
build_info.json | 2 +-
files/etc/config/dhcp | 9 +-
files/etc/config/network | 17 +-
files/etc/uci-defaults/12_onion_version | 2 +-
package/kernel/linux/modules/video.mk | 511 ++++-
target/linux/ramips/base-files/etc/board.d/01_leds | 1 +
target/linux/ramips/base-files/etc/board.d/02_network | 6 +-
target/linux/ramips/base-files/etc/diag.sh | 1 +
target/linux/ramips/base-files/lib/ramips.sh | 3 +
target/linux/ramips/base-files/lib/upgrade/platform.sh | 1 +
target/linux/ramips/dts/OMEGA2DASH.dts | 37 +
target/linux/ramips/image/mt76x8.mk | 8 +
target/linux/ramips/mt76x8/config-4.14 | 79 +
17 files changed, 6792 insertions(+), 48 deletions(-)
create mode 100644 .config.O2Dash
create mode 100644 target/linux/ramips/dts/OMEGA2DASH.dts
root@ea7a8942a075:~/source#
Ran Make Menuconfig. Everything seems correct, including the addition of libugpio for the cross-compile example. So I exit without saving the configuration.
Your configuration changes were NOT saved.
root@ea7a8942a075:~/source# make -j6
WARNING: Makefile 'package/feeds/onion/transmission-console-app/Makefile' has a dependency on 'Onion-Console', which does not exist
WARNING: Makefile 'package/feeds/onion/transmission-console-app/Makefile' has a dependency on 'transmission-daemon', which does not exist
WARNING: Makefile 'package/feeds/onion/zeromq/Makefile' has a build dependency on 'libuuid', which does not exist
Checking 'rsync'... ok.
time: target/linux/prereq#0.14#0.00#0.26
WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!
make[1] world
make[2] tools/compile
make[2] package/cleanup
make[3] -C tools/flock compile
make[3] -C tools/sed compile
...
This of course fails after two hours:
make[3] -C feeds/packages/net/vsftpd compile
make[3] -C feeds/packages/net/vsftpd compile
make -r world: build failed. Please re-run make with -j1 V=s to see what's going on
/root/source/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 1
root@16fae4e217a9:~/source# make -j7 V=s
WARNING: Makefile 'package/feeds/onion/transmission-console-app/Makefile' has a dependency on 'Onion-Console', which does not exist
WARNING: Makefile 'package/feeds/onion/transmission-console-app/Makefile' has a dependency on 'transmission-daemon', which does not exist
WARNING: Makefile 'package/feeds/onion/zeromq/Makefile' has a build dependency on 'libuuid', which does not exist
make[1]: Entering directory '/root/source'
make[2]: Entering directory '/root/source'
make[2]: Entering directory '/root/source'
make[3]: Entering directory '/root/source/target/linux'
make[4]: Entering directory '/root/source/target/linux/ramips'
...
Then hundreds and hundreds of pages of compiler output, which I won't even include here, but it fails again after two hours with this text:
make[3]: Leaving directory '/root/source/package/firmware/linux-firmware'
time: package/firmware/linux-firmware/compile#5.49#5.02#813.85
make[2]: Leaving directory '/root/source'
package/Makefile:103: recipe for target '/root/source/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile' failed
make[1]: *** [/root/source/staging_dir/target-mipsel_24kc_musl/stamp/.package_compile] Error 2
make[1]: Leaving directory '/root/source'
Build failed - please re-run with -j1 to see the real error message
/root/source/include/toplevel.mk:216: recipe for target 'world' failed
make: *** [world] Error 1
root@16fae4e217a9:~/source#
Finally, my questions:
I'm comfortable using Microchip's IDE tools, where there's a file browser on the left part of the window, I can see and easily open tons of different source files, etc.
How do I get something similar set up for Omega? I don't mind using nano, etc for simple python scrips but it's too restrictive for big projects. Something like Eclipse or Atom would be amazing. I can even dual boot this machine if it's useful - VirtualBox, Hyper V, etc don't seem to like giant dual screen machines and I can't work in a single 1024 x 768 window.
Is there a way to set up an IDE that... sorry for bad phrasing... points to my docker system, assuming I can get the docker image to compile properly in the first place?
Google search for 'IDE with Docker compiler' seems to get out in the weeds really, really quickly.
Thanks for reading. I really, really want this platform to work for us in several upcoming products. But I've never had to fight so hard just to get a silly 'hello world' to run.