reef-pi :: An opensource reef tank controller based on Raspberry Pi.

t951

Community Member
View Badges
Joined
Feb 5, 2016
Messages
60
Reaction score
45
Location
Orlando, FL
Rating - 0%
0   0   0
I posted this on my thread, but this thread gets far more views...

I have setup Reef-Pi to use ML pi-hat pins 4,5,6. These pins will activate the three doser pumps. I imagine that each motor gets the positive connected to a pin. (Motor 1 goes to pin 4, Motor 2 to 5, etc). I read the thread and know that they should share the ground with the controller to avoid voltage drift. My question is how do I get 12v to those pins.
I have a buck converter that connects to the hat 12v.
Each motor has a + -
So the wiring from the motors would go from my second box (holding the dosers), to my reef-pi box. A straight through connection with 3 wires for positive (one for each motor) and a shared ground. The wires then get connected to what?

I hope my question is clear....

TLDR....how do i power 12v pumps from the pi-hat?
 

trustychords

New Member
View Badges
Joined
Aug 17, 2019
Messages
24
Reaction score
30
Location
Virginia, USA
Rating - 0%
0   0   0
I have some basic questions about setting up Prometheus on Windows 10. I think I am close but can't get it to run. Here is what I have done so far, step-by-step.

  1. Downloaded Prometheus here and unziped it.
  2. Opened Windows Powershell and executed the following commands one-by-one:
    1. Code:
      Set-Location -Path C:\ -PassThru
    2. Code:
      MKDIR prometheus
    3. Code:
      CD prometheus
    4. Copy/pasted the contents of the Prometheus download into the newly created folder.
    5. Went to http://localhost:9090/graph to ensure Prometheus is operational. It is operational and I got the following screen.
      Untitled.png
    6. At the very bottom of the "prometheus.yml" file in the Prometheus folder, I edited the "static_configs" section. Here is where I can't get things to work, even though I think they should. I add my IP and save. The line now reads 'localhost:9090','000.000.0.201:80/x/metrics'. I save and then go to "http://000.000.0.201:80/targets" but it won't connect. "000.000.0.201" is just a placeholder IP, I enter my actual IP when configuring!
Does anyone have guidance?
 
Last edited:

trustychords

New Member
View Badges
Joined
Aug 17, 2019
Messages
24
Reaction score
30
Location
Virginia, USA
Rating - 0%
0   0   0
I have some basic questions about setting up Prometheus on Windows 10. I think I am close but can't get it to run. Here is what I have done so far, step-by-step.

  1. Downloaded Prometheus here and unziped it.
  2. Opened Windows Powershell and executed the following commands one-by-one:
    1. Code:
      Set-Location -Path C:\ -PassThru
    2. Code:
      MKDIR prometheus
    3. Code:
      CD prometheus
    4. Copy/pasted the contents of the Prometheus download into the newly created folder.
    5. Went to http://localhost:9090/graph to ensure Prometheus is operational. It is operational and I got the following screen.
      Untitled.png
    6. At the very bottom of the "prometheus.yml" file in the Prometheus folder, I edited the "static_configs" section. Here is where I can't get things to work, even though I think they should. I add my IP and save. The line now reads 'localhost:9090','000.000.0.201:80/x/metrics'. I save and then go to "http://000.000.0.201:80/targets" but it won't connect. "000.000.0.201" is just a placeholder IP, I enter my actual IP when configuring!
Does anyone have guidance?

I figured this out. In the prometheus.yml file, you have to change the metrics_path option. Instead of this:
Code:
  # metrics_path defaults to '/metrics'
you have to put
Code:
metrics_path: /x/metrics

So the complete section of code looks like this:

Code:
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    metrics_path: /x/metrics
    # scheme defaults to 'http'.

    static_configs:
     - targets: ['ENTER YOUR REEF-PI IP ADDRESS HERE']
 

Litserv

Community Member
View Badges
Joined
May 3, 2020
Messages
64
Reaction score
55
Rating - 0%
0   0   0
(
Ranjib said:
I have not tried this personally, but should be fairly easy. Try this: https://pimylifeup.com/raspberry-pi-ssl-lets-encrypt/ , its for apache web server (which we are not using) but the instructions provided here does show how to control the path of generated certificates.
Please do report back if this works. If not, i'll find out how to do this. Its an important topic (to run reef-pi with https and proper cert authority), which should be easy, and we should know if theres some obvious gotchas.
)

I'm away from home until next week. Asap I'll try it and report the resulst. THANKS!

I wasn't able to get a certificate from letsencrypt. Sorry, I give up...
 

Kerinin

Community Member
View Badges
Joined
Jun 8, 2020
Messages
45
Reaction score
29
Rating - 100%
2   0   0
I know there's been some discussion of adding the ability to control stepper peristaltic pumps. I'm thinking about doing some work on that topic and I thought I'd describe my plans to make sure I'm not duplicating any existing work, or going in a direction that doesn't make sense for some reason.

One of my priorities is minimizing stepper noise, so I've been looking at the Trinamic TMC-series stepper drivers. They claim to be able to run silently at lower speeds. The two drivers I've been looking at are the TMC2130 and TMC5160. The TMC5160 is basically a more powerful version of the TMC2130 that includes a step/ramp generator controllable via UART.

My first thought was to use the rpi's serial pins to drive the *5160, allowing multiple drivers to be controlled via a shared serial bus. The problem with the approach is that it could lead to uncontrolled dosing: the reef-pi could instruct the *5160 to ramp up to a given velocity with the intention of instructing it to ramp back down the future, then fail somehow, and leave the driver running for an indefinite amount of time (power loss, OOM, unhandled panic, etc).

So my second thought was to use the TMC2130 and an Arduino Nano to generate the step signals. The *2130's are available in 4-packs for $30 and the Nano costs $10 so it ends up being cheaper to run 2+ steppers. There's a stepper library for Arduino that can control multiple drivers simultaneously and includes features like acceleration and deceleration. The Arduino could additionally be used to read GPIO pins, which could be useful for things like preventing dosing if a fluid level sensor is triggered (or not). A serial API would be needed between the rpi and the Arduino, ideally something along the lines of "please execute N steps". On the software side, I think this would involve writing a "sketch" to drive the arduino and a driver for reef-pi.

Does this seem reasonable? Are there concerns I should be considering?
 

Urtoo

Well-Known Member
View Badges
Joined
Jul 1, 2019
Messages
688
Reaction score
865
Rating - 0%
0   0   0
My TMC2130’s run my 3D printer for hours without fail and are silent. I have not seen the other 51 series you mention, but that gives me something to look at today.
It would be amazing to have stepper motor control for many reasons. I wish you success in this.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
Yeah, controlling the amount of steps is the way to go. It's a small pet peeve of mine, seeing people that want to use stepper motors trying to control time and speed instead of actually leveraging the benefit of them and controlling degrees of turning.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I made up a sensor holder today for my ATO which is working great so far.
The lower one is the ATO sensor and the upper one turns off the skimmer if the water level gets high.

Is it possible to also use the upper sensor as a fail safe for the ATO if the sensor fails with the pump on? What would be the best way to set this up?
If I just set the upper sensor to turn the ATO pump off, will they just fight with each other each time the sensors do a check?

20200627_142627.jpg
Looking good :-)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I made up a sensor holder today for my ATO which is working great so far.
The lower one is the ATO sensor and the upper one turns off the skimmer if the water level gets high.

Is it possible to also use the upper sensor as a fail safe for the ATO if the sensor fails with the pump on? What would be the best way to set this up?
If I just set the upper sensor to turn the ATO pump off, will they just fight with each other each time the sensors do a check?

20200627_142627.jpg
Just setup another ato controller with the upper sensor and same pump
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I know there's been some discussion of adding the ability to control stepper peristaltic pumps. I'm thinking about doing some work on that topic and I thought I'd describe my plans to make sure I'm not duplicating any existing work, or going in a direction that doesn't make sense for some reason.

One of my priorities is minimizing stepper noise, so I've been looking at the Trinamic TMC-series stepper drivers. They claim to be able to run silently at lower speeds. The two drivers I've been looking at are the TMC2130 and TMC5160. The TMC5160 is basically a more powerful version of the TMC2130 that includes a step/ramp generator controllable via UART.

My first thought was to use the rpi's serial pins to drive the *5160, allowing multiple drivers to be controlled via a shared serial bus. The problem with the approach is that it could lead to uncontrolled dosing: the reef-pi could instruct the *5160 to ramp up to a given velocity with the intention of instructing it to ramp back down the future, then fail somehow, and leave the driver running for an indefinite amount of time (power loss, OOM, unhandled panic, etc).

So my second thought was to use the TMC2130 and an Arduino Nano to generate the step signals. The *2130's are available in 4-packs for $30 and the Nano costs $10 so it ends up being cheaper to run 2+ steppers. There's a stepper library for Arduino that can control multiple drivers simultaneously and includes features like acceleration and deceleration. The Arduino could additionally be used to read GPIO pins, which could be useful for things like preventing dosing if a fluid level sensor is triggered (or not). A serial API would be needed between the rpi and the Arduino, ideally something along the lines of "please execute N steps". On the software side, I think this would involve writing a "sketch" to drive the arduino and a driver for reef-pi.

Does this seem reasonable? Are there concerns I should be considering?
There are direct rpi drivers for steppers, either using the two hardware timers or by generating pwm (using the same timer) and using it to driver steppers employing some pwm -> stepper board. I have some sample doser and drivers for experimenting, but didn't get to it due to lack of time/compelling reasons. Most of my requirement are easily done by DC motors (ato and dosing), but I'm definitely interested in this. This is critical for unlocking precise dosing which is underpinning for titration.
Let me know if I can be of any help. Idellay, you'll endup with a driver and associated IC/board and rest of reef-pi should easily integrate with it. If that's not the case, and you think some major UI changes is required, let me know.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,682
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I figured this out. In the prometheus.yml file, you have to change the metrics_path option. Instead of this:
Code:
  # metrics_path defaults to '/metrics'
you have to put
Code:
metrics_path: /x/metrics

So the complete section of code looks like this:

Code:
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'prometheus'

    metrics_path: /x/metrics
    # scheme defaults to 'http'.

    static_configs:
     - targets: ['ENTER YOUR REEF-PI IP ADDRESS HERE']
Thank you. I think I had mentioned this somewhere. Worth adding it in docs/guides ...
 

Aqua Gardener

Active Member
View Badges
Joined
Apr 26, 2020
Messages
241
Reaction score
171
Rating - 0%
0   0   0
Hi All, I am configuring the Kasa smart plug, and I am trying to configure the temp control to turn off my heater if the temp goes above 81 and turn it on whenever the temp goes below 78. I tried to use the macros, but it is not running the commands. I plan to use this as a fail safe if the heater should ever get stuck in the on position. Thank you!
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Hi All, I am configuring the Kasa smart plug, and I am trying to configure the temp control to turn off my heater if the temp goes above 81 and turn it on whenever the temp goes below 78. I tried to use the macros, but it is not running the commands. I plan to use this as a fail safe if the heater should ever get stuck in the on position. Thank you!
You don't need macros, just set up your temps in the temperature setup.

Screenshot_20200629-190003.png
 

-MerlyN-

New Member
View Badges
Joined
Feb 29, 2020
Messages
4
Reaction score
27
Rating - 0%
0   0   0
Hello. Still waiting for ML's goby hat, which is delayed at customs, so making very little progress with my own build.
However I set up a temp sensor for a very simple first look test. Ok, works :D
I dont get the dashboard, however. The health and temp graphs are adjusting fine. The graph for 'Temperature(historical)' does not adjust correctly. How can I fix that?
test_graph.jpg
 

Kerinin

Community Member
View Badges
Joined
Jun 8, 2020
Messages
45
Reaction score
29
Rating - 100%
2   0   0
I've been working on how to use an Arduino to drive the step/dir interface of stepper drivers, and I ran across the Firmata Protocol. Firmata is designed to allow control of an Arduino over a serial interface, for instance you can read an analog pin's value, or set a pin high/low. The protocol has extensions for a number of different features; my interest is primarily the interface for the AccelStepper library. The AccelStepper interface allows control of up to 10 steppers running on the Arduino.

Unfortunately I don't see a Go implementation of the AccelStepper interface. I'm working on a implementing the missing pieces - it doesn't look too complicated. Once that's complete, it should be possible to load the Firmata sketch onto an Arduino and then use Go to control steppers (or stepper drivers) connected to the Arduino in Go over a serial connection from the "host" computer. Planning to look at extending the reef-pi to use this communication layer once the Firmata pieces are all working.
 

SDchris

Active Member
View Badges
Joined
Mar 3, 2015
Messages
198
Reaction score
225
Location
Sydney
Rating - 0%
0   0   0
One of my priorities is minimizing stepper noise, so I've been looking at the Trinamic TMC-series stepper drivers. They claim to be able to run silently at lower speeds. The two drivers I've been looking at are the TMC2130 and TMC5160. The TMC5160 is basically a more powerful version of the TMC2130 that includes a step/ramp generator controllable via UART.

My first thought was to use the rpi's serial pins to drive the *5160, allowing multiple drivers to be controlled via a shared serial bus. The problem with the approach is that it could lead to uncontrolled dosing: the reef-pi could instruct the *5160 to ramp up to a given velocity with the intention of instructing it to ramp back down the future, then fail somehow, and leave the driver running for an indefinite amount of time (power loss, OOM, unhandled panic, etc).
If you use SPI you can access the on board motion controller TMC5160. That way you only need to send it the amount of steps you want to move and the TMC takes care of the rest. Including ramp generation and speed. That way it doesn't matter if the PI fails.

Last I looked TMC5160 step sticks don't have access to the motion controller. You need the TMC5160-bob.
 

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,695
Reaction score
1,607
Rating - 0%
0   0   0
By the way, is it planned to have actual calibration for dosing volume as part of the dosing pump settings going forward? Or is that omitted on purpose because right now the dosers can only do full second increments?
 

Kerinin

Community Member
View Badges
Joined
Jun 8, 2020
Messages
45
Reaction score
29
Rating - 100%
2   0   0
If you use SPI you can access the on board motion controller TMC5160. That way you only need to send it the amount of steps you want to move and the TMC takes care of the rest. Including ramp generation and speed. That way it doesn't matter if the PI fails.

You're right, I didn't realize until after I posted that the "target" mode could be used to drive an arbitrary number of steps (I misunderstood the "target" as describing the angle of the rotor). I still think I'm going to go the Arduino route though, mostly because it's not specific to a specific driver board. The Arduino should be able to control any stepper driver using the step/dir interface. SPI also eats up a lot of GPIO pins on the Pi, for instance I'm planning to drive 7 pumps on the project I'm currently working on.

By the way, is it planned to have actual calibration for dosing volume as part of the dosing pump settings going forward? Or is that omitted on purpose because right now the dosers can only do full second increments?

My plan was for the dosers to be controlled by "steps", and for the Pi to be responsible for translation steps into fluid volumes. So there would be a calibration in the Pi mapping a single "step" into a fluid amount, but the Arduino would only ever know about steps.
 

ARE YOU READY TO CONFESS TO CRAZIEST, DUMBEST, FUNNIEST THING YOU’VE EVER DONE IN REEFING?

  • Yeah, I'll confess! (Share your story in the comments!)

    Votes: 10 58.8%
  • Nah, I'll keep mine a secret...(Don't be like that, share with the class!)

    Votes: 7 41.2%
Back
Top
Home
Post thread…
Market
What's new