Novedad: el cortafuegos de IA supervisa toda la plataforma y explica cada incidente con palabras sencillas. Vea cómo funciona

HC-05 vs HC-06 vs HM-10 for an Uno that has to reach a Pi gateway six metres away

HC-05 vs HC-06 vs HM-10 for an Uno that has to reach a Pi gateway six metres away

Resuelto 7 6

Backend developer doing my first hardware project, so forgive the confusion.

An Uno sits next to our heat pump and reads two DS18B20 probes (flow and return). A Pi 4 in the hall cupboard six metres away already sends other stuff to Hermetry and I want it to forward the heat pump temps too. A cable isn’t an option (rented flat, no drilling).

I bought an HC-06 and an HM-10 on a whim because they were cheap. The HC-06 pairs with the Pi in bluetoothctl. The HM-10 doesn’t show up in the pairing list at all, even though its LED blinks. Every guide uses different words (master, slave, SPP, BLE, GATT) and I can’t tell which module I should be building around, or whether the 5V Uno is going to fry any of them.

The Uno currently prints the temps on USB serial every 10 s, like flow=41.25 return=36.75, so whatever module I end up with only has to carry that one line. I would rather not end up with a third module in the drawer.

♥ 1

Following, I have exactly the same confusion.

♥ 0

HC-05 is master, HC-06 is slave, that’s all I know so far

Ask me about 4–20 mA.
♥ 0

The HM-10 is BLE (CC2541 chip). It won’t pair like a classic device, you connect to it and read a GATT characteristic. That’s why bluetoothctl’s pairing list ignores it.

♥ 0

I have a drawer full of these, so here’s how they differ in practice.

HC-05: classic Bluetooth with the serial port profile, can be master or slave, configured with AT commands at 38400 when you hold the KEY/EN pin high at power-up. HC-06: classic SPP too, slave only, fewer AT commands, default 9600. HM-10: Bluetooth Low Energy, the «serial» data goes through characteristic FFE1. Lower power, but the Pi side has to speak BLE.

All three have 3.3 V logic on RX. Their breakout boards take 5 V on VCC, but put a divider on the Uno’s TX line (1k from the Uno, 2k to ground) before it goes into the module’s RX.

For your case the HC-06 is the least work. On the Pi:

sudo rfcomm bind 0 98:D3:31:F5:A2:10 1     # HC-06 address, channel 1
# /dev/rfcomm0 now behaves like a serial port
python3 -c "import serial; s=serial.Serial('/dev/rfcomm0', 9600); print(s.readline())"

Uno side, one line per reading so the Pi can split it easily:

Serial.print("flow_c="); Serial.print(tFlow, 2);
Serial.print(";return_c="); Serial.println(tReturn, 2);

If the Pi is already your gateway to Hermetry, report the heat pump as its own child device on v1/gw/telemetry rather than adding the keys to the Pi itself, then it gets its own page and alarms.

Timestamps in UTC or it didn't happen.
Solución aceptada♥ 4

Went HC-06. rfcomm0 works but I get garbage like «fx9cw_c=xe2…» instead of the line.

♥ 2

HC-06 default is 9600. Is your sketch on 115200?

If it isn't logged, it didn't happen.
♥ 0

…it was on 115200. Changed the sketch to 9600 and the lines are clean. The heat pump shows up as its own child device now, flow 41.3, return 36.8. Thanks all, Lewis especially for the divider warning, I was about to wire it straight.

♥ 0
Viendo 8 entradas – de la 1 a la 8 (de un total de 8)
  • Debes estar registrado para responder a este debate.

Únete a la conversación

Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

Compartir