How to switch the RN4871 / RN4870 Bluetoothmodul into command mode? - bluetooth

I try to switch the RN4871 modul into command mode. My actual code ist something like:
printf("$");
delay_100ms();
printf("$$\n");
I know will expect something like "CMD>" but unfortunately I didn't get an answer from the bluetooth modul. Baudrate is correct. Any further ideas?

for me its "$$$" without carriage return
but I not sure that there is a firmware in RN4871 ?
Are you able to discover it with a PC or a smartphone ?
Regards

Related

Issues using setappvolume with nircmd

I am using nircmd for a personal group project. I am trying to use the setappvolume command to send specific program/process sounds to a sound device other than the default sound device.
This is the format of the command:
setappvolume [Process] [volume level] {Device Name/Index}
I have tried this:
setappvolume Spotify.exe 1 "Speakers"
This command doesn't work. However, when I drop the optional command, the function does work:
setappvolume Spotify.exe .5
The same issue applies to the changeappvolume command. Every other listed command that I've tried works. Does anyone know what I'm doing wrong? Or if there is an alternative way to accomplish this, please let me know (Windows or Linux, but preferably Windows).

EVIOCGRAB newline from terminal

I am grabbing the keyboard using ioctl(fd,EVIOCGRAB,(void*)1), but the terminal keeps sending the shell newlines from executing the program. The same problem as in this question.
Is there a way to solve this without calling sleep() before ioctl?
The solution I came up with was to read from the keyboard device once before calling ioctl(fd,EVIOCGRAB,(void*)1).
Please let me know if there is a better way.

How to make Sound Alert in Lua?

I want to write a function
whenever I call it must be make a sound alert
is it possible in Lua ?
This should be your solution:
os.execute("echo \7")
or
os.execute("echo \a")
This creates a short beep (using the speaker, not the beeper).
** Tested on Windows. But should work in UNIX also.

Can't send AT commands to Bluetooth module with UART interface

I want to change the pairing code of a device. It's a chinese clone of a MiniELM327 adapter with a Bluetooth interface. If I power it up through its OBD2 connector supplying 12V, the whole device is on. Through the Bluetooth Serial Port I can communicate with the ELM327 chip and send AT Commands, receiving correct answers.
But that is not what I want to do. I want to change the pairing code of the bluetooth interface itself.
The module is a RG-BT10-10 from Redgoo based on a Beken BK3211 chip. I have the datasheet and the command set (not sure if it's the right one). Unfortunately it is all in chinese and the customer support is in chinese too (they use automatic translators).
www . redgoo.com.cn/product/20131106105822750.pdf
www . redgoo.com.cn/product/20131130122844243.pdf
www . belon.cn/Uploadfiles/psd/BK3211datasheetv1.2.pdf
I tried to contact the manufacturer and they said that I have to send the following commands:
AT+EN1 (enter command mode)
AT+PIN****
AT+EN0 (exit command mode)
and then reset the module.
I bought a ftdi-based USB-to-UART converter at denkovi.com
www . denkovi.com/usb-to-uart-ftdi-serial-interface-adaptor
Then I wired the pins on the USB-to-UART with the corresponding contacts on the RG-BT10-10 (Tx and Rx are switched of course).
According to the datasheets, the parameters are:
Baud Rate: 38400
Parity: None
Data bits: 8
Stop bit: 1
And the AT commands should be terminated with \r\n that is CR+LF if I'm not mistaken.
No information on flow control. The RTS pin on the board is not even soldered, meaning that it's not used during device normal operation.
From here on, I'm lost. I tried with several programs (Hyperterminal, Putty, Tera Term etc.) to send the AT command which should yield an "OK" but no response has ever arrived.
To be clear, if I fiddle with the wires (like grounding and releasing RTS or turning the RG-BT10-10 on and off) I sometimes get some chars so the flow of data from the module to the computer physically works.
Is there some basic theory I'm missing? I can't get enough information from the manufacturer (language barriers...). And I believe that I have all the hardware that I need, so I just have to understand how to set it correctly :)
Thank you very much for your help!
I had exactly your problem. No response to AT from PuTTY or HyperTerminal at 9600 Baud (which is correct/default for the SPP-CA).
All I would see is:
+READY
+PAIRABLE
when powering up.
I then tried the Serial Monitor that comes with the Arduino IDE, www .arduino.cc/download_handler.php?f=/arduino-1.6.7-windows.exe. Changed line endings to "Both NL & CR" and at 9600 Baud, it came to life:
AT
OK
AT+VERSION
+VERSION=+BOLUTEK Firmware V2.2, Bluetooth V2.1
I hope this helps someone.
You can also use Putty to send
Ctrl+M : Carriage Return(“\r”)
Ctrl+J : Line Feed(“\n”)
This worked for me in getting a response:
AT [CTRL-J]
OK

How can I determine touch screen device in a bash script?

I am trying out the eGalax touch screen driver for my touch screen, as an alternative to the evdev/xinput_calibrator combination.
The calibration tool that comes with the eGalax driver, TKCal, takes the device to which the touch screen is connected as a command line argument.
Now I would like to start the calibration tool from a bash script. Is there some smart way to determine the device within the script, instead of hard coding "/dev/hidraw0" as in this example:
TKCal /dev/hidraw0 Cal
I presume that I can't rely on the touch screen landing on hidraw0 every time, can I? If I run my software on a different system, with a mouse and a keyboard and touch screen, I guess I have to handle that the devices can be conneted to different hdrawX devices. Please correct me if I am wrong.
Thank you very much!
/Fredrik Israelsson
Try looking at /sys/class/hidraw/hidraw*/device/uevent.
The guys developing the eGalax drive told be to try a much simpler solution:
Write a udev rule that will map the touch screen to a device name of my choice.

Resources