Oh, it's simple issue as I remember. I wrote manual about CMake using.
Don't build application on Omega, it's not works like the Raspberry, use only cross-compiling.
Posts made by Modest Polykarpovich
-
RE: CMake on Omega2+
-
RE: Never have been able to use Omega2+ I received
@bigdogsb, you have to know it's a home-based device and OpenSource OS. Also you must be a very good Linux-user or admin to get maximum abilities from device. OS is very good and stable, there are many network's features.
You listed several bugs, but it's for home using.
- Web-interface as for me - no need at all;
- AP doesn't turn off - many users know that, it the bug;
- Not stable Wi-Fi connection - we all know it. For example my MIUI router from time to time no want to connect Omega2 then I reboot him (router).
- You have serial UART terminal to tune device if be able any problems with SSH.
-
RE: Cross Compiling OpenWrt Package
@luckycometdaft said in Cross Compiling OpenWrt Package:
... I have installed MQTT on board and there is a .so file in Board. Now, how do I cross-compile with this library?
Look through my first post in the manual [Manual] How to make native C/C++ application step by step. There is part of it:
... Second problem in third-party libraries - Omega; opkg manager doesn't install -dev files of libraries and it's will be a problem in your application.
You have to know OpenWRT it's a minimal disk-size system. It have no .h-files to build anything in. I think you compiled your application into the Omega board (direct compilation). In this case you had install GCC build system with common h-files, but you need append your third-party h-file for special .so library.
You have to find this and append manually. You can find your h-file from so-library repository.
But I recommend you compile via SDK. You will need it in future if touch to build native applications. -
RE: [GUIDE] Install OpenWrt 18.06 on Onion Omega2 Pro
I don't see real feature to change OnionOS, I hoped to see OpenWRT 19.07. To place battle software internal 32MB is enough. Database and other data files can be placed to the external disks (USB, MMC) with no problems.
-
RE: Smart irrigation system
@supczinskib, thank you for the answer. Your UI looks like production factory device.
Your idea has interes in general. I think main controller need a bigger display for monitoring parameters. All its configurations must be declared via web-intetface or any cloud server.
Also this device need a big hardware part (pums, valves, sensors including remoted). I think it needs a big database about botany as help-part for users.
By the way... sensors you can power by solar sells, to trsnsfer data you can get LoRa net.
-
RE: Smart irrigation system
@supczinskib, please tell us how did you make splash boot screen with a progress bar?
Also how use third-party touch input device in the Omega?
-
RE: Cross Compiling
@crispyoz said in Cross Compiling:
I'm currently building the the LEDE system on the docker image running on my Surface 4, i7, 16GB, Windows 10 Pro 64Bit the build has been running for about 18 hours and still has not completed. The same build on the same machine but running Ubuntu 17 on VMWare Workstation Pro 15, builds in about 2 hours.
I'm using Oracle VirtualBox with a Debian i386 CLI without GUI (3GB RAM, 4 core of processor). VM runs on the host Windows 10 Home, AMD Phenom II X6 16GB RAM.
make clean make -j4
The building takes in about 45 minutes.
-
RE: Project "liburtc" the library to operate external RTC devices
@crispyoz said in Project "liburtc" the library to operate external RTC devices:
Not sure where I would buy old Russian diodes here on Australia though
You can try 1N34A that's Germanium Diode too and say us result.
-
[Manual] Connection TFT display ILI9341 (custom Dash)
Hi all. Yesterday I've connected my TFT display (3.2" controller ILI9341 320x240) and Omega2. Look at the photo below.
I don't have Dash board, but I re-compiled firmware with drivers (kernel objects).
If someone else wants to do it, I post here my experience.Hardware connection
Let's see connection diagram below.
It's item named "LCD TFT 320x240 Graphic Color Touch Display ILI9341 Mega2560 Arduino Compatible" from AliExpress.Software setup.
-
You must select the next components (via
make menuconfig
to in-built firmware:kmod-fb
kmod-fbtft-support
kmod-fbtft-ili9341
,dejavu-fonts-ttf-DejaVuSans
.Then you have to append initial script (filename
files/08-fbtft-device
) from Omega2 Dash Package repository -
Or select
omega2-dash-base
inmake menuconfig
menu. -
Or select the board Omega2 Dash in the same menu.
-
Or download and force upgrade firmware (filename omega2dash-vX.X.X-bXXX.bin) via util
sysupgrade
from repo.onioniot.com. DIDN'T TESTED!
See next useful links about it:
-
-
RE: i2c RTC on 0x68 can find in system
@Moonshiner, I figured out in part of this and appended
kmod-rtc-pcf8563.ko
; NXP PCF8563 based address 0x51. First I've got next kernel message, please compare below:root@Omega-D913:/# dmesg | grep rtc [ 0.615614] hctosys: unable to open rtc device (rtc0)
Next I appended device manually:
echo pcf8563 0x51 > /sys/class/i2c-dev/i2c-0/device/new_device
Then you will see
/dev/rtc0
device.Next creating default RTC symlink:
cd /dev ln -s rtc0 rtc
and...
hwclock -r Sun Jul 5 19:50:44 2020 0.000000 seconds
It's works!
But this procedure we must do for each loading.
Driver works well, we have errors in
OMEGA2[P].dts
file, something wrong there. -
RE: i2c RTC on 0x68 can find in system
@Moonshiner said in i2c RTC on 0x68 can find in system:
May be we must to change platform to somethink else... orangePi, nanoPi..
Yes that's good Idea, debian's type OS' have
*-kernel-headers
to compile dynamical kernel modules. The driver's subsystem in Linux is very inconvenient at all as compared with Windows.
I think you encounter many hardware problems there, like Interrupts, DMA, memory management, kernel-space coding etc. If you no-system coder, don't start to be one.OrangePi computers are very fast for a simple projects, I prefer C++ language, programs work too fast )). I choose Omega by the lowest prize and stable OpenWRT OS in. Last time I used to MCUs only, but they are poor for multimedia projects (TFT-diaplays, sound, touchscreen input) or database using (SQLite), also mini-computers allow service tools inside and third-party packages. But they have difficult way to append any hardware driver. In fact a hobbyist can only use system "in-box", I mean that's already not very bad.
I think Omega should upgrade board Dash to Dash2, with the next hardware on:
- support some SPI displays (like 2.4"...3.5") and Qt library (package)
- support set of touchscreen drivers for the displays set
- sound (the best is codec WM8960 with microphone),
- rtc
- Ethernet connector with PoE (external shield).
- (external shield) USB-hub with 3-4 connectors (one slot must be always free for service using).
- (external shield) PCI-E controller SATA for 2.5" hard drives.
There is base powerfull computer board for the most multimedia projects.
-
RE: i2c RTC on 0x68 can find in system
@Moonshiner said in i2c RTC on 0x68 can find in system:
and copy to omega and add it. Now a can see it but no /dev/rtc0 ...
rtc_m41t80 is already loaded
System programming is not for us mere mortals. Leave your ideas and hopefulness, have a cup of beer and take a break.
You have to know, Omega has limitations with difficult OS, if you need more hardware to operate, look for ESP32, ESP8266 solutions.Why you need watchdog that's only need for industrial projects, Omega built for home using. OpenWRT have not industrial standard. You can make external resetter for Omega when it get freeze and flashing LED will stop.
Don't freeze yourself, move on and make&take simpler tasks.
-
RE: i2c RTC on 0x68 can find in system
I think you should correct DTS from example below if you need watchdog
.../rtc/rtc-m41t80.txtAnd as last resort you can take my user-space rtc application liburtc as a template to append your chip into.
-
RE: i2c RTC on 0x68 can find in system
I'm interesting in this too and how
make kernel_menuconfig
works because I heard it doesn't work well - devices are not present after, such as TFTs, I2S codecs, RTCs.Please execute the command
lsmod | grep m41t80
-
RE: Building kernel driver.
@Martin-Vana, kernel objects for Omegas are big problem, same problem with I2S sound card, TFT-displays, RTC and others device drivers.
You have to recompile your own firmware. But why you need external LAN78XX device, Ethernet port is already in Omega, you can only append transformer and RJ-45 or connect expand shield to use it.
-
RE: Power Omega2 from 3.7 volts?
@CAP-33, you should look at schematic Power Dock 2 expansion shield.
But Omegas take much power and doesn't have power management subsystem. You have to use a big Li-Pol battery or change MCU Like ESP8266 instead. -
RE: I2S ADC Headaches
The kernel objects in the Linux OS' are very capricious thing and one of the biggest problem. So... kernel object will work only in the same kernel version and build number, well I want to say these are likely static feature than dynamical as it give us.
We (users) can't append sound driver or TFT-display (frame buffer driver and his friends), PCI Express->SATA controller, etc.!
To append your own kernel object you have to build you own firmware - it's not convenient. Second way - build kernel objects on the omega (direct compilation), but it needs special tools, like
linux-headers-*
, that's out of repositories too.Let's type code in Python! ((
-
RE: I2S ADC Headaches
I tried to connects I2S sound card CJMCU-4344 (alternate PCM5102), based on Cirrus Logic CS4344. I cant understand: all I2S modules are already loaded, why I have no any soundcard device?
These are my sound modules that is loaded:
root@Omega-D913:~# lsmod | grep snd_ regmap_i2c 2298 1 snd_soc_wm8960 snd 41582 12 snd_usb_audio,snd_usbmidi_lib,snd_soc_wm8960,snd_soc_core,snd_compress,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_rawmidi,snd_seq_device,snd_hwdep snd_compress 10436 0 snd_hwdep 4286 1 snd_usb_audio snd_mixer_oss 12729 1 snd_pcm_oss snd_pcm 61710 6 snd_usb_audio,snd_soc_ralink_i2s,snd_soc_wm8960,snd_soc_core,snd_pcm_dmaengine,snd_pcm_oss snd_pcm_dmaengine 2971 1 snd_soc_core snd_pcm_oss 36177 0 snd_rawmidi 16298 1 snd_usbmidi_lib snd_seq_device 2191 1 snd_rawmidi snd_soc_core 114758 4 snd_soc_simple_card,snd_soc_simple_card_utils,snd_soc_ralink_i2s,snd_soc_wm8960 snd_soc_ralink_i2s 7088 0 snd_soc_simple_card 4304 0 snd_soc_simple_card_utils 5095 1 snd_soc_simple_card snd_soc_wm8960 24224 0 snd_timer 15806 1 snd_pcm snd_usb_audio 121378 0 snd_usbmidi_lib 16883 1 snd_usb_audio usbcore 137059 29 option,uvcvideo,usb_wwan,snd_usb_audio,pl2303,ftdi_sio,cp210x,ch341,usbserial,usblp,usbhid,ums_usbat,ums_sddr55,ums_sddr09,ums_karma,ums_jumpshot,ums_isd200,ums_freecom,ums_datafab,ums_cypress,ums_alauda,snd_usbmidi_lib,cdc_acm,btusb,usb_storage,ohci_platform,ohci_hcd,ehci_platform,ehci_hcd
And we can see no any card installed!
root@Omega-D913:~# aplay -l aplay: device_list:272: no soundcards found...
root@Omega-D913:~# alsactl init alsactl: init:1757: No soundcards found...
root@Omega-D913:~# aplay -L null Discard all samples (playback) or generate zero samples (capture)
root@Omega-D913:~# cat /proc/asound/cards --- no soundcards ---
Onion OS: 0.3.2 b233, kernel version 4.14.81
-
RE: libpcap-dev for omega2?
-dev(...elopment) files install only inside SDK. Runtime OS doesn't have and need that, you can find only dynamic libraries (
*.so
). Static libs (*.a
) don't install too.You have to manual compile lib in the SDK, then you can see all files. But why your Python project need c-headers, It seems incorrect?!
-
RE: [Manual] How to make native C/C++ application step by step.
Hi all! I glad to show my template of project Hello world that uses CMake build system, it's named as
myapptemplate
.My last sample was use GNU Autotools, it's a difficult system. Today we have many projects with CMake (cmake.org). For new projects I recommend use CMake. But it will have problems with cross-compilation for beginners. Let's find it out!
Step 1. Creating you own CMake project
First you have to install
git
andcmake
applications in the host if there are none.Next follow into you projects directory in the host, e.g.
$HOME/projects
and clone there my CMake templatemyapptemplate
project. Then enter new project directory and remove.git
dir from there.git clone --single-branch --branch CMake https://bitbucket.org/hlorka/myapptemplate.git <my_app_name> cd ./<my_app_name> rm -rf ./.git
The files
CMakeSettings.json
andmyapptemplate.vcxproj
for MS Visual Studio IDE and can be deleted too.Step 2A. General compilation for the host machine
It's very simple. First you have to configure and make cache CMake's files. Look at the command below:
cmake . [--config Debug]
--config Debug
will append debug information (symbols) and postfix-d
to the output binary file (helloworld-d
).Then you can build (compile) project, using next commands below
-
Via CMake:
cmake --build . [--clean-first]
-
Or via Makefile (
make
utility)make
Step 2B. Cross-compilation using OpenWRT SDK
First open file
cross-compile/openwrt-mips-toolchain.cmake
for modify.nano ./cross-compile/openwrt-mips-toolchain.cmake
Fragment of this file below:
... # ΠΠΎΠΊΠ°Π»ΡΠ½ΡΠ΅ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΠ΅ set(openwrt_sdk_dir $ENV{HOME}/OpenWRT-sdk) # ΠΠΊΡΠΏΠΎΡΡΠΈΡΡΠ΅ΠΌΠ°Ρ ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½Π°Ρ, Π² ΡΠΊΡΠΈΠΏΡ `xcmake.sh` set(staging_dir ${openwrt_sdk_dir}/staging_dir) set(toolchain_dir ${staging_dir}/toolchain-mipsel_24kc_gcc-7.3.0_musl) ...
You have to check/modify OpenWRT SDK paths.
Next run
cmake
with parameters:cmake -DCMAKE_TOOLCHAIN_FILE=./cross-compile/openwrt-mips-toolchain.cmake [--config Debug] [-DREMOTE_INSTALL_IP=<remote-IP> -DREMOTE_INSTALL_USER=root]
Parameters
REMOTE_INSTALL_*
will make targets to help you copy binary files to the Omega viarsync
. You also need SSH access by key.To build (cross-compile) project you have to run script:
./xcmake.sh --build . [--clean-first]
Step 3 (optional). Remote-installation
If you set
REMOTE_INSTALL_*
parameters, after build you able usingremote-install
,remote-uninstall
targets for example below:cmake --build . --target remote-install
or
make remote-install
Step 4 (optional). Making IPK-package
After cross-compilation you will see files
openwrt-manifest-git.mk
,openwrt-manifest-local.mk
in the root project directory. There are two variants of manifest (renamed Makefile).-
openwrt-manifest-git.mk
- variant of manifest file of project to make package that sources will be download from Git repository. -
openwrt-manifest-local.mk
- variant of manifest file of project to make package localy. It's useful for debugging or internal using.
To make package, first you have to create feed directory outside this project, e.g.
$HOME/my-openwrt-packages
. Create sub-directory in it with you project name, e.g.$HOME/my-openwrt-packages/<my_app_name>
Then make symlink there for one of the Manifest file, e.g.:
ln -sf $HOME/projects/<my_app_name>/openwrt-manifest-local.mk $HOME/my-openwrt-packages/<my_app_name>/Makefile
Next change working dir to the root of OpenWRT SDK. Open file
feeds.conf.default
in any text editor and append your own feed there like below string.... src-link my_packages /home/<my_user_name>/projects/my-openwrt-packages
Then run once sequence of commands:
./scripts/feeds update my_packages ./scripts/feeds install <my_app_name>
Now you can build IPK-package:
-
Variant
openwrt-manifest-local.mk
:make package/<my_app_name>/prepare make package/<my_app_name>/compile
-
Variant
openwrt-manifest-git.mk
:make package/<my_app_name>/download make package/<my_app_name>/compile
Your IPK-files you can find in the directory
<OpenWRT_SDK_dir>/bin/packages/mipsel_24kc/my_packages
. It will named like<my_app_name>_1.0-1_mipsel_24kc.ipk
To install package from IPK-file in the Omega, run next command:
opkg install ./<my_app_name>_1.0-1_mipsel_24kc.ipk
-