Skip to content

Instantly share code, notes, and snippets.

@lidio601
Created July 2, 2014 14:59
Show Gist options
  • Select an option

  • Save lidio601/cd860ece8c6a4d7602e7 to your computer and use it in GitHub Desktop.

Select an option

Save lidio601/cd860ece8c6a4d7602e7 to your computer and use it in GitHub Desktop.
Python test to send SMS to a phone via Bluetooth
import bluetooth
#import serial
sockfd = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
# sockfd.connect(('00:15:2A:D1:F4:8A', 1)) # BT Address
sockfd.connect(('00:1B:EE:35:0A:B1', 1)) # BT Address
sockfd.send('ATZ\r')
sockfd.send('AT+CMGF=1\r')
sockfd.send('AT+CMGS="+390111001101"\r') # TO PhoneNumber
sockfd.send('SMS over Bluetooth\n')
sockfd.send(chr(26)) # CTRL+Z
sockfd.close()
@g0053
Copy link
Copy Markdown

g0053 commented Dec 23, 2019

thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment