tagyoureit / nodejs-poolController

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

Nixie “Schedules” start/end timer settings not responding as expected #367

Closed rock-crusher closed 2 years ago

rock-crusher commented 2 years ago

Issue: In the nixie scheduler when setting the on/off times the minutes are not changeable while in the 12:00pm hour. When you try, it automatically reverts back to 12:00pm. For instance, if you set the time as 12:37pm the system automatically resets the time back to12:00pm for some reason. All the other hours 1-11 am or pm you can set any minute you desire.
I’m sure it’s just something I’m doing wrong. Any Ideas?

Schedules

rock-crusher commented 2 years ago

No, the instructions never said it install that.

rstrouse commented 2 years ago

So what does the prompt say when you run pm2 stop REM

rock-crusher commented 2 years ago

I ran it again

j

So what does the prompt say when you run pm2 stop REM

i

rstrouse commented 2 years ago

Ok that is much better. It also appears to be now communicating with the MEGA-BAS correctly. Keep this console open and capture what goes by when you click the + on the devices list.

rock-crusher commented 2 years ago

It gave me that same wrong address?

l

k

rstrouse commented 2 years ago

Wait did you enter 63 and it still gave you 3?

rstrouse commented 2 years ago

Not 3F you must enter it in Decimal which is 63.

rock-crusher commented 2 years ago

I didn't enter anything, the window to do that never opened, the program just does it by itself. This has been the problem from the beginning.

rstrouse commented 2 years ago

Open up a browser on your windows and go to address http://raspberrypi:8080. Could it be that the click is being propagated to the window that opens up.

rock-crusher commented 2 years ago

It shows the same thing.

rstrouse commented 2 years ago

Ok so close the console that we currently have running rem by clicking the x at the upper right.

Then cd ~/relayEquipmentManager git pull npm i npm start

Wait for REM to start up.

Then using the browser on your PC hard refresh it by holding down the ctrl key and pressing F5.

I forcibly removed the mouse click event from the queue when you click the +.

rock-crusher commented 2 years ago

Ok, should I try again clicking the device + button?

rock-crusher commented 2 years ago

I clicked it again, sorry. It did the same thing.

rstrouse commented 2 years ago

Ok that is bizarre. From the ~/relayEquipmentManager/data directory upload your controllerConfig.json file. I will add the relay in manually for you. I cannot believe this is acting this way.

rock-crusher commented 2 years ago

Sorry, had to step away for awhile. The system (this site) says: "We don't support that file type." How can I upload it?

rstrouse commented 2 years ago

Rename it to .txt or zip it up

rock-crusher commented 2 years ago

controllerConfigjson.txt

rock-crusher commented 2 years ago

Here is something else weird, nothing shows under device info?

m

rock-crusher commented 2 years ago

I just did a reboot & it now gives a reading?

n

rstrouse commented 2 years ago

That is really strange. I have not seen nor can I explain the weird behavior on your pi.

At any rate here is the file with the pre-configured 8-relay.

  1. Shut down REM. Make sure there are no instances of REM running pm2 stop REM
  2. Rename thise file to controllerConfig.json and copy it into the ~/relayEquipmentManager/data directory controllerConfigjson.txt
  3. Restart REM pm2 restart REM

On a side note I noticed two additional i2c bus definitions detected on your pi (Bus 20 & 21). Both of them are tied to Broadcom STB (Set Top Box) which seem to point to some sort of display device (Roku, XBMC, game console ...etc). I have just never seen these before and do not normally exist on Raspberry Pi.

Just curious what is the output from i2cdetect -l? Something just doesn't seem right with the pi.

rock-crusher commented 2 years ago

Hi rstrouse, HAPPY THANKSGIVING! I'll try the above later and let you know how it works out. Thanks again for all your hard work, I really appreciate it!

rstrouse commented 2 years ago

Happy Thanksgiving! I this works I know what I will be thankful for. I did order a few more SD cards to run through a full install.

rock-crusher commented 2 years ago

Hi rstrouse, Well, the above worked, I now have the relay board connected and working (thank you for that)! Also, I am able to save the port "/dev/ttyS0" where before it wouldn't let me. Problem now is, my VSF pump still does not acknowledge a connection using the RS485 cable.

b c d a

tagyoureit commented 2 years ago

Glad you got it working so far!

Did you add any hardware/plug-ins/etc that would add 2 extra i2c busses? Those aren't standard.

Also, how are you running your VSF pump today? How do you turn it on/off and/or does it turn itself on automatically or on a schedule?

rock-crusher commented 2 years ago

Glad you got it working so far!

Did you add any hardware/plug-ins/etc that would add 2 extra i2c busses? Those aren't standard.

Also, how are you running your VSF pump today? How do you turn it on/off and/or does it turn itself on automatically or on a schedule?

I do have the jumpers set for (2) temp sensors on the Building Automation hat , but they are not connected. Other than that, just the 2 wire RS485 cable to pump.

f I also have the jumpers set for the RS485 g Pump configuration

e

I can only turn the pump on/off at the pump itself, no schedule is set at the pump.

tagyoureit commented 2 years ago

What is showing on the pump display when you try to control it? It should be idle. Or you can try to turn of Feature 1 and then try to control the pump.

You could always try to reverse the wires again; some adapters are wired differently/wrong. Also, send a couple pictures of the wiring to your Pi and the pump.

Oh - wait... why do you have the pump setup as "spa"? Can you set that to pool and then turn on the pool circuit. Spa will try to rotate valves and let's start with something basic like the pool.

rock-crusher commented 2 years ago

What is showing on the pump display when you try to control it? It should be idle. Or you can try to turn of Feature 1 and then try to control the pump.

You could always try to reverse the wires again; some adapters are wired differently/wrong. Also, send a couple pictures of the wiring to your Pi and the pump.

Oh - wait... why do you have the pump setup as "spa"? Can you set that to pool and then turn on the pool circuit. Spa will try to rotate valves and let's start with something basic like the pool.

Ok, reversed the wires, no change, so I put them back as : Yellow = A, Green = B. I also changed from "spa" to pool, still nothing. I'm bench testing everything first prior to putting into service. I have keyboard, mouse & monitor connected to pi as well. h i j

tagyoureit commented 2 years ago

The pump IS running on a schedule. image

It won't respond to the RS485 when that is happening. For starters, press the 1 button to manually turn it on and then try to connect to it with njsPC. Long term, you'll need to disable the local pump schedule.

rock-crusher commented 2 years ago

The pump IS running on a schedule. image

Long term, you'll need to disable the local pump schedule. I went through the menu, but didn't see how to disable that?

tagyoureit commented 2 years ago

Here's the link to the manual: https://www.pentair.com/content/dam/extranet/nam/pentair-pool/residential/manuals/pool-pumps/intelliflo-vsf/intelliflo-vsf-om-eng.pdf

rock-crusher commented 2 years ago

Ok, went through the manual and read about programming/scheduling the pump etc. Nothing has changed, and there is not a setting that will make the "Running Schedule" (what you have circled in red) go away other than pressing the start/stop button. There are no scheduled programs set at all in my pump, NONE. All the programs in my pump are either set to disabled, or manual. The only options for programs 1-4 are: Manual, Schedule, or Egg Timer. Mine has always been set to manual for 1-4. Now, as for programs 5-8 there are just 2 options: disabled, or schedule. Mine has always been set to disabled. The "Running Schedule" that shows up on the screen seems to always be there no matter what settings are in place. Again, the only way I have found to make that go away is to press the start/stop button. So, maybe there is something wrong with my pump/display, or? I must say though, I'm a little confused about this (what else is new) because when I asked a few days ago, rstrouse said the pump needs no special set-up on its control panel in order to connect with the Nixie pool controller, that it was just plug & play. Thoughts? k

rstrouse commented 2 years ago

Well we are not done here. I have a couple of SD cards that are arriving today so I can rework the setup just as you have it.

It is my belief that the serial port is not really communicating. The serial port on the Raspberry Pi through njsPC is putting outgoing messages onto the RS485 bus but I do not believe they are going anywhere. Hence the reason why your pump that appears to be properly set up is not responding.

There is one other thing on the pump to check and that is to make sure the pump is on address 1. Follow the docs for the pump and ensure address 1. Externally from the pi this is the one thing that would send the data out on the RS485 bus and the pump won't hear it.

If checking the address doesn't get us there, lets go back to the basics. First, it is alarming that there is an i2c-20 and i2c-21 on your Pi. These buses are non-existent in the Raspberry Pi docs. In fact I don't see a way to enable them or to map pins to them. Since this is the only thing that I see being weird about your pi lets get to the bottom of it.

This is why we keep asking what hardware is installed. So lets try to get to the bottom of what these devices are and which RPI pins are being occupied by them. So lets see what the pins on your pi are mapped to by running the following command and posting the results here. raspi-gpio get

Then power off the pi and remove the relay card. Power the pi back up again and see if the i2c by running i2cdetect -l We are trying to see if the i2c-20 and i2c-21 buses disappear. If they do stop here and let me know.

If they do not disappear then power down the Pi and remove the MEGA-BAS card. You will have to power the pi through the 5v USB-C connector but power it back up that way and lets see if the i2c-20 and i2c-21 buses go away by running. i2cdetect -l

If it does leave your pi running like this and report back here.

rock-crusher commented 2 years ago

Yes, my pump is set to address 1, I believe that is its default setting same as with the Nixie under the pumps tab configuration. Ok, first two pics are: raspi-gpio get Third pic: i2cdetect -l with relay card removed Forth pic: MEGA-BAS card removed Looks like no change?

a b c d

rstrouse commented 2 years ago

Well the good news is that neither of those buses are assigned to any of the IO pins on the pi. The bad news is that I do not know what they are.

Lets make sure we are up to date on the firmware for Raspberry Pi. If it asks for confirmation always answer yes at the prompts. sudo apt update sudo apt upgrade

rock-crusher commented 2 years ago

Ok, here are the results.

e

rstrouse commented 2 years ago

I should have my SD cards in the next couple of hours but I want you to try it with the 1 button pressed on your pump. image

You have bullseye installed and I don't think we have seen anyone with that version of the pi OS so I will install a pi with Bullseye and see if there are compatibility issues with that OS. Some hat manufacturers have had some issues.

rock-crusher commented 2 years ago

Only thing that happens when the 1 button is pressed on the pump is that it turns on to the set speed of 450 rpm. Still no control with the Nixie.

rstrouse commented 2 years ago

I have installed the new OS and I found that it creates two i2c buses at 20 and 21 and it omits addresses 3-7 on its scan. That being said this OS is an exercise in futility. I think it has some very serious warts.

After fighting with trying to get XRDP installed and realizing that remote desktop is so slow it borders on unusable I will continue to try to see if there are issues related to the serial port on the MEGA-BAS. I'll let you know. I am also going to image a Buster for comparison.

rstrouse commented 2 years ago

Ok so I have been around the block with the new OS and I found a few things.

First, I would like you to verify a few things. So power everything down. This includes the pump as well as the Raspberry Pi.

  1. Make sure you have the yellow wire in the A terminal and the green wire in the B terminal. I have several adapters on my desk and many of them are marked incorrectly. I have modified the docs but it is very likely that at the time of the writing, the adapter I was using was marked incorrectly.
  2. After you have made the connections make sure to engage the wire securely into the connector. I spent about an hour trying to figure out why I only had reliable one way communication. Turns out you can get the wire into the connector but it ends up not being engaged in the connector. So screw the connector open quite a bit before inserting the wire and pull on it to make sure it is engaged.
  3. Double check the jumpers on the MEGA-BAS to ensure they are installed vertically. If the jumpers are horizontal that is incorrect and the comms will just loop back on themselves.

image

  1. Start the pi back up again and run the following commands. We want to shut njsPC and REM down. Make sure that the display indicates that both of these are stopped. pm2 stop njsPC pm2 stop REM
  2. We need to update the firmware on your MEGA-BAS so run the following commands but only after you have completely turned off REM and njsPC. This is important as the MEGA-BAS will silently fail the firmware update if it is getting commands. cd ~ git clone https://github.com/SequentMicrosystems/megabas-rpi.git cd ~/megabas-rpi sudo make install cd ~/megabas-rpi/update .update/0
  3. We need to disable the rs485 MODBUS functions for the card so run the following commands. cd ~/megabas-rpi megabas 0 rs485wr 0 9600 1 0 1
  4. The new OS requires that the serial port code is recompiled in njsPC. So to do this enter the following commands. cd ~/nodejs-poolController npm rebuild
  5. Reboot your pi by entering the following command. sudo reboot now
  6. Wait until the pi has had some time to boot back up again and the njsPC, dashPanel, and REM have had time to start then check the pump display. What we are hoping for is that the pump says Display Not Active. If it does not then we need to check the configuration in dashPanel to ensure it is enabled and sending messages to the pump.
rock-crusher commented 2 years ago

Hi again rstrouse, I removed the RS485 wires from the terminals and reinstalled them as stated above, they are tight. Double checked the jumpers as stated above, they are also correct and in place. When I try to shut njsPC and REM down I get this: I have rebooted twice along with a complete shut down & reboot with the same result???

a28 b28

rstrouse commented 2 years ago

I'm such an idiot. I modified the post it should be pm2 stop njsPC and pm2 stop REM

rock-crusher commented 2 years ago

Lol... "I'm such an idiot" No sir, far from the truth! Hey, That statement is reserved for me! Sorry, you can't use it. Ok, I'll give it another go and report back.

rock-crusher commented 2 years ago

I don't think this turned out correctly?

c28

rstrouse commented 2 years ago

It should be ./update 0 whose fingers have I been using.

rock-crusher commented 2 years ago

Now this?

d28

rstrouse commented 2 years ago

Ok that looks like REM or njsPC are running. Run pm2 stop njsPC and pm2 stop REM then try again.

rstrouse commented 2 years ago

Btw you can pick up where you left off with the ./update 0 command. Just make sure njsPC and REM are not currently running.

rock-crusher commented 2 years ago

Ok, all that went good! Now this.

e28

rstrouse commented 2 years ago

In that directory run megabas -list

rock-crusher commented 2 years ago

f28