LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-09-2017, 09:29 AM   #1
jon_smark
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
Setting up static PIN for Bluetooth pairing


I want to use any mobile phone to connect to a IoT device via Bluetooth Classic with the serial port protocol (SPP). The IoT device has no screen and no keyboard, and it's supposed to accept connections automatically as long as the connecting phone knows a secret PIN (ie, I don't want to be forced to ssh into the IoT device to set up pairing every time a new mobile phone tries to connect).

These are the commands that I've run so far on the IoT device:

Code:
# Make the device discoverable:
hciconfig hci0 piscan

# Register SPP:
sdptool add --channel=22 SP

# Start rfcomm:
rfcomm -r watch /dev/rfcomm0 22
Unfortunately, I couldn't find any way to set up a PIN, and pairing fails when I try to connect with a mobile phone. In addition, the device is only discoverable for a short interval.

How do I configure the IoT device's Bluetooth stack (running a recent Bluez) to auto pair with any phone that knows a given PIN, and how do I make the discovery period eternal?
 
Old 02-11-2017, 02:20 PM   #2
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
I'm not sure about setting a static pin, but as far as discover-ability timeout, you would edit /etc/bluetooth/main.conf and set DiscoverableTimeout = 0 and you might also want to change PairableTimeout = 0.

I'll see if I can find anything about PIN and update if I do

Last edited by TheEzekielProject; 02-11-2017 at 02:21 PM.
 
Old 02-11-2017, 02:48 PM   #3
TheEzekielProject
Member
 
Registered: Dec 2016
Distribution: arch
Posts: 668

Rep: Reputation: 190Reputation: 190
This is the most recent information I could find as far as setting a static pin. Hopefully it will be useful for you
 
  


Reply

Tags
bluetooth, bluez, rfcomm



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bluetooth pairing fails _with_ PIN (org.bluez.Error.AuthenticationFailed) Vinter Linux - Software 2 08-27-2014 04:04 AM
System Settings: No way in 12.12 to enter PIN Number when pairing w/Bluetooth hlw Linux Deepin 2 07-11-2013 01:26 AM
Bluetooth Pairing geller6980 Linux - Networking 4 05-29-2011 09:07 PM
bluetooth pairing deadlinx Ubuntu 15 08-02-2009 03:26 PM
Bluetooth pairing Dj Blaze Linux - Laptop and Netbook 0 01-28-2006 05:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration