Announce: Espresso machine powered by Tcl/Tk

6311 views
Skip to first unread message

Decent Espresso

unread,
Jul 29, 2019, 9:58:38 AM7/29/19
to
I gave a presentation a few weeks back at EuroTcl, about our espresso machine that is Tcl powered.

An Android tablet is provided, with the control app pre-loaded. But because the app runs on Androwish, it also runs on Mac, Windows and Linux. You can download the app (it's open source, obviously) at http://decentespresso.com/downloads

In my talk (video link below) I mention:
- How Tcl "origin story" to script scientific instrumentation makes it extremely well suited to control apps for home appliances.
- Tk is very much optimized for windowing guis and mice. I had to write a framework for touch-friendly controls (and their "bleed zones"). I'd be happy to spin this out as a library if there's interest.
- Skinning, scripting and "source code included" are very much novel concepts with a tablet app, but Tcl makes it easy.
- the dichotomy between iOT and embedded approaches to software controlled devices, and how Tcl can be a middle path, avoiding most of the problems of either approach, and keeping the strengths of both.

Here's my annotated talk:
https://www.youtube.com/watch?v=Ey30Cg1fM0Q

At EuroTcl I was encouraged to post here about this project, as it might be of general interest to Tclers, so apologies if this seems like a commercial post. .

More info at https://decentespresso.com or email me at decente...@gmail.com

- John Buckman

Harald Oehlmann

unread,
Jul 29, 2019, 10:51:22 AM7/29/19
to
John,

good to read from you! Great work !

Here is a start of our common ticket regarding the exit command within
Androwish:

http://www.androwish.org/home/tktview?name=25d77d29ae

I hope, we will find the reason.

Thank you,
Harald

Gerald Lester

unread,
Jul 29, 2019, 6:11:18 PM7/29/19
to
John,

I think a touch-friendly library would be a great addition to TkLib!

--
+----------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC |
| Email: Gerald...@kng-consulting.net |
+----------------------------------------------------------------------+

two...@gmail.com

unread,
Jul 31, 2019, 1:05:56 PM7/31/19
to
On Monday, July 29, 2019 at 6:58:38 AM UTC-7, Decent Espresso wrote:

> In my talk (video link below) I mention...
>

I enjoyed your talk, thanks.

I wonder if you could say a few words about how you handled the install
of androwish. You mentioned the downloading of androwish, copying the
files, and running the make icon program.

You appear to have made that simple and mentioned "as long as I spelled
it out" non-technical people had no difficulty.

Do you use the "debug key" version or something else?

When I begin with a signed "debug key" version, I have to
run this on my own little version of .wishrc to get things started.

file copy -force .wishrc /data/data/tk.tcl.wish/files/

because otherwise that directory is protected against simply copying
files, and has to be copied from within a running androwish. Or at least
that's how it was when I first started using androwish.

I've always wanted a way to have an android icon on the desktop
and be able to launch any *.tcl file in the same way as I do
on windows, where I associate the extension .tcl with a tclkit.

You would appear to have solved this. I was wondering if you could
share where you spell that out for people.

Rich

unread,
Jul 31, 2019, 1:43:38 PM7/31/19
to
two...@gmail.com wrote:
> I've always wanted a way to have an android icon on the desktop
> and be able to launch any *.tcl file in the same way as I do
> on windows, where I associate the extension .tcl with a tclkit.

Re. the "any", that part may be unachievable, given how sand-boxed each
Android process is in modern Android variants.

However, with a little preparation, you can place icons that will run
particular scripts sitting on the filesystem (provided they are read
accessible by androwish). Look at the "borg shortcut add" subcommand
in the documentation of the "borg" command.

two...@gmail.com

unread,
Aug 1, 2019, 5:16:13 AM8/1/19
to
On Wednesday, July 31, 2019 at 10:43:38 AM UTC-7, Rich wrote:
> Look at the "borg shortcut add" subcommand
> in the documentation of the "borg" command.

Yes, that certainly is what the OP must have used when
he spoke of running the make icon program. However, I've
tried that command and just get a silent response. Command
accepted, but no icon appears. I was hoping the OP's receipe
would show some detail I missed.

Rich

unread,
Aug 1, 2019, 7:16:48 AM8/1/19
to
Did you follow the instructions in the docs that stress that the
"script-to-run" *must* use an absolute file: style URL?

This works perfectly for me:

borg shortcut add "test icon" file://storage/emulated/0/Download/test.tcl

And I get a new icon named "test icon" that would launch "test.tcl"
that is sitting in /storage/emulated/0/Download/.

The thing is, you have to work out, for the particular device you are
on, what exactly is the absolute path to the file you want to have
launched from the icon.

two...@gmail.com

unread,
Aug 1, 2019, 12:28:20 PM8/1/19
to
On Thursday, August 1, 2019 at 4:16:48 AM UTC-7, Rich wrote:

> Did you follow the instructions in the docs that stress that the
> "script-to-run" *must* use an absolute file: style URL?
>
> This works perfectly for me:
>
> borg shortcut add "test icon" file://storage/emulated/0/Download/test.tcl
>

Thanks, you must be looking at a different set of instructions, when
I search "androwish borg make shortcut" in bing, I get,

https://blog.tcl.tk/39249

and find this,

The script, specified as script-to-run must use an absolute path must be readable by the user id under which the AndroWish package has been registered by the Android installer.

And so it never occurred to me that it had to be a URL, and so
I entered an absolute path as,

/storage/emulated/0/home/test.tcl

I will try it as you show, and if I still have a problem I will
start another thread.

Thanks.

Rich

unread,
Aug 1, 2019, 1:17:41 PM8/1/19
to
I always just go to the androwish site
https://www.androwish.org/home/home and look at the docs there. And
the docs for 'shortcut' on the master site are different than what is
presently in the Wiki. You might want to edit the wiki page to change
the 'shortcut' paragraph to match the official docs.

undro...@gmail.com

unread,
Aug 1, 2019, 1:41:09 PM8/1/19
to
Am Donnerstag, 1. August 2019 19:17:41 UTC+2 schrieb Rich:

> ...
> I always just go to the androwish site
> https://www.androwish.org/home/home and look at the docs there. And
> the docs for 'shortcut' on the master site are different than what is
> presently in the Wiki. You might want to edit the wiki page to change
> the 'shortcut' paragraph to match the official docs.

yes, please correct the wiki entry. I'm trying to have the
www.androwish.org site in an acceptable shape regarding docs.
But am unable to fully support the Tcl'ers wiki, too. And the
docs on www.androwish.org are short and sometimes have a strange
wording (due to not being a native English speaker). Thus I'm
always open for improvement requests posted to www.androwish.org's
ticket system.

Happy Tcl'ing
Christian

two...@gmail.com

unread,
Aug 1, 2019, 2:34:58 PM8/1/19
to
On Thursday, August 1, 2019 at 10:41:09 AM UTC-7, undro...@gmail.com wrote:

> yes, please correct the wiki entry.

I'll give it a try as soon as the maintenance mode is off.

However, I suspect it might be better if that entire wiki
page was replaced with a link to the official documentation.
Wouldn't that make more sense and less work?

Not sure I want to be the one to do that though :)


Decent Espresso

unread,
Aug 2, 2019, 4:54:13 AM8/2/19
to
On Android 8.x, the very latest debug version of Androwish can now create icons, though there is an Android security confirmation popup window to approve. I sent Christian an Android 8.1 tablet (he didn't own one), and he very kindly made "borg shortcut" work on Android 8.

As to Android 9 and later, they are currently problematic when it comes to making Tcl icons on the Desktop. The sandboxing in those recent Android versions may kill that ability permanently.

Note that "borg shortcut add" will fail silently if any parameters are not correct. And the file paths need to look like this: "file://mnt/sdcard/de1beta/de1plus.tcl"

It's possible to launch a Tcl program via a usb connection to your computer, with adb and this command. That's how I programmatically create icons.

adb shell am start -n tk.tcl.wish/.AndroWishLauncher -a android.intent.action.ACTION_VIEW -e arg file:///mnt/sdcard/de1plus/create_de1plus_icon.tcl

The Androwish Wiki are the current docs, not the Tcl Wiki. And Christian is incredibly responsive to bug reports

As to directions on how I tell users to install Androwish and make an icon, check out this:
https://decentespresso.com/downloads

Since it was asked "how I help users do this" I'd ike to mention that I'm a big fan of short videos that demonstrate the task. Here's my video on resetting a tablet to factory defaults and reinstalling my tablet app from scratch:
https://www.youtube.com/watch?v=TxMmenl6QTQ

-john

Decent Espresso

unread,
Aug 2, 2019, 4:56:49 AM8/2/19
to
> When I begin with a signed "debug key" version, I have to
> run this on my own little version of .wishrc to get things started.
>
> file copy -force .wishrc /data/data/tk.tcl.wish/files/
>
> because otherwise that directory is protected against simply copying
> files, and has to be copied from within a running androwish. Or at least
> that's how it was when I first started using androwish.

I'm putting my Android tablet into "developer mode" (tap tap tap on the Android version in settings) and enabling USB debug, and then using the "adb" command line to copy files.

Then I use this command to place files exactly where I want them:

adb push /d/download/sync/de1plus /mnt/sdcard/de1plus

two...@gmail.com

unread,
Aug 2, 2019, 1:52:45 PM8/2/19
to
On Friday, August 2, 2019 at 1:56:49 AM UTC-7, Decent Espresso wrote:

> Then I use this command to place files exactly where I want them:
>
> adb push /d/download/sync/de1plus /mnt/sdcard/de1plus

Thanks, I will have to look into the adb setup.

I too discovered that the latest debug androwish was required to get
the shortcuts to be created under my 8.0.0 phone.

It took me a while to figure out how to create a proper .png file and
then to create one with a transparent background so I could have
rounded rectangles and other shapes.

There's a freeware tool on windows called IrfanView that lets you
resize to 192x192 and add shadows, shapes, rounded corners etc.
Then you can save a file as .png and select a color from the image as
the transparent color. Then a couple of lines of tcl code turn that into
the png argument for the borg shortcut.


All w/o needing any android development setup so far :)

And yes, your videos are very helpful.

Hussain

unread,
Jun 1, 2022, 3:51:37 AMJun 1
to

Hussain

unread,
Jun 1, 2022, 8:55:34 AMJun 1
to
SELENITE SWORD ENERGY HEALING
SELENITE SWORD ENERGY HEALING is an effective and Intuitively guided technique that uses Selenite Healing Swords of Light. For more details, please visit official website. Thanks.

https://www.solaraawakening.com/selenite-sword-energy-healing

Hussain

unread,
Jun 1, 2022, 8:56:42 AMJun 1
to
Here at solaraawakening we here to access your records together you can get valuable information from your guides and spiritual team to help guide you in making big life decisions
Visit Here for More Details and bookings
https://www.solaraawakening.com/akashic-record-consultations
Reply all
Reply to author
Forward
0 new messages