RN-42 HID模式切换咨询:从键盘模式转为鼠标模式
Hey there! I’ve tackled this exact problem with RN-42 Bluetooth modules before—getting stuck in HID keyboard mode and losing access to the serial terminal feels frustrating, but there’s a straightforward way to get back into command mode and switch to mouse mode. Here’s what you need to do:
Step 1: Trigger Command Mode
Even when the RN-42 is in HID mode, you can still enter command mode by sending three consecutive +++ (plus signs) over the serial connection. A few key notes here:
- Send the
+++without any leading/trailing characters or delays—type them as quickly as possible in your serial terminal. - Make sure your serial tool is set to the RN-42’s default parameters: 9600 baud, 8 data bits, no parity, 1 stop bit (8N1), no flow control.
- Try sending this right after powering on the module, or after disconnecting any paired Bluetooth device (to avoid HID traffic interfering).
Step 2: Verify Command Mode
Once you send +++, the module should respond with CMD in the terminal. This confirms you’re in command mode and can send configuration commands.
Step 3: Switch to HID Mouse Mode
Send the command to set the HID profile to mouse:
SH,2
SHstands for "Set HID Profile"2is the code for mouse mode (1 is keyboard, 3 is consumer control, etc.)
The module will reply with AOK if the command is accepted.
Step 4: Save the Setting (Critical!)
To make the change permanent (so it persists after reboot), send the save command:
WR
You’ll get another AOK response, and the module will restart automatically. After reboot, it will now operate as an HID mouse.
Troubleshooting Tips
- If
+++doesn’t triggerCMD, try power-cycling the module and sending the sequence immediately after power-up—this avoids any ongoing HID data that might block the command. - Double-check your wiring: Arduino Micro’s TX pin should connect to RN-42’s RX pin, and Arduino’s RX to RN-42’s TX (crossed wiring is essential for serial communication).
- If you previously changed the RN-42’s baud rate, adjust your serial tool to match that rate instead of the default 9600.
内容的提问来源于stack exchange,提问作者nachomcapella

