Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: gavinmc42 on October 07, 2015, 11:37:19 PM

Title: TCL/TK
Post by: gavinmc42 on October 07, 2015, 11:37:19 PM
Anyone got TK working?

I want to do a GUI outside of Xwindows.
Installed tcl.tcz and tk.tcz
Seems to be a missing Xorg-7.7-lib.tcz

Tcl seems to work but I get errors when I add - package requires Tk
Title: Re: TCL/TK
Post by: gavinmc42 on October 08, 2015, 12:50:03 AM
Whoops it is in .....7.x/armv6/tcz
Still getting head around going from 6 to 7.

no libtk8.5.so ?
Title: Re: TCL/TK
Post by: gavinmc42 on October 08, 2015, 12:55:51 AM
Yep looks like libtk8.5.tcz is missing
Title: Re: TCL/TK
Post by: bmarkus on October 08, 2015, 01:46:19 AM
Yep looks like libtk8.5.tcz is missing

Yes, there are no such extension.
Title: Re: TCL/TK
Post by: bmarkus on October 08, 2015, 01:48:10 AM
Whoops it is in .....7.x/armv6/tcz
Still getting head around going from 6 to 7.

no libtk8.5.so ?

Install tk.tcz

If you are looking for a file, use the 'Provide' function of package manager to identify which tcz extension has it.
Title: Re: TCL/TK GUI
Post by: gavinmc42 on October 08, 2015, 07:21:31 PM
Hi Bela,

Have to manually copy tcz's, no internet access :(
tcl,tk loaded with most of their dependencies.
Lots of files, so not a simple install.

What I am looking for is some way make GUI's outside of X11.
Starting to realise tk is X11 based I think.

This is for simple instrument UI's on the LCDs everyone is looking at now.
There is even a nice little 2.4" LCD 320x240 with touch, low cost $45 AUD.

Looking at some way to accelerate the UI's.
OpenVG, dispmanx to framebuffer?

Think I will go back and explore this option in more detail.
http://forum.tinycorelinux.net/index.php?topic=18821.0
or this
https://williamaadams.wordpress.com/tag/raspberry-pi-2/

By off loading the UI to the GPUs I can still use the ARM for control and sensor data collecting.
Going to install rpi-videocore.tcz and have a play.
Hmm old rpi-videocore.tcz, will it work on 4.1.8 kernel?

Gavin

 
Title: Re: TCL/TK
Post by: andyj on October 08, 2015, 07:38:27 PM
I'm currently using TCL/TK for a project using a 2.8" screen. Yes TK uses X. I don't know how you would do it otherwise. You want a framebuffer console display? I suppose it's technically possible, but why? What's wrong with X? Also, I had to compile TCL and TK 8.6 for myself. These versions are required for freewrap, and for PNG support. The display speed issues are probably related to the interface. HDMI is quite fast, GPIO seems OK, and USB is laggy but livable. I haven't tried the native display connecter yet.
Title: Re: TCL/TK
Post by: gavinmc42 on October 08, 2015, 09:34:59 PM
Hi Andyj,

Trying to reduce the OS footprint.

For the types of UI I am doing I don't need windowing on a small screen.
Just a couple of buttons and plot graphing output.

Direct to framebuffer would be one method.
But it would be nice to have something like SVG to framebuffer.
http://forum.tinycorelinux.net/index.php?topic=18192.0

Been looking at this, also has some direct to memory "(/dev/mem") GPIO toggling I might test for speed.
https://github.com/Wiladams/LJIT2RPi

Lua, like C can write to memory, to save CPU I would like the GPU's to handle that.
A SVG UI would be nice then easy to do local LCD display and/or webserver html.
Multiple screens /dev/fb0, /dev/fb1.....

This looks interesting
https://pythonhosted.org/fbpy/
Test it with Micropython?

Regards
Gavin

Title: Re: TCL/TK GUI
Post by: bmarkus on October 08, 2015, 10:40:16 PM
Hmm old rpi-videocore.tcz, will it work on 4.1.8 kernel?


No, but you can use the latest from RPi GITHUB repo:

https://github.com/raspberrypi/firmware
Title: Re: TCL/TK
Post by: gavinmc42 on October 08, 2015, 11:09:47 PM
Yep, I would if I could figure out how to wrap it up into a tcz:)
Title: Re: TCL/TK
Post by: jncl on October 09, 2015, 06:47:17 AM
Hi gavinmc42,

  Try the attached scripts, put them in ~/.local/bin and make them executable:
Code: [Select]
chmod +x ~/.local/bin/*.sh
  They require a defined directory structure:
Code: [Select]
mkdir -p ~/build/tmp
  The rpi-videocore.tcz will be created in ~/build/tmp.

HTH

  Jon
Title: Re: TCL/TK
Post by: andyj on October 10, 2015, 06:40:22 AM
My TK app runs full screen, no windows, using X, and I've made some tweaks to the TC boot sequence so I can go from power on to full screen GUI in under 10 seconds. And I am running raspicam to do video capture. I'm still not seeing where you are having a problem.
Title: Re: TCL/TK
Post by: gavinmc42 on October 11, 2015, 05:54:32 PM
Hi Andyj,

Might end up using X but for a single page UI it seems like overkill.
X11 requires lots of extras that take up memory.
Trying to minimize the libraries etc.
By reducing code and resources hopefully reliability goes up.

The UI is mainly for the smaller TFT LCD, 2.4-3.5", don't have space to waste on windows borders etc.

Been reading up, there seems to be a trend towards HTML based UIs, Webkit etc.
This sort of makes sense as most IoT devices have webservers built in.
Use the same tools to make standalone UI.
HTML for structure, CSSS for skins, JS for functions.
Accelerated UI's using the GPUs looks like the future.

There is also a good case to have Text based UI using curses as this can used in a serial terminal interface.
Make device with built in USB uart on the RPi serial port, plug Tablet into device, serial CLI debug/configure.
Could even have just a 3 wire connector and external USB uart dongle.
Title: Re: TCL/TK
Post by: andyj on October 12, 2015, 03:08:27 PM
I don't have any windows or borders on my 2.8" screen. TK runs fullscreen. There is a USB 2.8" display from Robopeak as well and I've used it but it's a little laggy. You say you want stability, speed, a smaller memory footprint, and then want to lean towards a browser and JS and no windows or X. I'm still confused.
Title: Re: TCL/TK
Post by: gavinmc42 on October 12, 2015, 06:26:44 PM
Haha,

Want I want is not usually want I need:)
Here I am thinking about tcl/tk which is quite old tech and then the latest "just around the corner" accelerated html UI's.

I figure if I learn tcl/tk it will work on any linux box, so it won't hurt to learn the old way.
But as I have already learnt to make webpage UI's with HTML5, CSS3, SVG, JS, it would be useful to use that method for local UI's.

In keeping with the spirit of Tinycore I don't want a code bloated OS.
Most of my stuff is one off prototypes that must work for years.
Old shell script methods running on 700MHz+ cpus are not that slow, add dialog, micropython, lua and now tcl/tk and you can do useful stuff.
tk on top of x11 is code bloat and not that easy, because I use the standard SSH piCore installing tcz from behind the Uni firewire is not easy.
So any tcz must be installed manually until I make a local tcz mirror.
Title: Re: TCL/TK
Post by: curaga on October 13, 2015, 01:31:57 AM
The entire 6.x armv6 repo is just 1.2gb. Perhaps someone close to you can burn you a dvd?
Title: Re: TCL/TK
Post by: gavinmc42 on October 13, 2015, 01:51:09 AM
We now have our own local network for testing.
Also got a Nas, so a local mirror will be added to the todo list

Just need to add learn mirroring to the list as well:)
Title: Re: TCL/TK
Post by: andyj on October 13, 2015, 02:30:18 PM
On my dev RPi 2 I have 140+ extensions loaded including X, sound, ffmpeg, raspicam, compile-essentials and lots of dev-libs, Tcl/Tk, NFC, and my Wish app, and I have over 560 MB free. That's about as bloated as you can get and and I'm not even half full yet. Yes, Tcl/Tk has been around a while and people call me old for using it instead of the latest and greatest. But I've been using it for 17 years, and it was solid when I began. I can only think the developers have been working out whatever obscure bugs have been found since then (that I never saw). Apps ran as long as the computer had power. I don't ever remember a crash. I have the latest and greatest browsers running JS. Slackware is pretty solid, but I've never had an app or system crash that didn't involve a browser. You're right that it's the future, but the future isn't here yet. You have to ask yourself: Do you want to play with it or work with it?
Title: Re: TCL/TK
Post by: gavinmc42 on October 13, 2015, 06:27:07 PM
How is the Pi 2 going as a dev platform?

Been thinking about using a Pi 2 as one.
And yep will probably end up with as many extensions as you.
I have found the Pi 2 with Raspbian or Ubuntu Mate as a little slow.
Want to eventually use the Pi2 for compiling C code, making tcz etc, but still got lots to learn yet.

On my IoT Pi's I normally only have mc, openssh, i2c-tools, busybox-httpd.
Recently added lua and luajit as they don't take up much room.
Micropython is pre installed in version 7.

Mostly use old 128MB sd cards and still have ~80MB free.
Easy then to make an image to stick on 4, 8,16GB SD's
Can you get class 10 2GB SD's?
Don't need much memory if I keep things small, for IoT boot time is important.
For instruments with GUIs can get away with a bit longer times.
Title: Re: TCL/TK
Post by: andyj on October 13, 2015, 08:04:37 PM
The RPi 2 with make -j4 will compile a kernel and modules in under two hours. Builds like libraries and packages are just a few minutes, so the difference between doing a native compile on the RPi and a cross compile and transferring the files is usually a wash. It's fast enough for what I need for development. I don't know about SD card class versus actual speed. I haven't tested it. I'm curious about that myself, but not curious enough to buy a bunch of different cards and do the testing. Boot time is important to me too. I had do to a few unsanctioned tweaks involving custom kernels and overlayfs to get the time down, but I cut 20+ seconds off the boot time. All the cards I have are 8GB give or take, as that's about the sweet spot for Micro SD cards these days (a few dollars US each).
Title: Re: TCL/TK
Post by: gavinmc42 on October 13, 2015, 08:58:08 PM
I tested rdp, windows remote desktop on a Raspbian Pi a few months back, it just worked.
No need to install anything on Windoze.

Thinking about setting up a few Pi's for compiling.
Not sure if tcz has rdp, does have rdesktop.tcz but that looks like client.

Do you compile Pi 1 ARM6 code on Pi 2?
Title: Re: TCL/TK
Post by: bmarkus on October 13, 2015, 11:05:49 PM
Few random notes on the discussion.

Next piCore7 alpha is built on the new BusyBox 1.24.0 with i2c tools which means it is part of base. Probably i2c-tools.tcz can be omitted depending on BusyBox version feature set and compatibility.

piCore itself and all tcz's except kernel built native on RPi2 for armv6 target. make -j4 works in most cases, but be careful, not all applications honor parallel build.

In my RPi2 dev system 502 extensions mounted, it takes 67 seconds (piCore7 logs time):

Code: [Select]
Deplist creation for 170 extensions ready: 0s
Mounting 502 extensions ready: 34s
ldconfig return value: 0
depmod return value: 0
Symlinking ready: 57s
Script finished: 67s

Further reduction of startup time is in progress.
Title: Re: TCL/TK
Post by: gavinmc42 on October 14, 2015, 12:12:30 AM
Thanks Bela,

Been waiting for busybox to add i2c-tools.
Hmm quite a lot of changes in busybox 1.24
One less tcz to worry about.
Will test it when next version 7 done.

Regards
Gavin
Title: Re: TCL/TK GUI
Post by: bmarkus on October 15, 2015, 02:20:38 AM
What I am looking for is some way make GUI's outside of X11.
Starting to realise tk is X11 based I think.

Xorg is not only responsible for displaying but for input devices too. For example one recent experience is that using the official RPi 7" display without Xorg touch screen works uncalibrated, why with X it is just OK and sends back correct coordinates. Windowing is not an Xorg job but the WM (Window Manager). My advice to use Xorg always and do not waste time for handling displays low level.

Regarding GUI, you can choose Tcl/Tk, GTK, Qt, wxWIDGETS depending on goals. While to have a small size application is good, on the other hand SD cards are cheap. If you have a small size <1GB old card, it is most probably slow and maybe unrealible except some industrial grade.

Title: Re: TCL/TK
Post by: gavinmc42 on October 15, 2015, 06:03:57 PM
Thanks Bela,

My boss also told me off for wasting time on low level graphics :'(
X11 it will be, until something better comes along :P

Good point about the touch screen calibration.

Probably a good idea to try tcl/tk first as it has been around for a long time.
Tcl/tk only add 2+MB + X11?
Now need to figure out how to add x11 to the SSH release.
Really, really need to make a local mirror now.

Actually finding newer SD cards are less reliable, maybe got some dodgy chinese ones in the mix?
Following the ESA Pi's to see how they handle the extra radiation in space.
Wonder who's SD cards they will use.

Finding my old 128MB ones are rock solid, probably because of bigger die size.
Only got two and they will wear out eventually.

Not sure yet which is the best microSD cards, 8GB seem to be the optimum.
Still need to test whether class 4, 6 or 10 makes much difference, need to do some boot timing.
Don't trust 16GB+ cards yet, expensive  so they are good targets for counterfeiting.
OS goes on the SD card, data goes to external USB, so most of the writing to memory will be to the USB stick which is easy to swap/replace.

Actually have thought about making a PCB with something like SPI FRAM for booting.
Pretty sure the GPU boots from the SD card in SPI mode.

Regards
Gavin
Title: Re: TCL/TK
Post by: bmarkus on October 15, 2015, 10:30:30 PM

Now need to figure out how to add x11 to the SSH release.


Install TC.tcz and its dependencies recursively.