Click here to Skip to main content
15,887,135 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 391 Pin
den2k8814-Jul-22 21:23
professionalden2k8814-Jul-22 21:23 
GeneralRe: Wordle 391 Pin
ChandraRam14-Jul-22 22:08
ChandraRam14-Jul-22 22:08 
GeneralRe: Wordle 391 Pin
Greg Utas15-Jul-22 1:08
professionalGreg Utas15-Jul-22 1:08 
GeneralRe: Wordle 391 (5/6) Pin
musefan15-Jul-22 1:35
musefan15-Jul-22 1:35 
GeneralRe: Wordle 391 Pin
Cp-Coder15-Jul-22 4:30
Cp-Coder15-Jul-22 4:30 
GeneralRe: Wordle 391 Pin
FreedMalloc15-Jul-22 5:50
FreedMalloc15-Jul-22 5:50 
GeneralRe: Wordle 391 Pin
jmaida15-Jul-22 9:57
jmaida15-Jul-22 9:57 
GeneralChallenges of Bluetooth PinPopular
raddevus14-Jul-22 4:43
mvaraddevus14-Jul-22 4:43 
A few years ago I wanted to see if I could activate my garage door motor from my phone.

I knew if I could remotely just close the switch on the two wires of the garage door motor I could do it.
I knew nothing about Arduino but knew it might be an option.
I figured I could get it to activate a relay to close the switch.
Next I contemplated how to send a signal wirelessly.
I had a smart phone (Android) and I knew it supported a wireless protocol named Bluetooth.
>BOOM< Bluetooth was trending.

Enter "Classic" Bluetooth
These were the days before a thing called BLE (Bluetooth Low Energy -- which is a marketing ploy).
Anyways, I searched for a component which would allow me to send a signal from my Android phone to the component which would be connected to an Arduino.
Here's the Bluetooth module that hobbyists use: HC-05 Wireless Bluetooth RF Transceiver[^]
These BT components vary wildly by manufacturer are very cranky & often don't work to proper specs. But once you learn all that, you're on the inside. I got mine working.

Security Protocol
Since this would be opening my garage door I knew it would be important that no one else be able to connect to the device.
Here's the really cool thing. Bluetooth is a secure transmission type which includes pairing & bonding functionality.
The HC-05 allows you to set a 4-digit passcode and forces the user to enter the passcode to pair & bond (create a lifetime connection).

HC-05 Stores Secret
So, if you wanted to open my garage door you had to know the passcode to pair. Only once properly paired could you send the transmission which would activate the garage door motor.
The bonding causes the HC-05 to store a secret that only the newly paired phone knows.
For each phone that successfully enters passcode it would store a new secret for that new phone.

iPhone User: BLE Only
I have used an Android phone for 10 years, but I finally gave in and became a iPhone user (2 weeks ago).
iPhones do not support Classic Bluetooth*. They only support BLE.
I knew I needed to replace the HC-05 with one that supports BLE.
I had worked with a replacement component named a HM-10 (DSD TECH HM-10 Bluetooth 4.0 BLE iBeacon UART Module with 4PIN Base Board[^]).

Blithely I Roll On
I had great success using the component. Wrote a new iOS app (Swift) for my iPhone, tested and it sent the same data over BLE to the newly added HM-10 which activates the garage door motor.

It was a lot of work & I was glad it actually worked. Now my family members who had iPhones could get the (now 6-digit passcode) and use my app to open my garage door if I allowed it.

The Problem
I paired my wife's iphone and it worked great.
I went to open the garage door and discovered it didn't work on my phone. Hmmm???
I had to add all kinds of logging into the iOS app and was back and forth with her phone and mine.

1 Phone Only
Finally I discovered -- very painfully -- that the HM-10 will only store 1 Secret for one phone.
As soon as you pair a new phone, it removes the secret to the old phone and that phone will no longer work.
User has to go into Bluetooth settings and remove the device and repair it. !!!! Mad | :mad:

Got So Lucky (but could'a been bad luck)
So all those years of having multiple Android phones paired to the HC-05 and it worked great and I never knew how lucky I was that it worked. It all depends upon this little device.

Tried Numerous Other BLE Devices
Arduino Nano 33 BLE -- doesn't support security protocol, anyone can connect & send data.
EMB1082 Seeed Studio cheap BLE module[^] - Won't pair with iPhone.
Another cheap knock off Arduino with BLE -- no security protocol.

It's amazing how difficult this very simple thing is to solve.

You can also read an extensive article here on codeproject about my garage door opener solution[^].

Just had to kind of get that out of my system.
I'll be receiving yet another BLE module today and I'll test it to see if it will work (uses security protocol and allows multiple connections).
JokeRe: Challenges of Bluetooth - Wrong type Pin
Afzaal Ahmad Zeeshan14-Jul-22 5:32
professionalAfzaal Ahmad Zeeshan14-Jul-22 5:32 
GeneralRe: Challenges of Bluetooth - Wrong type Pin
raddevus14-Jul-22 5:36
mvaraddevus14-Jul-22 5:36 
GeneralRe: Challenges of Bluetooth Pin
honey the codewitch14-Jul-22 6:02
mvahoney the codewitch14-Jul-22 6:02 
GeneralRe: Challenges of Bluetooth Pin
raddevus14-Jul-22 6:20
mvaraddevus14-Jul-22 6:20 
GeneralRe: Challenges of Bluetooth Pin
honey the codewitch14-Jul-22 6:46
mvahoney the codewitch14-Jul-22 6:46 
GeneralRe: Challenges of Bluetooth Pin
raddevus14-Jul-22 7:16
mvaraddevus14-Jul-22 7:16 
JokeRe: Challenges of Bluetooth Pin
trΓΈnderen14-Jul-22 11:18
trΓΈnderen14-Jul-22 11:18 
GeneralRe: Challenges of Bluetooth Pin
JohnDG5215-Jul-22 2:01
JohnDG5215-Jul-22 2:01 
GeneralRe: Challenges of Bluetooth Pin
englebart20-Jul-22 16:01
professionalenglebart20-Jul-22 16:01 
GeneralRe: Challenges of Bluetooth Pin
raddevus21-Jul-22 4:10
mvaraddevus21-Jul-22 4:10 
JokeRe: Challenges of Bluetooth Pin
englebart21-Jul-22 15:10
professionalenglebart21-Jul-22 15:10 
RantWe're not all in the US: Annual rant about dates Pin
Chris Maunder14-Jul-22 3:50
cofounderChris Maunder14-Jul-22 3:50 
GeneralRe: We're not all in the US: Annual rant about dates Pin
CPallini14-Jul-22 3:58
mveCPallini14-Jul-22 3:58 
GeneralRe: We're not all in the US: Annual rant about dates Pin
Ralf Quint15-Jul-22 13:07
Ralf Quint15-Jul-22 13:07 
GeneralRe: We're not all in the US: Annual rant about dates Pin
OriginalGriff14-Jul-22 3:59
mveOriginalGriff14-Jul-22 3:59 
GeneralRe: We're not all in the US: Annual rant about dates Pin
Greg Utas14-Jul-22 4:00
professionalGreg Utas14-Jul-22 4:00 
GeneralRe: We're not all in the US: Annual rant about dates Pin
Craig Robbins14-Jul-22 4:04
Craig Robbins14-Jul-22 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.