Back to

Can't change MQTT server with shell command

I’ve been working without problems with the shell until now.
For testing with a local mqtt broker, I frequently change the MQTT server using
mqttsrv -h -p 1883 , and then back to, and until now it worked flawlessly.
But from one moment to another, the command stopped working.

In the shell I issue:
mqttsrv -h -p 1883

and it responds with :

SCK > mqttsrv -h -p 1883
Saved configuration on eeprom!!
Restarting ESP...
ESP off...
ESP on...
Mqtt Host:
Mqtt Port: 1883
SCK > Connecting to Wifi...
ESP finished booting
Synced config with ESP!!
Connected to wifi!!
Hello sent!
Hello OK!!
Info sent!
Info publish OK!!

Basically ignoring the command, and leaving the mqtt server.

I haven’t changed firmware or updated anything on the Kit.
The only change I’m aware of is the IP of my localhost that went from …108 to 118.

My versions are:

Hardware Version: 2.1
SAM Hardware ID: 111BF6AD50515157382E3120FF0F2204
SAM version: 0.9.8-e283e58
SAM build date: 2021-09-13T14:17:43Z
ESP MAC address: B6:E6:2D:65:AA:52
ESP version: 0.9.8-e283e58
ESP build date: 2021-09-13T14:18:25Z

The other thing I’ve noticed is that some other commands respond in a kind of unstable fashion.
For example netinfo sometimes retrieves the info, and some times just shows

SCK > 

What could be the problem?, and how can I proceed to solve it?

Thank you!!

If I encounter strange behaviour I tap the metal reset button and that usually takes care of it.

Perhaps you’ve already tried this though?


1 Like


I think the only problem is that your are using -h -p and you should be using -host -port as stated in the help command:

mqttsrv:     Configure mqtt server address and port: [-host serverName] [-port portNum]

I tried it and here are my results:


Hope this helps!


Hi Cyrille, Victor,

Thank you very much for your answers.
Probably both of you were right.
Finally, I found out that in the process of doing something else I generated a mess with the serial ports and that was also adding to the problem.
Now having followed your advice and fixed the problem of the serial port, it is working fine again!!

Best regards