G15 PMN INSTALLATION--most updated info! Also all about installing G15 PMN app# 100400, the Ann programming language, written in G15 PMN and coherent with it throughout, for G15 PMN FCM Robotics work. This also contains notes about G15BATCH, which is designed to work with Ann, allowing batch robotic processes to be steered eg via Termux in Android even though the main robotic processes are running in Linux; and notes about graphical G15PMN w/mousesim for Android, and analogous approaches for G15 hardware This text updated: 2021:11:28 setup_1000400_linux.txt at g15pmn.com, ie, norskesites.org/fic3/fic3inf3.htm MOST UPDATED INFO ABOUT INSTALLATION OF G15 PMN: You can install any of the G15 PMN in any of the platforms, and all the standard G15 PMN programs will work in every one. To do robotics, there will be some hardware commands tuned to just some platforms; we favour the distribution called Neon KDE Linux for this provided that you choose 'Wayland session' when you log in. To install G15 PMN in Neon KDE Linux and highly compatible platforms: Have SDL2 installed, as this ensures access to screen, keyboard, mouse for the G15 PMN platform: either install the exactly up-to-date version number, or install the larger bundle by the general versionless command for SDL2: sudo apt install libsdl2-dev Reboot and log in choosing Wayland Session on the login-screen, consistently. Unzip neong15ways.zip in a normal home folder with normal read/write/executable permissions. Open terminal eg with CTR-ALT-T and there type cd neong15ways ./neong15pmn Type car press ENTER some times and CTR-W to activate mouse to press on the slash or arrow symbols to start programs, eg C/599 for B9edit editor. Press [del] key to switch between fullscreen and frame mode in Wayland sessions with this form of G15 PMN. This works well. However in some Linuxes, and given some intricate changes of frame eg by the frame's inner 'Move' command, the mouse gets out of its proper coordinates due to frame-size-changes. It must be put back to fullscreen mode to click correctly and the G15 PMN should be restarted to fix this. This arises rarely and is predictable, which means that we consider this not an issue that is in need of fix. To exit G15 PMN, press CTR-Q and type reb and press ENTER. Restart often during intense work and very often when developing new programs; and restart at least twice pr day. GOOD NEWS ABOUT G15 PMN w/mousesim FOR ANDROID: When you install intraplates.com/scientific_apks the g15pmn.apk there [easy way in present Android eg on Samsung phones and similar is to adjust setting of eg the often excellent Edge browser in Android to allow installation of new programs; click on the line that says g15pmn.apk there, and after the Download has completed, it will suggest 'open', and the affirmation of that by a finger-touch will lead to the question of Install], you will find that there is a new ease of getting files into and out from this package. What you do is that you get norskesites.org/neong15ways.zip and unzip it exactly into the download folder of Android. You can use 7zipper [only unselect when 7zipper suggests creating an extra folder for it] or such as the unzip command in Termux. All the .g15 files are now in the download folder. THE ONLY QUIRK IS THIS: the 'mnt' command, menu #1, used to mount an app in G15 PMN assumes continuous database access to the files that it mounts, and while Android grants this access to an app in general, it may do so reluctantly as it were [it didn't work right after install but when it was checked some weeks later it did work; on unrooted, normal, plain phone Androids]. WORKAROUND, which can be made very elegant and fast by making a little .sh script in Termux: RENAME THE .G15 FILES IN THE download/neong15ways FOLDER IN THE WAY YOU WANT TO MOUNT WHAT YOU WANT AND PROTECT AND BACKUP WHAT YOU WANT. For example, if you load in 1235555.zip from g15pmn.com, which gives you a way to show larger font, MORECARS, it contains two files, h1235555.g15 i1235555.g15 SO TO START THIS PROGRAM WHAT YOU DO IS THIS: rename your existing hdisk.g15 and idisk.g15 to eg hdisk_main.g15 and idisk_main.g15. Copy the new files to hdisk.g15 and idisk.g15 and you are up and running them speedily. Rename back when done handling these files. Eg, in Termux, cd /sdcard/download/neong15ways unzip 1235555 mv hdisk.g15 hdisk_main.g15 mv idisk.g15 idisk_main.g15 cp h1235555.g15 hdisk.g15 cp i1235555.g15 idisk.g15 ..start using them in graphical G15 PMN w/mousesim.. Afterwards, restore normal files like this: cd /sdcard/download/neong15ways mv hdisk_main.g15 hdisk.g15 mv idisk_main.g15 idisk.g15 You can make scripts for this, and elaborate on these scripts, eg by the simple text editor 'micro' in Termux. Type chmod 755 scriptname1 chmod 755 scriptname2 and eg put these files to the ../usr/bin folder so that you can run them any time from anywhere in Termux with great ease. In Termux: The program lftp is good for handling ftp for also very large files while the command ftp handles small files well. Lftp is however way too restrictive on certificates and when you know the FTP sites well, you can do this: put this line in a file called rc set ssl:verify-certificate no and put this file rc to ~/.config/lftp and the login procedures will work well. Make a note that you have done this change so that you can undo it to increase the security of your FTP when called for. See the intraplates.com/scientific_apks for ready-made scripts about this, and a variety of alternative forms of X windows oriented G15 PMN, including for Raspberry PI OS for Raspberry PI 3 and 4. GOOD NEWS ABOUT WAYLAND: WHEN neong15ways.zip WAS MADE, WAYLAND WORKED ONLY PARTIALLY WITH A NUMBER OF MAJOR APPLICATIONS BUT NOW MORE AND MORE APPLICATIONS WORK FULLY WITH WAYLAND LOGIN, WHICH IS A DESERVED WIN FOR WAYLAND, ELEGANT SIMPLICITY AS IT HAS, IN TUNE FAR MORE WITH WHAT WE CALL "FIRST-HAND PROGRAMMING" THAN THE CONVENTIONAL LINUX LOGIN Be aware though, that when you use Wayland there may be very subtle issues with some applications that vanishes when you log in to X Windows [ie, a font in LibreOffice may drop out or Gimp may take unusual time on some actions]. SETUP INSTRUCTIONS FOR APP#1000400 THE ANN PROGRAMMING LANGUAGE FOR G15 PMN FCM ROBOTICS WHEN STARTED IN A LINUX PC DRIVING ROBOTS for Ann Programming Language app# 1000400 The Ann Programming Language for G15 PMN FCM robotics work [[[Ann is still in prototype form. This setup will be expanded and made more complete as Ann is getting nearer completion. G15 PMN is of course wholly complete and has long been.]]] Ann programming language builds on the PMWORK app, which expands the Third Foundation, and with some extra two-letter words added. This is similar to the batch-oriented G15BATCH, which is designed to work with Ann. G15BATCH runs G15 PMN programs that does not require keyboard, mouse, screen i/o, but which can run in the background and with text output. G15BATCH can serve also as a 'relay station' for commands you enter, conveying them to the robot through eg Termux in Android, or similar for G15 hardware, to the main PC with full graphical platform doing the robotics; or you can set up the robot to work with G15BATCH, allowing Ann to run the G15BATCH. ************************************* Some notes when installing neong15ways.zip at Neon KDE Linux: The 015inneon.txt tells of installation of a certain version number of SDL 2; in most recent versions of Neon Linux, it is preferrable to load in libsdl2-dev as that brings the most recent version number of SDL2 into the machine. Also: * Wayland login isn't strictly speaking necessary with superbly simple forms of Linux X-Windows desktops like LXDE, as long as switching between the fullscreen mode and frame mode isn't in focus. [or, when exiting it by a click on the Del key, you are sticking to keyboard rather than mouse]: but the mouse-handling is distinct in Wayland and X Windows mode as regards frames, and g15rwx.zip handles X Windows. But you must use something like the 'neong15rworks' startup of G15 to get the full functionality required to drive robots with G15. The less cluttered the window/frame handling is, generally the better. Lxde, eg started instead of Neon login eg by a command like startx startlxde is eminent, fast, simple, works flawlessly as long as X Windows is the orientation. * You can run the G15 PMN program in a folder that you do 'cd' at, in a terminal, provided that there is read/ write access in that folder. The program itself, when Linux, eg neong15rworks, can be copied eg into /usr/bin area, perhaps under a shorter name. When started, it will look into the .g15 files, that are its disks, in the present folder. A technique for putting stuff like 'mynewfunction' into /usr/bin goes about like this, but only do it when you know what you're doing: sudo -i cd /usr/bin ll mynewfunction This is to check that is not already something there, called the same. cp -i /home/whatevermyusernameis/folder/mynewfunction . chmod 755 mynewfunction exit * By putting the startup commands for G15 there, you can run the G15 PMN platform on a pluggable device even when it is not formatted to permit program performance from it. However, when you run something like 'rworks', to start robotic interaction programs through terminal command from G15 PMN, which includes camera-read programs, you may find that some of these may work best in the computer's home disk. This you must check for each platform, with each external program [eg with some versions of snap- installed fswebcam in some linux'es configured in a standard way that program can store files at home disk and usb card yet not at sdcard; other variations of this sort may arise from time to time]. ************************************* In this setup.txt, the hardware input/output for robotic cameras, robotic engines etc are all Linux oriented, and oriented towards running inside the folder that comes when you unzip the neong15ways.zip package at norskesites.org/fic3/fic3inf3.htm which is oriented towards Wayland sessions in Neon KDE Linux or one that is extremely compatible. There are some BMP conversion routines included there. The other programs referred to in the .sh are very usual standard installable-over-the-net linux commands. Start with neong15ways.zip package, ideally performed in Wayland login modus in Neon KDE Linux or one very similar: ./neong15rworks or similar there to access command line. SETUP OF MAIN SOUND AND SOME IMAGE CONVERT USEFUL FOR CAMERA INPUT Install sox, eg by sudo apt install sox in order to enable the command 'play'. By installing the package 'imagemagick', you enable the command 'convert'. For the time being, the hardware input/output for robotic cameras, engines etc are all Linux oriented, and the interaction with servos etc is as suggested here by means of connecting many Arduino Uno R3 together and steering them as a group handling many PWM servos, that in turn direct strong engines. SETUP OF CAMERAS Example: command MOTIONDETECT in Ann Depending on the choice of camera-reader, and the powers of the PC, the stability of the camera connection, and such, there is a certain amount of hours a loop of reading from the camera can go on without the need of restarting the terminal in Linux, or the PC as a whole. When you use MOTIONDETECT .. WITH THRESHOLD, in a Linux context, the command ./tisignal.sh is called whenever motiondetect detects a motion, in addition to the sound which is being played. This tisignal.sh should be set up before you try that command. It can contain anything you please :) Depending on intensity of usage, orientation of cameras, and more, you will want to find a proper configuration for each application of Ann to robotics. In Neon KDE Linux, camtogem_std_s.sh can be copied to camtogem.sh and the line with goodclear.sh can either be deleted or you can set it up as described further in this text to clear cache during continous run of PC in many hours. G15 PMN with Ann is perfectly able to perform flawlessly over many hours but it requires good hardware, and good configuration of surrounding software. Good programs to capture one image at a time from cameras, eg /dev/video0, /dev/video15 etc, connected eg with USB to a PC are 'fswebcam' and 'streamer'. While hour-long use of fswebcam repeatedly gives consistent use, it seems some versions of streamer leaves a residue in RAM so that the image from the camera changes in brightness over time. However, fswebcam requires clever configuration work in some linux contexts. A solution is 'ffmpeg', which is usually installed with ease and which appears fairly stable and which can be configured in very many ways; however fswebcam appears more stable when you get it to work. Copy camtogem_std_f.sh to camtogem.sh in case you wish to use fswebcam. In some cases, when, in Linux, something is installed using the 'snap' rather than the 'apt' approach, the program gets a 'shielding' from hardware. To make fswebcam reach out and actually connect to /dev/video .. channels, it may be necessary to type in something like this, once, after install: sudo snap refresh fswebcam --edge sudo snap connect fswebcam:camera STREAMER Copy camtogem_std_s.sh to use streamer. FFMPEG copy camtogem_std_g.sh to camtogem.sh. In each of the camtogem_std*sh, you find the line 'goodclear.sh'. Initially, you may omit the line with 'goodclear.sh', read below about it. In all cases, it seems that it is best to turn off 'scrollback' options for a terminal, like Konsole, from which such a repeat- script is started, so it doesn't use more and more RAM. FOR EACH CAMERA explore the settings inside each line in the script as to what part of the image is being shown, and to what extent it is tilted, treated for brightness, and such, before a standard greentone BMP is created of it of size 500x500. It may for instance have an active area that is 350x350, usually more than enough for robotic pattern matching of an efficient type. The greentone is the approach of G15 PMN; to get differentiation of colours, use filters on the way from a colour camera to the input and treat them separately inside the G15 PMN program. HARDWARE: some cameras heat up or get their internal electronics a bit clogged after continous usage over some time. Experimentation will show which types are best. TERMINAL TEXT SCROLL: it is almost certainly the best that there is no saving of text output when you wish to run a script which does have text output in a loop for hours. The effect may be very significant. To be sure, you can do chmod 755 camtogem.sh Modify the statements about resolution, about which video--eg 0 for the most 'native' webcam during startup, or eg 'video2' for the first connected to the PC laptop after startup. Also modify rotation and brightness and contrast statements connected to the 'convert' command inside it to suit the webcam. So, that, through these commands, something kept within 500x500 pixels are generated as a standard green BMP suitable for GEM import. For driving many USB elements, you may have to have a powerful power supply for the PC, and not longer cables than necessary. For important work, a clean boot and no other programs open are advsiable. command MOTIONDETECT in Ann create rsound001.wav as a 16- or 32-bit WAV file [eg exported by audacity in linux from a suitable sound recording]. The command 'pkill play' should stop playing. The argument in favour of Wav format is that it is very near the 'first-hand relationship to data' approach, entirely unlike mp3. SETUP OF MAIN ROBOTIC ENGINES We use the established Arduino 32 gate miniboard which allows the steering of servos; these servos steer voltage controls of larger engines in the typical Avenuege G15 1000400 robotic setup. We have servos as 'air locks' between the low-voltage, low-ampere PWM output from the digital electronics and the high-ampere power supplies that power the engines of the Avenuege G15 PMN Ann robots. TO ENHANCE PERFORMANCE DURING HOURS SUITABLE FOR KDE NEON LINUX AND THE LIKE NOTE: consult with experts as to security in case you are using a PC which must be set up to be very secure and you wish to edit things in the /etc region of it. Create a text file eg in gedit called goodclear.sh, let it contain: sysctl vm.drop_caches=1 sysctl vm.drop_caches=2 sysctl vm.drop_caches=3 Save it to ~ which is /home/yourusername Go into administrator mode using your password: sudo -i cd /usr/bin cp /home/yourusername/goodclear.sh . -i sudo 755 goodclear.sh cd /etc Open text file /etc/sudoers in a text editor that works in administrator mode with great care after making a backup of it, or, with great care copy it to a local area, edit it eg with kwrite, and copy it back while in Administrator mode and give it back its proper permissions with chmod. In the editor you add a last line to it, namely yourusername ALL=(ALL) NOPASSWD: /usr/bin/goodclear.sh Having done this, leave the administrator mode by this command: exit Do a reboot to ensure that sudo goodclear.sh now can be performed inside a batch file without passwords having to be typed in each time. You can now enhance stability by allowing these to be the completing two lines eg in camtogem.sh, with eg sleep 0.15s being used higher up in it, adding up to sleep 0.35s: sudo goodclear.sh sleep 0.25s Remember though that Linux is a vast system and that there are more processes than those covered by such simple commands that ideally should having their caches refreshed for even better performance. at g15pmn.com => norskesites.org/fic3/fic3inf3.htm