2

Ive connected an hm10 ble to my raspberry pi 2 GPIO pins (3.3V, GND, Rx and Tx).

I've changed the cmdline.txt to 9600 and the inittab is empty. I downloaded raspbian about 1 week ago.

Im running this python script on the raspberry pi 2 to try and send commands to the ble module. I cant get the module to respond:

#!/usr/bin/env python

import serial

ser = serial.Serial('/dev/serial0',9600,parity=serial.PARITY_NONE,stopbits=serial.STOPBITS_ONE,bytesize=serial.EIGHTBITS,timeout=None)

while True:
        ser.write("AT")
        data = ser.read()
        ser.write(data)

I just get an empty prompt and no response in terminal. What am I missing?

1

Got it working. Ended up posting the answer on my original raspberry.org forum post here: https://www.raspberrypi.org/forums/viewtopic.php?f=91&t=158856&p=1032763#p1032763

Basically I had to change AT+IMME = 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.