Posts

MQTT Protocol

MQTT is an IoT protocol used for transporting small amount data in a structured way between IoT peripherals. The protocol is simple - all IoT peripherals are connected over LAN/WiFi and they publish/subscribe to a MQ Broker. There are a variety of clients and servers that support various versions of this protocol. The latest version was 3.0.1 at the time of writing this. The protocol is simple in that the overhead is minimum, the data persistence and delivery QoS is assured by the server, and there are various levels of QoS which help assume the optimal strategy. The publishers publish to a topic to MQ Server over persistent TCP/IP connections. The subscribers subscribe to topics and are assured latest message delivery ASAP. MQTT client library typically has about 6-8 source files and the protocol overhead is only a few bytes, this has made it popular.

Weird problem with Linux Mint - probably memory leak

I am back from a big vacation and so got tons of photos. While viewing them on mg laptop I saw some slowdowns after a while - usually after an hour of photo viewing. This was observed on Linux mint. On windows 10 there was no such problem. So I looked around and the system manager showed huge memory taken by cinnamon. I logged out and relogged in, and it would clean it up but after half an hour again we would be going back to the sluggish state. This has me irritated and I'm thinking  about changing back to Ubuntu. Let's see.

GStreamer monkeying

Code Here We needed to work on gstreamer playback for a project. So I dig around to see if I could get something done. Then I stumbled upon this bit of code which takes screenshot from a playing video.

Finally switched to Linux Mint

After sticking with Ubuntu, I have switched to Linux Mint 17.

Distroshare Ubuntu Imager - Remastersys replacement

I have been Remastersys to backup my customized distros for what seems like years. Its been a wonderful utility nicely tailored for this task. But its development stopped few years back, and so there have been couple of alternatives for that. Just recently I had to put together an ISO of my current OS setup on one of my laptops. So digging around I stumbled upon distroshare utility. This is a nice replacement for Remastersys. Its actually called Distroshare Ubuntu Imager. After trying it out I found that it does exactly what I was looking for. And I successfully created a Live CD backup using distroshare.

TCP/IP Client server persistent connections

So just last week I was moved to another project where I'm gonna be working on a client server program. So we are going to be using TCP/IP for communication. And its exciting since its been over two years since I last dabbled in networking. Life is looking exciting. Anyway so the problem was everywhere I looked, I could find only simple networking examples. So I dug in and put together some code to keep a connection alive for back and forth connection. What I did was basically keep the connection open for next request rather than closing it and reopening it. This enabled me to have a continuous chat like communication between client and server. Then I spent some time refactoring the code to make it streamlined. But I still have to add error handling to it. I'll share it here when I have it ready. It was fun!!!

Limiting CPU percentage of a process

cpulimit is a utility available on Linux to limit the CPU time of any process. The use is cpulimit -l [℅ CPU] -e [binary name] I found it useful to emulate slow embedded processor behavior on desktop.