edit:b192 Stock Rom When I build the image i saved it named omega2p without thinking later... It's a custom image, i am writing aHere is the tutorial of how to build an image that supports to fbtft kernel modules.
ILI9341 2.8" TFTLCD SPI
ILI9341 FBTFT Staging drivers and modules
400 piece of 320x240 16bit bmp files that located in a usb flashdisk, it takes 4 - 6 seconds to display on the screen,
it means 80fps - 100fps
UPDATE 16th Aug
Compiled C binary which includes "C include file style bmp" files, shows [ 387 fps ] minimal rate. memcpy() used. (Omega2+)
Compiled C binary, memcpy() fill_screen one color 1000 times -> [ 432 fps ]
Compiled C binary, memcpy() fill_screen 21 color 1000 times -> [ 439 fps ]
mkdir ~/.ssh
nano ~/.ssh/config
# add below lines in to config file
Host github.com
User unique1984 "this one is your github username"
IdentityFile ~/.ssh/id_rsa "this one is your created id_rsa file"
# save and close the file Ctrl+o, Ctrl+x
# change permissions to ./ssh and nested files
chmod 744 ~/.ssh
chmod 600 ~/.ssh/*
id_rsa is your enc/dec key, don't lose it nor give someone else, id_rsa.pub goes to github's side.
add github hostkey in to knownhosts typing,
ssh-keyscan -H "github.com" >> ~/.ssh/known_hosts
this way we won't see append key prompt from github
configuring git global
git config --global user.name "Yasin KARABULAK"
git config --global user.email "yasinkarabulak@gmail.com"
that's it.
Getting the build system source from omega
[ ] Clone the source
cd ~/
git clone https://github.com/OnionIoT/source.git
# or if you have a github account that setted up with your ssh key.
git clone git@github.com:OnionIoT/source.git
! At least 1 time reading before any question, would be nice (I'm just a human being I might miss some points.) !Open Wrt Lede Build System Usage Docs
Fully specified documentation of lede build system.
With these two documents we can start build process
[ ] Make host system config
Cross Compile binaries's location in to the $PATH variable.
nano ~/.bashrc
# append below line in to .bashrc file
export PATH=$PATH":~/source/staging_dir/host/bin:~/source/staging_dir/toolchain-mipsel_24kc_gcc-5.4.0_musl-1.1.16/bin"
# save and close the file ctrl+o,ctrl+x
this way system will know where are the cross compilation binaries.
Image Build Process
cd ~/source
git log
commit d62d8430d155f737013a9f4aa9c2a98e6440e903
Author: greenbreakfast <lazardemin@gmail.com>
Date: Tue Jul 17 23:41:25 2018 +0000
added telnet and telnetd to busybox config
commit 0066202f3a8ef8dc8b0da6842d9b72692a814646
Author: greenbreakfast <lazardemin@gmail.com>
Date: Wed Jul 11 21:38:47 2018 +0000
added adc-exp package and python module to package repo, as well as kernel modules for spi gpio bitbang
commit 72d103106dd7a22edbdfdba0d0c98d3ac33afcf6
Author: greenbreakfast <lazardemin@gmail.com>
Date: Thu Jul 5 21:42:13 2018 +0000
updated onion script, new versions of OnionOS and camera apps
...
# each commit is our build number last commit is "b192" before that "b191" after compilation our build named to "b193".
Image Configuration
We are using the Onion's build system so we don't need to change menuconfig's "Target System", "Subtarget", "Target Profile", "Target Devices" and "Target Images" options, if anyone who wants to chroot type image then activate this selection in the "Target Images" menu.
[ ] Update & Install feeds
2. ./scripts/feeds update -a
* Update feeds
3. ./scripts/feeds install -a
* install feeds
[ ] Menu configuration
4. make menuconfig
* save and exit for now, details are here
5. make defconfig
* It means this
[ ] Kernel menu configuration
6. make kernel_menuconfig
* this command will compile some of the cross compile tools and shows the kernel_menuconfig window.
* details are here
* we will select fbtft driver modules in here.
* You can take a coffe or two in this step. (Depends of Cpu power) We will select some Graphic Drivers, some Character Devices, some Staging Drivers from under the "Device Drivers" section
attention: below list is not a menu ordered, it is a process ordered list
Device Drivers --->
Graphics support --->
Frame buffer Devices --->
<M> Support for frame buffer devices --->
[*] Enable firmware EDID
[*] Framebuffer foreign endianness support --->
[*] Enable Video Mode Handling Helpers
[*] Enable Tile Blitting Support
[*] Backlight & LCD device support --->
[*] Bootup logo --->
[*] Staging drivers --->
[*] Staging Board Support
<M> Support for small TFT LCD display modules --->
# select your display driver or all of them your cohice
<M> FB driver for the ILI9341 LCD Controller
<M> Generic FB driver for TFT LCD displays
<M> Module to for adding FBTFT devices
Character devices --->
[*] Virtual terminal
[*] Enable character translations in console (NEW)
[*] Support for console on virtual terminal (NEW)
[*] Support for binding and unbinding console drivers
[*] Support multiple instances of devpts
Graphics support --->
Console display driver support --->
[*] Enable Scrollback Buffer in System RAM (NEW)
<M> Framebuffer Console support
[*] Map the console to the primary display device
[*] Framebuffer Console Rotation
Library routines --->
[*] Select compiled-in fonts
[*] VGA 8x8 font
[*] VGA 8x16 font
# Save and Exit kernel_menuconfig window
9. make download
* This command get all the files those will compile
! Before the compile process
check this file's 29th line package/feeds/telephony/re/Makefile
...
DEPENDS:=+libopenssl +libpthread +zlib
...
if +zlib is not in there, put it in there. libre, librem, baresip packages allways gives an error for this.
Leave your computer connected to the internet, i think make download is not enough.
LANG=C LC_ALL=C enter.
[ ] Before the compilation process check the config files for reset !It happened to me while writing this tutorial, built was succeeded but created image was 5.3MB it should be 7.1MB, when I checked the menuconfig there was nothing in there, there are 2 things that i can think
1st one is, It is normal, first run just compile the toolchain with base system without packages then after this we should make menuconfig and kernel_menuconfig.
2nd one is, This is abnormal do 'make clean' take Revert to the base step and do it again above steps.
I could not try the 2nd possibilty because of the time (23:13) and already compiled toolchain (it took 2 hours on my computer) simply I did menu_config and kernel_menuconfig without make clean (this clean all the packages those built) and diff (7th step).
[ ] Compile the images and all selected packages ignoring errors.
10. IGNORE_ERRORS=1 make -j2
* node-usb and i2c-exp-node packages will give an error (look at the after compilation part)
* This command starts build process
* make package/utils/busybox/{clean,compile,install} -j1 V=s this will clean then compile then install the package busybox with debugging mode (-j1 V=s)
* IGNORE_ERRORS=1 make -j2 this is a life saver if you want to troubleshooting after compilation you can use this, if some packets give an error then you can compile and debug them using above command.
* Details are here
[ ] After Compilation
we should use node lts/argon for the node-usb and i2c-exp-node packages.
nvm use lts/argon
npm install -g node-gyp
# after restart the machine node default will be node version
make package/feeds/onion/node-usb/{clean,compile,install} -j1 V=s
make package/feeds/onion/i2c-exp-node/{clean,compile,install} -j1 V=s
# after these steps refreshing the compile
make -j2
# that is it.
[ ] For cleanup and revert the config (do not use if it's not must, time issues)
make clean deletes all of the compiled packages without touching toolchain, if you use it mistakenly it will possibly give a headache. Details are here
after make clean you can go to step Revert to the base and start all over with having toolchain.
[ ] Locating image (bin) files
They have created under ~/source/bin/targets/ramips/mt7688/ directory.
[ ] Copy image file in to a flashdisk and flash the Omega2, tutorial is here
[ ] Locating the needed fbtft module (.ko) files
# under the ~/source/ directory
find . -name "*.ko" | grep "fb" -type f
this command gives us most of the modules we need. Other ones trial and error, insmod and if it is give an error grep -irn "error_function_name" ./ this way we will learn which module is absent and find it and append the list.
Further to do list for myself, i have.
[ X ] Find a way to creating image includes these modules. | Edit 29.07.2018 without fbtft_device.ko, the way found. (+200KB in to the original image)
[ X ] Find a way to implement fbtft_device (31.07.2018)
[ X] Find a way to append spi touch modules.(29.08.2018)
With Atmega328p, rc522 and spi touch modules integrated. I wrote my communication protocol(simple and stupid, 1Mhz) because of serial interface's slow transmit rate. This way i am manipulating Atmega for my own needs, using omega2's power.
[ X ] Write a simple framebuffer parser that can create and manipulate a desktop area on the display.(29.08.2018)
[ ] Find a way to make use of kdb and UTF-8 console fonts for the desktop and it's applications.
[ ] Take over the Mars before Elon do.
If these are happens, many projects that look cool and with minimal cost can be implemented with Omega2, I think.
Thank you for your hard work, @Maximilian-Gerhardt . I am willing to help or test this, actually i cloned directfb, and lvgl_project, but i couldn't create time for the full scale display manager because of my project.
I've nearly finished a prototype device for education purpose using fbtft on omega, plus atmel328 that drives touch screen and rc522 rfid R/W, display on/off, some digital controls ...
After this project i will take my time, firstly chrooted debian i am thinking of, this way i can find a way out or might be see a workaround. After than that, not for just prototype, from top to toe openwrt lede specialist, I am aiming for. I am lack of knowledge for the full scale solution but all of us together is another thing. If this thing works Omega2 will be a fullscale computer
In a month or so i will be dive deeper i think.
here is my custom image file, and it works(just flashed) 1st possibilty is higher, but i sure of it i was using the b192 (#!) i'll inspect this further but right now time is 22:00 here and i dont want to miss bloody moon.
@Maximilian-Gerhardt I will prepare how to for the kernel_menuconfig, right now i share fbtft and virtual console modules and init/deinit scripts
I forgat that you are using ili9325, just compiled it, here is the module fb_ili9325.ko
ps. after fbtft_device init virtual console does'nt work properly.
ps2. when trying send the image files simply 1st run take the images allocation in to the buffer, and file access will be faster. this is my test script
#!/usr/bin/env sh
fps=$((1000000/20))
if [ ! -z $1 ]; then
fps=$((1000000/$1))
echo $fps
fi
#img_count=1;
#timer=0;
start_second=$(date +"%S")
while true
do
#for i in `ls -v /root/flashdisk/sequence/*.bmp`
#for i in `ls -v /root/msd/sequence/*.bmp`
i=1
while [ $i -lt 5000 ]
do
#echo $i
#cat $i > /dev/fb0
# cat /root/flashdisk/sequence/file$i.bmp > /dev/fb0
cat /tmp/mounts/USB-A1/sequence/file$i.bmp > /dev/fb0
echo /tmp/mounts/USB-A1/sequence/file$i.bmp
#sleep 0.001
#img_count=$(($img_count + 1))
#usleep $fps
#timer=$(($timer+$fps+1))
#echo $timer
#if [ $timer -gt 1000000 ]; then
# echo $img_count
# timer=0
# exit
#fi
i=$(($i+1))
if [ $i -gt 400 ]; then
echo $start_second" -"$(date +"%S") >> refresh.log
# exit
i=1
start_second=$(date +"%S")
fi
done
done
@Maximilian-Gerhardt actually i did nothing, parts are allways on the desk. After red your kernel driver compile topic i catch a glimps that i did not copy the ".ko" files in to omega :D, i know this is laughable but i could'nt find the solution until read this topic of yours.
simply put
make kernel_menuconfig
Append neccecary parts and compile,
after the compilation process
copy these files in to omega's /root/modules/ folder.
this part as simple as breathe but actual problem is how to fbtft_device.ko configuration.
This is the best part, after inspecting fbtft's all the source code i decide to bruteforce
load one of the kernel module, give the error, find the neccecity file, insmod that and again and again. that's it after no error insmod fbtft_device custom init save my day.
I learnt that we have 96Mhz clock, i did'nt know this.(If i'm not wrong 40Mhz is in the datasheet of mt7688)
I am learning how to write framebuffer application, i think i can write a simple framework that work like css or something similar.
The questions:
can we build X11 and configure it to work with /dev/fb0?
after simple search i found fbgui, and littlevgl, i did not push all the way to x11 but i am researching for a while. It's possible I gues.
can we get a graphical desktop running? Enlightenment?
Yes! I will write that i hope but not a rival of KDE
can we cross-compile libs like libsdl2 or mesa3D to the Omega2?
I did not look that but when i researching fbtft i came across something mesa with openwrt
can we get more powerhungry emulators running?
I do'nt think so, i tried ffmpeg 320x240 video to bmp sequence 25fps but 12fps is the limit of omega2p's, on the other hand we probably use omega2p cluster 10 of them
can we finally prove LadyAda from Adafruit wrong who said that the Omega2 can't run Doom?
I do'nt know, really. I believe that omega2 is strong enough to do more, playing doom1 exactly can, i play that 25Mhz Cpu computer in 1990's but doom 3 and after releases (if there are) ? mmm i do'nt think so for now, floating point units a must for the job.
root@Omega-C617:~# youtube-dl -f140 https://www.youtube.com/watch?v=gGdhzmfIYtI
[youtube] gGdhzmfIYtI: Downloading webpage
[youtube] gGdhzmfIYtI: Downloading video info webpage
[youtube] gGdhzmfIYtI: Extracting video information
WARNING: unable to extract uploader nickname
[download] Destination: Onion Omega2 Kickstarter Video-gGdhzmfIYtI.m4a
[download] 100% of 2.46MiB in 00:41
WARNING: gGdhzmfIYtI: writing DASH m4a. Only some players support this container. Install ffmpeg or avconv to fix this automatically.
root@Omega-C617:~# ls Onion*
Onion Omega2 Kickstarter Video-gGdhzmfIYtI.m4a
It's really slow but fun thing to do have a nice day
in the fat file system Omega2p seems %10 faster for audio encoding
...
Stream mapping:
Stream #0:0 -> #0:0 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
size= 691kB time=00:00:44.14 bitrate= 128.1kbits/s speed=0.169x
FFMPEG video to bmp sequence on omega2
In your 'ffmpeg installed computer' convert some video to your display size. (If you try this part in the omega it will possibly kill you, "time issue - life time" ) ffmpeg -i some-video-file.mp4 -vf scale=320:240 scaled.avi
copy scaled.avi file to ffmpeg installed omega2 using flashdisk, scp etc.
then we are ready!
connect the console of omega2 and type the command (edit the directory for your side) ffmpeg -i scaled.avi -pix_fmt rgb565 -r 1/1 seqtest/file%001d.bmp
in this code 1/1 means 1 frame per second, 25/1 25 frame per second, and so on. Omega2p can handle 12fps
root@Omega-C6xx:~# cd
root@Omega-C6xx:~# mkdir .ssh
root@Omega-C6xx:~# dropbearkey -t rsa -s 2048 -f .ssh/id_rsa
Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDCnBHLo648uVcmRAs1myDJVlZNo27TaaycRDjg9S1/r28qIkQu8rbTCgzn+BQTIrAMQsBARiVD02NaJTLP2EurGYo2ryYbYCTZYGNA7QsI6BdqIn7o8wiz7p02DZUE6CSo69HNxPwpcK6QjvV5/Ojrh5ka7C8yow4m8VqtKjGEiqcin0yWwKvSSHqLHyxK+zMLMw0vYgtvhU2EOsrHTF2y0grYRM0eTytXCZ8co+UtRgsoAtGM/5IxSiCZ1Q05zIJMlcUgLOLMq3IKUL64mDkh6XUlSchkv4IxUqx28nikayNg5+1jksVMLKe43kpdep4KiqDO8Gmbxax0C7L1fjpF root@Omega-C6xx
Fingerprint: md5 92:03:c5:4c:be:c1:9e:63:c7:2d:3f:12:28:68:d4:62
Showing and saving Omega2's public key to another file as "id_rsa.pub"
When we create the ssh private key (id_rsa) on the console you see the public portion... this goes to authorized_keys file that we use on the Raspberry Pi's "~/.ssh/authorized_keys" file.
2. RaspberryPi side (ssh-keygen)
I don't have Pi, I am using Debian and the ssh's binary is openssh-server these configuration should work!
yasin@uxn:~$ cd
yasin@uxn:~$ ssh-keygen -t rsa -b2048 -N "" -f ~/.ssh/omega2_passwordless_rsa
Generating public/private rsa key pair.
Your identification has been saved in /home/yasin/.ssh/omega2_passwordless_rsa.
Your public key has been saved in /home/yasin/.ssh/omega2_passwordless_rsa.pub.
The key fingerprint is:
SHA256:KZap5TCuT57Al443fZUk55AzNWXsNy9s6t8AVIbitFI yasin@uxn
The key's randomart image is:
+---[RSA 2048]----+
| oo.o |
| E.oo |
| * =. |
| oB.=.. o |
| o * SX ..o o |
| . . O . + .+ .|
| o *.. . o.. |
| Oo.. . . o |
| oo=. . .... .|
+----[SHA256]-----+
We have 2 file under .ssh/ folder that can use for ssh connection without typing password. Do not give the private key someone
root@Omega-C6xx:~# ssh -i /root/.ssh/id_rsa yasin@192.168.1.33
Linux uxn 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1 (2018-04-29) x86_64
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
You have new mail.
Last login: Sat May 5 17:05:55 2018 from 192.168.1.36
yasin@uxn:~$
A psu unit that i tested, i am recommending these 3 parts for stable 3.3v
0.1µF
LM3940
33µF
LM317 -> Too complicated,
LM1117, LD1117 -> when a usb hub connected reboots omega2 ?
LM3940 I love it, 3 parts and it works for me.
After connecting lots of thing it can read mifare rfid tags and play sounds (mp3) and communicate with an external arduino using uart1 that built on omega2 etc.