site  contact  subhomenews

Tentative first step framebuffer with LittleVGL

August 19, 2018 — BarryK


As posted earlier today, I have started to evaluate LittlevGL:

http://bkhome.org/news/201808/first-go-at-evaluating-littlevgl.html

the "PC simulator" does look like a good starting point, though it is setup to create a binary named "demo" that is linked against SDL2. That's OK for learning, but I am aiming to talk directly to the Linux framebuffer.

For EasyOS, SDL2 packages are available here (libsdl2-*):

http://distro.ibiblio.org/easyos/amd64/packages/compat/oe/pyro/

Download the pc-simulator zip file:

https://littlevgl.com/download
Direct link to version 5.1.1:
https://littlevgl.com/download/pc_simulator_v5_1_1.zip

Expand the zip file, and this is what you see:

image

Open a terminal, and type "make". That's it, a binary named "demo" will be created. Run it "# ./demo", and you get a GUI:

image

There is another tutorial web page that explains how to create a simple "Hello World" app using the Linux framebuffere, so onto that...

Hello World with Linux framebuffer

There is an introduction and tutorial here:

https://littlevgl.com/blog/23/embedded-gui-using-linux-frame-buffer-device-with-littlevgl

I fiddled around for awhile. Like the "PC Simulator" tutorial page, there is a conceptual-gap in the instructions. Here:

2. Compile the code and go back to character terminal mode

...er, how to compile it? For a beginner, this is an awkward step. A Makefile is needed. These are the steps that I followed:

  1. Run "make clean"
  2. In the 'pc-simulator' folder, I moved 'lv-conf.h', 'lv_drv_conf.h', 'lv_ex_conf.h', 'main.c' and 'Makefile' elsewhere.
  3. I then created new 'lv_drv.h', 'lv_conf.h' and 'main.c' as per instructions in the above URL.
  4. I copied-back the 'Makefile' that I had previously moved away, and edited it. Snapshot of the files, 'hide1' is where I moved the original files to:

image

Here is my edited Makefile:

#
# Makefile
#
CC = gcc
CFLAGS = -Wall -Wshadow -Wundef -Wmaybe-uninitialized
CFLAGS += -O3 -g3 -I./
#LDFLAGS += -lSDL2 -lm
BIN = demo
VPATH =

LVGL_DIR = ${shell pwd}

MAINSRC = main.c

#LIBRARIES
include ./lvgl/lv_core/lv_core.mk
include ./lvgl/lv_hal/lv_hal.mk
include ./lvgl/lv_objx/lv_objx.mk
include ./lvgl/lv_misc/lv_fonts/lv_fonts.mk
include ./lvgl/lv_misc/lv_misc.mk
include ./lvgl/lv_themes/lv_themes.mk
include ./lvgl/lv_draw/lv_draw.mk

#DRIVERS
include ./lv_drivers/display/display.mk
include ./lv_drivers/indev/indev.mk

OBJEXT ?= .o

AOBJS = $(ASRCS:.S=$(OBJEXT))
COBJS = $(CSRCS:.c=$(OBJEXT))

MAINOBJ = $(MAINSRC:.c=$(OBJEXT))

SRCS = $(ASRCS) $(CSRCS) $(MAINSRC)
OBJS = $(AOBJS) $(COBJS)

## MAINOBJ -> OBJFILES

all: clean default

%.o: %.c
@$(CC) $(CFLAGS) -c $< -o $@
@echo "CC $<"

default: $(AOBJS) $(COBJS) $(MAINOBJ)
$(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS)

clean:
rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ)

I do realise that more modules than are needed, are being included in the build, but that's OK, as I plan to play with adding more widgets. Notice that SDL2 is not being linked.

Run "make", it creates 'demo'. This will not run on the Xorg desktop, though I vaguely recall a method of doing it in a terminal. Anyway, the way to test 'demo' is to exit from X, via the Shutdown menu in EasyOS (and most pups). Then, on the commandline, as long as a framebuffer has command of the screen, which is likely (there are some caveats), just execute 'demo', where-ever it is.

On the commandline, here is what it looks like:

image

That's as far as I've got. Next, need to investigate mouse support...

Tags: linux, easy

EasyShare supports Android phone via USB

August 13, 2018 — BarryK

I posted recently about Android utilities being included in future EasyOS and Quirky releases:

http://bkhome.org/news/201808/android-tools-and-adbfs-rootless-in-oe.html

EasyShare is now using these utilities and supports file sharing via an Android phone connected by USB cable.

The main GUI now has a checkbox "Android USB", and it is very simple to use. Here is a snapshot:

image

The only slight difficulty, very slight, is that Developer mode and USB debugging have to be turned-on on the phone. The phone is automatically discovered, and it is just a matter of clicking the "Mount" button. 

I have updated the EasyShare tutorial page:

http://bkhome.org/easyapps/easyshare-super-easy-network-file-and-printer-sharing.html   

Tags: easy, quirky

adb connection to phone over wifi

August 09, 2018 — BarryK

I posted yesterday about using 'adb' and 'adbfs' over usb to browse files on my Android phone:

http://bkhome.org/news/201808/android-tools-and-adbfs-rootless-in-oe.html

Briefly mentioned that it could be done over wifi as well. Yes, this site has a nice explanation:

https://futurestud.io/tutorials/how-to-debug-your-android-app-over-wifi-without-root

It does require a one-time usb connection to enable the phone to listen on port 5555. With usb-debugging enabled on the phone and usb cable connected to PC, on the PC:

# adb devices
...this will confirm the connection
# adb shell "ip route"
192.168.1.0/24 dev wlan0  proto kernel  scope link  src 192.168.1.8
...192.168.1.8 is the ip-address of the phone.
# adb tcpip 5555
...starts the phone listening on port 5555

Then unplug the usb cable, and on the PC:

# adb connect 192.168.1.8:5555
# adb shell "ls /sdcard"
...will list folders and files on phone
# adbfs /mnt/phone
...can browse the files
# fusermount -u /mnt/phone

Yeah it works, but not very secure. Port 5555 stays open until the phone is rebooted. adbfs is a simple method, but reckon will restrict to only doing it via usb cable.

Tags: easy, quirky, linux

EasyShare now using fakeidentd

August 07, 2018 — BarryK

I posted about the rewrite of EasyShare a few days ago:

http://bkhome.org/news/201808/easyshare-file-and-printer-sharing-re-written.html

Which appeared in EasyOS 0.9.6 released a couple of days ago.

Then yesterday, examined using fakeidentd server for network discovery:

http://bkhome.org/news/201808/easyshare-probing-computers-to-obtain-hostnames.html

Puppy Forum member 'step', a longtime contributor on the forum, sent me a pm about another way to query fakeidentd, using 'telnet'. Like this:

# { printf \\n; sleep 1; } | telnet 192.168.1.4 113

Busybox has a telnet applet, though my current configuration of busybox does not have it.

Very nice, thanks very much for that info. As I have the 'ident-user-enum.pl' perl script working, staying with that for now. EasyShare is now modified to use fakeidentd, and I have tested, works great.

Running 'easyshare' from a terminal, noticed an error message, although the sshfs connection worked:

do_known_hosts: hostkeys_foreach failed: No such file or directory

It was a one-off message, I discovered because folder /root/.ssh did not exist. Fixed.

Tags: easy, quirky

Kernel 4.14.61 and SeaMonkey 2.49.4

August 07, 2018 — BarryK

I have compiled the Linux kernel, version 4.14.61, on EasyOS 0.9.6 Pyro64. The source, with patches and build scripts, is here:

http://distro.ibiblio.org/easyos/source/kernel/4.14.61/

There is a PET package, that will be used in the next builds of EasyOS and Quirky. There is a SFS file of the source:

http://distro.ibiblio.org/easyos/amd64/packages/sfs/pyro/

I also compiled the latest SeaMonkey, version 2.49.4. The PET is here (45MB):

http://distro.ibiblio.org/easyos/amd64/packages/pet/pet_packages-pyro/seamonkey-2.49.4-pyro64.pet

...this is for EasyOS 0.9.5 and later. Do not try and use it in any other distro, as it is linked against specific libraries, such as 'icu', that likely won't be present, or mis-configured.

Tags: easy, quirky

EasyShare probing computers to obtain hostnames

August 07, 2018 — BarryK

EasyShare has automatic discovery of shared folders and printers on the local network. To achieve this, it has to discover the hostnames of the computers, and in the case of Windows computers, the netbios-name.

EasyShare has two ways of doing this, by probing for SMB servers and then using the 'nbtscan' utility to retrieve the hostname or netbios-name, or by probing a modified dnsmasq server and using the 'nmap' utility to retrieve the hostname.

In the latter case, EasyOS (and Quirky) runs the dnsmasq server in a special configuration such that it will return the hostname upon receiving a query from nmap. A problem is that this is a corruption of how dnsmasq is normally used, so if someone wanted to use dnsmasq in the normal way, they can't.

What I want is a lightweight server that upon receiving a request, will return an arbitrary string. It would be nice if I could write such a server, but I don't know how. Instead, looking for something ready-made...

After googling, I discovered the 'identd' server. Busybox has a very cutdown version, name 'fakeidentd'. On one of the computers, run it, with any arbitrary string:

# fakeidentd HITHERE

fakeidentd listens on port 113, so we need some way to query this port, from another computer on the network. I could not see how to use 'nmap', however, found a perl script:

http://pentestmonkey.net/tools/user-enumeration/ident-user-enum

EasyOS and Quirky have a cut-down perl named "perl_tiny", and with the devx sfs, the full perl. I tried this script first with the devx loaded, so had the full perl, and it required just one more module, Net::Ident. This was easy to install:

# perl -MCPAN -e shell
> install Net::Ident
> quit

...which I made into a PET package. I then tested without the devx, and Net::Ident was missing some dependencies. Those missing deps are now included in perl_tiny.

Now, on another computer on my network, with Net::Ident and ident-user-enum installed, where 192.168.1.4 is the computer running fakeidentd:

# ident-user-enum.pl 192.168.1.4 113
ident-user-enum v1.0 ( http://pentestmonkey.net/tools/ident-user-enum )

192.168.1.4:113    HITHERE

...yay!

So, we have a simple mechanism to broadcast the hostname. My intention is to use this instead of dnsmasq. 'perl-net-ident' will be a PET package, in the noarch repo, and 'ident-user-enum.pl' will be builtin at /usr/sbin in woofQ.

Of course, this discovery mechanism will apply to computers running EasyOS and Quirky only. For other computers, they must be running the SMB server ('smbd' daemon in the case of Samba). EasyShare probes for both.

Tags: easy, quirky

EasyOS version 0.9.6 released

August 06, 2018 — BarryK

Version 0.9.5 has changes to Easy Containers, however that work work has been on hold, as I "jumped tracks" to work on EasyShare, super-easy network file and printer sharing. EasyShare has been re-written, bugs fixed, improvements, and is the main feature of EasyOS 0.9.6.

Between 0.9.5 and 0.9.6, various bugs have been fixed. Just today, at the 12th hour before releasing 0.9.6, fixed a bug in the Xorg Wizard.

One curious thing, Xorg is now defaulting to using the 'modesetting' driver for Intel video hardware. You need to run the Xorg Wizard to explicitly choose the Intel driver.

Some issues regarding 0.9.5 posted to the Puppy Forum, have not yet been resolved, as my attention has been on EasyShare. Will get onto them soon.

There is a new app in 0.9.6, Vovchik's Gxlat language translator, that I posted about recently (look in the Document category in the menu):

http://bkhome.org/news/201807/gxlat-language-translator.html

Download:

http://distro.ibiblio.org/easyos/amd64/releases/pyro/0.9.6/

The download is an image file to be written to a USB-stick. There are many utilities for doing that. If you need some instruction, read this:

http://bkhome.org/easy/how-to-write-easyos-to-a-flash-drive.html

If you wish to read-up on what EasyOS is all about, look here:

http://bkhome.org/easy/

Read about 0.9.5 here:

http://bkhome.org/news/201807/easyos-version-095-released.html

Discussion on EasyOS is happening at this thread of the Puppy Forum, for 0.9.5 start reading from here:

http://murga-linux.com/puppy/viewtopic.php?p=1001305#1001305

Have fun!

Tags: easy