Welcome

I’m Pavel, a software engineer passionate about exploring new technologies and sharing what I learn. Please, have a seat and let’s talk about programming, microcontrollers, and other cool stuff.

Curl vs. requests

Here is an interesting development of the Geekhouse project. I wanted to add a simple 16x2 LCD display to the server. I connected the display to the I2C pins and added the code to serve the appropriate URL (/lcd?text=...). I started testing it with cURL and realized that I had to use the --url-query flag to pass any text with spaces, like this: curl -X POST --url-query 'text="Hello world"' http://192.168.1.130/lcd It worked fine with the curl command, and the text was displayed on the LCD. ...

2024-12-30 · 2 min · 385 words · Pavel Anni

From Alexa to LLM: The Geekhouse Story

Previously It all started several years ago when I thought “Can I use Alexa to manage physical devices?” I created a simple demo project to show it to my amateur radio friends. You would say, “Alexa, turn my antenna 90 degrees,” and my model antenna would magically turn. It was a fun weekend project that used a Raspberry Pi, a stepper motor, and a miniature model antenna. I published it on YouTube, if you’re curious. ...

2024-12-23 · 9 min · 1846 words · Pavel Anni

Project: Geekhouse

Overview Geekhouse is a smart dollhouse project that combines IoT devices with Large Language Models to create a natural language interface for controlling physical devices. Users can control LEDs, motors, and sensors using commands in any language, which are automatically translated into REST API calls by an LLM. Features Natural language control of physical devices Multilingual support (demonstrated with English, Russian, Spanish) HATEOAS-compliant REST API for device discovery Real-time sensor monitoring Support for various actuators: LEDs (multiple colors and locations) DC motors Servo motors Human-friendly responses from sensors Technical Stack Hardware Raspberry Pi Pico W (main controller) Keyestudio Smart House Kit components: Light sensors Rain sensors LED arrays DC motors Servo motors Software MicroPython with Microdot framework for REST API Python client application Anthropic Claude (Haiku-3.5) for natural language processing HATEOAS-based API architecture Implementation Details REST API Design The API follows HATEOAS principles, providing self-documenting endpoints: ...

2024-12-10 · 2 min · 348 words · Pavel Anni

Control panel: A TinyGo Adventure

You know how it all started? I was browsing Amazon one day (as you do) and came across this set of color 7-segment LED displays. Instantly, I thought of building colorful time displays with knobs to control them. This project combines two of my favorite things — tech tinkering and fun. I used two Raspberry Pi Picos, some 7-segment LED displays, rotary encoders, and (of course) Go! And before you ask — yes, it does something cool, and no, I haven’t explored all its possibilities just yet. ...

2024-10-07 · 6 min · 1163 words · Pavel Anni

Project: Time Control Panel

Overview A hardware project that creates a multi-functional time control panel using modern microcontrollers and Go programming language. The system uses two Raspberry Pi Picos to manage different time displays, complete with sound effects and persistent memory. Features Three time displays (Target, Current, Previous) Real-time clock functionality Rotary encoder input for time setting Sound effects via DFPlayer Mini Persistent memory for time settings Inter-controller communication via UART Time travel simulation with visual and audio feedback Technical Stack Hardware 2× Raspberry Pi Pico 7-segment LED displays with TM1637 chip Rotary encoders for time setting DFPlayer Mini for audio playback SD card for sound storage Software TinyGo compiler for microcontrollers Go standard library features: Goroutines for concurrent operations Channels for event handling Time and date manipulation UART communication protocol Flash memory operations Implementation Details Multi-Controller Architecture Left Pico: Handles target time setting and display Right Pico: Manages current time and previous time UART communication for time synchronization Time Management RFC3339 time format for inter-controller communication Real-time clock implementation Persistent storage in flash memory Gray code implementation for rotary encoders Sound Integration MP3 playback via DFPlayer Mini Sound effects triggered by time travel events UART commands for audio control Current Status Core functionality working Time setting and display operational Sound effects implemented Flash memory persistence working Future Plans Add GPS integration for actual speed detection Implement speed-based trigger for time travel Create DIY kit version Add Pomodoro timer mode Develop chess clock functionality Improve sound effect timing Similar projects I found several similar projects using LED displays for time and various method to set the date/time. ...

2024-10-07 · 2 min · 349 words · Pavel Anni

Thoughts on the Metric System: An Immigrant’s Perspective

I’ve long intended to write about the comparison between the metric and American measurement systems. It’s a topic that periodically resurfaces in American discourse, often sparking passionate debates about tradition versus global standardization. It’s fascinating to reflect on how my own attitude towards this debate has evolved. When I first arrived in America, I had to adapt to these unfamiliar measurements, and I initially resisted. “What’s with all these illogical units?” I thought. It wasn’t even the individual measures that bothered me most — after all, what’s inherently wrong with an inch, and how is a centimeter radically better? No, it was the seeming lack of logic in the system as a whole that irked me. Why are there 12 inches in a foot but three feet in a yard? And then 16 ounces in a pound? It all seemed arbitrary and inexplicable. ...

2024-08-08 · 5 min · 1062 words · Pavel Anni

Machine learning with matchboxes

I made my first machine learning project when I was 12. I used 24 matchboxes, 55 (give or take) cherry pits, gouache paint, paper, scissors, glue, and colored pencils. That was all I needed to start working with machine learning in the 1980s. My dad gave me a book by Martin Gardner describing a simple game and a machine for playing it. He called the game Hexapawn because it used just six pawns on a 3x3 board. ...

2024-05-26 · 7 min · 1325 words · Pavel Anni

How to monitor SSH logins?

I noticed that a friend of mine routinely logs into his lab servers via SSH using the root username and password. “Why do you do that?” I asked. “What’s wrong with that?” he said. “I know, I know, it’s not a good security practice, but I’m used to it. It’s just a lab server; what can go wrong? And also, all other ways are not that easy.” “‘What can go wrong?’” I said, “The famous last words!” “I’m not going to tell you horror stories. I just think that what you consider ’the most convenient way’ is not that convenient. There are other ways.” ...

2023-04-27 · 14 min · 2959 words · Pavel Anni

Project: SSH Login Monitor

Overview A Go program that monitors SSH login events in system logs, matches login/logout pairs, and identifies users by their SSH key fingerprints. The project demonstrates practical use of Go for system administration tasks and showcases how AI can assist in development. Features Parses /var/log/secure for SSH login events Matches login and logout events by port numbers Identifies users via SSH key fingerprints Calculates session durations Supports CSV-based user database Command-line argument support Comprehensive test coverage Technical Stack Platform Requirements Linux system with SSH server Access to system logs (/var/log/secure) Go runtime environment Software Components Go standard library github.com/spf13/pflag for command-line parsing Regular expressions for log parsing CSV handling for user database Implementation Details Log Parsing Regular expressions to extract: Timestamps IP addresses Port numbers SSH key fingerprints Login/logout events User Identification CSV database format: username,fingerprint Fingerprint matching for user identification Support for multiple users with different keys Session Tracking Port-based login/logout matching Duration calculation Source IP tracking Current Status Core functionality complete Command-line interface implemented Test suite in place Two versions available: Original Go implementation ChatGPT-generated version Future Plans Add real-time monitoring mode Implement log rotation handling Add support for different log formats Create configuration file support Add output formatting options Implement statistics collection Updates 2024-12-23: Documentation Update Converted to new documentation format Added detailed technical specifications Reorganized project structure Read the full story about this project ...

2023-04-27 · 2 min · 228 words · Pavel Anni