G15BG, or G15 PMN with Batch Graphics berlinib@aol.com www.g15pmn.com norskesites.org/fic3 Version: June 2024 Works with latest long-term support edition of Ubuntu 64-bit on AMD/Intel and latest Android on eg a Samsung phone Created by Aristo Tacoma as an aspect of the G15RBT suite which, among many other things, are oriented towards FCM robotics. WHAT YOU NEED TO DO TO INSTALL: Internet connection, loading in some standard programs, and doing a little bit of nerdian typing to configure. Keyboard overview next, after that comes intro & detailed installation info :) KEYBOARD: The G15BG version assumes that you have letters, digits, and visible characters, Enter, and backspace, and an option to press CTR-X, CTR-P and CTR-F as well. The most important functionkeys and $ and ~ are available via CTR-X plus something extra, while CTR-F repeats last CTR-X key combination (useful eg when clicking arrows repeatedly): CTR-X followed by digit equals: 1 to 9 is F1 to F9 0 is F10 CTR-X followed by letter equals: W: F11 K: F12 E: ESC The diamond 'T' (up), 'V' (beneath), 'F' (left)', 'G' (right) is often used for arrows, --we do so here. O: Home P: PgUp B: PgDn 'page-Beneath' I: Ins Q: End To ease keyboard for tiny keyboards: Y: Gives this effect: ~ J: Gives this effect: $ Whereas CTR-X CTR-X letter equals CTR-letter [eg CTR-X CTR-X X equals CTR-X.] A function-key via CTR-X will usually give what is (by intention) a symbolic output, such as eg ^ for arrow-up; when repeat button CTR-F is used, there is also a symbolic output, either a generic one for CTR-F, or, for some of the CTR-X combinations, a repeat of the CTR-X symbol. [Terminal-dependent: A program that requires sudden exit may sometimes be exited by a click on CTR-Z.] Extra info on keyboard inputs at last page in this setup info for G15BG. What sort of G15 PMN standard programs must be rewritten to fit G15BG batch graphics: [1] A program giving even the briefest call to something like a 'pause' function, which relies on internal timings, instead of the timings called from commandline; because such a pause won't exit; [2] any program that relies at any point entirely on mouse-input; [3] any program requiring read from a pixel-point at screen; [4] any point relying on combinations of function-keys with SHIFT, ALT, CTR. [5] any program that relies on the interactively intended fast commands for showing gem images and curveart, in G15 these are eg 'im' and 'ca'. See bgextra1.zip for some example programs that do in fact work. INTRO [installation instructions beneath] ========================================= G15BG is a powerful, terminal-friendly implementation of G15 PMN programming language and platform that doesn't give text output at every lineshift, but rather gives 'batch graphics' on every lineshift, suitable for applications which are low in demand on keyboard and have no demand on mouse pointer device and never calls any timing or pause function except eg through 'date' command at commandline as the G15RBT does, and which does all 'painting' of screen by 'manual' pixel-drawing. It works on any .six-image compatible text terminal like XTerm on on a 64-bit Linux like Debian, and on Android with a .six-image compatible text terminal like Termux in its great open source Termux-Monet fork, supposing the phone is a bit powerful and also has a bluetooth keyboard. The algorithmic part of G15BG is lightening fast and totally compatible-- as all G15PMN versions are--with one another so the program and data disks can be interchanged, even be in the same folder, between the versions. However, usually, the programs you run on G15BG has been made with an eye to getting also to be practical on this narrow text-keyboard-and- without-any-mouse-pointer-device implementation of G15PMN. G15BG can both be used in robotics as an aspect of the G15RBT package and as a light-weight easy-to-start programming mini-terminal on any powerful Android phone equipped with a little bluetooth keyboard [What is .six-image? it is an image format very similar to bmp which is easy for a text terminal to output sequentially, and scroll, even in high resolution format, given that it has access to individual pixels on the screen] Tested to work absolutely flawlessly on the latest versions of Android AND on the latest long-term support version of Ubuntu and probably most other GNU/Linux variants. This zip contains all you need except highly standard easy-to-fetch elements on both sorts of platforms--in a practically installation-free way. You just need to type a little bit of the normal things one typically types on Linux terminals to get it started the first time, with a working Internet line to receive updated applications. And, yes, for this package we will include updates in case of some differences with compatibilities of future versions of this or that. It is all very standard and safe, though. INSTALL You can test and use this package without blending it with the G15RBT package. Note that the G15 PMN disks, with the suffix .g15, of the G15RBT are the same between G15PMN in main graphics interactive version and G15BG as batch graphics text terminal version. The programs are compatible as long as functions dependent on either mouse or timing are not engaged in such a way as to cause indefinite way (on a mouse input signal and/or a timer update and/or keyboard input), and so that fast gem and fast curveart commands are not called. The data bases can be exchanged between them by normal G15 PMN mounting, in the interactive vesion, or by renaming the relevant ?disk.g15 for the batch graphics version. This version uses, over and over, filename xo1.bmp for the screenimage, whereas an interactive graphics version usually generates a series of xo1.bmp, xo2.bmp etc when such as alt-del is clicked (or just del in firth). WHEN YOU HAVE SUCCESSFULLY INSTALLED, TRY THIS LITTLE TEST: When you start it up the first time, do a simple test, eg add 3 and 5 for the Fibonacci sum 8 and quit the platform. You'll see the text 3 and 5 as you type, but you'll see the answer only in the green graphics, eg as you click CTR-P. Each time you click enter a smaller version of the graphics show just before the lineshift is handled by the program. This is how you can type it, lineshift after each: 3 5 ad nn At this point eg click CTR-P, and, to quit it, qu You just performed a Third Foundation G15 PMN in the expanded form used with G15RBT robotics at the F-disk at the point where this package was last updated. NOTE ON MOST RECENT UPDATES OF THE ROBOTIC EXPANSIONS TO THIRD FOUND.: To be sure you use the absolutely latest version of the F-disk, and get the associated programs in from the other disks, after you have got G15BG to work in one folder, copy all the g15bg, g15bgx, g15bga, g15bgx and the short-named little scripts over to the relevant robot folder, and eg do the chmod all over again there, and you're set to work! But it's a good idea to wait doing this until you have it started with its own g15bg files, so you know the setup is perfect. Editors can be made in G15PMN to work esp. with G15BG; but as a starting- point, use other, mouse-enabled G15 PMN implementations with the same G15 disks in the same folder cdisk.g15, ddisk.g15 .. ldisk.g15 to program using the 'native' CAR editor, and you can switch to G15BG for a graphics-low-intensity 'batch' way of running these programs. You can also type in programs directly into G15BG, eg: hi3= ll:10 ^love lo. hi3 And you can start whole applications like the spreadsheet. The 'batch graphics' version of G15 PMN has full graphics, but not updated many times pr second as the interactive edition; it has a keyboard limited mostly to letters, digits and other visible characters, and some function keys available by CTR-X combinations (listed above), and it has no mouse pointer input nor even a simulation of mouse pointer input; and total absence of any sort of call such as to a 'pause' function that relies on internal timing. Apart from these interactivity features, and the 'read pixel from screen' option used in GEM image editor, everything of G15 PMN is there-- which is why it is perfect to run machines like robots. They can get more than enough timing from the 'date' command via command line as parsed towards G15 PMN. In addition, it is also a delight to use as a free-thinking 'programming terminal' when all one has at hand there and then is a device with a tiny screen and keyboard. Set it up for Ubuntu 64bit PC [see below for Android] ============================= and on any similar enough GNU/Linux [1] Check that you have Xterm available, by typing xterm on a terminal. On this terminal type each command to check whether it is installed, and if not, follow the installation instructions for it. But begin getting the full ImageMagick: sudo apt install imagemagick [2] Get img2sixel and [3] At some point also python3 [more about python3 and alias and such in the main G15RBT.ZIP package, of which this package can be seen as an aspect]. And get, [3b] the 'micro' editor. [4] Get the g15bg.zip to the folder you want to run it from. There: unzip g15bg.zip Make sure its main commands can be performed: chmod 755 g15bg chmod 755 g15bgx chmod 755 a chmod 755 aa chmod 755 aaa chmod 755 bg chmod 755 bgx chmod 755 bs [4b] As with the G15RBT main package, please set up some single letter commands also; read more in it for how to do it in an alternative way; check before you do this these single- letter commands are not already 'occupied' by simply typing them in--p, h, t. This makes them easily available for all the G15 PMN robotics call to commandline: sudo -i cd /usr/bin ln -s printf p ln -s echo h ln -s cat t exit [5] Before you start it, I want you to consciously be aware that Xterm with certain parameters should be started, rather than the normal terminal of the GNU/Linux. This you can do by the command ./bs You might figure out a way to list this command as 'favourites' on your desktop. In other words, be sure that the Xterm frame you start ./bg from is started by ./bs or equivalent, rather than by the simple command 'Xterm'--to get the .six compatibility. Inside Xterm, by the way, SHIFT-INS is its particular form of Copy, and also its particular form of Paste. Inside Xterm, start it: ./bg Note: if you use it with Robotics, your computer must have an Ethernet cable or such with an IP address, and if so, modify the motorsip.txt which is included in the zip to have the right IP address for your cable, as you probably easily will find in the settings of the computer. This IP is shown during startup of G15BG. So, now you have your G15PMN in its graphics batch version running! Each time you press ENTER, a small but more fast version of the G15PMN screen is shown. Each time you press CTR-P a larger version (you can adjust pixel-size for CTR-P by editing the numbr in the script 'aa'). Type qu and press ENTER to exit it. Just how the CTR-P version of the screen is can be set (too large and perhaps nothing will show; smaller and it shows faster) you can adjust by adjusting the number in the script aaa (the Android version uses aaa): micro aa Vary the number shown there by some hundred at a time and see if the CTR-P next time is working well. If not set the number back. When the G15BG is active, and accepts keyboard input, it shows what you type with a space between each character. This space is of course not part of the graphics display as you press lineshift. Set it up for Android [see above for Ubuntu] ===================== First get Termux-Monet installed, whatever way you like, or do it either this way: [1] Check if you have Termux already installed. If so, backup everything you have there--on a different device --and really check you have got it all; uninstall Termux completely and delete all its files on the device; and after that, install Termux-Monet. Do not accept updates of it from any place other than from its official git: https://github.com/KitsunedFox/termux-monet/releases/ [Why you must uninstall Termux to install Termux-Monet is that you want all the super modules provided for Termux so those who have forked it have very wisely not changed its identity as App. That is to say, it has a similar id, and the App manager will indicate that this app is already installed.] Find the latest version for Android/ARM of Termux/Monet, download and open it; a browser used for the first time to install an apk on ta phone will of course warn but also suggest that you authorize in Settings for installation for the browser. Do so if you have not already done so. [2] Or this way: Again, start by being absolutely sure you have uninstalled any existing non-monet Termux first, of course backuping every one of the important files. Then install TermuxMonet as included with the .zip. Here is included both its git open source licensed source and its apk inside the g15bg.zip. It is there called: monet.apk So look into the g15bg.zip and extract the monet.apk from it and put it eg to /sdcard/Download. Use eg Files to open the monet.apk file or get one from their git website, github.com/KitsunedFox/termux-monet Refer to this website if you make any use of their source. The apk installation will require that you authorize in Settings that Files can indeed install if you have not already done so. [3] Next, get the g15bg.zip into the home area of your Termux-Monet. Start Termux-Monet, type the usual pkg upgrade and allow it to upgrade. Follow its suggestions when it suggests how other things should be installed. Eg, if you want the wget command, type pkg install wget You should absolutely imao have the micro editor: pkg install micro Learn it! Use screen sideways for wide texts. To get the graphics, type img2sixel and see what it suggests as installation instructions, eg something like pkg install libsixel. To get more options on graphics, type convert and follow its instructions to install ImageMagick. Also, you need pkg install zip And why not, for sound, pkg install vlc [3b] Get python3 set up and with an alias, 'th', as described in the G15RBT.ZIP main package, and also enable the one-letter commands p, t and h. Here's how in Termux-Monet: python3 It will probably tell you to type pkg install python and this you do. When this is done, type [eg using 'Hacker's Keyboard' or a Bluetooth keyboard, which also allows you to do such as CTR-ALT-C to make a new terminal session and CTR-ALT-N to switch between them]: cd cd .. cd usr cd bin dir python3 Here, it should say 'python3' in nice color. dir th Here, it should say 'no such file' and such. Let us make that file, as a link: ln -s python3 th And while in the usr/bin folder, let us get the essential three letters, p, t, h enabled in your TermuxMonet; these are used all the time by the G15 PMN Robotics routines. cp ../../home/p . cp ../../home/h . cp ../../home/t . chmod 755 p chmod 755 h chmod 755 t cd One more thing (that may be unnecessary in Termux-Monet but do it anyway): in scripts, the path #! /usr/bin/th will work, rather than having to write: /data/data/com.termux/files/usr/bin/th given termux-exec which redirects some absolute paths to usr/bin so they look more relative. In that way, it is more compatible with Ubuntu and its well-working robotics scripts in the G15RBT package, supposing you manage to connect as well as properly configure an Ethernet adapter to your Android device. So you write is this: pkg install termux-exec And then you restart the Termux. [4] Then use this to get the g15bg.zip: wget norskesites.org/g15bg.zip Then unzip it: unzip g15bg.zip Make sure its main commands can be performed [note, g15bg for Ubuntu AMD/Intel, g15bga for Android ARM]: chmod 755 g15bga chmod 755 g15bgax chmod 755 a chmod 755 aa chmod 755 aaa chmod 755 ad chmod 755 adx And start it: ./ad Note: if you use it with Robotics, your computer must have an Ethernet cable or such with an IP address, and if so, modify the motorsip.txt which is included in the zip to have the right IP address for your cable, as you probably easily will find in the settings of the computer. This IP is shown during startup of G15BG. So, now you have your G15PMN in its graphics batch version running! [Read below for how to maximalize the screen in Termux-Monet, by removing the area given to extra ctrl-keys and such.] Each time you press ENTER, a small but more fast version of the G15PMN screen is shown. Each time you press CTR-P a larger version--and you can generally increase it vastly more on a phone laid sideways. Type qu and press ENTER to exit it. Just how the CTR-P version of the screen is can/should be set (too large and perhaps nothing will show; it will show faster with a smaller number) you can adjust by adjusting the number in the script aaa (aa for Ubuntu): micro aaa Try to adjust the number shown there a little and check how CTR-P works next time you have started the g15bg. Go back to the original number if it isn't working as well. Now to see the screen more clearly, and have less of that extra keyset displayed on bottom of the screen, you can type this--use the phone sideways for extra width: cd cd .termux cp *properties backup.txt micro *properties In this, scroll ahead to where it talks about 'extra-keys'. Here, just write extra-keys = [] And click ctr-s to save, ctr-q to exit. Type exit to exit the Monet, and restart it, and it should have nothing of that extra set. To get back the extra key set later on, just type cd cd .termux cp backup.txt termux.properties When the G15BG is active, and accepts keyboard input, it shows what you type with a space between each character. This space is of course not part of the graphics display as you press lineshift. MORE BACKGROUND Broadly speaking, this is a rock-solid production or factory like implementation of the core algorithmic functionality of G15 PMN in context such as driving robots and where screen updates are kept at a (controlled) minimum, and no assumption about extensive keyboards are made--just the core keyboard--and where no reliance on mouse pointer device at all is a criterion for the types of programs that are to run; also, a criterion is that wait-functions (by timer and/or keyboard) are generally avoided completely; as all interactively intended fast gem and curveart functions. The graphics come 'by request' eg on a .six compatiable terminal like Xterm or, at Android, Termux-Monet, whether by the interactor with the program through text terminal, or as coded in the program itself. This is also a very pleasant way to have PMN programming options interactively available directly inside any Android phone, with graphics output as much as one pleases (though generally not 'instantly'; it can eg take a second). In contrast to Termux on Android, which is extremely well-known, Termux-Monet is an open source, git-stored fork which sticks to .six standards similar to how Xterm can be used on eg Ubuntu Linux; both the apk and the whole git source is given here in accordance with normal open source licenses, with all acknowledgements intact. After installing the APK, then, inside the unzipped zip for G15BG, it only takes the ./ad command to start the G15 PMN machinery. And it is, in its algorithmic essence, blazingly fast. On Android: a small bluetooth keyboard is strongly recommended but not absolutely essential. This is part of the G15RBT project in the larger sense. Normally, a program to be performed in G15BG has been prepared using the normal type of full-keyboard and mouse pointer device in the Personal Computer context. THE PROGRAMS THAT RUN IN G15BG ARE GENERALLY A BIT MODIFIED TO FIT THE CONTEXT OF A TEXT TERMINAL WITH OPTIONAL (PERHAPS NONRAPID) GRAPHICS DISPLAYING. Typically, the programs in G15BG start by autostarting F1, and do not go via the (mouse-oriented) CAR menu approach. This F1 is exactly the same 'slightly expanded Third Foundation' as is in the G15RBT package. The spreadsheet is already, in the G15RBT main programming part, being tweaked to accept more textual control from PMN terminal and that fits superbly with the G15BG context and in that sense, and indeed in all FCM senses, the program is identical. You can start it on this. Suitable for, eg, * Running completed robotic FCM programs in which much update on the screen is not called for as the attention is to what the robot is doing; with occasional options and such emerging at screen * Doing a bit of G15 PMN programming where perhaps only a minimal text keyboard and, eg to save battery or computational power, eg only occasional display of the graphics are important and where no timing or pause function is called on except through commandline Extras included Cpu extra command# 253, which you can access via G15 by that number, does the ctr-p action from within the program The g15bgx (for Ubuntu etc) and the g15bgax (for Android etc) has many times more RAM available for programs. To activate, use ./bgx and ./adx, respectively. EXTRA KEYBOARD INFO What happens if you use other function keys on a terminal running G15BG? That's system-dependent and as such, perhaps ideally do not program with any assumption about that. Eg, direct use of a function key like Del in such terminals may lead to ESC followed by three visible characters, [ 3 ~. Parsing this sort of input often leads to cluttered programming esp as this must be distinguished from a 'proper ESC' (ie, as clicked by CTR-X E). So stick to the simple CTR-X combinations. Note that a robot production program should have several 'easy exits' from program; exiting terminal will usually quit application (but otherwise use the command 'pkill' followed by name of program' or a Force Quit option from OS Menu) but be ready to restore files from backup if quit happened during file write to ensure file integrity. Type exit (even if terminal echo is off) and press ENTER to exit a terminal if it exited abruptly. To initiate such an exit, CTR-Z may work. P.S. The full graphics version with simulated mouse of G15 PMN does work when the neong15ways.zip (not neong15pmn.zip, as was written in the setup instructions at intraplates) is unzipped in folder Download, making a subfolder called neong15ways which has all the .g15 disks and such. However though this is a very standard form of Apk, it will produce a message like 'Did not install [click Details to see more]', and when Details are clicked, it tells about it being for earlier Android and only at that point gives an option, 'Install anyway'. With this, that is safe.