tagyoureit / nodejs-poolController

An application to control pool equipment from various manufacturers.
GNU Affero General Public License v3.0
325 stars 95 forks source link

Changing IntelliFlow pump RPM results in outbound message error. #272

Closed brentratliff closed 3 years ago

brentratliff commented 3 years ago

Changing IntelliFlow pump RPM results in outbound message error.

Changing the pump speed results in:

Message aborted after 3 attempt(s): 165,1,16,33,155,47,1,128,0,0,0,6,10,1,11,0,0,0,0,0,0,0,0,0,0,0,0,3,190,134,0,0,0,0,0,0,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,109

Stack Trace:

ApiError: Message aborted after 3 attempt(s): 165,1,16,33,155,47,1,128,0,0,0,6,10,1,11,0,0,0,0,0,0,0,0,0,0,0,0,3,190,134,0,0,0,0,0,0,232,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,109 at SendRecieveBuffer.writeMessage (/home/pi/nodejs-poolController/controller/comms/Comms.ts:421:27) at SendRecieveBuffer.processWaitPacket (/home/pi/nodejs-poolController/controller/comms/Comms.ts:371:29) at SendRecieveBuffer.processOutbound (/home/pi/nodejs-poolController/controller/comms/Comms.ts:379:30) at SendRecieveBuffer.processPackets (/home/pi/nodejs-poolController/controller/comms/Comms.ts:362:21) at Timeout. (/home/pi/nodejs-poolController/controller/comms/Comms.ts:393:59) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7)

Pool Equipment

I can still change the pump speed in ScreenLogic. It appears to be changing the pump speed via PoolController as well. I changed it with PC, then verified it via SL. Yesterday, however, it was reporting the incorrect speed and wattage. Today it is reporting the same as SL.

rstrouse commented 3 years ago

Are you changing the rpm via dashPanel, webClient, or through one of the interfaces. Also, are one of the circuits a Solar circuit on the pump? I know strange question.

brentratliff commented 3 years ago

Via dashPanel. I'm not sure which circuit the pump was installed on. I did not program it. It looks like it may be Aux 6. I don't know how to tell if it is a solar circuit. I'm having an IntelliChem installed in a couple weeks and I'll ask the installer.

brentratliff commented 3 years ago

Now my circuits will randomly disappear. I delted the data directory and config.js and reran. Everything worked for a bit and then I start getting:

[3/4/2021, 6:38:55 PM] error: Cannot read property 'circuits' of undefined

And I lose my pump, heater, and IntelliChem.

brentratliff commented 3 years ago

Looks like I'm getting the same errors in SL. I think the wireless protocol adapter is failing. I'm having it replaced tomorrow.

brentratliff commented 3 years ago

So after further troubleshooting, it appears that when PC is running, ScreenLogic no longer works for turning on circuits. As soon as I power down the Pi, ScreenLogic starts working again. The Pi is tied into the bus at the protocol adapter.

tagyoureit commented 3 years ago

There is something off with that packet. Will try to look at it soon but I’ve been completely slammed recently.

brentratliff commented 3 years ago

Thanks, no hurry, SL is working for now and I can control it through HomeKit. I just like the UI and architecture of PC better and will eventually broadcast MQTT to HomeSeer with it. Great project.

brentratliff commented 3 years ago

More info, the Intellichem packets seem to be crossed. When I changed the alkalinity, the tank levels of both decrease. When I try to change the level of the tanks, I get a stack trace error. I'm on 6.5.2 of Next.

rstrouse commented 3 years ago

I don't have IntelliChem so it would be good to get the stack trace error. It sounds like the alkalinity and tank levels are not correct for EasyTouch. These attributes work correctly on IntelliCenter so I need some more information. It would be good if you could capture changing these values from EasyTouch with a replay -- without the Capture Configuration Reload checkbox checked. I only want to see the messages that are sent when you change the data from EasyTouch.

brentratliff commented 3 years ago

I don't control the IntelliChem through EasyTouch, it has it's own UI, but it's tied into the RS485 bus at the EasyTouch panel. There may be a way for EasyTouch to communicate with it though. I will look into it. I can control it at its UI or through ScreenLogic.

brentratliff commented 3 years ago

Ok, I can control the tank levels and PH, ORP setpoints from the EasyTouch. The Saturation Index is available on EasyTouch as well. What's interesting is that running PC disables the ability for ScreenLogic to control certain aspects of the EasyTouch such as Intellibrite and external relays (outdoor lights). As soon as I power it down, ScreenLogic works again. This was happening before I installed the IntelliChem.

brentratliff commented 3 years ago

I uninstalled 6.5.2 and rebuilt with a git pull next. PC now seems to play nice with ScreenLogic, but the IntelliChem issue still exists. I will do a packet capture controlling through EasyTouch.

brentratliff commented 3 years ago

replay.zip

This is a capture of changing the IntelliChem tank levels and Alkalinity through the Easytouch settings menu.

brentratliff commented 3 years ago

On a reboot of the Pi, everything reads correctly in PC including IntelliChem. I can toggle lights, pumps, cleaner, blower. As soon as I try to change pump speed or IntelliChem settings, I get the Stack Trace errors and ScreenLogic stops working.

rstrouse commented 3 years ago

Thanks for the output. I need to understand what the settings were that you were setting to: So were you setting the following: Cyanuric Acid = 44 Total Alkalinity = 20 Calcium Hardness = 250

Or did you set the TA to 160

brentratliff commented 3 years ago

I set the TA to 160 and changed the levels in both tanks on that capture. I can also capture changing pump RPM which throws an error and locks out SL.

rstrouse commented 3 years ago

I can't seem to find the spot where you changed the tanks. The seem to be a solid 6 all the way through from start to finish. Did you do it before or after the TA from 120 to 160?

Also was CYA = 44 and CH = 250 or do we have these values incorrect as well. Also is there a setting that you have set to 20 for anything. Perhaps max dosage volume or time?

brentratliff commented 3 years ago

I don't think I have anything set to 20. I will go check. I am home all day and am happy to do as many captures as you need. I can't remember if I changed the tanks before or after. The CYA and CH values are correct.

rstrouse commented 3 years ago

Just to be sure the only changes you can make to IntelliChem with EasyTouch are

  1. pH Setpoint
  2. ORP Setpoint
  3. pH Tank Level
  4. ORP Tank Level
  5. CYA
  6. CH
  7. TA

Is there anything else for your configuration that you can change on EasyTouch. Can you set dose priority or any of the dosage limits from EasyTouch?

rstrouse commented 3 years ago

Do you by chance have your pool volume set to 16kgal on the IntelliChem?

brentratliff commented 3 years ago

That is exactly correct. I cannot change dosing information or any of the other SI values from the EasyTouch. I can also change the pump speed on the IntelliFlow pump that was causing the error also.

brentratliff commented 3 years ago

Yes, it is set to 16K gallons

brentratliff commented 3 years ago

I noticed that PC is also always display dosing information as 0ml. I have it set to Oz in IntelliChem. The Intelliflo pump seems to be working correctly in 6.5.2 next.

rstrouse commented 3 years ago

@tagyoureit is planning on looking at the pump speed change issue for you. I am reviewing all the messages for IntelliChem. With the exception of the value that is 20 (this could be a flag), I think I have found our misalignment.

I don't see any incoming data for the dosing information from IntelliChem. That is unfortunate because I imagine it would be great to get dose amounts. Perhaps this data does exist and we just don't know it because the outputs we do get might not be dosing at the moment it was captured. I don't have IntelliChem but if you are game perhaps we can find this information.

brentratliff commented 3 years ago

Thanks for all the help. I am game to try to find the info. I know it's in IntelliChem because it's monitored to prevent over dosing and I can change it. I am not sure it is broadcasted however.

rstrouse commented 3 years ago

Ok so here are the steps. First stop njspc then restart it. This will clear prior log data and start with a clean slate for this session.

  1. Open Messsage Manager by navigating to http://[your dashPanel IP]/messageManager.html
  2. Open the dialog under hamburger menu and go to the logging tab.
  3. Select all the options as you see here. We are setting this up so that only the IntelliChem information is captured. After you have made the selections click outside of the dialog to dismiss it. image
  4. Click on the icon identified by the arrow. It should turn hot pink and messages to and from IntelliChem should start streaming into the messages list. image
  5. Go back to the log tab under the hamburger menu and click the Log to [File] button under the Packets section. This will start writing what you are seeing in the browser to a file on njspc.
  6. Change each value on EasyTouch and keep track of what you changed in the sequence you changed it. Make sure you include changes to the max 24 hour dose setting from IntelliChem. Let me know what you changed it to.
  7. Make IntelliChem administer an acid dose. Let me know what the dose amount should be. Let's hope it lets us know what it is dosing and how much time is left.
brentratliff commented 3 years ago

Great, I will do this tomorrow.

rstrouse commented 3 years ago

One more thing. Don't forget to uncheck the log to file. You don't wan the logs to fill up your pi. The resultant log file will be located in the /logs directory with a file name containing the date of when njspc was restarted.

brentratliff commented 3 years ago

I tried this and it didn't log to file. There were a ton of IntelliChem packets going out on the console.

brentratliff commented 3 years ago

I checked file before and unchecked after as instructed.

rstrouse commented 3 years ago

Did you look in the nodejs-PoolController /logs directory on the pi? It will not be in the dashPanel directory.

brentratliff commented 3 years ago

Yes, the log file is there, but there are no IntelliChem logs. [consoleLog(2021-03-20_11-16-07).log](https://github.com/tagyoureit/nodejs-poolController/files/6175992/consoleLog.2021-03-20_11-16-07.log)

brentratliff commented 3 years ago

I figured it out. I set the app log to file, not the packet log to file. I'll redo it.

rstrouse commented 3 years ago

That is the console log. We are looking for the file named packetLog(2021-03-20_xx-xx-xx).log. I figured you might have clicked the wrong log to file. Kinda neat to hear your IntelliChem in its native tongue even if you don't understand what it is saying.

brentratliff commented 3 years ago

From EasyTouch PH -> 7.4 ORP -> 700 PH level 3->4 ORP level 4->3 CH ->250 TA->160 CYA->44

Accidentally turned pump off which reboot IntelliChem

Auto ORP Dose of 49oz or 1/11th of that

From IntelliChem

PH 11->10 doses per day PH 49->48oz PH mixing time 25->24 minutes ORP mixing time 19->20 minutes ORP doses 11->10 ORP 49->48oz

PH manual dose of 3-5 seconds

packetLog(2021-03-20_11-16-07).log

.

brentratliff commented 3 years ago

Quick look by me, I don't see any dosing information in the packets.

rstrouse commented 3 years ago

Thanks for that. I will take a look at this over the weekend. Yeah that dosing information will be on that action 18 message. If you want to see only the messages that have changed you can click on the not equal icon on the list. When you click on the message it will show you which bytes changed from the last message sent. The action 146 message is you changing something on EasyTouch. The action 210 is just EasyTouch asking IntelliChem to cough up its status on the action 18 message.

If you are interested the first 4 bytes are the pH and ORP. For pH you take (byte(4)*256 + byte(5))/100 to give you 2*256+228/100 = 7.4 and ORP is simply 2*256+188 = 700. So the known values of 18 are (the ???? are our suspicions):

        //      0-1 : pH Level
        //      2-3 : ORP Level
        //      4-5 : pH Setpoint
        //      6-7 : ORP Setpoint
        //      8 : Unknown = 0
        //      9 : pH Dose time remaining (min) = 0x60??????
        //      10 : pH Dose time remaining (secs) = ?????
        //      11-12 : Pool volume 16x1000 + 0x100 = 16,000 gallons.
        //      13 : ORP Dose time remaining (min) = ??????
        //      14 : Unknown = 0
        //      15 : ORP Dose time remaining (secs) = ?????
        //      16 : Unknown = 0
        //      17 : pH Dose volume (unknown units) = ?????
        //      18 : Unknown = 0
        //      19 : ORP Dose volume (unknown units) = ?????
        //      20 : pH tank level 1-7 = 6
        //      21 : ORP tank level 1-7 = 6
        //      22 : LSI = 3 & 0x80 === 0x80 ? 256 - 3 / -100 : 3/100 = .03
        //      23-24 : Calcium Hardness
        //      25 : Unknown = 0
        //      26 : CYA
        //      27-28 : Alkalinity
        //      29 : Unknown = 20 
        //      30 : Water flow alarm = 0 = ok, 1 = no flow.
        //      31 : Water Temperature
        //      32 : Alarms = 8 = (no alarm)
        //      33 : pH Lockout, Daily Limit Reached, Invalid Setup, Chlorinator Comm error
        //      34 : Dosing Status
        //      35 : Delays = 0
        //      36-37 : Firmware = 80,1 = 1.080
        //      38 : Water Chemistry Warning
        //      39 : Unknown
        //      40 : Unknown
brentratliff commented 3 years ago

The only thing I can find that I have set to 20 is the mixing time for PH

brentratliff commented 3 years ago

I will double check the mixing times and post them

tagyoureit commented 3 years ago

Just want to double check... all the problems with setting the pump circuits speeds have disappeared with your new protocol adapter?

brentratliff commented 3 years ago

I didn't end up replacing the protocol adapter. I did replace the wireless connection kit that sends the raw RS485 data from the EasyTouch to the protocol adapter. It didn't really start working correctly (with exception of IntelliChem) until I did a complete uninstall and reinstall of njspc. It seems to be working correctly now. I am still trying to figure out how sending bad packets from njspc blocks ScreenLogic from controlling some circuits.

rstrouse commented 3 years ago

So are the pump functions working? Also do you remember how much chlorine dosed during the period you captured these messages. The messages seem to indicate 240 in whatever units. This appears to be mL which would = 8.11oz of chlorine is that correct? Your pH dose was for 7 seconds and it dosed what appears to be about 1/2 oz if we have the units correct. This pans out to a pump that puts out around 128mL/min.

brentratliff commented 3 years ago

Yes, the pump functions are working since a clean install of 6.5.2 next. Those numbers make sense to me although they are not recorded in ScreeLogic or visible on IntelliChem. Changing the pump no longer breaks ScreenLogic but changing IntelliChem values does.

brentratliff commented 3 years ago

I have the dosing set to 10/48. I’m not sure if that’s 10 doses a day for a total of 48 in 24 hours.

brentratliff commented 3 years ago

48oz

rstrouse commented 3 years ago

Ok pull njspc next and give it a go. I think I have decoded the messages as we know them. There are some bytes we know nothing about but they are probably for CO2 tank dosing (they are always 0). Unfortunately, IntelliChem does not appear to report the dose target. It only counts up until it dosing status changes. Kinda sucks for determining what is going on. It's really too bad that it doesn't report the target or you would know how much longer the dose is going to take and how much more it is going to put in.

This is a major difference with REM Chem where the dosing targets are determined at the start of the dose then re-evaluated as the dose is taking place. It would require a pi and some Atlas gear but the flow cell, tanks, and pumps you have can be used.

brentratliff commented 3 years ago

Thanks for the update. I wonder if it didn't report the target since I dosed it manually with start and stop. The first dosing recording was an automated one with a preset target. I think IntelliChem does re-evaluate and change as it gets close. It also reduces the dosing to 25% while in spa mode.

brentratliff commented 3 years ago

SI changes all work now and don't affect the tank levels. Still getting errors when setting tank levels via dashPanel.

ORP TypeError: Cannot read property 'setpoint' of undefined at ChemControllerCommands.setIntelliChemStateAsync (/home/pi/nodejs-poolController/controller/boards/SystemBoard.ts:3414:45) at ChemControllerCommands.setChemControllerStateAsync (/home/pi/nodejs-poolController/controller/boards/SystemBoard.ts:3508:110) at /home/pi/nodejs-poolController/web/services/state/State.ts:31:61 at Layer.handle [as handle_request] (/home/pi/nodejs-poolController/node_modules/express/lib/router/layer.js:95:5) at next (/home/pi/nodejs-poolController/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/pi/nodejs-poolController/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/home/pi/nodejs-poolController/node_modules/express/lib/router/layer.js:95:5) at /home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:335:12) at next (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:275:10) at /home/pi/nodejs-poolController/web/Server.ts:336:21 at Layer.handle [as handle_request] (/home/pi/nodejs-poolController/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:317:13) at /home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:335:12) at next (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:275:10)

PH

TypeError: Cannot read property 'setpoint' of undefined at ChemControllerCommands.setIntelliChemStateAsync (/home/pi/nodejs-poolController/controller/boards/SystemBoard.ts:3415:47) at ChemControllerCommands.setChemControllerStateAsync (/home/pi/nodejs-poolController/controller/boards/SystemBoard.ts:3508:110) at /home/pi/nodejs-poolController/web/services/state/State.ts:31:61 at Layer.handle [as handle_request] (/home/pi/nodejs-poolController/node_modules/express/lib/router/layer.js:95:5) at next (/home/pi/nodejs-poolController/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/home/pi/nodejs-poolController/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/home/pi/nodejs-poolController/node_modules/express/lib/router/layer.js:95:5) at /home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:335:12) at next (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:275:10) at /home/pi/nodejs-poolController/web/Server.ts:336:21 at Layer.handle [as handle_request] (/home/pi/nodejs-poolController/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:317:13) at /home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:335:12) at next (/home/pi/nodejs-poolController/node_modules/express/lib/router/index.js:275:10)

brentratliff commented 3 years ago

Water balance seems to reverted. Usually reports around 0. Showing 258.4.

rstrouse commented 3 years ago

Please pull dashPanel and njspc. Don't forget to hard refresh your browser. Use CTRL + F5 or equivelant for dashPanel. I needed an extra set of parens on the SI math so that calc should be fixed.

Unfortunately, there is no place in the messages coming out of IntelliChem where the current dose amount or time is emitted during the dose. I did figure out that 20 is actually the salt level reported by your controller. It is 20 x 50 = 1,000ppm. In your case you are not using a chlorinator so this is probably the default level.

        //      Bytes - Descrption
        //      0-1 : pH byte(0) x 256 + byte(1) / 100
        //      2-3 : ORP byte(2) x 256 + byte(3)
        //      4-5 : pH Setpoint : byte(4) x 256 + byte(5) / 100
        //      6-7 : ORP Setpoint : byte(6) x 256 + byte(7)
        //      8 : Unknown = 0
        //      9 : Unknown = 0
        //      10 : Unknown = 0
        //      11-12 : pH Dose time seconds. The number of seconds since the dose started. byte(11) x 256 + byte(12)
        //      13 : Unknown = 0
        //      14-15 : ORP Dose time seconds.  The number of seconds since the dose started. byte(14) x 256 + byte(15)
        //      16-17 : pH Dose volume (unknown units) - These appear to be mL.
        //      18-19 : ORP Dose volume (unknown units) - These appear to be mL
        //      20 : pH tank level 1-7
        //      21 : ORP tank level 1-7
        //      22 : LSI. (byte(22) & 0x80) === 0x80 ? (256 - byte(22) / -100 : byte(22)/100
        //      23-24 : Calcium Hardness = byte(23) x 256 + byte(24) = 250
        //      25 : Unknown = 0 (probably reserved CYA byte so the controller is always dealing with integers)
        //      26 : CYA Max value = 210.
        //      27-28 : Alkalinity = byte(27) x 256 + byte(28)
        //      29 : Salt level = byte(29) x 50
        //      30 : Unknown = 0
        //      31 : Temperature
        //      32 : Alarms
        //      33 : Warnings pH Lockout, Daily Limit Reached, Invalid Setup, Chlorinator Comm error
        //      34 : Dosing Status (pH Monitoring, ORP Mixing)
        //      35 : Delays
        //      36-37 : Firmware = 80,1 = 1.080
        //      38 : Water Chemistry Warning (Corrosion...)
        //      39 : Unknown = 0
        //      40 : Unknown = 0

It looks like the ph and orp objects are not being sent from dashPanel which is why I am suspecting the dashPanel version.