1 (edited by MonkeyWrench 2025-07-24 18:18:45)

Topic: Two Way Communication

I'm a newbie here, "trying before buying" to see if your software will do what I need.  I'd appreciate any advice.

I have a hardware "device" up and running with an ESP32 board at its heart.
It's fairly simple – several touch capacitance buttons controlling a small bank of relays under the hood, to switch external 12vDC circuits on and off.  For the next phase of the project I was hoping to introduce the RemoteXY app connecting via Bluetooth to enable remote switching of the device.  I'm hoping to have it set up so that the app would also indicate a change in on/off status, if one of the "hardware" buttons is toggled back at the device's control panel.

BUT – if I understand right, button/switch communication is one way only, from the app to the microcontroller ?

So I believe I have sorted out what I will need to do for programming the app – which is to set up a series of buttons or push switches with text labels alongside, and a series of corresponding indicator LEDs.

I'll program the switches to not show any visible on/off state in the app.  The code would be written so as to NOT care about what state the app thinks the switches are in – but any switch signal from the app should toggle its corresponding relay's state at the ESP32 and in turn trigger a signal back to the app to toggle its corresponding indicator LED.

Does this all make sense and sound feasible ?   Is there an easier way that I'm missing?

Any feedback would be greatly appreciated !

Thanks in advance,
MonkeyWrench.

PS – I have already gotten a test sketch up and running on my ESP32, so app and microcontroller are both happily communicating.

2 (edited by MonkeyWrench 2025-07-24 19:53:53)

Re: Two Way Communication

UPDATE :

Sorry, it seems this was much simpler than expected.  I already have a test sketch up and running with a single button/LED combo in the app side.  I dropped the LED exactly on top of the button, with its background hidden while state = 0.  So the button is visible in the background as a "visual placeholder" until the LED lights up and covers it.  Works perfectly.

Next hurdle – I noticed that if i switch away from the app momentarily in my iPhone, it loses its connection to the ESP32.  I have to "close" the connection in the app and reconnect in order to get communication working again.  Is there a way around this ?
Far from being a deal breaker if the answer is no !!

Once again thanks in advance for any advice.

3

Re: Two Way Communication

1. Perhaps you will find the answer in this tutorial https://remotexy.com/en/help/code/structure/
2. The operating system does not allow an inactive application to work in order to save battery. Just connect to the device at the moment you need it.

4

Re: Two Way Communication

There are detailed examples for the switch: https://remotexy.com/en/help/controls/switch/