Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Robo-Tank v6.0 is Ready - Now v6.5
#61
Sorry, when I changed the create database file last time I wanted to run it on mine to test but had to add DROP DATABASE robotank; as I had to delete the database, I thought it would be ok left there but obviously it ends there if no database to drop.

I updated the download, run that long install command and it'll do it this time. It should go much quicker too as everything is installed.
Reply to top
#62
It completed with no errors, but I still have no robotank schema
Reply to top
#63
It should have worked, I verified I updated the files, I have a card baking in the oven now.

Let's do it with commands. Try running these.

sudo rm Robo-Tank_v6_1.zip

sudo systemctl stop robotank.service

sudo wget -c https://www.robo-tank.ca/app/releases/Robo-Tank_v6_1.zip

sudo unzip -o Robo-Tank_v6_1.zip -d /boot/

sudo mysql --user=root --password=robotank < /boot/robotank/install/robotank_database.sql

sudo rm Robo-Tank_v6_1.zip

sudo rm -r /boot/robotank/

sudo systemctl start robotank.service
Reply to top
#64
That worked.
Reply to top
#65
Great, let's hope you don't see a red plug.
Reply to top
#66
The health meter is green and the plug is green.


I set up 3 lighting modes ramp up, hold, ramp down, the sliders now appear, and I set them.
I set up the PCA9685 GPIO ports 11 and 12 as function = AC Power to switch the AC relays on my blue LEDs and my white LEDs. Then, I created schedule events of type 'AC Outlet' and set them to go on and off at the desired times.

BUT: I don't see where these events get associated with the GPIO ports 11 or 12. What am I missing?

Thanks,
Phil
Reply to top
#67
Ah the forum didn't tell me about this message...

Once you assign a port a function it's automatically associated with the correct GPIO. If you click LED Port 5 on simple view and select a function the system knows what GPIO that is and sets it accordingly.

When you assigned DC 4 and 5 as an outlet you should get two icons on dashboard showing for outlets and then you can use them in the schedules. As they were available in the schedules sounds like it should work.

If you click the outlets on dashboard you can then manually turn on/off to test. When finished click the red dot that appears on icon to put outlet back in automatic mode.

One thing to note, some things aren't cleaned up automatically yet. For example if you create a schedule for DC 4 and you then reassign the port function as maybe a light that schedule could cause issues. Shortly it'll delete anything related to that pin if the function is changed.
Reply to top
#68
OK, very good. I think I understand what's going on now. Part of my confusion is that I used the same 'hanging LED fixture' icon for both AC ports. It's also a bit confusing when setting up schedules knowing that I'm scheduling a DC port (as labeled on the controller box), but that port is controlling an AC switch...

Now three more 'advanced' questions.

1) A few months ago when I was having trouble with my DS1820s, you suggested that I put one of them on the SENSOR 1 port, and you gave me instructions on how to modify the board, and the reef-pi configuration. I've been using that successfully to get 'room temp'. How can I activate that DS1820 in Robo Tank?

2) I purchased, but have not yet installed, the RTC module that you recommended. Can you provide guidance for how to hook that up and have Robo Tank use it?

3) Although I've got the ph probe interface, I've got no ph probe. Can I make that reading disappear from the dashboard?

THANKS!!
Reply to top
#69
The idea is a user doesn't need to know what a GPIO is, just tell a port what to do and everything updates elsewhere.

The function AC Outlet and DC port are identical systems, if you change DC 4 and 5 to a DC port they will move from outlets to dc ports but do the same thing. When you make schedules you'll see they aren't available as AC anymore, you would select DC when setting up the schedules and the ports would show. If you do reassign them delete the AC schedules first then create them as DC schedules. Later there will be an option to set speed on DC ports that's why they are different systems as well. The DC ports are driven by the pca9685 so the output can be adjusted.

Today you setup the extra 1-wire buses for DS18B20 the same as reef-pi. You need to edit the /boot/config.txt file on the Pi and change those lines.

Here's some commands to do that.

sudo nano /boot/config.txt

When it opens find the following line.
dtoverlay=w1-gpio

Change that line to this to comment it out.
# dtoverlay=w1-gpio

Add the following two lines under it.
dtoverlay=w1-gpio,gpiopin=4
dtoverlay=w1-gpio,gpiopin=17


After you make changes press Ctrl + S to save it and then Ctrl + X to exit.

Then run the command
sudo reboot

Later when you click on a sensor port on configure ports screen the DS18B20 will be an option and it will automate what you're doing above.

I'll save the RTC for another day as the software doesn't support it yet. It will come soon though and easy to add.

For the pH you need to go to database today. Go to the "probes" table, there will be one record, change the "plugged" field to 0. You may need to refresh the dashboard. If you double click any records field you can edit inline.


For the DS18B20, make sure Sensor Port 1 on the configure ports screen is disabled.
Reply to top
#70
Thanks for this.  I followed the instructions, and now the ph probe 'box' and graph on the dashboard are gone as desired.
The new 'Room Temp' probe has appeared, BUT, it seems to have replaced the original 'Tank Temp' box,  added a new graph, and the original Tank Temp graph is no longer updating.

One question.  You said to comment out the first dtoverlay=w1-gpio line. That line appears multiple times and I only removed the first occurance.  Should the other be removed as well.  Here's a snippet from the file:

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=off
dtparam=i2c_arm_baudrate=10000
#dtoverlay=w1-gpio
dtoverlay=w1-gpio,gpiopin=4
dtoverlay=w1-gpio,gpiopin=17
dtoverlay=pwm-2chan
dtparam=i2c_arm_baudrate=10000
dtoverlay=w1-gpio
dtoverlay=pwm-2chan
dtoverlay=w1-gpio
dtoverlay=pwm-2chan
dtoverlay=pwm-2chan

I restarted a couple of times but saw no changes.

Thanks,
Phil


Attached Files Image(s)
   
Reply to top
#71
Thanks for posting the config file, I believe my script made that mess, looks like it keeps adding lines every time it runs. Delete all the extra dtoverlay=w1-gpio lines, that will be causing the problem. 

I see dtoverlay=pwm-2chan is also duplicated many times, remove them as well and any other duplicate lines you see. They probably aren't hurting anything but shouldn't be.

And for your lights, they should start changing in 6 hours 34 minutes assuming no modes have start/end times overlapping and the levels on each mode are different. I think you probably have them correct.


I see this as a duplicate as well.

dtparam=i2c_arm_baudrate=10000


The light countdown on dashboard won't update when lights change, you need to refresh dashboard to see next countdown.
Reply to top
#72
That did not solve the problem.  Here's what's in my /boot/config.txt now:
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=10000
dtoverlay=w1-gpio,gpiopin=4
dtoverlay=w1-gpio,gpiopin=17
dtparam=audio=on
[pi4]
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
[all]

that's it--everything else is commented out.  

I shutdown the pi and did a power cycle.  
Now, here's what I see: 
  • Most of the time, the 'Room Temp' is displayed in the left box on the first line.  Occasionally, it moves to the right and 'Tank Temp' appears in the left box, but it displays the actual room temp.  Then both boxes go blank and then the Room Temp appears in the left box.
  • The tank temp graph has stopped updating (actually, the graph time/x-axis moves, but no data is displayed)
  • The room temp graph is updating, but the temperatures it is displaying are above those of the room temp, and below those of the tank temp.
  • Earlier, I incorrectly stated that the ph graph was gone.  It was just hidden by the way my display was set.  It is still there, but it is no longer updating and shows time and values from several hours ago
-Phil


Attached Files Image(s)
   
Reply to top
#73
Wow, based on it momentarily appearing the program is doing what it should. Every time it reads a sensor it first scans the bus to find all sensors. If a sensor that's on the dashboard isn't seen in that scan it disables it causing it to disappear. Next time it sees that sensor ID it will enable it again causing it to reappear. The first time it appears in a box the values shown will be from the sensor that was previously in that box, that's just a UI issue. 2nd read it sorts out but it's not lasting that long.

Any chance it's not fully plugged in?
If you unplug room temp does it appear? The room should disappear.

I forgot the pH graph doesn't stay hidden after page refresh, you'll have to go in database, "probes" table and change "graphVisible" to 0.


Also if you move the room temp sensor to a temp port do both appear?

Maybe try this. Disable the dtoverlay=w1-gpio,gpiopin=17 line with the # in front, then plug both temp sensors in a temp port and see if they both appear.
Reply to top
#74
For the values you see on the chart when you hover the line, those are being averaged. If you hover over the name you'll see the "MA" field, likely set to 10. Change to 0 and the graphs will show raw values written. That number smooths out the line. Also you can pan on the graph with the mouse to move around.
Reply to top
#75
The averaging explains the graph issue, now, after about an hour, the room temp has dropped to 73 from about 75.  I had put a fan at the door so I could more easily tell the difference between tank temp and room temp.  You might consider using a shorter time constant for the averaging.

I'll do some testing consistent w/your other questions and report back in a subsequent post.

-Phil
Reply to top
#76
Thanks. The averaging really depends on the timeframe selected, for 24hr 10 is high, I just picked a number for a default, I think I will go with 0 as it's not a mystery why it doesn't match. At 3 day or more 100 average can be useful. Each graph has it's own value so you can change them to fit the timeframe.
Reply to top
#77
I had an additional long-wire DS18b20 probe, and I plugged that in, in place of the Tank probe. It was immediately recognized started working properly including its 'box' display as well as its graph. I'll leave this probe out of the water for a while and see if it is stable. I fear instability issues when I put it in the tank.

I find it curious that the 'Tank Temp' probe worked reliably all day until I enabled the second port--that seems fishy. Both probes had been plugged in the entire time--when I made the software configuration change, the Tank Temp became unstable.

Over the last 10 mins, or so, I've noticed a couple of times where the Dashboard Box display of the new temp display disappeared momentarily.

-Phil
Reply to top
#78
I assumed the tank temp was fine until you enabled the second port, I find that fishy as well, the programs definitely dosing what it should.

If I remember, you had issue where one sensor would knock them both out and a restart was required, is that right?

My hope/thought is that wouldn't happen any more based on how I manage the sensors. If it's not there it doesn't attempt to read it which could have caused it to hang. Still better to run two 1-wire buses as you have though.

To make my auto system for the ds18b20 I needed to edit some system files on the Pi related to 1-wire. You may or may not have noticed, in reef-pi if you plug in a sensor it can take up to 10 seconds to be detected, if you unplug a sensor reef-pi might report that sensor available for up to 2 minutes. This is all based on the Pi. I found direction to make some changes and now the Pi updates the /sys/bus/w1/devices/ location every 1-3 seconds. It finds new sensors in 1 second and in 3 seconds or less it detects any missing.

After I made that change I discovered quite a few more errors when trying to read sensors, sometimes the 1-wire bus is gone, maybe a sensor or bad data from a sensor.

In the database go to the "errors" table. You could see a variety of errors related to ds18b20, during the read process there's 4 checks and I've seen them all fail at one point or another. Every time something happens the sensor will disappear on the home page as I hide it because in theory it's not available so no point in showing.

So it is common to see 1 or all sensors randomly disappear from the dashboard and then reappear. I am going to make it so it needs to be gone a couple read cycles before it actually disappears on dashboard.


The important thing to watch is the min / max, those are captured every reading so nothing gets by it. If a max of 108 was shown that means that value was used through-out the system, that's why it's important to use a delay when activating macros based on temperature. If a bad reading like that got through it wouldn't cause any ill effects as the custom rule would need say 10 seconds of a valid reading. I run 3 sensors all on the same bus and haven't seen a bad reading but doesn't mean it can't happen.
Reply to top
#79
Rob asks: If I remember, you had issue where one sensor would knock them both out and a restart was required, is that right?

Yes, that is correct and why we enabled the second port for 1-wire. Reef-pi was never made stable measurements with the 1-wire in the tank.

Looking at the errors I see 24 total starting from about 3:30 this afternoon. All three sensor generated errors including two 'out of range' values for one sensor, and the rest being 'sensor not seen on Bus'. Statistics:
Sensor ID, Error Type, Num Occurences
f6, out of range, 2
f6, not on bus, 1
a8, not on bus, 14
0d, not on bus, 7
a8 = original tank temp
f6 = room temp
0d = new long probe

So, it looks like the long DS18b20 probes are a problem for me. The new one is just coiled up much like it came in teh bag w/the controller, sitting on the shelf.

-Phil
Reply to top
#80
It's ok to run those sensors, they should be fine. I've personally noticed a change depending on where the cable runs. When I have it laying with AC cables they definitely have more errors. I know that's not the issue with the coiled up on but it does affect them.

The out of range error means temp was outside -70 to +70 celsius.

The not on bus means it tried to open the file path for that sensor ID but the file wasn't there so it skipped it. Because it's not there it gets disabled and hidden on dashboard. The next read it see it again so enables it and reappears. That's the main error as you can see but it's no big deal as it handles them.
Reply to top


Possibly Related Threads…
Thread Author Replies Views Last Post
  Robo-Tank v6.6 is Ready Rob F 75 20,808 03-09-2024, 07:19 AM
Last Post: Enigma79
  Reef-pi Hardware Now Available Rob F 20 13,377 06-18-2020, 06:33 PM
Last Post: Rob F

Forum Jump:

Current time: 03-29-2024, 02:38 AM