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

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
You need to execute a command to create the tplink driver using API (similar to ph calibration), thats all, then you can create outlet using that driver and associate it with an equipment using the normal UI

what command is used to create the driver?
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
I have 3.0 and use chrome exclusively to access...3 temp sensors, 2 heater controllers ph board all reading at 60 seconds...8 outlets and 2 macros and 4 lighting pca9685 channels...steady 8 percent mem usage
 

BenB

Community Member
View Badges
Joined
Jun 11, 2019
Messages
98
Reaction score
152
Rating - 0%
0   0   0
This is still an issue?

Here are the logs:
upload_2019-6-14_7-44-8.png


It looks like a PCA9685 needs to be connected when enabling the PCA9685 option. Only then I do not expect that reef pi does not start, rather gives an error.
Can someone try the same? I have nothing connected to the PI, running 2.4 with raspbian 4.14. From a blank install just enable the "PCA9685" update and reboot.
Deleting the database afterward brings you back to a functioning reef-pi, Thanks!!
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
what command is used to create the driver?
create a file with following data (kasa.json) . Type "hs1xx" is important, this tells reef-pi that its a kasa smartplug. Change the SMART_PLUG_IP with your smar plug's IP (check your router or kasa app to get the ip ).
Code:
{"name":"KasaTest","type":"hs1xx","config":{"address":"SMART_PLUG_IP:9999"}}
Then use reef-pi api to create a new driver. Use appropriate reef-pi ip. You'll need to create the cookie.txt file using auth/signin api. if its there, it can be reused.
Code:
curl -X PUT -d @kasa.json  http://REEF_PI_IP/api/drivers -b cookie.txt
After this you should see a new driver name kasa is visible in Configuration -> Drivers section. You can go to connectors and create outlet and associate the new driver from UI . Let me know how it goes . I was ecstatic to see this working :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Here are the logs:
upload_2019-6-14_7-44-8.png


It looks like a PCA9685 needs to be connected when enabling the PCA9685 option. Only then I do not expect that reef pi does not start, rather gives an error.
Can someone try the same? I have nothing connected to the PI, running 2.4 with raspbian 4.14. From a blank install just enable the "PCA9685" update and reboot.
Deleting the database afterward brings you back to a functioning reef-pi, Thanks!!
this is a bug. :-( . We'll have to fix it.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
create a file with following data (kasa.json) . Type "hs1xx" is important, this tells reef-pi that its a kasa smartplug. Change the SMART_PLUG_IP with your smar plug's IP (check your router or kasa app to get the ip ).
Code:
{"name":"KasaTest","type":"hs1xx","config":{"address":"SMART_PLUG_IP:9999"}}
Then use reef-pi api to create a new driver. Use appropriate reef-pi ip. You'll need to create the cookie.txt file using auth/signin api. if its there, it can be reused.
Code:
curl -X PUT -d @kasa.json  http://REEF_PI_IP/api/drivers -b cookie.txt
After this you should see a new driver name kasa is visible in Configuration -> Drivers section. You can go to connectors and create outlet and associate the new driver from UI . Let me know how it goes . I was ecstatic to see this working :)
I just noticed this driver support was landed soon after the 3.0 alpha prerelease, so this is not present in rhat release. Are you building from master? If not, you have to wait till I cut a new release of build from master.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
I just noticed this driver support was landed soon after the 3.0 alpha prerelease, so this is not present in rhat release. Are you building from master? If not, you have to wait till I cut a new release of build from master.
I'm building from source. I'll test later today.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,826
Rating - 0%
0   0   0
The really great thing about the tplink driver, or reef pi supporting a good smart plug, is that it eliminates having non technical people having to wire up something to control MAINS(120v or 240v) power. Issues with safety(UL listings and such) are taken off the table if well made UL listed devices are used for the AC side of things.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
The really great thing about the tplink driver, or reef pi supporting a good smart plug, is that it eliminates having non technical people having to wire up something to control MAINS(120v or 240v) power. Issues with safety(UL listings and such) are taken off the table if well made UL listed devices are used for the AC side of things.
I must say I also like the less wire aspect of it :) . The dependency on WiFi is a concern though.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
if i'm developing my own driver, where should i put the source code in my local repo? any time i try to add it with a command similar to yours above, i get an error about an unknown driver type.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
i should add to my above post that i've updated factories.go to include my driver directory, and placed it in it's own directory in /gospace/pkg/dep/sources/https---github.com-reef--pi-drivers/ and did a make clean and make start-dev...but still no joy.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
i should add to my above post that i've updated factories.go to include my driver directory, and placed it in it's own directory in /gospace/pkg/dep/sources/https---github.com-reef--pi-drivers/ and did a make clean and make start-dev...but still no joy.
you can develop your driver code in someplace inside the reef-pi repo itself (not in reef-pi/driver), and wire it up in here . Once its tested with your physical setup, copy the driver code in reef-pi/drivers, unit test it and raise a PR against reef-pi/drivers. You can refer to your pr branc of reef-pi/drivers that has your code in reef-pi controller repo under Gopkg.toml . Currently it points to master, change it to your remote branch and test again. Let me know if you need any help
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
i should add to my above post that i've updated factories.go to include my driver directory, and placed it in it's own directory in /gospace/pkg/dep/sources/https---github.com-reef--pi-drivers/ and did a make clean and make start-dev...but still no joy.
Did the existing hs1xxx driver worked?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,825
Reaction score
17,041
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
i should add to my above post that i've updated factories.go to include my driver directory, and placed it in it's own directory in /gospace/pkg/dep/sources/https---github.com-reef--pi-drivers/ and did a make clean and make start-dev...but still no joy.
You have to update the Gopkg.toml and run dep ensure -update github.com/reef-pi/drivers etc.. dont take that route right now. Just keep the code inside reef-pi controller repo and hook it up in the factory as i mentioned before
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,075
Location
Gambrills
Rating - 0%
0   0   0
We have to cross check if the culprit is reef-pi or something else running on pi. Assuming its reef-pi, I am noticing 20% memory usage increase in past 10 days. Is that assessment correct? Can you share some details around what all you have configured on the reef-pi? I can then reproduce and fix the issue. I am specifically looking at timer, lights, ato, temp controller, ph etc.

It's been almost 24 hours, and my resources are getting chewed up. I'm not running a lot from this box, but since the pH probe went online, it's been a problem. Anything else I can provide to help with this?

23 hours.JPG


fuge light.JPG


temp.JPG


ATO.JPG


pH mem.JPG
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
you can develop your driver code in someplace inside the reef-pi repo itself (not in reef-pi/driver), and wire it up in here . Once its tested with your physical setup, copy the driver code in reef-pi/drivers, unit test it and raise a PR against reef-pi/drivers. You can refer to your pr branc of reef-pi/drivers that has your code in reef-pi controller repo under Gopkg.toml . Currently it points to master, change it to your remote branch and test again. Let me know if you need any help

I added it to my factories.go....so i need to push to my clone and point to that? Before i test w/ my physical setup?
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
No... this should be enough to test it at your end

do i need to do an import here?

Edit: basically, i've got my foo.go and foo_hal.go files. Where do I need to put them, and what import change do i make to factories.go? I added the case to the switch statement, still no luck...

Edit 2: i'm missing something basic here. i changed the 'hs1xx' to 'hs1xx123' but didn't change the json file and it still got added, even after a fresh make start-dev. do i need to do something else to get the factories.go changes to kick in?
 
Last edited:

A worm with high fashion and practical utility: Have you ever kept feather dusters in your reef aquarium?

  • I currently have feather dusters in my tank.

    Votes: 73 38.2%
  • Not currently, but I have had feather dusters in my tank in the past.

    Votes: 64 33.5%
  • I have not had feather dusters, but I hope to in the future.

    Votes: 25 13.1%
  • I have no plans to have feather dusters in my tank.

    Votes: 28 14.7%
  • Other.

    Votes: 1 0.5%
Back
Top