I did some googling and if I run command “mosquitto -d” before any other command it starts working but that doesn’t make any sense for me and also if raspberry will be restarted it will stop working again
Is used to start the mosquitto daemon from the command line (much like sudo service mosquitto start) so it sounds like you just need to enable the mosquitto service to start at boot time. Try this command
Brian and the rest of us here, who between us put quite a lot of time and effort into answering the questions and solving the problems here, do so freely and without the expectation of anything more than an occasional ‘thank-you’. I know you’re new here, but expecting someone half-way around the world to spend time chatting to you is not something we are prepared to do.
There’s a huge amount of information on this website and the associated ones, and there’s a search function too. If looking at the guides and searching the forum for someone with a similar problem doesn’t help, we’re only too happy to help you. But just remember, you’re not the only one who needs our help.