Hi!
Today I want to finally show you the project I'm working on for about 2 years and release the first ready-to-use version. This project is pyLCI - Python-based Linux Control Interface, an external interface for Linux computers which allows to interact with the system using character displays. You can write applications for this interface which will allow you to change your system's settings, control different desktop and console applications, as well as launch scripts and execute commands - and all of that without depending on monitor&keyboard!
My interface is:
- Cheap
- Simple
- Easily extensible
- Universal
Interested? Read on.
I've been feeling lack of proper headless interfaces for a long time while using Linux systems. We've been using simple menu-driven interfaces on mobile phones for ages, but I sometimes need to plug in a UART adapter to understand, why my Raspberry Pi home automation hub won't do some specific task! Last time I checked, it was because I swapped 2 identical boards and eth1 changed to eth0 - which wouldn't get a network address because it wasn't in /etc/network/interfaces. Adding a screen and some buttons to at least be able to check on those situations would cost about 5-10$, but there also needs to be a software side...
Here comes pyLCI.
What can pyLCI be used for?
- Connecting to wireless and wired networks, getting information about network connections and their settings.
- Connecting Bluetooth devices
- Controlling media players and volume
- Scanning/printing documents, taking pictures and videos using a camera
- Controlling running services
- Mounting/unmounting partitions and backups
- GPS and navigation
- Pentesting
What can you use pyLCI with?
- Raspberry Pi and other SBCs. That's the thing it was originally developed for, and it fits perfectly. Want to connect to a wireless network? Sure. Want to shutdown it to avoid SD card corruptions? Same. Launch a script to fix something? Easy thing. Can't connect your Bluetooth keyboard? You don't need to search for and plug in a wired one to reconnect it.
- Home servers and routers. Want to see DHCP addresses currently leased? Want to turn off WiFi or maybe block a specific site? Or maybe you want to mount a flash drive and launch a backup script? You can achieve all of that without using the web interface from another computer.
- HTPCs. Got tired of this specific track and want to switch to the next? Or maybe the volume is too high? Or, maybe, you want to connect your Bluetooth speakers.
- Desktop computer. Especially if it's a Raspberry desktop =) Even if not, it's actually a pretty good addition to the system tray.
- Linux tablets and laptops... Especially DIY ones.
This month, I decided to make pyLCI more accessible to all the other Linux users. As a result, I'm releasing v1.0!
What can it do at the moment?
- Connect to wireless networks (known secure and any open networks)
- List network interface IP/MAC addresses
- Adjust your volume
- Change tracks in my music player (I use MOCP, but it's easy to adjust)
- Scan I2C bus for devices
- Shutdown and reboot
The list is not big yet, but it's very easy to add applications. pyLCI is a framework that is easily extensible by Python-written applications to add your own functions. These applications get access to the hardware abstraction layer, which can be used to communicate with the user, as well as a set of UI elements to allow focusing on the application's goal instead of things like hardware quirks or nested menu interaction logic.
What hardware do you need to start using it?
First, a HD44780-compatible display, like this one:
Easy to come by in various "starter kits", and it's super cheap.
Also, you need buttons. Like these ones:
5 buttons is the lower limit, feel free to use more. You can even use this:
To clarify, my interface now supports GPIO-connected buttons and displays (for Raspberry Pi), I2C->GPIO expanders and USB HID keyboards&keypads. Additionally, I support PiFace Control and Display Raspberry Pi shields.
To appear soon:
- Support of Arduino boards with LCD&button shields, to be connected over USB. All that's necessary is simple Arduino firmware and a corresponding driver - which are hella easy to write. That'll make a very simple peripheral.
- A wireless device that'd have buttons&LCD and allow you to connect to pyLCI over WiFi (most likely, using ESP8266).
Where to start?
Take a look at the documentation page, as well as the installation instructions.
Want to develop your own app? I have a small crash course for that, as well as already written applications for code examples.
I had a last-minute project name recently ;-)
Some temporary shortcomings:
- pyLCI is a single process, including all the loaded applications. That means that, for an average user, it's much more simple to run pyLCI as root than to set up all the necessary permissions&groups for things to work. It's not a huge flaw per se, because a user sufficiently privileged to change various system settings isn't that far from root in terms of damage which can be done. However, this will eventually be resolved in future versions.
- My install scripts are currently developed for and tested under Debian/Raspbian only. If anybody could help with adjusting them for other distributions, I'd be very grateful for that. Alternatively, open an issue on GitHub if you want to run them on other distributions but lack the skill necessary, I'll do my best to help you =)
- I don't have a sysvinit script yet, the system is systemd-only. If you have a tested skeleton script suitable for this, please do send it my way, I'll be happy to incorporate it.
- If you give pyLCI a USB keyboard/numpad, it grabs it completely. I'll soon work on a driver that grabs only a part of keyboard, leaving all the other keys accessible for normal operation =)
Guess that's all for today's announcement. I'm very interested in your opinion about my system, as well as your thoughts about how you'd want to use it for your Linux devices. Here you can check out my plans for system's future, as well as a list of applications soon to be added to the system. Leave comments at my project page and don't be shy to open GitHub issues if you encounter problems on your way.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.