Hey,
I am programming a little app that'd I'd like to automatically connect to an arduino via a bluetooth. The arduino has to be switched on via a web request to a shelly smart plug. So essentially start app click button 1 start the shelly realay to get the arduino to turn on, then automatically connect to the arduino via the hc 05 bluetooth module.
Everything works fine but I cant get it to reliably connect via bluetooth. Sometimes it works, sometimes the module just keeps flashing in paring mode and trying to send commands will result in Error 516:Unable to write:Broken pipe.
Closing the app while leaving the relay on fixes the issue the bluetooth connects every time.
This is the little function I use to connect. Is there a better way to autoconnect to a bluetooth module? I have been trying to get this to work for ever.
Thanks a lot.