jshank / bwalink

Automate your Balboa Spa! A docker container with socat and ccutrer/balboa_worldwide_app that supports a remote serial to IP device or host running ser2net, socat or ESPEasy serial server
30 stars 6 forks source link

Issues with my setup (Me issues I'm sure) #12

Closed mobiusmat closed 1 year ago

mobiusmat commented 1 year ago

Ok - I've created the addon folder bwalink and put the four files and the translations file and folder.

I now see the addon and installed it. I've also added mosquito MQTT and MQTT and thats looking good although my knowledge on MQTT at this point is zip but MQTT seemed to find the Mosqito broker.

I installed my EQ10 device and that is getting power and I've connected it to my Wifi and I can hit the browser page on my Lan and I've configured the settings as per your instructions.

When I start the addon it starts and then shuts down - Here is the log below - Where do I start - Do I need to test the RS485 is working and what's the best way to test that?? My wife is dying to have this going so WAF is high on this one ;)

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [15:50:39] INFO: Starting BWALink addon... [15:50:39] INFO: Setting addon timezone to Pacific/Auckland based on the system timezone. [15:50:40] INFO: Starting mqtt bridge connecting tcp://192.168.69.42:8899/ to mqtt://core-mosquitto:1883 I, to spa: # D, wrote: 7e 05 0a bf 04 77 7e /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/message.rb:78:in parse': Unrecognized data length (28) for message BWA::Messages::Status (BWA::InvalidMessage) from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/client.rb:65:inblock in poll' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/client.rb:64:in loop' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/lib/bwa/client.rb:64:inpoll' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:33:in block in initialize' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:32:inloop' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:32:in initialize' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:421:innew' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.4/exe/bwa_mqtt_bridge:421:in <top (required)>' from /usr/bin/bwa_mqtt_bridge:25:inload' from /usr/bin/bwa_mqtt_bridge:25:in `

' D, discarding invalid data prior to message bf 06 5c 7e D, discarding invalid data prior to message 7e 05 00 bf 07 5b 7e D, read: 7e 1c ff af 13 00 00 ff 12 04 00 00 01 03 01 0c 00 00 02 00 00 00 00 00 00 4c 00 00 25 7e s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

mobiusmat commented 1 year ago

So going over this am I reading it right that BWALink is talking to the Serial Wifi Adaptor and hence the Balboa controller on RS485 but it isn't getting the data blocks it expects??

mobiusmat commented 1 year ago

Wow - I've been banging my head on a wall for at least an hour a day in free time trying to resolve this. Turns out I'm a moron who can't read (Or I got poor search results). Turns out I ended up with an EW10 (Which I didn't notice as I wrote that) and EW10 is the RS232 version - Not the EW11 which is RS485 so now my EW11 is on its way - At least I have the connectors already and all the wiring is done. That explains why I seem to be getting real data but its not being recognised correctly - I was reading blocks that had the correct date and time - I guess I need to learn the difference between RS232 and RS485 to better understand what was happening. Not sure if I blame tiredness when ordering or bad search results on Aliexpress (Happens a bit) but either way I should have figured it out by now.

jshank commented 1 year ago

Thanks for reporting back. I was looking at those responses and they didn't make any sense (which now makes sense!). Let us know how it goes once you have the RS485 version.

mobiusmat commented 1 year ago

Yeah it was the 7C's where I'd expect 7E's that had me thinking it might be a speed / flow control issue or something which made me suddenly realise my assumption that the EW10 vs EW11 probably isn't just a version issue. I'm both really annoyed and elated that based on everything else I've been checking and playing with it should just instantly work when the EW11 turns up and the wiring etc is all already there. Just trying to think of something I can use the EW10 for but can't think of anything I've used RS232 with for such a long time.

supersebbo commented 1 year ago

Glad you found the issue! I missed the importance of the EW10 vs 11 in your original post too, I was going to suggest the data polarity was reversed.

Quite a lot of A/V equipment like TVs and projectors still have RS233 control, you might find something to do with it there!

blundell commented 12 months ago

F**K I also have an EW10 sitting in my hottub and have spent hours (probably days) installing and reinstalling trying to get it working!

Thanks for working this out 😆 😭

mobiusmat commented 12 months ago

My ew11 is in the country with customs and my expectation is plug it in and it’ll work immediately so I’ll let you know how it goes when it arrives. It’s a weird mix of elation and frustration when you realise aye.

blundell commented 12 months ago

I jumped on Amazon 🙊 and getting it tomorrow with prime, this has been going on to long - I need a win! 😆

The ironic thing was, the error was staring me in the face all this time. Had the elfin device tab open and kept checking it!

image

🤣

mobiusmat commented 12 months ago

Let me know how it goes if you get yours first. It’s been killing me.

blundell commented 11 months ago

@mobiusmat arrived yesterday, plugged in this morning. Like you said simple disconnect and reconnect of the ethernet cable 👍 then just give it the same static ip as the old one on my router and its working 🎉 .

image
mobiusmat commented 11 months ago

Nice - Mine turned up this morning and initially is giving me the same error about 28 byte status length. I've only had it connected for 5 minutes so I'll be back.

mobiusmat commented 11 months ago

So I was still getting the message length error - Changing the line

MESSAGE_LENGTH = (24..32).freeze to MESSAGE_LENGTH = (22..32).freeze

Makes it continue past this point and then I get a bit of "discarding invalid data before...." even though when I did a raw dump to a log with Putty I seemed to be getting lots of data starting and stopping with 7E where when I was on the EW10 and obviously getting interference and bad data I was getting lots of bad data packets.

I once got

I, to spa: # D, wrote: 7e 05 0a bf 04 77 7e /usr/lib/ruby/gems/3.2.0/gems/mqtt-ccutrer-1.0.3/lib/mqtt/client.rb:494:in initialize': getaddrinfo: Name has no usable address (SocketError) from /usr/lib/ruby/gems/3.2.0/gems/mqtt-ccutrer-1.0.3/lib/mqtt/client.rb:494:innew' from /usr/lib/ruby/gems/3.2.0/gems/mqtt-ccutrer-1.0.3/lib/mqtt/client.rb:494:in connect_internal' from /usr/lib/ruby/gems/3.2.0/gems/mqtt-ccutrer-1.0.3/lib/mqtt/client.rb:250:inconnect' from /usr/lib/ruby/gems/3.2.0/gems/homie-mqtt-1.6.3/lib/mqtt/homie/device.rb:36:in initialize' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:28:innew' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:28:in initialize' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:421:innew' from /usr/lib/ruby/gems/3.2.0/gems/balboa_worldwide_app-2.1.5/exe/bwa_mqtt_bridge:421:in <top (required)>' from /usr/bin/bwa_mqtt_bridge:25:inload' from /usr/bin/bwa_mqtt_bridge:25:in `

' s6-rc: info: service legacy-services: stopping

This is killing me - Would it be that I need the Y splitter so this is on an existing channel talking as if its the existing Panel rather than on its own spare panel header where it needs to configure itself as an extra panel??

mobiusmat commented 11 months ago

apologies - I removed and re-added to make sure there weren't any prior edits I'd made to messages.rb or anything and that set logging back to warning only. I set it to debug - Turned the spa on and off for good meassure and this is the latest log.

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started [13:26:39] INFO: Starting BWALink addon... [13:26:40] INFO: Setting addon timezone to Pacific/Auckland based on the system timezone. [13:26:40] INFO: Starting mqtt bridge connecting tcp://192.168.69.66:8899/ to mqtt://core-mosquitto:1883 I, to spa: # D, wrote: 7e 05 0a bf 04 77 7e D, discarding invalid data prior to message 00 00 a8 7e D, read: 7e 0d 0a bf 23 14 00 04 00 88 00 04 00 51 7e I, from spa: #<BWA::Messages::FilterCycles cycle1 4:00@20:00 cycle2(enabled) 4:00@08:00> D, read: 7e 1a 0a bf 24 64 d7 05 00 53 49 42 50 32 50 20 20 01 c9 13 ff cb 02 0a 02 00 a0 7e I, from spa: # D, read: 7e 0d 0a bf 23 14 00 04 00 88 00 04 00 51 7e I, from spa: #<BWA::Messages::FilterCycles cycle1 4:00@20:00 cycle2(enabled) 4:00@08:00> D, read: 7e 0d 0a bf 23 14 00 04 00 88 00 04 00 51 7e I, from spa: #<BWA::Messages::FilterCycles cycle1 4:00@20:00 cycle2(enabled) 4:00@08:00> D, read: 7e 1a 0a bf 24 64 d7 05 00 53 49 42 50 32 50 20 20 01 c9 13 ff cb 02 0a 02 00 a0 7e I, from spa: #

I refresh and get a few:

D, discarding invalid data prior to message ff D, discarding invalid data prior to message 7e 05 10 bf f7 D, discarding invalid data prior to message 7e 05 10 bf 07 5b fe D, discarding invalid data prior to message e5 ff D, discarding invalid data prior to message fe D, discarding invalid data prior to message 71 f9 ff D, discarding invalid data prior to message 7e 1c ff fc 05 10 bf 07 5b 7e 00 01 03 01 1c 00 00 02 00 00 00 00 00 00 50 00 00 a8 7e

So the log above indicates it is talking to the spa to some extent as its getting the filter cycle times and control configuration. Do I still have issues between the Balboa Worldwide app and the spa or is my issue with MQTT??

I have installed the Add in Mosquitto Broker - Do I have an issue there?

blundell commented 11 months ago

I thought mine was working because it added the device on MQTT but then I've looked at it and there's nothing I can do with the controls, no data, or anything I can do in the device. It looks like this:

image

Sorry, don't want to derail your thread 😅 but how do I turn the logging to debug, so I can see information like you are sharing?

mobiusmat commented 11 months ago

In the addons under settings where you start, stop and configure the addon there is a log tab and in config you set the log level to debug to get additional logging. What Balboa controller do you have and what software level. Mines a Balboa Collosus running M100_215, you get the version from the spa keypad controller in settings, info.

mobiusmat commented 11 months ago

Ok - I'm really wracking my brain trying to work out whats wrong. I've run a logging telnet session for a few seconds to the EW11 and then opened it as hex - Copied and pasted and run a search and replace to replace double 7E with 7E carriage return 7E and I get a perfect log of 1676 lines with every line starting and ending in 7E so I think I've ruled out corruption in data - I was starting to wonder if I needed some shielded cable but its a short cable length of around 40cm and my wifi strength is very strong.

So that leaves the issue that my status lines are of varying lengths shown below some getting exceedingly long with lots of 20's (Spaces?????).

:EDIT: These aren't status - I hadn't gone back to the Wiki on decoding as 13 is status and I didn't get this once this time - so 1C is length at 28 and that isn't 28 so maybe all the 20's are corruption or is that Telnet?? What should I use to make sure I'm getting true raw logging as Putty sends PUTTY responses all the time??

7E 1C 4D 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 01 03 20 20 20 20 20 1C 02 4C 87 7E

7E 1C 4D 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 01 03 20 20 20 20 20 1C 02 4C 87 7E

7E 1C 4D 0D 0A 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 01 03 20 20 20 20 1C 02 4C 87 7E

7E 1C 4D 0D 0A 20 20 20 20 20 20 20 20 20 20 14 01 03 20 20 20 1C 02 4C AB 7E

My board in the controller is a SIBP2P part number 56205 part of a Colossus unit with a TP800 interface (Colossus usually came bundled with a TP600). I have the EW11 running off one of the additional "Main" controller ports on the board - It has 3 labelled J34 J35 & J36 and I've tried it in 35 and 36 - Do I need the Y Cable so I'm not being an additional controller but instead I'm pretending to be the existing TP800 button panel?? The SSID / Software ID reported by the Information menu on the TP800 is M100_215 V5. I see lots of talk of M100_220 and 221 going up to Version 36. My controller says it supports the Balboa Wifi module but maybe this early version talks slightly differently and the Balboa unit understands it but thats not whats been decoded??? I'm going to try doing some logging while my wife pushed buttons and changes Temp and turns pumps on and off.

The biggest oddity for me is the need to change the MESSAGE_LENGTH = (24..32).freeze to MESSAGE_LENGTH = (22..32).freeze to get anything other than the addon stopping immediately with an invalid message length. Having seen the huge status message lengths I'm getting I might try it on 22..64 and see what happens??

As in a post above I do sometimes get messages indicating the BWA Gem has spoken to my spa and shows the Filter Cycles but that's the most I ever get??

mobiusmat commented 11 months ago

Here is the Raw log file done with Telnet with logging to see if anyone can see whats wrong. I might turn the spa of and on and no hit anything so its running without pump or Ozone to see if there is no electrical interference and if I get different results.

Log Converted to head and Delimited.txt

mobiusmat commented 11 months ago

Ok - this time with no pumps going at all - Still not getting a lot of joy but all the hex 20 (Space) are gone. Maybe I need to be better shielded before I go further as this looks better. I've just cut one end of the ATX mini lead and stripped the end and put them directly into the screw terminals on the connector with the EW11 - I didn't end up using the Silicone wires at all and I don't see they'd be better insulated but maybe that is half my problem. PS- I see 20 can be set temperature requests but it talks about length 6 where I'm getting more 20's than that in the blocks?? I'm really trying to understand what I'm getting here but I'm missing something.

Log Fixed without Pumps on.txt

I'm seeing lots of length 1C (28) which then is not 28 - In fact it seems to be 8 (not including 1E delimeters) - Not sure what the hell is going on based on my interpretation.

blundell commented 11 months ago

What Balboa controller do you have and what software level. Mines a Balboa Collosus running M100_215, you get the version from the spa keypad controller in settings, info.

fwiw:

Control: Balboa TP600 Panel: v3 Balboa Spa Command. Model: BW6013X1 Software level: M100_226

mobiusmat commented 11 months ago

Yours is a fair bit newer than mine. I’m starting to question what the hell mine is doing. None of what I’m getting out of it makes much sense. I’m going to look into whether the firmware can be updated but I don’t think it’s really serviceable.