📜 ⬆️ ⬇️

pyLCI - front end for Raspberry Pi and other Linux devices

Hello!



Today I want to show you the project I have been working on for the last couple of years and finally release the first usable version. This is pyLCI - Python-based Linux Control Interface , an external interface for computers with Linux, which allows you to interact with the system through symbolic displays and buttons. With the help of applications written for this interface, you can perform a large number of tasks related to the administration and configuration of the system, as well as run various scripts and execute commands. And all this is independent of the monitor with the keyboard!
')
And also my interface:

Interested? I ask under the cat.



About K ^ W ^ W How it all began
In my very first article on Habré, I planned to release a series of articles on configuring various services for Linux using the example of EEE Pc 701 with a broken screen, which I then acquired (and I still successfully use to solve various problems). I did not manage to complete that cycle, mainly due to lack of organization, but also because I faced an acute problem of the lack of a normal interface to simplify all my tasks. I started writing my control panel with a web interface, which resulted in several months of experimentation, which ended because of the initially incorrect architecture of my creation, as well as due to the lack of knowledge about the best decisions about its choice (well, and limited funds to buy extra hardware for some key features). Nevertheless, the idea stayed in my head for a long time and I slowly looked closely at the existing solutions.

After a year or two, I was finally able to start working with Raspberry Pi. It was interesting, and I came up with a new project for myself - a device with a Raspberry Pi and many add-ons that would make it more or less comparable in functionality to a computer. It was planned to insert it into the compartment of the 5.25 personal computer, bring the wires to the rear panel, connect the HDMI cable to the monitor and use it as a player / lightweight browser / etc. It was not possible to bring the project to its logical conclusion - there was a lack of an easy interface to manage this good. There were unsuccessful attempts to connect the screen from Nokia 3310 to display at least something, but the screen was still not enough ...

Well, it didn't work out - it didn't work out like that. After a while I became interested in wearable computers. Not least because of Fallout with the eternal Pip-Boy, in the interface of which I then spent a lot of time ;-) I was interested in Pip-Boy, but not only because it could be cured before another skirmish. I have for some time felt how much hidden potential there is in Linux devices — Android is an example of this. Problems start around UI.
UI is one of the problems that caused me to abandon my control panel. It’s not easy to define a UI from scratch - you need to know where to give freedom, and where to restrict the user of your UI and who will create applications based on it.
And the UI is now mostly adapted for graphic displays. Which are huge, uncomfortable and easy to beat, and so on. Lucky if there is a touchscreen. If not, take it with your mouse. Returning to wearable computers - what the hell is wearable with a huge display?

After some time, I'm completely mired in a Raspberry Pi. Now in my room 4 things are adapted for different tasks, 2 more are free. Problems with their configuration - you need to either climb on the network, or on the UART. On the network - what's the IP? Is he even received? And then something the router is silent ... UART? Yeah, unless it's disabled. There was a case when I had to mount the SD card under another computer and edit the bootloader parameters ... As for me, it is too difficult. Unreasonably difficult.

What to do? Where to get inspiration for solving all these problems?

image

Here.
Yes, in old mobile phones. The simplest menu systems for the configuration that we used in mobiles and a bunch of other devices long before the appearance of the Raspberry Pi, but for some reason did not move further, to where they are now lacking.



What can you use this interface for?





Where can I use this interface?







Recently, I decided to make pyLCI more accessible for everyone to use, and as a result of my work, I present you version 1.0 .

What does she know out of the box?




While this is a fairly small list, but it is very easy to fill up. pyLCI is a kind of framework that can be easily extended with “applications” in Python to add one or another function to it. It provides these applications with I / O devices that can be used to communicate with the user, as well as a set of basic UI elements — such as a menu item. Thus, when writing an application, you can not concentrate on the hardware or the nuances of the UI logic (such as nested menus) and fully devote yourself to solving the main goal =)



What iron is needed to start using?


You need an HD44780-compatible display. Type of such:
image
Permanent inhabitant of all sorts of starter kits, itself worth about $ 2 (eBay).
Still need buttons. Type of such:
image
Or even as part of this:
image
Another $ 1-5. Even using I2C expanders ($ 1 a piece), it’s really possible to keep within $ 7-10 / set. \

More specifically, GPIO- connected devices (for Raspberry Pi) and I2C -> GPIO expanders, as well as USB HID input devices, are currently supported. In the plans:




All interested I suggest to familiarize with documentation , well and the instruction for installation . Interested in developing your own application? I have a small crash course and examples as code for already written applications .

Of the disadvantages:



  1. The entire system at the moment is one process, including applications. In this regard, and the possible number of settings that the system should be able to change, it is easier for the average user to start it under the root than to configure all the necessary permissions. If there is a need, I can list which groups / permissions are needed for specific applications and methods of connecting IO.
  2. I have written installation scripts only for Debian / Raspbian. I would be grateful if someone could help with adding support for other distributions in install.sh, config.sh and update.sh.
  3. Also, there is no script for sysvinit - at the moment everything is sharpened under systemd. If anyone has a suitable proven script for rework, please share =)
  4. If you give the pyLCI keyboard, it captures it all. It's sad, because it would be cool to use one keyboard for both X and pyLCI — use the numpad arrows (active when NumLock is disabled) for navigation and put a screen next to it. I think soon to add the ability to “throw” key codes back into the system that are not used by the active application, if the HID driver is used =)


Perhaps on this finish today. I am very interested in your opinion about my idea / implementation, as well as whether you are interested in using it for your Linux devices. Here you can evaluate plans for the near future of the system, as well as an indicative list of applications that will be added to the standard delivery in the future.

Source: https://habr.com/ru/post/392589/


All Articles