RPiAqua (Raspberry Pi Light Controller - In Progress) - Page 8 - The Planted Tank Forum
 6Likes
Reply
 
LinkBack Thread Tools Display Modes
post #106 of 119 (permalink) Old 06-17-2019, 07:20 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 11,589
Quote:
Originally Posted by Kaiede View Post

At this point, my light controller has been operating without intervention for 3+ months, without a service restart.
Cool
kind of more amazing stuff..
https://github.com/blueacro/reefpi-p...pi_pico_v2.pdf


https://www.reef2reef.com/proxy.php?...fcf66c6e989369


https://www.reef2reef.com/threads/re...boards.499890/
Pi-Zero though...

OPP's..
Quote:
Pi 3 should work fine when used with a M/F ribbon extender.

"A man with a watch knows what time it is. A man with two watches is never sure."

Last edited by jeffkrol; 06-17-2019 at 07:50 PM. Reason: edit
jeffkrol is offline  
Sponsored Links
Advertisement
 
post #107 of 119 (permalink) Old 07-18-2019, 05:19 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 11,589
I have attempted to convince Reef-Pi people to add your gamma dimming to their program.. hope you don't mind..

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is offline  
post #108 of 119 (permalink) Old 07-18-2019, 07:29 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
There’s no real magic there. More LED driving software/firmware should be accounting for gamma. So I hope they pick up the feature. But that’s me being a color management nerd.

They should just be careful about what units they use for config inputs. I found it’s easier to adjust raw “lumens” when dealing with plants/algae to dial it in. Even though you then want to interpolate along the gamma curve while dimming. Reef tanks I expect are similar.

Hmm, now I wonder about offering a setting to tweak color balance of a multi-channel light, and have it applied automatically for you to the lighting. I.e: you just ask for 50% and it figures out how much to skew the RGB channels to keep color temp close to what you want. Probably overkill, probably a pain to configure.

But maybe more valuable is being able to at least do a basic version of it. My local changes supports naming channels in the hw config file now that the schedule is its own file... maybe make it possible to merge multiple hw channels into a single software one.


Sent from my iPhone using Tapatalk


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
 
post #109 of 119 (permalink) Old 07-28-2019, 07:28 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
FYI, I'm about to deploy an updated build to my personal tank that does a few things:
  • Updates to Swift 5.0.2, Raspbian Buster. This brings the environment up to date. This setup is supported by the Pi Zero, which is great news. I wasn't sure if 32-bit ARM would work with Swift 5 (it was looking pretty broken for a while).
  • Splits the schedule and hardware configuration files. This will be needed for future updates.
  • The PWM HAT I2C address can be specified in the configuration.
  • Adds the ability to use multiple bits of hardware for LED output. So multiple PWM HATs (with separate addresses), or whatever you can make work without conflict.
  • Channels are now named by the user in the hardware configuration, so schedules are now more hardware agnostic.
  • Experimental support for MCP4725 boards for 0-10V analog output. (Kessil Control, Maybe?)

On a less user-facing note:
  • Refactor of the LED output module. A lot of this was needed to better support the split configuration file, and the MCP4725 DAC output.
  • Redid the JSON parsing code. It now uses the JSON decoder included in Swift 4 and later. One less dependency to build and track. Errors are a bit more specific, but also more confusing since I'm currently exposing the raw errors from the built-in decoder. I'll need to make these better as I start working on MQTT support.

I'll let this run for a couple weeks on my home aquarium and flushing out any bugs before I push it out, but it should be stable enough to release once that's done.

I want to see if I can implement one more feature before I mark it as "1.0" though: support for reloading the schedule.json file when the user makes changes without rebooting the service. Although maybe this isn't a huge deal compared to making people use 'sudo systemctl restart rpilight' if they are editing it by hand, if MQTT will render the feature moot? Especially since it looks like I don't need to worry about losing support for 32-bit in order to add MQTT anymore. I may just make this release the big "1.0".

EDIT: Already found one bad bug introduced by the LED controller refactor and fixed it. Hmm, should write some tests around some of that code, I think.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Kaiede; 08-13-2019 at 05:03 AM. Reason: Small update
Kaiede is offline  
post #110 of 119 (permalink) Old 08-13-2019, 05:55 AM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
Aug 12th Update: Early test so far seems to be doing well. There's some work I need to do with the bootstrap script before it's ready, but it's getting close.
  • Raspbian Buster shipped pulling packages from the 'testing' Debian Buster repo. It needs an 'apt-get update' before Swift 5's dependencies can get installed. So I need to update the instructions with that, or include it in the bootstrap script.
  • Need to make sure Swift is in the PATH before calling the build script while bootstrapping. I've got a patch ready, just need to test it.

But everything on the aquarium itself seems to be working fine.

Aug 14th Update: 1.0 is now out. It breaks Swift 3 and existing configuration files, be aware if you are running on 0.9.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by Kaiede; 08-15-2019 at 04:07 AM. Reason: Update
Kaiede is offline  
post #111 of 119 (permalink) Old 09-09-2019, 11:36 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
It's been a month, but I haven't been idle.

I'm in the middle of hooking up an MQTT library. I'm having to do some work building on top of the library, but that's coming along well. Once that's done, I'm going to start hooking stuff up for being able to read the state of the lighting over MQTT. Then will come the work to allow new state to be written.

Part of that will be writing a small iOS app that shows how to read/control the lights.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
post #112 of 119 (permalink) Old 11-09-2019, 10:04 AM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jul 2016
Posts: 33
Do you have any expirience with rPI and LC-LM358-PWM2V.
PWM turn voltage module 0%-100%PWM turn to 0v-10V voltage_chinalctech

I am trying to get 10V out of it but max is 9,12V. Also low PWM freq. is making it little unstable. Could be rPI PWM problem? I am using GPIO18.
Jabolko is offline  
post #113 of 119 (permalink) Old 11-09-2019, 01:41 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
Quote:
Originally Posted by Jabolko View Post
Do you have any expirience with rPI and LC-LM358-PWM2V.

PWM turn voltage module 0%-100%PWM turn to 0v-10V voltage_chinalctech



I am trying to get 10V out of it but max is 9,12V. Also low PWM freq. is making it little unstable. Could be rPI PWM problem? I am using GPIO18.

Not too familiar with that one. I have a couple I2C -> 0-10V chips I mean to test though.

But it is possible to feed it the 1-3kHz it needs with the Pi. I drive my current setup in that range no issue. The problem is that the inputs expect 5V and the Pi uses 3.3V on the GPIO pins. I’m surprised it works at all.

I think I may have looked at boards similar to this months ago and wrote them off because they required 5V logic on the inputs.


Sent from my iPhone using Tapatalk


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
post #114 of 119 (permalink) Old 11-09-2019, 03:06 PM
Algae Grower
 
PTrader: (0/0%)
Join Date: Jul 2016
Posts: 33
Hmm yes.. could be PWM 3.3V problem. What I2C chip do you use in current setup?
Jabolko is offline  
post #115 of 119 (permalink) Old 11-09-2019, 03:19 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
I’ve written a library to talk to the MCP4725 chip used in boards like this one: https://aptinex.com/product/aptinex-...v-mcp4725-i2c/

I still need to get around to testing the library with my Kessil though.


Sent from my iPhone using Tapatalk


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
post #116 of 119 (permalink) Old 11-09-2019, 03:59 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 11,589
Quote:
Originally Posted by Kaiede View Post
Not too familiar with that one. I have a couple I2C -> 0-10V chips I mean to test though.

But it is possible to feed it the 1-3kHz it needs with the Pi. I drive my current setup in that range no issue. The problem is that the inputs expect 5V and the Pi uses 3.3V on the GPIO pins. I’m surprised it works at all.

I think I may have looked at boards similar to this months ago and wrote them off because they required 5V logic on the inputs.


Sent from my iPhone using Tapatalk
AFAICT most take a variable range of PWM input..
Not unlike Meanwell drivers..


Quote:
3.3P-5V 3.3V PWM Signal to 0-10V Voltage Converter D/A Digital-Analog PLC Module
Quote:

1. This module can convert 0-100% PWM digital signal into analog signal.
2. The input digital signal can be a 0-100% PWM signal of 3.3V level.
3. The output analog signal can be 0-10V voltage.

PWM Signal Receive Frequency Range: 100HZ-3KHZ (1-3KHZ is recommended)




eek bay thing so no link..
Just need to put a sticker on it..
https://www.amazon.com/KNACRO-Conver.../dp/B079B9SWH2

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is offline  
post #117 of 119 (permalink) Old 11-11-2019, 05:12 PM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
Quote:
Originally Posted by jeffkrol View Post
AFAICT most take a variable range of PWM input..
Not unlike Meanwell drivers..
Not wrong, but they have to be designed for it. A lot of the super cheap boards here are using off the shelf budget ICs and keeping component counts down for price reasons. If they say you should feed it a minimum of 4.5V PWM, believe it.

3.3V logic to 5V logic tends to sit in the “undefined behavior” zone of most digital logic designs that use 5V.

Quote:
Originally Posted by jeffkrol View Post
eek bay thing so no link..
Just need to put a sticker on it..
https://www.amazon.com/KNACRO-Conver.../dp/B079B9SWH2

The Amazon version is similar, but I still wouldn’t expect it to be identical in behavior. It’s a gamble.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
post #118 of 119 (permalink) Old 11-11-2019, 05:31 PM
Planted Tank Guru
 
PTrader: (0/0%)
Join Date: Jun 2013
Location: WI
Posts: 11,589
Quote:
Originally Posted by Kaiede View Post
Not wrong, but they have to be designed for it. A lot of the super cheap boards here are using off the shelf budget ICs and keeping component counts down for price reasons. If they say you should feed it a minimum of 4.5V PWM, believe it.

3.3V logic to 5V logic tends to sit in the “undefined behavior” zone of most digital logic designs that use 5V.




The Amazon version is similar, but I still wouldn’t expect it to be identical in behavior. It’s a gamble.

how about this one? Popular w/ the Reef Pi crowd..


https://www.tindie.com/products/rant...for-mars-aqua/

"A man with a watch knows what time it is. A man with two watches is never sure."
jeffkrol is offline  
post #119 of 119 (permalink) Old 11-18-2019, 12:50 AM Thread Starter
Planted Member
 
Kaiede's Avatar
 
PTrader: (0/0%)
Join Date: Sep 2017
Location: Seattle, WA
Posts: 256
Latest Update (Nov 17, 2019): 1.1 Released
  • YAML Configuration File Support
  • Daylight Savings Time Fixes (thanks rgmoorer, for reporting this)
  • Updated to Swift 5.1.1

Swift 5.0.x is still supported. Swift 4.x is not. It made sense to try to get off Swift 4 while the getting was good, since it wasn't the greatest release on the Raspberry Pi. Swift 5 is much better, and opens up more libraries now that we've caught up with the official releases.

YAML support meant that I had to change the format of the config files slightly again. Using the new format, you can also use JSON if you really want, but if you are editing this by hand, YAML is much cleaner and faster to edit.

----

Quote:
Originally Posted by jeffkrol View Post
how about this one? Popular w/ the Reef Pi crowd..


https://www.tindie.com/products/rant...for-mars-aqua/
That should work fine, I think. Just needs to be fed the PWM output from RPiLight and it should do the right thing. 15$ isn't a bad price either. Maybe a little more wiring to be done by the person using it though.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Kaiede is offline  
Reply

Tags
None

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Planted Tank Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome