I am trying to use mqtt as a broker on my RPi4b running Bullseye. I have a ESP8266 running a very simple sketch and a very simple flow in NR. It was working earlier today, now the ESP mqtt will not connect. When I click deploy this is printed in the terminal:
10 Feb 22:35:50 - [info] Starting flows
10 Feb 22:35:50 - [info] Started flows
10 Feb 22:35:50 - [info] [mqtt-broker:rpi mqtt broker] Connected to broker: mqtt://localhost:1883
10 Feb 22:36:29 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
10 Feb 22:36:29 - [info] Stopping flows
10 Feb 22:36:29 - [info] [mqtt-broker:rpi mqtt broker] Disconnected from broker: mqtt://localhost:1883
The esp reports in the Serial Monitor (Arduino)
Attempting MQTT connection...failed, rc=-2 try again in 5 seconds
I have the broker set to localhost, and the mqtt in node shows "connected". If I use the ip address of the RPi4b then it just says "connecting". There is nothing filled in on the security tab. I have power cycled everything except the router. I restarted mqtt in the terminal and testing it in terminals and it seems to work ok. I don't know why now, other than the router gave a different IP address to the ESP8266 via DHCP, could that be the problem? The RPi4b has the same IP as earlier. I tried it with windows firewall off. For some reason the forum tells me new users can't upload attachments but I have the flow and sketch ready to post if you'll let me.