Closed ivanvach closed 1 year ago
You have found a bug. Apparently I made assumptions about what hardware would be present, in this case, the heater. I need to fix the way I’m accessing that data so that I a heater is not required. Please have a little patience, I will fix the bug when I have the opportunity. Or if you would like to try, feel free to fork and submit a pull request. Michael Mucciarone On Dec 15, 2022, at 9:34 PM, ivanvach @.***> wrote: Thanks for the great idea and implementation. I'm very excited and interested in using the Screenlogic API. Managed to install and run it. Console output attached below at the bottom However none of the HTTP GET end points is accessible from a browser. Help will be greatly appreciated. Thanks, Ivan
@.*** start node server.js
Finding Screenlogic Units... Express server listening on port 3000 Found ScreenLogic unit at: 192.168.1.203:80 Poll for full ScreenLogic update at 1671161361740 Logged In... Pump ID: 0 Pump SenderID: 30 Pump ID: 1 Pump SenderID: 31 Pump ID: 2 Pump SenderID: 32 Pump ID: 3 Pump SenderID: 33 Pump ID: 4 Pump SenderID: 34 Pump ID: 5 Pump SenderID: 35 Pump ID: 6 Pump SenderID: 36 Pump ID: 7 Pump SenderID: 37 Requesting Schedule Type: daily Schedule SenderID: 50 Requesting Schedule Type: runOnce Schedule SenderID: 51 Got Version �8POOL: 5.2 Build 733.0 Rel /home/ivan/screenlogic-api/server.js:316 poolSpaInfo.controllerConfig.equipPresent.heater; ^ TypeError: Cannot read properties of undefined (reading 'heater') at /home/ivan/screenlogic-api/server.js:316:53 at Array.forEach () at UnitConnection. (/home/ivan/screenlogic-api/server.js:314:33) at UnitConnection.emit (node:events:513:28) at UnitConnection.onClientMessage (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:385:14) at UnitConnection.processData (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:175:12) at Socket. (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:145:13) at Socket.emit (node:events:513:28) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) Node.js v18.12.1
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
It does have a heater that activated automatically when SPA is on hence the heater is properly connected and legit.
So then let's dig deeper.
But, in the interest of getting deeper can you please answer these questions:
I just started my API up in dev mode, and I see this difference in our startups:
Got Version �8POOL: 5.2 Build 738.0 Rel
Yours comes up as Build 733...
.
Perhaps update your ScreenLogic Adapter and try again?
Heater is Pentair. Yes to all other questions.
I'm not sure that I can update the Adapter per se as it is firmware driven. I'm also playing with another implementation of same library https://github.com/parnic/node-screenlogic and it connects correctly with my Adapter. This make me think that the Adapter is not a problem. I like your implementation better because of it's simplicity and easy to use. I'm surprised that it doesn't open the listening port. Regardless of problems connecting to heater etc. it should at least open the port and listen to it. Is it working at your place? If yes than I may be missing something basic in the settings or the way I start it. Can you please hold my hand and get me started. If needed I'll gladly provide you with access to my computer over AnyDesk.
To update your adapter, follow the instructions here: https://www.pentair.com/en-us/education-support/residential/product-support/pentair-pool-and-spa-software-downloads/screenlogic-update.html
I have the code from master running on my pool. Others have also reported success running my code.
I just pushed a pull request that updates the versions in the node modules. That might help. Do a git pull
on master, then try again.
According to the log you posted above, the issue is that the ScreenLogic adapter is not returning what we expect it to return when it queries the heater info. Unfortunately, there's not much I can do if the device isn't returning the expected info, which is why I recommend trying the update.
@mikemucc
Thanks a lot for the prompt response. I will certainly try all of your suggestions and come back here with the result. Thanks for your patience with a novice like me.
Ivan
@mikemucc
Updated the adapter successfully. Still getting the same error when running your app. Tried to do git pull and got these errors (see below). What do I do wrong.
Thanks, Ivan
hint: Pulling without specifying how to reconcile divergent branches is hint: discouraged. You can squelch this message by running one of the following hint: commands sometime before your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation. remote: Enumerating objects: 14, done. remote: Counting objects: 100% (14/14), done. remote: Compressing objects: 100% (6/6), done. remote: Total 10 (delta 6), reused 6 (delta 3), pack-reused 0 Unpacking objects: 100% (10/10), 3.12 KiB | 118.00 KiB/s, done. From https://github.com/mikemucc/screenlogic-api 7a8fcd8..165c6bf master -> origin/master Updating 7a8fcd8..165c6bf error: Your local changes to the following files would be overwritten by merge: package-lock.json Please commit your changes or stash them before you merge. Aborting
@mikemucc
As far as the upgrade failed (see above) I deleted everything and re-installed it from scratch. Still getting the same error
screenlogic-api@1.0.0 start
node server.js
Finding Screenlogic Units... Express server listening on port 3000 Found ScreenLogic unit at: 192.168.1.203:80 Poll for full ScreenLogic update at 1671312468955 Logged In... Pump ID: 0 Pump SenderID: 30 Pump ID: 1 Pump SenderID: 31 Pump ID: 2 Pump SenderID: 32 Pump ID: 3 Pump SenderID: 33 Pump ID: 4 Pump SenderID: 34 Pump ID: 5 Pump SenderID: 35 Pump ID: 6 Pump SenderID: 36 Pump ID: 7 Pump SenderID: 37 Requesting Schedule Type: daily Schedule SenderID: 50 Requesting Schedule Type: runOnce Schedule SenderID: 51 Got Version �8POOL: 5.2 Build 738.0 Rel
/home/ivan/screenlogic-api/server.js:316 poolSpaInfo.controllerConfig.equipPresent.heater; ^
TypeError: Cannot read properties of undefined (reading 'heater')
at /home/ivan/screenlogic-api/server.js:316:53
at Array.forEach (
Node.js v18.12.1
Alright, I just pushed another fix. Parnic's library now has helper functions to calculate some of the stuff that I put into the equipPresent array. Previously I was doing this work myself based on a JSON object, I've removed that and am now using his code.
I think that is where your setup was choking, as I didn't have a key in that object that matched up with your config.
Do a git pull
on master and please try again.
@mikemucc
Thanks a lot. Will try asap. and let you know.
@mikemucc
Woohoo !!! Working now ! At least it doesn't break and responded to .../api/all As they say devil is in the details. So I will test extensively and let you know if there are other issues. Thanks a lot for the cooperation.
Best, Ivan
Excellent, I will close this issue.
@mikemucc
Thanks for the great idea and implementation. I'm very excited and interested in using the Screenlogic API. Managed to install and run it. Console output attached below at the bottom However none of the HTTP GET end points is accessible from a browser.
192.168.1.149:82/api/all
I did setup the IP address 192.168.1.149 and port :82 as requested at the description
Help will be greatly appreciated.
Thanks, Ivan
Finding Screenlogic Units... Express server listening on port 3000 Found ScreenLogic unit at: 192.168.1.203:80 Poll for full ScreenLogic update at 1671161361740 Logged In... Pump ID: 0 Pump SenderID: 30 Pump ID: 1 Pump SenderID: 31 Pump ID: 2 Pump SenderID: 32 Pump ID: 3 Pump SenderID: 33 Pump ID: 4 Pump SenderID: 34 Pump ID: 5 Pump SenderID: 35 Pump ID: 6 Pump SenderID: 36 Pump ID: 7 Pump SenderID: 37 Requesting Schedule Type: daily Schedule SenderID: 50 Requesting Schedule Type: runOnce Schedule SenderID: 51 Got Version �8POOL: 5.2 Build 733.0 Rel
/home/ivan/screenlogic-api/server.js:316 poolSpaInfo.controllerConfig.equipPresent.heater; ^
TypeError: Cannot read properties of undefined (reading 'heater') at /home/ivan/screenlogic-api/server.js:316:53 at Array.forEach ()
at UnitConnection. (/home/ivan/screenlogic-api/server.js:314:33)
at UnitConnection.emit (node:events:513:28)
at UnitConnection.onClientMessage (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:385:14)
at UnitConnection.processData (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:175:12)
at Socket. (/home/ivan/screenlogic-api/node_modules/node-screenlogic/index.js:145:13)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
Node.js v18.12.1