How to control duplicate remote devices

I have a remote ESP32 system controlling a number of devices from Dashboard via MQTT. All functionality (thus far) is operating as designed. I have also duplicated the ESP system (without the connected devices) that I have been doing additions/modifications/fixes to the ESP software. However, I can't run the remote system and the development system at the same time (presumably) so I have to take the active remote system offline while I work on the development system. What should I do to enable me to run both at once - Dashboard changes? ESP software changes? . I feek I should know how, but can't seem to get my head pointed in the right direction. Look forward to any suggestions. Cheers

What is it that stops you running them both at the same time?

How are you handling the MQTT 'topics' ?
Are the remote ESP32 systems subscribing to the same topic?

I have a number of remote ESP32 systems and use this topic structure...
msg.topic = basenet/${baseID}/${nodeID}/directives;

I can configure each remote system to subscribe to a specific topic like this..
basenet/station_1/node_6/directives //So it only reacts to that topic

Or use the wildcard '+' like this...
basenet/station_1/+/directives

NOTE:
You do realise each client connecting to the broker must have a unique client ID string.
If two or more systems have the same Client ID - a system will get disconnected from the broker - which maybe what is happening in your situation.

EDIT:
MQTT topics are a key part of organizing messages, especially when you have multiple systems or devices to control. Using a well-structured topic hierarchy makes your system scalable, maintainable, and easy to debug.

MQTT topics are hierarchical strings separated by slashes (/):

home/livingroom/light
home/kitchen/temperature
factory/machine1/status

Each level represents a category or a subsystem. Clients subscribe to topics to receive messages, and publish to topics to send commands or updates.
<location>/<system>/<device>/<command_or_data>

Hello David,

Very nice of you to respond so quickly.

Firstly, I am a forum novice and thought as I write to you whether I should reply on the forum?? Your thoughts would be welcome.

As for the content of your response:

  • I have implemented the MQTT side of things in the simplest possible way (I’m using Pi Zero for the server)
  • And yes, both the active system and the development system do subscribe to the same topic – I was wondering about that, especially as I want to run exactly the same code on both the active and development systems (to ensure when uploading any changed code would operate exactly the same way)
  • I’m sorry to admit that I have on idea about your use of ‘basenet’ – what it is for, how is it used etc, etc. I will endeavour to find out in the coming days.
  • Is the ‘code’ you have shown in the MQTT server or each of any remote ESP32’s – or both?

Again, thank you for replying and hope to hear from you again.

Cheers

Steve Vardy

Don't worry - basenet is just the name I gave to the network of my remote devices.
I have the name 'homenet' for devices around my home and garden.
It might worth typing something like the following into ChatGPT...
"can you tell me how to use a topic structure with MQTT as I have multiple systems to control ?"
The results you get should prove useful.

What do you mean by remote - Does the ESP32 connect to your MQTT broker over the internet, or are they on the same wifi network?

What mqtt topic structure do you use?