Code Monkey home page Code Monkey logo

esp8266_spa's Introduction

Based on the great work over at
https://github.com/ccutrer/balboa_worldwide_app/wiki https://github.com/ccutrer/balboa_worldwide_app/blob/master/doc/protocol.md

esp8266_spa

Control for a Balboa spa controller using the esp8266 (tested on BP2100 and BP601 series)

The sketch connects to the tub, gets an ID and spits out the state to the MQTT broker on topics "Spa/#". You can control the tub using the subscribed topics, f.e. "Spa/light" with message "ON" for maximum compatability with openhab.

Maybe you need to adjust the sketch to your tub configuration (number of pumps, connection of blower, nr of lights...). You may find the DEBUG comments useful for this task.

Bonus: you may add several relays or such like I did ;-)

Getting started

  • Make sure your Spa is using a Balboa controller
  • This is known to work on and developed on a BP2100G0 and BP601 series controllers. Yours may be compatible.
  • Get the parts
  • Flash the esp8266 fom the Arduino IDE or PlatformIO
  • Connect everything together
  • Hook up on the Spa
  • Enjoy and get tubbin' ;-)

Parts

  • Get a esp8266, perferable a Wemos D1 Pro in case you need to attach a seperate antenna
  • RS485 bus transceiver, (for example the "ARCELI TTL To RS485 Adapter 485 Serial Port UART Level Converter Module 3.3V 5V")
  • A DC-DC converter for powering from the Tub (LM2596 for example)
  • breadboard, wire etc...

Hardware connections

Example

  • Look up finding the right wires on https://github.com/ccutrer/balboa_worldwide_app/wiki#physical-layer
  • Connect the DC-DC converter to the supply wires (+ and Ground) from the Tub
  • Set the DC-DC converter to output 3.3V. This output voltage (+ Ground) should then connect to the Wemos D1 Mini Pro and the RS485 transceiver
  • Connect the RS485 transceiver to the A and B wires
  • Connect the esp8266-TX to the RS485 TX
  • Connect the esp8266-RX to the RS485 RX

Example

Debug

  • First, check your voltages - the system is running at 3.3V
  • The RX (and to some extent the TX) LEDs of the RS485 transceiver (if using the one above) should light up as data goes through. If that is the case you know data is being converted from RS485 to TTL
  • The Wemos D1 Mini Pro should spit out data to the MQTT broker (MQTT Spy can be useful here to see: 1. that it is connected to the wifi; 2. that it is connected to the broker). If that is the case, you know the device can communicate over MQTT
  • Swap A and B - in my personal experience, if A & B are the wrong way round, the hot tub display (if you have one) will display (NO COMM) as the RS485 traffic get garbled by the esp8266_spa

Appetiser using OpenHab...

Example

HomeAssistant integration

The system uses HomeAssistant autodiscover and should just appear in the MQTT Integration under "Esp Spa" Example

TODO

  • Add more documentation
  • Add fault reporting
  • Add more setting possibilities (filter cycles, preferences maybe)

esp8266_spa's People

Contributors

cribskip avatar emmanuellm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266_spa's Issues

Bench Testing

I find that the biggest problem with getting this project to work is configuring the UART to send and receive data via the RS485 converter. And you always seem to end up fiddling with things, bend double, outside on the ground with the HotTub taken apart.
But RS485 is a half duplex interface - the transmit and receive use the same pins.
So you receive whatever you send. This means you can fool the software into thinking you are connected to the Hottub just by sending the right message.
So I added a little test feature that sends an ID Command packet with ID = 0 every 3 seconds.
If everything is working, the software will respond with an ID ACK message.
This all runs on the bench inside where you have your logic analyser and oscilloscope.
So if you can get the ID ACK working on the bench, when you get in outside in the Hottub, the only thing left that can be wrong, is the RS485 wires might need swapping around.

My test function looks like this:
void spa_emulate() {
Q_out.push(0xFE);
Q_out.push(0xBF);
Q_out.push(0x02);
Q_out.push(0x00);

rs485_send(true);
}

Call it every 3 seconds in the loop function (Don't forget to remove it when you connect to the Hottub)

WEMOS D1 Mini Pro clone - not working

Seems the genuine D1 mini pro is in short supply, so I had to buy a clone!
The problem is the clone uses CH340 for the USB to Serial whereas the original uses the CP2104. It also has no series resistor in the Rx path.
CH340 when the USB is not connected drives the RX pin low. This blocks all serial traffic from the hottub.

The solution I came up with was to use SoftwareSerial on pin 4 & 5, connected to the RS485 converted.
Running Software Serial at 115200 baud is at its limit, but it works with only a few errors every minute. These are normally quickly overwritten by correct data.
Maybe I'll add better data checking so these errors don't get passed to MQTT.

Has anyone else had problems with clones?
Any other the solutions than SoftwareSerial?

Ray

Warning about MT3608 suggestion

In the README, we can find the following information: "A DC-DC converter for powering from the Tub (MT3608 for example)".
However, the MT3608 is a step-up converter, while you will definitely want a step-down converter.
Its step-down counterpart for example is the "LM2596".

Just a little warning for those like me who forgot to look into the difference between step-up and step-down converters.

Problem finding the right pins on the pcb

Hello everybody,

I have a Balboa bp2100g3 board. Unfortunately, I'm not really sure which pins the RS485 transceiver A / B should be connected to. I have a picture of the circuit board, the connector is on the top right. I've found the physical link layer description and I am confused what the meaning is. "It is also recommended to put pin 3 on the return line of the connection device to reduce the common mode voltage." Is It really necessary?

How did you connect your transceiver? A schematic would be helpful.

Many thanks to all the developers of this project.

electronic-board-for-balboa-bp6013g3-box

No MQTT messages

Hello.
Thank you all for the great work on this.
I have some problems with the fork of Emmanuel:
https://github.com/EmmanuelLM/esp8266_spa

I use a Wemos D1 mini Pro
and this config:

#define VERSION "0.32"
#define WIFI_SSID "TP-Link_F526"
#define WIFI_PASSWORD "******"
#define BROKER "192.168.1.170"
#define BROKER_LOGIN "loxberry"
#define BROKER_PASS "********"
#define AUTO_TX true //flag for the RS485/TTL chip - i.e. do we need to pull D1 or not....

So far Wemos is connected to my wifi but i dont receive any spa message on my broker.
I have subscribed to Spa/# topic.

At the moment i don't have the spa connectet to the RS485 TTL transceiver.
But anyway i should get some mqtt messages, no ?

I am powering the wemos and transceiver with 5V output of my DC-DC converter

Here is a photo of the HW:
IMG_20210203_153635
Mirror Image of rear view HW:
IMG_20210203_155654

Wemos keeps resetting

I’ve tried with 2 different wemos d1 mini, but after it connects to WiFi it disconnects again crashes with wdt reset.

what Couple be wrong ?

no connection, no messages

Hello everybody,

I am desperate about this project right now.

My config:

  • BP2100 (Spatech)
  • WEMOS D1 mini pro (including external antenna)
  • ARCELI TTL To RS485 Adapter 485 Serial Port UART Level Converter Module 3.3V 5V
  • LM2596 (set to 3.3V)

What happened until now:

  • Adoption of version 0.34
  • Adaptation to my environment (SSID, PWD, Broker, Brk_Login, Brk_pwd)
  • no connection to the WLAN recognizable

Then change by me:

  • //Serial.println("millis-Hrest ");
  • // hardreset ();

Result:

  • no hard reset
  • MQTT client send a message to MQTT server if connected
    => WLAN probably has enough time to connect and the MQTT server receives a "connection" confirmation
  • that's all

Problem:
It doesn't matter whether I connect the spa or not
(RX flashes when connected), I do not receive any messages via MQTT.
When entering http://my_ip/update I only get the option for OTA update. No login process.
The default website then shows "Not found: / config".

I am happy about any kind of support.

Thanks in advance!

Temp going haywire!

My Spa has been plodding along happily for a week or so, then it seems a confused message led to the temperature thinking it was 70'C where it has persisted...

The MQTT debug output looks like this:

Spa/time/state 07:16
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state OFF
Spa/highrange/state ON
Spa/jet_1/state OFF
Spa/jet_2/state OFF
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON
Spa/target_temp/state 35.00
Spa/time/state 07:17
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state OFF
Spa/highrange/state ON
Spa/jet_1/state OFF
Spa/jet_2/state OFF
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON
Spa/node/msg 7e 05 fe bf 00 ac 7e
Spa/node/msg 7e 08 fe bf 02 23 f1 73 ab 7e
Spa/node/id 35

Spa/target_temp/state 70.00
Spa/time/state 07:18
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state OFF
Spa/highrange/state ON
Spa/jet_1/state OFF
Spa/jet_2/state OFF
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON
Spa/target_temp/state 70.00

Not quite sure what has happened, would welcome any suggestions :-)

David

Lost entities after HA reboot

Hi,
If I restart Home Assistant, all entities set unavailabe. Mqtt is connected, I can see published data via MQTT.explorer. When I restart the spa with circuitbreaker everything will be ok. What is the problem? How can I restart esp via mqtt? Or why can not see HA autodiscovery after reboot? THX

Network dropping

Hi,

I've been using this since some time, but not without issues, after a cold boot it can run for days or even weeks, and suddenly stops working. I can still see it in Unifi -its connected to an AP, I can see that the DHCP server is constantly offering an IP.

Web server not working and no ping response. I've replaced the D1 Mini with another model but issue persisted, any ideas or have anyone else seen anything similar?
Compiled using Arduino 1.8.15 so maybe I should try and update some libraries?

2022-10-26T15:48:02 Informational dhcpd Internet Systems Consortium DHCP Server 1  
2022-10-26T15:47:58 Informational dhcpd DHCPOFFER on 172.16.0.147 to c4:5b:be:54:7f:xx via em0  
2022-10-26T15:47:58 Informational dhcpd DHCPDISCOVER from c4:5b:be:54:7f:xx via em0  
2022-10-26T15:47:54 Informational dhcpd DHCPOFFER on 172.16.0.147 to c4:5b:be:54:7f:xx via em0  
2022-10-26T15:47:54 Informational dhcpd DHCPDISCOVER from c4:5b:be:54:7f:xx via em0  
2022-10-26T15:47:52 Informational dhcpd DHCPOFFER on 172.16.0.147 to c4:5b:be:54:7f:xx via em0

Defective RS485 Module

So, after using the same RS485 module for over 2 years now, it gave up on me.

I'm using something like this, so the simplest possible interface:
image

Artefact has been, the communication to the SPA was impossible.

I've enabled character-level tracing and got something like this to my surprise:

Spa/node/msg 7e 30 66 00 00 b0 00 eb 00 7f 10 8f ff 00 00 80 00 fe 18 64 ff 3f 00 ec 00 18 11 ff 3f 00 00 ff 00 1f fc 
Spa/node/msg 7e 18 66 00 00 40 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 00 
Spa/node/msg 7e 18 66 00 00 40 fe 00 18 11 ff 00 00 ec ff 00 1d fc 8b ff 00 00 a8 00 fe 18 fd 8b ff 00 00 00 ff 00 7e 

Matching with the great docs over at https://github.com/ccutrer/balboa_worldwide_app/blob/main/doc/protocol.md this did not make any sense.

I powered off the SPA over night because of fear of having water in there which may have caused corrosion.

Today, I've dismanteled the SPA and checked everything. Dry as it should be.

The RS485 did not light its power LED so I've checked power supply. Fine but the module showed increased power consumption.

Another module at hand, I've swapped it out and all went good again.

Topic only shows me Spa/node ON

Hi,
I like this project, thanks a lot.
I did all you recommand but when when I include MQTT client, the only command founded is "Spa/Node" with the status ON.
Can you explain me why ? My jeedom (MQTT Server) seems communicate right with the Wemos D1 Mini pro but not with th tub.
I have compiled arduino program wtih the LOLIN (WEMOS) D1 mini Pro, is it right ? I've read, in another MQTT application, that we have to select NodeMCU ... Is there a difference ?

Strange Temperature Readings in HASS

My install seems to be working and I am getting data into HASS. I see a couple issues maybe someone can help me with.

  1. Strange Temp readings. example: Spa says 92 deg F, HASS is showing 46 F. I am sure it has to do with some kind of conversion.
  2. Pump 1...My spa has a 2 speed pump. During low speed HASS shows the pump off and it only shows on when the pump is in high speed.
  3. During HASS reset, it show unavailable. I have to cycle power on the 8266 and then the reading come in.

Hour and minute

Good morning Cribskip

Can you add the possibility of modifying the hour and the minutes in your program.
Thank you so much

Nadlio

URL for webserver and other stuff

Hi there,
I have spent many hours trying to get this to work, and I just can’t work it out. At least not without some more information. So I have a couple of questions.

  1. It indicates in the code that there should be a web server for configuration, is there a URL endpoint? Or is it just the ip address of the d1 mini?

  2. Does the circuit need to be connected to the spa before the webserver will start?

  3. Does the circuit need to be connected to the spa before the MQTT will start?

  4. Is there a web enabled terminal screen for de-bugging?

  5. I am seeing the following message in the terminal when the D1 mini is plugged into usb, where is this getting derived from?
    ets Jan 8 2013,rst cause:4, boot mode:(3,7)
    wdt reset
    load 0x4010f000, len 3460, room 16
    tail 4
    chksum 0xcc
    load 0x3fff20b8, len 40, room 4
    tail 4
    chksum 0xc9
    csum 0xc9
    v0005fc00
    ~ld

  6. Is it possible to get the URL for the web server added to this message to make it easier to find.

i need some help. but not for what you think.

Hi there,
I am reaching out the my fellow Balboa Spa controller owners because I need some help with something. This is not really related to the ESP8266 client. Its more about the controller its self.
A few days ago one of the pumps in my spa took a power spik that fused the motor. This also caused a huge current spike that resulted in an arc at the point where the power goes into the controller.
I’m confident the controller is still able to be repaired, one thing that is great about the Balboa controller is they are almost bullet proof. Mind you I have never tried to shoot it, although I have been tempted.
Anyway, I have a Balboa Revolution controller (BP1600) and I need to either get a copy of a circuit diagram or else just a picture of the board where the neutral power goes into the controller. I have attached a couple of photos of what I am talking about, I need to know if the neutral line or the active line connects to U11, as you can imaging this is a very significant difference.

Thanks in advance, and sorry for the off-topic request, but I have run out of other options.

20211111_161918
20211111_161923

"Nothing to send" not handled correctly?

Hi. Thanks for your project, it's a great starting point!
While comparing code to the specification I noticed that it's not handling "Nothing to send".
According to: https://github.com/ccutrer/balboa_worldwide_app/wiki#nothing-to-send

"Nothing to send" should be sent when "Clear to Send" is received but we have no update.
Right now code will send "Toggle Item Request" instead with byte 0x00 - this does not seem to be correct.

Here is the amended code (send == 0x00):

       if (send == 0xff) {
          // 0xff marks dirty temperature for now
          Q_out.push(id);
          Q_out.push(0xBF);
          Q_out.push(0x20);
          Q_out.push(settemp);
        } else if (send == 0x00){
          // A Nothing to Send message is sent by a client immediately after a Clear to Send message if the client has no messages to send.
          Q_out.push(id);
          Q_out.push(0xBF);
          Q_out.push(0x7);
        } else {
          // Send toggle commands
          Q_out.push(id);
          Q_out.push(0xBF);
          Q_out.push(0x11);
          Q_out.push(send);
          Q_out.push(0x00);
        }

Let me know your thoughts.
Cheers,
Irek

Helping editing code so that I can simply publish data to MQTT

After I finally got it hooked up to my hot tub on Friday, I've been trying to figure out how to understand why the data is all incorrect.
The temperature is really bad, but ultimately, I want to publish the entire read data, all the flags, from the spa to 1 or 2 MQTT messages. What's the easiest way to do this.
I'm guessing, based on reading the information on the wiki, that my hot tub is using differen bits for most things on here. My Jet has 2 speeds, but the jets on here is only 1. My aux controls a jet, but there are 2 controls for jets on here which are different. My thinking is go through, figure out why the data is all off. Once I have the correct data, I can realign the signals and publish it correctly.

I guess where I'm most confused at this point is this line of code: if (bitRead(Q_in[18], 1) == 1).
Why is Q_in[18] byte 13?

It seems like both the developers working on this maybe aren't working on anything on github since Oct 2021. It would be helpful is anybody has some insight on to how to make this work for my specific spa. I know I'm really close, but getting the exact right parameters maybe is the hardest part. I am concerned that the temperature is off by so much though.

Not compiling?

Hi cribskip! I found your repo when googling for an ESP library for Balboa. I've successfully done a few ESP8266 projects before, but I'm no expert. When I try to compile and upload your code to my ESP, it fails to compile with the following messages:

balboa_helper:1:14: error: 'CircularBuffer' was not declared in this scope
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
              ^
balboa_helper:1:36: error: expected primary-expression before ',' token
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                                    ^
balboa_helper:1:43: error: 'data' was not declared in this scope
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                                           ^
balboa_helper:1:47: error: expression list treated as compound expression in initializer [-fpermissive]
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                                               ^
esp8266_Spa:53:16: error: variable or field 'print_msg' declared void
 void print_msg(CircularBuffer<uint8_t, 35> &data) {
                ^
esp8266_Spa:53:16: error: 'CircularBuffer' was not declared in this scope
esp8266_Spa:53:38: error: expected primary-expression before ',' token
 void print_msg(CircularBuffer<uint8_t, 35> &data) {
                                      ^
esp8266_Spa:53:45: error: 'data' was not declared in this scope
 void print_msg(CircularBuffer<uint8_t, 35> &data) {
                                             ^
balboa_helper:1:21: error: 'crc8' declared as an 'inline' variable
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                     ^
balboa_helper:1:21: error: redefinition of 'uint8_t crc8'
balboa_helper:1:9: error: 'uint8_t crc8' previously defined here
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
         ^
balboa_helper:1:21: error: 'CircularBuffer' was not declared in this scope
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                     ^
balboa_helper:1:43: error: expected primary-expression before ',' token
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                                           ^
balboa_helper:1:50: error: 'data' was not declared in this scope
 inline uint8_t crc8(CircularBuffer<uint8_t, 35> &data) {
                                                  ^

It's probably me or my setup, but I would very much appreciate if you could guide me on the way. Using latest Arduino IDE (1.8.13) and already included the required libraries. If I can get it running I would be more than happy to contribute with testing and further development.

Thx.

Problems with compiling sketch

Best cribskip,

I have the following problem when trying to compile the sketch. I have add the circularbuffer
and also the pubsubclient, i have selected the ESP8266 Wemos D1 R1.

The following is the compiler log:

/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>
esp8266_spa.ino: In function 'void loop()':
esp8266_spa:252:16: error: 'ID_ack' was not declared in this scope
ID_ack();
^
esp8266_spa:258:20: error: 'ID_request' was not declared in this scope
ID_request();
^
esp8266_spa:278:20: error: 'rs485_send' was not declared in this scope
rs485_send();
^
exit status 1
'ID_ack' was not declared in this scope
/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>/>

What could be the problem?

Best regards,

Steem

Spa sometimes keeps stopping reacting

After a few days use, the Spa may stop reacting to commands sent by this controller.
Restarting the controller by MQTT command gets it going again.

When the cause is found, I'll close this issue

Status messages. Results inaccurate.

Noticed we are getting incorrect statuses every hour or so. Seems to be a result of the status message being shorter than normal and skewing the data.

Spa/node/msg 7e 20 ff af 13 00 00 ff d 29 00 00 67 67 00 04 00 00 00 00 00 00 00 00 00 66 00 00 00 78 00 00 9e 7e
Spa/target_temp/state 102.00
Spa/time/state 13:41
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state OFF
Spa/highrange/state ON
Spa/jet_1/state OFF
Spa/jet_2/state OFF
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON
Spa/node/msg 7e 20 ff af 13 00 00 ff d 29 00 00 67 67 f0 fe fe fc 01 00 00 66 00 00 00 78 00 00 9e 7e
Spa/target_temp/state 120.00
Spa/time/state 13:41
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state ON
Spa/highrange/state ON
Spa/jet_1/state ON
Spa/jet_2/state ON
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON
Spa/node/msg 7e 20 ff af 13 00 00 ff d 29 00 00 67 67 00 04 00 00 00 00 00 00 00 00 00 66 00 00 00 78 00 00 9e 7e
Spa/target_temp/state 102.00
Spa/time/state 13:41
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state OFF
Spa/highrange/state ON
Spa/jet_1/state OFF
Spa/jet_2/state OFF
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON
Spa/node/msg 7e 20 ff af 13 00 00 ff d 2a 00 00 67 67 00 04 00 00 00 00 00 00 00 00 00 66 00 00 00 78 00 00 52 7e
Spa/target_temp/state 102.00
Spa/time/state 13:42
Spa/heatingmode/state ON
Spa/heat_mode/state heat
Spa/heatstate/state OFF
Spa/highrange/state ON
Spa/jet_1/state OFF
Spa/jet_2/state OFF
Spa/circ/state OFF
Spa/blower/state OFF
Spa/light/state OFF
Spa/relay_1/state OFF
Spa/relay_2/state ON

d1 mini reboot all the time

I put the code via arduino on a d1 mini, everything seems to go well. However, the module restarts every 10 seconds, so it never gets into the air properly. anyone have experience with it?

testing on the bench first

Hi, thanks for your efforts here; this is a great project. I'm not all that familiar with Arduino programming, so forgive me if this question is obvious.
First up, I am going to try and make this project more universal. In that, rather than looking for a specific set of codes, it uses a translation table to convert the codes from the Spa into something universal (maybe Modbus); that way, in theory, at least, it will be possible to use the same type of device with a lot of different systems.
But to do that, I need to be able to reproduce the messages that are being sent from the Spa on my workbench. So I thought I would ask if anybody else has already built something to act as a faux_Balboa controller already, or perhaps can somebody explain what the Balboa Helper is for, because it looks like that it might do that exact thing (except I can't get it to work)
Thanks in advance.

OTA Update And HASS Client

Hi, Thanks heaps for the logic. I had been trying with Micropython to get this going, but I was just unsuccessful at getting it to go. Then just a couple of hour and I got your solution going. It would be great to get this as part of ESPHome, but I think the refresh rate may be too low.

Anyway, I have made a couple of changes to my version of the code to make it work how I wanted, and thought you may appreciate these minor code changes.

Arduino OTA
I see you had a note to get OTA to work (and even had the library included). The logic changes to make this are:

Just incude ArduinoOTA.begin(); in the setup task.
void setup() { ... ArduinoOTA.begin(); ... }

And include the ArduinoOTA.handle at the start of the loop:
void loop() { ArduinoOTA.handle();...

And it will be ready. Once you have done this intial serial download, then you can add the following lines to the platformio.ini file:

upload_protocol = espota
upload_port = spa.local

And through the magic of mDNS it will be able to do a download to it. This is great for debugging while it is connected to the SPA.

HASS Client
I noted that the HASS client was only working for some items. Most markedly the Climate item wasn't working, this is due to the default message length limit of 256B. You may have fixed this by modifying the PubSubClient.h file in your instance (or maybe the climate just hasn't worked for you). To make it work for me, I added the "setBufferSize" comand when the mqtt service is setup.

  mqtt.setServer(BROKER.c_str(), 1883);
  mqtt.setCallback(callback);
  mqtt.setKeepAlive(10);
  mqtt.setSocketTimeout(20);
  mqtt.setBufferSize(1024); // Set buffer size to allow discovery messages to work correctly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.