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

OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
New here, but want to say I really appreciate all the info and guidance provided on this thread. Just built my first pi controller (build thread coming) and so far the process is going well! Looking for input on a next possible step - I have one of the new kessil 360x lights which (unfortunately for diy) uses USB-C rather than the old 10-v input to control the intensity and spectrum signals. I'd love to figure out a way to build a pwm light controller for it, maybe by using an adafruit usb-c breakout board, but maybe this is a task for an engineer.

I emailed Kessil and they said "At this moment this is confidential and the pin layout and control schema for K-Link is not open to the public. I have passed this feedback on to our engineering team for consideration"
I am sorry to say that I have nothing to help you with a360x for the moment. I don't know what protocol it uses , there's no doc or any other code to understand the details :-(
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
thanks for confirming my choice on getting an older WE Kessil instead of the x :) At this point I want to make everything work with Reef-Pi if I can :)

@Ranjib any thoughts on how to tackle wavemakers? I don’t mind getting my hands dirty in some code, but also don’t want to reinvent the wheel/tread on toes if you guys already have plans/have it sorted already.
For wave makers, I believe we have most things needed on the software side,, we have to sort out the pump specific circuit and then may be polish the UI a bit. Here is what I would do if I'm in your shoe:

- First decide on a pump, e,g. mp10 or gyre or jebao
- Understand its operating voltage and the type of driver needed. Most pumps operate at 24v and uses bemf/bldc drivers. You might be able to repurpose the existing wavemaker controller or worst case buy one. Drok bdlc driver will cost around 25$ on amazon
- Hook everything up and test with reef-pi by treating the pump as a light. If we can control the pump speed with light intensity slider.. that's enough
- Use random or composite profile for setting up alternating or reef crescent style pump profile. Do this with API (since those profiles are not supported by UI yet) and treating the pump as light. I can provide the necessary instructions.
- If everything goes well,, I'll make sure to add software features to streamline this (docs, UI support for random/composite profile, and may be dedicated wave maker module)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
New here, but want to say I really appreciate all the info and guidance provided on this thread. Just built my first pi controller (build thread coming) and so far the process is going well! Looking for input on a next possible step - I have one of the new kessil 360x lights which (unfortunately for diy) uses USB-C rather than the old 10-v input to control the intensity and spectrum signals. I'd love to figure out a way to build a pwm light controller for it, maybe by using an adafruit usb-c breakout board, but maybe this is a task for an engineer.

I emailed Kessil and they said "At this moment this is confidential and the pin layout and control schema for K-Link is not open to the public. I have passed this feedback on to our engineering team for consideration"
Welcome to reef2reef :-)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
For wave makers, I believe we have most things needed on the software side,, we have to sort out the pump specific circuit and then may be polish the UI a bit. Here is what I would do if I'm in your shoe:

- First decide on a pump, e,g. mp10 or gyre or jebao
- Understand its operating voltage and the type of driver needed. Most pumps operate at 24v and uses bemf/bldc drivers. You might be able to repurpose the existing wavemaker controller or worst case buy one. Drok bdlc driver will cost around 25$ on amazon
- Hook everything up and test with reef-pi by treating the pump as a light. If we can control the pump speed with light intensity slider.. that's enough
- Use random or composite profile for setting up alternating or reef crescent style pump profile. Do this with API (since those profiles are not supported by UI yet) and treating the pump as light. I can provide the necessary instructions.
- If everything goes well,, I'll make sure to add software features to streamline this (docs, UI support for random/composite profile, and may be dedicated wave maker module)
Just wanted to highlight on this topic, that the pwm output -> wavemaker part is still not sorted out. Rest is not a big deal. We have some idea how to do it (BEMF/BDLC drivers) but never tested. Hence that's the unknown we have to tackle.
 

cnidus

Community Member
View Badges
Joined
Mar 19, 2020
Messages
67
Reaction score
79
Rating - 0%
0   0   0
For wave makers, I believe we have most things needed on the software side,, we have to sort out the pump specific circuit and then may be polish the UI a bit. Here is what I would do if I'm in your shoe:

- First decide on a pump, e,g. mp10 or gyre or jebao
- Understand its operating voltage and the type of driver needed. Most pumps operate at 24v and uses bemf/bldc drivers. You might be able to repurpose the existing wavemaker controller or worst case buy one. Drok bdlc driver will cost around 25$ on amazon
- Hook everything up and test with reef-pi by treating the pump as a light. If we can control the pump speed with light intensity slider.. that's enough
- Use random or composite profile for setting up alternating or reef crescent style pump profile. Do this with API (since those profiles are not supported by UI yet) and treating the pump as light. I can provide the necessary instructions.
- If everything goes well,, I'll make sure to add software features to streamline this (docs, UI support for random/composite profile, and may be dedicated wave maker module)

Awesome! I’ve got a couple of Jebao’s that I can modify to control via 0-5v, so hardware is easy enough.

If you can give some pointers to the API on the crescent/alternating patterns I should be good to take a crack at it.

Also happy to help out with docs or anything you want to point me at.

Thanks again! This is a great project, super impressed on both where it is today and what the future holds. Really appreciate your efforts on it :)
 

Freccialata

Community Member
View Badges
Joined
Jan 31, 2020
Messages
54
Reaction score
97
Location
Rome (Italy)
Rating - 0%
0   0   0
@Ranjib

I would like to know if it's possible to integrate in reef-pi:

1) tuya drivers for smart plugs.
In the case there are different drivers for each plug /and it would impossible to create tons of drivers!!!), we have to consider that Tuya wifi smart plugs can easily flashed.
Is it possibile to choose only one firmware of a single smart plug to flash in Tuya smart plugs and implement that kind of "generic" driver in reef-pi?
To better understand what I say, check here https://github.com/reef-pi/reef-pi/issues/642 what philkry commented on 19 of march 2019.

2) Aquatlantis (easy led and easy led 2.0) ramps.
This kind of led lamp are very used in Europe.

Thank you in advance for your answers.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib

I would like to know if it's possible to integrate in reef-pi:

1) tuya drivers for smart plugs.
In the case there are different drivers for each plug /and it would impossible to create tons of drivers!!!), we have to consider that Tuya wifi smart plugs can easily flashed.
Is it possibile to choose only one firmware of a single smart plug to flash in Tuya smart plugs and implement that kind of "generic" driver in reef-pi?
To better understand what I say, check here https://github.com/reef-pi/reef-pi/issues/642 what philkry commented on 19 of march 2019.

2) Aquatlantis (easy led and easy led 2.0) ramps.
This kind of led lamp are very used in Europe.

Thank you in advance for your answers.
reef-pi 3.0 introduced HAL which should make adding new driver pretty easy. As of now I have written shelly, dli web powerswitch and couple of other drivers. If you know the Tuya firmware's API then that will be our starting point. I can assist, but testing these things are bit harder for me since I don't physically use them. Most of my equipment worked without custom firmware. Shelly is opensource, which makes it very appealing in particular (and I think they are available in EU). I would avoid custom firmware support in cases where mainlining is a known impossible (i.e. the feature in consideration is explicitly called out as wont be supported by the original manufacturer). For rest of the use cases, it should be kosher. Tuya is very popular among the home automation folks, I would definitely lend a hand. I'll be landing the mqtt integration soonish..

Same goes for the light. If you have any document/resources on how to control it , that will be starting point. We are likely need to sort out the circuit details. I dont think there will be any software work. We may do some frequency tuning on the software side.. but generally, most of the light controls involve building the control circuit.

Thank you for taking the time to provide such specific feedback. I would really like to improve reef-pi user experience for the EU users
 

Freccialata

Community Member
View Badges
Joined
Jan 31, 2020
Messages
54
Reaction score
97
Location
Rome (Italy)
Rating - 0%
0   0   0
How can I use HAL to add new drivers?
I'm totally unable to create software or program anything.... I'm just an user!!! lol

For the lights... I use Aquatlantis Luminus controller ( https://www.aquatlantis.com/en/products/luminus.html/ ).... I don't know anything else...
It's quite difficult to have document/resources for commercial items! :-(

I'm to thank you for your support and... patience!!!
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Awesome! I’ve got a couple of Jebao’s that I can modify to control via 0-5v, so hardware is easy enough.

If you can give some pointers to the API on the crescent/alternating patterns I should be good to take a crack at it.

Also happy to help out with docs or anything you want to point me at.

Thanks again! This is a great project, super impressed on both where it is today and what the future holds. Really appreciate your efforts on it :)
Thank you for the kind words. It means a lot to us.
On how to use the API to change lights profiles:
- Learn how to use the API using curl command: https://reef-pi.github.io/guides/troubleshooting/
- List your lights, to get the ID of the specific light you want to update `curl -b cookie.txt http://<reef-pi-ip>/api/lights`.
- Save an existing light(with id 1) in son file: `curl -b cookie.txt http://<reef-pi-ip>/api/lights/1 > light_1.json`
- Edit the file, update profile with the one you prefer. Provide profile specific details in the config section under profile. Here is an example of random profile:
Code:
{
  "id": "1",
  "name": "Test",
  "channels": {
    "0": {
      "name": "Channel-1",
      "on": true,
      "min": 0,
      "max": 100,
      "pin": 0,
      "color": "#6f6faf",
      "manual": false,
      "value": 0,
      "profile": {
        "type": "random",
        "config": {
          "start": "00:00:00",
          "end": "23:59:59"
        },
        "min": 0,
        "max": 100
      }
    }
  },
  "jack": "1",
  "enable": true
}
- Upload the updated light spec: `curl -b cookie.txt -X POST -d @l.json http://192.168.86.166/api/lights/1`
Thats it.
Now, regarding what profiles are available and their specific configuration (details here). You can get example configuration in individual profile specific test file in that link.
- Example: Auto: The original 2.0 style setup. Where intensity is specified at 2 hour interval. e.g. 12 set points are provided. config
- All profiles have a min max value that is used to decide the range of values profile can generate. When not defined 0 and 100 used.
- Threres diurnal, sine and random profile that simulates specific daily pwm patterns
- Lunar profile does a concave intensity curve with amplitude varying across different days of the months (foolmoon and new moon)
- Composite profile take a list of sub-profile and iterates over them. Use composite profiles made of different random profiles with varying min/max intensity to simulate reef crest like effect. Use composite profile made with diurnal profile of differnet min/max values to simulate tidal waves.
Currently there's no charting available to visualize the effect, its only evident via graphana/adafruit. This makes it hard to experiment. I am working on to fix that (better charting support for light profiles)
 

Bliff

New Member
View Badges
Joined
Apr 6, 2020
Messages
18
Reaction score
41
Rating - 0%
0   0   0
I'm arggh

I'm getting dropouts from the DS18B20 probe. It didn't do this while I had it on a breadboard, measuring temps over at least 3 days of operation, but now it's dropping out after several hours and reef-pi isn't seeing it. This is also messing up my graph because of the zero readings and occasionally bizarre temps like -1536°C throwing the scale out.

If I power-cycle the pi (sudo shutdown, power cycle) the temp probe reappears like nothing had ever happend, and reef-pi can do it's thing as usual.
I'm using the 3v3 line and the same rating 4.7k resistor as a pullup between 3v3 and data for the probe. I doubt that I have a dodgy connection, given the screw-together cable that the temp probe is using, and the solder joint of the resistor between the VCC and data leads of the probe seems to be good.

Naturally I'll be rechecking this in the near future, and I'll post an update.

Has anyone else had this same issue? I am expecting another probe in the future, so that'll be something to swap out for testing as well. The info on the DS18B20 says that it can take either 5V or 3.3V, so another option is to connect it to 5V - would I use the same value resistor or need something higher?

------------------------- Issue 2 -------------------------

That's on top of the pi frequently ghosting out on the network connection, which is another conundrum.

This is what happens:
The pi is visible to the router, it appears to be maintaining DHCP with a relatively short lease (for now). I have power saving mode turned off on the pi, so the wifi chip stays awake. The pi won't respond to pings, not even when I ssh in to the router and ping it from the router itself. Meanwhile, the pi seems to be merrily doing it's timer related tasks, turning on/off the relays as it's supposed to. It's like it just forgets to respond over the network.
If I save settings on the router's wifi page, this forces the wifi to restart (kicks off all the devices, and in a few moments they all reconnect). Usually this is enough to make the pi respond again.
Is this just a wifi quirk? (signal strength is 90+% via DD-WRT info). It doesn;t seem to happen on my 3B+ that is wired through ethernet.
Rebooting the pi also fixes this.
My next idea is to crontab pinging the router every 15 minutes and see if that keeps the wifi alive.
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
90
Reaction score
73
Location
Parma, Italy
Rating - 0%
0   0   0
Did you reload reef-pi after enabling ph capability ?

hello @Ranjib, when I reloaded the reef-pi the PH tab start to work. But when I try to calibrate my probe, the current reading is 0, I try with lemon juice (1.3V) and mineral water (1.7V) but I'm always read 0. I try to configure the same circuit with Arduino and work fine. Any other suggestion? can I read the raw data?
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
Anyone using an external drive to boot and run from instead of using the SD card? I been poking at it and have it working on a pi zero but haven't decided if I want to run permanently like that or not, need to read some more but was wondering if anyone was already doing it.

Thanks :)
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,321
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Anyone using an external drive to boot and run from instead of using the SD card? I been poking at it and have it working on a pi zero but haven't decided if I want to run permanently like that or not, need to read some more but was wondering if anyone was already doing it.

Thanks :)

In my opinion it's just another potential for failure with no real benefit.
 

Freccialata

Community Member
View Badges
Joined
Jan 31, 2020
Messages
54
Reaction score
97
Location
Rome (Italy)
Rating - 0%
0   0   0
Anyone using an external drive to boot and run from instead of using the SD card? I been poking at it and have it working on a pi zero but haven't decided if I want to run permanently like that or not, need to read some more but was wondering if anyone was already doing it.

Thanks :)
I have a raspberry pi 3 model B +.
The firmare allows to boot permanently from the USB port (id the SD Card is not inserted in the slot).
I use a sandisk 64 GB USB 3.0 Pen Drive... max speed 480 Mbps (Raspberry Pi 3 has USB 2.0. ports).

Raspberry Pi 4 firmware, at the moment, doesn't allow to boot from USB drive.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
That will be nice :)
I am also pretty happy with the current temp sensor performance , I think it’s more than enough for my tanks . But it’s always good to have better sensor and logic support
I have done some reading on electronics boards, and I think the temp sensors can be a crapshoot because most are made with real Dallas Semiconductor DS18b20 chips, but many of the inexpensive sensors found on ebay etc are made in China with cheap knockoffs and seconds.

I agree with @Ranjib my temps in the tank hold just fine with reef-pi, there is more than a daily .2 degree variance in the Amazon River where most of my fish come from. I think shallow reef water has a diurnal variance as well.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
In my opinion it's just another potential for failure with no real benefit.
I agree, just buy a quality SD card, and look into a RTC chip to add so raspian dont get corrupted with improper time stamped files. If the pi loses network it loses time keeping without a RTC
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
In my opinion it's just another potential for failure with no real benefit.
SD cards are the single most common failure point for pi setups in general. Having a USB backed bootable drive not only address that it also gives bigger, cheaper and more robust storage (since you can use standard laptop SSDs which have much larger market).
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have a raspberry pi 3 model B +.
The firmare allows to boot permanently from the USB port (id the SD Card is not inserted in the slot).
I use a sandisk 64 GB USB 3.0 Pen Drive... max speed 480 Mbps (Raspberry Pi 3 has USB 2.0. ports).

Raspberry Pi 4 firmware, at the moment, doesn't allow to boot from USB drive.
I like that setup. I have never tried it since I go through so many (I also run chef which does a lot of workaround). USB based storage and an ability to use computer power supply will open up lot of possibilities.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
I have a raspberry pi 3 model B +.
The firmare allows to boot permanently from the USB port (id the SD Card is not inserted in the slot).
I use a sandisk 64 GB USB 3.0 Pen Drive... max speed 480 Mbps (Raspberry Pi 3 has USB 2.0. ports).

Raspberry Pi 4 firmware, at the moment, doesn't allow to boot from USB drive.

I have it working with a pi zero and m.2 sata drive, you still need an SD card to boot but it only needs one file on it, bootcode.bin and update the partUUID in comandline.txt and fstab and it works. Thinking of trying it with rootfs over NFS, I already have a NFS server up and running but not sure how many hoops you might have to get that working with the zero.

:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,409
Reaction score
1,726
Location
Missouri
Rating - 0%
0   0   0
SD cards are the single most common failure point for pi setups in general. Having a USB backed bootable drive not only address that it also gives bigger, cheaper and more robust storage (since you can use standard laptop SSDs which have much larger market).

Yeah that was my thinking, the zero is picky though with they type of drive that is connected via USB on boot, I suspect it may be power draw but I've not nailed it down. I wanted to use an old 2.5" spinning platter of rust but while it works with the pi booted ( goes from 1.5 watts to 3 watts on my killawatt meter it will not boot, it does work fine when connected after boot. I've also noted that some SSD's will work while others will not (intel 320 drive 32g works, while the 80g version does not). I have lots of drives to play with and had a 128G m.2 sata enclosure and it works like a charm. With the pi zero you still need the SD card but it just has the one file on it and doesn't write to it at all, just read on boot. I will probably go with something like this just haven't finalized which option, going to play around some more this evening.

:)
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 38 27.3%
  • 100% dry rock + 100% live sand

    Votes: 47 33.8%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 30 21.6%
  • 75% live rock, 25% live sand

    Votes: 14 10.1%
  • 25% live rock, 75% live sand

    Votes: 10 7.2%
Back
Top