I've assembled a custom PCB that, among other things, features an ATTiny84A and an HC-06 Bluetooth module. Its a super simple board. The purpose of this board is to let me control my car's pop-up headlights via Bluetooth using my phone.
The code is available for reference here, on pastebin. You'll note that the handleSerial() function includes multiple Serial.print() commands. You'll also note that I'm using Arduino-ATtiny-Core by sleemanj on Github. I'm uisng the ATTiny84A's built-in 8MHz oscillator.
When I want to connect my desktop PC to the HC-06 module via Bluetooth at my desk, I can follow a guide like this one, and the device works properly. When I submit a command, the command text is returned to me by my Serial.println() line near the top of handleSerial(). When I submit a 's' command, the state string is returned to my terminal. When I submit gibberish, I get my "bad request" line. The else if block is working properly. Everything seems fine. Here's the output from a picocom session:
ads103@dragonpc:~$ picocom -b 9600 /dev/rfcomm0
picocom v2023-04
port is : /dev/rfcomm0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
stopbits are : 1
txdelay is : 0 ns
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
hangup is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv -E
imap is :
omap is :
emap is : crcrlf,delbs,
logfile is : none
initstring : none
exit_after is : not set
exit is : no
Type [C-a] [C-h] to see available commands
Terminal ready
help
tgla
tglb
tglt: does both
up: both up
down: both down
wink: pre-programmed full wink routine
s: current state
s
State: {sidea: 0}, {sideb: 0}
sgla
bad request
tgla
s
State: {sidea: 1}, {sideb: 0}
tglb
s
State: {sidea: 1}, {sideb: 1}
tgla
s
State: {sidea: 0}, {sideb: 1}
tglb
s
State: {sidea: 0}, {sideb: 0}
wink
When I want to connect my phone to the HC-06 module via Bluetooth, I use Ardutooth, available here. The connection succeeds. I can submit commands, and my multimeter can see switching happening. But no text is being returned to the phone. The phone is essentially flying blind. Here's a screenshot taken from the phone. This is the exact same board that the PC was connected to a moment ago.
Why would text be returned to my PC, but not my phone?