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,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I use react and noticed you guys also use react but have no backed experience in GO progrmaing language.

Here is my very rough idea let me know what you think thanks

ReefPI.png
I think it looks awesome and just wanted to say thank you so much for your interest. We could really use your help with various UI enhancement/bugfixing. Use the slackchannel invite in the very first post in this thread to get started. Theres a bunch of issues tagged as UI/UX in github that you can also take a look at.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I purchased one of the hs300 units, I like the concept but not sure I like the no security thing, I need to dig into it some more and understand how it works, but it appears you only need to be on the local network to control it. Would be nice if they had a way of verifying the request coming if etc, thinking of sticking it on my IOT network which has limited or no access outbound or to my lan. Need to do some more reading on how it works but currently it appears to be ip:9999 and you can do stuff. Here is one of the better article that digs into how it works, not up to date with a current firmware but does go into a lot of detail in how they work - TP-asa outlets
It uses auto-encrypt algorithm over a tcp connection. Its not at all a good security implementation. DLI uses digest auth which is little better but slower in performance. You can audit the details here: https://github.com/reef-pi/drivers/blob/master/tplink/connection.go

Let me know what you think., my current approach has been to have dedicated , locked down SSID for IoT things, and only allow those that work on local. SSID that's connected to internet gateway are on end to end iptables+ipsec (transport layer) encrypted
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I'm still "playing" with my reef-pi, even if it is running on a real fish tank I have to dismiss.

I use on “old” Samsung Galaxy Tab upon my Fish tank.
I also use Chrome and I reach my reef-pi server just with The IP.

The display is always on so that I can see data from my Adafruit’s profile Dashboard.

This is my configuration for the Raspberry:
Smart Plug WiFi --> Power Adapter --> Power Bank --> Raspberry
On the Raspberry is runnung a VPN server so that I can easily connect it from the outside.

On the tablet I have installed TeamViewer and the app to control the smart plug where is connected the Raspberry and the app to control the TP-Link smart plugs that control temperature and (later) the ph.

In case of problem I can access my lan in any way.

Next step is to connect my router to an UPS.... and/or put a SIM in the tablet.

6D3E31AF-D419-4BF1-89DE-05DA0835BC57.jpeg 051B26CC-5A09-4294-9416-DB00466BC109.jpeg
Very nice :-0) . Thank you for sharing
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Are there any settings in reef-pi that I may have missed or on the tablet? I renamed my pi 220dt so I typed in http://220dt.local and just get a blank screen. It works fine from a computer just nothing else.

Thank you
the .local domain utilizes mdns/bonjour style discovery. It has different behavior across different devices in different versions. Most new things work, most apple and windows things work. Some older android versions do not work,
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So playing with a HS300 and its no workie after a reboot, I see some comments from @Ranjib mentioning this but the outlet once defined will not work unless I restart the service after boot. In the journal I see this error message -
Code:
ERROR: equipment subsystem: Failed to sync equipment hs300 outlet 1 . Error: can't update 1 - can't get output pin

If you restart the service it comes up clean, this is a new load with the latest version, it's the order of the startup, it may be trying to come up before network is up which would cause the issue. I will do some more digging and see if I can pinpoint the issue, unless there is already a fix.

:)
you can reload reef-pi after pi is restarted to fix this issue. You can also update the systemd unit file for reef-pi to make it wait for network upon startup to permanently fix this issue.
 

scottrotton

Active Member
View Badges
Joined
Oct 5, 2017
Messages
128
Reaction score
143
Location
Sydney
Rating - 0%
0   0   0
I think it looks awesome and just wanted to say thank you so much for your interest. We could really use your help with various UI enhancement/bugfixing. Use the slackchannel invite in the very first post in this thread to get started. Theres a bunch of issues tagged as UI/UX in github that you can also take a look at.
Will join the slack group for Dev talk thanks
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
you can reload reef-pi after pi is restarted to fix this issue. You can also update the systemd unit file for reef-pi to make it wait for network upon startup to permanently fix this issue.

This is what I am using so far
Code:
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
but think we need to make sure users of that equipment are aware that they will need to reload once things come back up, I did notice though that the UI did not always come up either on clean boot. I need to do more testing and see if I can narrow things down, just passing along the information.
:)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
It uses auto-encrypt algorithm over a tcp connection. Its not at all a good security implementation. DLI uses digest auth which is little better but slower in performance. You can audit the details here: https://github.com/reef-pi/drivers/blob/master/tplink/connection.go

Let me know what you think., my current approach has been to have dedicated , locked down SSID for IoT things, and only allow those that work on local. SSID that's connected to internet gateway are on end to end iptables+ipsec (transport layer) encrypted

Will take a look at your information, so does the HS300 need internet access or not at least after it is setup. I believe it does if you want to get any energy data from it, but still poking at it. I have a dedicate vlan to iot things and may stick it there but it does not have internet access, I could open it up for certain devices but still thinking about how I want to proceed.

Thanks :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
This is what I am using so far
Code:
ExecStartPre=/bin/sh -c 'until ping -c1 google.com; do sleep 1; done;'
but think we need to make sure users of that equipment are aware that they will need to reload once things come back up, I did notice though that the UI did not always come up either on clean boot. I need to do more testing and see if I can narrow things down, just passing along the information.
:)
You can just add
Code:
After=network-online.target
Wants=network-online.target
its lot cleaner that way
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Will take a look at your information, so does the HS300 need internet access or not at least after it is setup. I believe it does if you want to get any energy data from it, but still poking at it. I have a dedicate vlan to iot things and may stick it there but it does not have internet access, I could open it up for certain devices but still thinking about how I want to proceed.

Thanks :)
It does not need internet access. But the pi to hs300 connection requires local wifi network , which is why i think my proposed solution is better, since it does not rely on internet/google name server. as long as eth0/wlan0 is up (ip assignment), we are good to go
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,234
Rating - 0%
0   0   0
The wifi power strips must be compatible with specific protocols. At this time, reef-pi supports some DLI, Shelly 1 and 2.5, and TP-Link HS 103, 110, and 300 outlets. Other systems, like espurna and Tasmota aren't supported yet.
Thanks, if you are just talking about the wifi protocol then it looks like they all use the same IEEE 802.11b/g/n protocol that the board I linked uses. But if you mean some other back end protocol then I am not sure if they are the same or not.

Either way I am still quite time poor atm so I am going to buy the boards I linked as they will be useful on the tank in the meantime anyway. Then I will hopefully have some time in June / July to see if they are compatible with reef-pi or not :)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
It does not need internet access. But the pi to hs300 connection requires local wifi network , which is why i think my proposed solution is better, since it does not rely on internet/google name server. as long as eth0/wlan0 is up (ip assignment), we are good to go

I will do some more playing tonight and over weekend, I've seen lots of articles where this does not work:
Code:
After=network-online.target
Wants=network-online.target

Honestly I'm not a systemd fan so I do not fully understand it, but I read several indications that the after and wants does not do what you would think like this - systemd

I will research some more and see what I can figure out, I do not think it will be that straight forward. I think the critical part of that article is this section
The right "wait" service must be enabled too (NetworkManager-wait-online.service if NetworkManager is used to configure the network, systemd-networkd-wait-online.service if systemd-networkd is used, etc.). systemd-networkd.service has Also=systemd-networkd-wait-online.service in its [Install] section, so when systemd-networkd.service is enabled, systemd-networkd-wait-online.service will be enabled too, which means that network-online.target will include systemd-networkd-wait-online.service when and only when systemd-networkd.service is enabled. NetworkManager-wait-online.service is set up similarly. Verify that the right service is enabled (usually only one should be):

Thats what I was doing in my first example but it requires network manager to be installed and configured and I do not think we want to go down that path. Will see what I can figure out.
 
Last edited:

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
It does not need internet access. But the pi to hs300 connection requires local wifi network , which is why i think my proposed solution is better, since it does not rely on internet/google name server. as long as eth0/wlan0 is up (ip assignment), we are good to go

I understand about the local wifi connection but not sure if the device needs to talk to the cloud for additional configuration. I remember when configuring the HS300 one of the options was to configure it local only and that was not an option for the HS300, lots to play with and figure out for sure..currently still wrestling with the power cables, grrrr
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
I had a couple f power trips last night and since then, I can't access my reef-pi. I can't access the IP address from my phone, Laptop,tablet or any of the usual devices I normally use. I also can't access via VNC or SSH in via Putty.

I DO however have my old touchscreen connected, so can access using that. Reef-pi is definitely running. I've had at least one automated function happen (that I saw)

Any ideas?
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I had a couple f power trips last night and since then, I can't access my reef-pi. I can't access the IP address from my phone, Laptop,tablet or any of the usual devices I normally use. I also can't access via VNC or SSH in via Putty.

I DO however have my old touchscreen connected, so can access using that. Reef-pi is definitely running. I've had at least one automated function happen (that I saw)

Any ideas?

Do you have a keyboard attached, if so you can drop to a command prompt and see what the issue is, I am guessing it's the network stack. Not sure if you are using wireless or wired connection, if your router provides dhcp lease information you can see if it's in the table or look for the mac address in the arp information. I think if you rebooted it now everything will come up clean, but it would be good to know what is not working properly. Another thing you can do is if you are able to drop to the command prompt with a keyboard is to look at the journalctl output and see what errors are present, would want to go to around the time that it came back up and scroll through looking for any errors.

Let us know what you figure out. :)
 

Des Westcott

Well-Known Member
View Badges
Joined
May 29, 2018
Messages
646
Reaction score
1,035
Location
Durban - South Africa
Rating - 0%
0   0   0
Do you have a keyboard attached, if so you can drop to a command prompt and see what the issue is, I am guessing it's the network stack. Not sure if you are using wireless or wired connection, if your router provides dhcp lease information you can see if it's in the table or look for the mac address in the arp information. I think if you rebooted it now everything will come up clean, but it would be good to know what is not working properly. Another thing you can do is if you are able to drop to the command prompt with a keyboard is to look at the journalctl output and see what errors are present, would want to go to around the time that it came back up and scroll through looking for any errors.

Let us know what you figure out. :)


Just realised the problem. Router assigned reef-pi a new IP address....... Realised when I saw the on the bottom info line on the reef-pi monitor.

Thanks Tom. On the money there. I need to remember to check that.
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Just realised the problem. Router assigned reef-pi a new IP address....... Realised when I saw the on the bottom info line on the reef-pi monitor.

Thanks Tom. On the money there. I need to remember to check that.

I had that issue with a mobile device stealing my ip address for the reef pi. I set my network up in the 10.x.x.x subnet so that I can have lots of subnets to separate things into.. I put that device into a subnet out of my DHCP net and gave it a static IP and no issues now.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
You can just add
Code:
After=network-online.target
Wants=network-online.target
its lot cleaner that way

Tested and that appears to work correctly on reboot and after poweroff. Reading the documentation it appeared that you would need an additional wait service to be installed, but I did a clean install and with the update in the service it's coming up properly. Is there a reason it's not currently in the service script? Any reason to not add it?

Thanks :)
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Just realised the problem. Router assigned reef-pi a new IP address....... Realised when I saw the on the bottom info line on the reef-pi monitor.

Thanks Tom. On the money there. I need to remember to check that.

Not sure what kind of router you have but if it's a decent one you can assign mac addresses to get assigned a specific address, acts like a static in the sense that it will always get the same address. If your router is lacking I can suggest some that have a lot more capability and are opensource, allows you to nail up stuff that you do not want changing.

Here is a screenshot of some of mine, lol way to many....
dhcp-static.png


With a decent firewall you can also add the names to DNS and have things working by name instead of relying on .local stuff. If you would like more information or questions just shoot me a PM.

:)
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
79
Reaction score
70
Location
Parma, Italy
Rating - 0%
0   0   0
@Ranjib Hello, the ADS1115 ph-board driver is working? i can connect to it, with arduino I can read the A0 value, but in reef-pi the only value I read is 0.

any advice?
 
Back
Top