Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
bluetooth-serial [2017/01/25 18:35]
arthur
bluetooth-serial [2017/01/25 18:54] (current)
arthur
Line 42: Line 42:
 === Arduino sketch: to program the HC-05 === Arduino sketch: to program the HC-05
  
-[[code]]+<code>
  
 // SERIAL LOOP SKETCH FOR COMMUNICATING WITH A BLUETOOTH SPP MODULE // SERIAL LOOP SKETCH FOR COMMUNICATING WITH A BLUETOOTH SPP MODULE
Line 75: Line 75:
   }   }
 } }
-[[/code]]+</code>
  
 === Configure the Bluetooth Module === Configure the Bluetooth Module
Line 104: Line 104:
 You can also change the pairing key if you want, either for easier access or for privacy – my Macbook defaults to 0000, but the HC-05 defaults to 1234. To make it publicly accessible, give it a pin of 0000: AT+PSWD=0000 - to make it secure, pick any 4-digits that you will remember. You can also change the pairing key if you want, either for easier access or for privacy – my Macbook defaults to 0000, but the HC-05 defaults to 1234. To make it publicly accessible, give it a pin of 0000: AT+PSWD=0000 - to make it secure, pick any 4-digits that you will remember.
  
-[[code]]+<code>
 AT+ORGL (Restore the factory default state) AT+ORGL (Restore the factory default state)
 AT+UART=115200,​0,​0 (Set transmission rate to 115,200 bps, one stop bit and no parity bit) AT+UART=115200,​0,​0 (Set transmission rate to 115,200 bps, one stop bit and no parity bit)
 AT+NAME=Smoothie AT+NAME=Smoothie
 AT+PSWD=0000 AT+PSWD=0000
-[[/code]]+</code>
  
 There are other parameters in the AT command set, but none of them are relevant to getting the HC-05 working on the SmoothieBoard. There are other parameters in the AT command set, but none of them are relevant to getting the HC-05 working on the SmoothieBoard.
Line 129: Line 129:
 In my experience, going over 230400 doesn'​t really give you anything except the likelihood of more errors. Stick with 115,200 or 230,400 as UART speeds - this is set in the config file: In my experience, going over 230400 doesn'​t really give you anything except the likelihood of more errors. Stick with 115,200 or 230,400 as UART speeds - this is set in the config file:
  
-[[code]]+<code>
 # Serial communications configuration ( transmission rate default to 9600 if undefined )  ​ # Serial communications configuration ( transmission rate default to 9600 if undefined )  ​
 uart0.baud_rate ​ 115200 ​  # Baud rate for the default hardware serial port uart0.baud_rate ​ 115200 ​  # Baud rate for the default hardware serial port
-[[/code]]+</code>
  
 It may be that you are able to perform the Bluetooth AT command setting using the SmoothieBoard itself, but I haven'​t investigated that method. If you have a spare FTDI USB-to-UART module, you can connect that directly to the Bluetooth module and program it using a terminal app. It may be that you are able to perform the Bluetooth AT command setting using the SmoothieBoard itself, but I haven'​t investigated that method. If you have a spare FTDI USB-to-UART module, you can connect that directly to the Bluetooth module and program it using a terminal app.