DFRobot Bluno Beetle: Blinking LEDs

I have a DFRobot Bluno Bluno. BT 4.0 4 Aoutputs, 4 Doutputs.

I am trying to detect when external devices are powered on wirelessly.

The beetle is such that it can only connect wirelessly or to Android /iphone devices.
I need it to connect or at least talk to a PC.

That is where the DFRobot BLE-Link comes in. Its basically a serial adapter that can link to the beetle.

You can configure them to auto connect via setting a specific mac addy.
You can also config them to act as master / slave.

My approach is such that, the Beetle is connected to PC through USB. I can interface with it via serial.

I plan to use the BLE Link Dongles to simply power up when external devices power up and the Beetle will attempt to pair with each of them.

If a pair is successful, I have a notification that device X is on

I have used/ adapted / written some code to accomplish this.
I store the known MAC addys of the external Link devices in an array.
I attempt to connect to each of the MACs one by one.

I attempt to send a request to the Link, if I get a reply, do X (Which for now is slow blink an LED)

My problem is that I get false triggers.

I plug a Link in, beetle link lights up.
I then try to connect to the known Link MAC ie:. 0x50658397CDC6
send, receive, blink.

Then I try to connect to fake MACs ie:. FakeMac1
somehow I still receive a return value.

I have placed many delays, and printouts to watch via serial monitor whats going on.
Right around connection attempt 7, you see it tries to connect to a FakeMac and still gets a return.

I have attached the code and the Log.


TEST.ino (3.44 KB)

Test_Serial_Mon_Log.txt (1.56 KB)