Skip to content →

Linux & Unix

MQTT server mosquitto on Raspberry Smarthome server does not start


After a few days of absence, I was unfortunately faced with some problems on my Raspberry smart home server.

Among other things, the Mosquitto MQTT server, which is supposed to receive and process messages from the various iot devices, was not available.


After analyzing the process overview with

ps -A | grep mosq

unfortunately no output was shown, i.e. the process had obviously not started.

The manual start with

sudo mosquitto

then led to success. The MQTT server was running and also receiving or processing all messages. Only the service to the Mosquitto caused problems.
After completing the manually started process, another attempt was made with

sudo systemctl start mosquitto.service

then start the service. The subsequent query with

sudo systemctl status mosquitto.service

initially provided a promising answer that the service had started successfully.

Unfortunately not quite successful, there is still no entry for mosquitto in the process overview, and the MQTT message processing did not work either.


After some troubleshooting, the problem was solved. The cause was an apparently corrupt mosquitto.db that is used by the mosquitto service to cache messages.


This problem can be easily solved by deleting the corresponding file in the directory / var / lib / mosquitto using:

sudo rm mosquitto.db

If then restarted with

sudo systemctl restart mosquitto.service

 mosquitto works fine. The service is automatically restarted even after a reboot.

Click here to read more

RFID: Tutorial on integrating RFID in NodeRED environment using IBM BlueMIX Technology

The linked Tutorial gives a brief overview of all the steps that are necessary to integrate a RC522 RFID Reader via Raspberry PI into NodeRED environment using IBM Bluemix services, watson IOT and nodes.

Very interesting and quite easy to do:

Click here to read more

RFID-Tags Read/ Write with Raspberry PI and RC522 MIFARE RFID-Reader

A very helpful tutorial if you plan to use and install a RFID Cardreader and how to do it with a Raspberry PI Mini-Computer (sorry, only in german ):

Click here to read more

MQTT: Public MQTT Broker

MQTT Connection settings for public broker HiveMQ:


Click here to read more

Linux-commands: ssh tunneling remote server to localhost

To start a ssh tunnel from some machine ports 80 to your localhost port 2001 use the following syntax:

ssh -N -L 2001:localhost:80  somemachine

Enjoy !

Click here to read more

Linux-Commands: Rapidly invoke editor to type long and complex command

To type a long and complex command from linux command line can be painful.  Helpful might be to invoke an editor for writing the details.  You can easily invoke an editor by using the following command:

ctrl-x e

Enjoy !

Click here to read more

Linux Command: Run the last command as root

To run the last command as root you simply can use this command:

sudo !!

Enjoy !

Click here to read more

AWK in Linux

awk Linux Commands

What is Linux awk Command?


awk command is used to manipulate the text.This command checks each line of a file, looking for patterns that match those given on the command line.

The Syntax is
awk '{pattern + action}' {filenames}


-W version Display version information and exit.

-F Print help message and exit.

Lets create a file file1.txt and let it have the following data:

Data in file1.txt

To print the second column data in file1.txt

awk '{print $2}' file1.txt

This command will manipulate and print second column of text file (file1.txt). The output will look like

To multiply the column-1 and column-2 and redirect the output to file2.txt:

awk '{print $1,$2,$1*$2}' file1.txt > file2.txt

Command Explanation:
$1: Prints 1st column
$2: Prints 2ndcolumn
$1*$2: Prints Result of $1 x $2
file1.txt: input file
symbolfile2.txt: output file

The above command will redirect the output to file2.txt and it will look like,
14 15 21015 15 2255 56 2805 25 125

Enjoy !

Click here to read more

Alias-Command in Linux

alias COMMAND:alias command allows you to create a shortcut to a command. As the name indicates, you can set alias/shortcut name for the commands/paths which is too longer to remember.

SYNTAX:The Syntax is 
alias [options] [ AliasName [ =String ] ]


-a Removes all alias definitions from the current shell execution environment.
-p Prints the list of aliases in the form alias name=value on standard output.

EXAMPLE:To create a shortcut temporarily:

alias lhost='cd /var/www/html'

This command will set lhost to cd /var/www/html/.

Now if you type lhost it will take you to the specified folder/directory.

To create a shortcut Permanently:
You can put your aliases into the /home/user/.bashrc file. It is good to add them at the end of the file.

alias home='cd /var/www/html/hscripts/linux-commands'

Now if you type home it will take you to the specified folder/directory.

To create a shortcut for a command:

alias c='clear'

This command will set c to clear.
Now if you type c it will clear the screen.

Enjoy !

Click here to read more

A nice app

I am using "Guide To Linux". Click this link to get it.

Enjoy !

Click here to read more

%d bloggers like this: