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,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Even after trying to create a timer and "successfully" doing so
Code:
Jan 16 18:59:02 raspberrypi reef-pi[14802]: 2018/01/16 18:59:02 Successfully added cron entry. ID: 1
Jan 16 18:59:02 raspberrypi reef-pi[14802]: 2018/01/16 18:59:02 ERROR: Failed to list
Jan 16 18:59:02 raspberrypi reef-pi[14802]: 2018/01/16 18:59:02 ERROR: GET /api/timers json: cannot unmarshal string into Go struct field Job.equipment of type timer.UpdateEquipment
Code:
{"error":"Failed to delete. Error: Cron ID not found for job ID:1"}
That failed to delete from cron error message is benign. reef-pi is trying to delete the job from running scheduler after it was deleted from database, but since these old jobs are not compatible with new schema, they were not loaded to begin with, hence that call is failing. If the /api/timers call is failing then it means there is still jobs represented in older schema , present in the database,

I can create a quick script to reset the timer table , you want to try that?
 

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
That failed to delete from cron error message is benign. reef-pi is trying to delete the job from running scheduler after it was deleted from database, but since these old jobs are not compatible with new schema, they were not loaded to begin with, hence that call is failing. If the /api/timers call is failing then it means there is still jobs represented in older schema , present in the database,

I can create a quick script to reset the timer table , you want to try that?
It may be helpful, as attempting to delete the timer entrys is not working... I went through 1-20 with that same error message, just to try and clear all entrys.
This is the code I am using for that, with asteriks added into username and password of reef-pi (not raspberry pi name and password, correct?)
Code:
pi@raspberrypi:~ $ curl -u ca******t:g******4 -X DELETE http://192.168.0.106/api/timers/1
Here is the restart log
Code:
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Reloading reef-pi controller
Jan 16 22:08:26 raspberrypi systemd[1]: Stopping raspberry pi based reef tank controller...
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 ERROR: Failed to reload reef-pi. Output:. Error: signal: terminated
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 ERROR: GET /api/admin/reload Failed to reload reef-pi. Output:. Error: signal: terminated
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Successfully unloaded system  subsystem:
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Successfully unloaded equipments  subsystem:
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Successfully unloaded timers  subsystem:
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Stopping temperature controller
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Successfully unloaded temperature  subsystem:
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Stopped lighting cycle
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Successfully unloaded lightings  subsystem:
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 Stopping health checker
Jan 16 22:08:26 raspberrypi reef-pi[16749]: 2018/01/16 22:08:26 reef-pi is shutting down
Jan 16 22:08:26 raspberrypi systemd[1]: Stopped raspberry pi based reef tank controller.
Jan 16 22:08:26 raspberrypi systemd[1]: Started raspberry pi based reef tank controller.
Jan 16 22:08:26 raspberrypi reef-pi[16876]: 2018/01/16 22:08:26 DB: reef-pi.db
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Successfully started subsystem: lightings
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Starting lighting cycle
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Successfully started subsystem: system
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 6 State: 0
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 19 State: 0
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 26 State: 0
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 12 State: 0
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 13 State: 0
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 16 State: 0
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 21 State: 1
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Setting GPIO Pin: 20 State: 1
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 INFO: equipment subsystem: Finished syncing all equipment
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Successfully started subsystem: equipments
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 ERROR: timer-subsystem: Failed to load timer jobs. Error: json: cannot unmarshal string into Go struct field Job.equipment of type timer.UpdateEquipment
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Successfully started subsystem: timers
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Successfully started subsystem: temperature
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Starting temperature controller
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 reef-pi is up and running
Jan 16 22:08:27 raspberrypi reef-pi[16876]: 2018/01/16 22:08:27 Starting http server at: 0.0.0.0:80
Jan 16 22:08:28 raspberrypi reef-pi[16876]: 2018/01/16 22:08:28 Starting health checker
Jan 16 22:08:49 raspberrypi reef-pi[16876]: 2018/01/16 22:08:49 ERROR: Failed to list
Jan 16 22:08:49 raspberrypi reef-pi[16876]: 2018/01/16 22:08:49 ERROR: GET /api/timers json: cannot unmarshal string into Go struct field Job.equipment of type timer.UpdateEquipment
Jan 16 22:08:57 raspberrypi reef-pi[16876]: 2018/01/16 22:08:57 lighting-subsystem: Setting PWM value: 0  at channel: 0
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
I have created a quick script that will wipe out the timer table entries, do you want to give it a shot? its surgical, so the code is not in the software, i have a gist for your reference:

gist: https://gist.github.com/ranjib/c0e5ea822f6657ff338f7118fd56f96e

Binaries: https://drive.google.com/drive/folders/1Ehmr4Aqdl_d0suV554-EZqgUxIipHH9J

you can download the reset3 ( for pi3 ) or reset0 (for pi zero) and execute as `sudo ./reset3` .
Sorry for the trouble :-(
Ranjib,
Thanks for creating that, but it looks like I am still missing something on the execution.
After making the binary executable, I was getting a timeout.
I added full access to the reef-pi.db file, but still getting the timeout.
Code:
pi@raspberrypi://var/lib/reef-pi $ ls -l
total 2084
drwxr-xr-x 2 root root    4096 Jan 16 17:31 assets
-rw-rw-rw- 1 root root  131072 Jan 17 07:33 reef-pi.db
-rwxr-xr-x 1 pi   pi   2037323 Jan 17 07:27 reset3
pi@raspberrypi://var/lib/reef-pi $ sudo ./reset3
ERROR: Failed to open db: timeout
What am I missing?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ranjib,
Thanks for creating that, but it looks like I am still missing something on the execution.
After making the binary executable, I was getting a timeout.
I added full access to the reef-pi.db file, but still getting the timeout.
Code:
pi@raspberrypi://var/lib/reef-pi $ ls -l
total 2084
drwxr-xr-x 2 root root    4096 Jan 16 17:31 assets
-rw-rw-rw- 1 root root  131072 Jan 17 07:33 reef-pi.db
-rwxr-xr-x 1 pi   pi   2037323 Jan 17 07:27 reset3
pi@raspberrypi://var/lib/reef-pi $ sudo ./reset3
ERROR: Failed to open db: timeout
What am I missing?
Did you stop reef-pi service? Probably its timing out due to the process running as service holding an exclusive lock on that file.
 

Ryan115

Well-Known Member
View Badges
Joined
Dec 28, 2010
Messages
586
Reaction score
1,085
Location
Mississippi
Rating - 0%
0   0   0
Did you stop reef-pi service? Probably its timing out due to the process running as service holding an exclusive lock on that file.
I figured it was something simple that I was forgetting.
Also, I may not have deleted timers high enough, as that script deleted timers in the 22-33 range.
All seems happy now.
I like the new timer duration, I am testing that out on a few things now.
As always, you are awesome and thank you for the help.
 

Fish Fan

Valuable Member
View Badges
Joined
Dec 8, 2017
Messages
1,271
Reaction score
1,702
Rating - 0%
0   0   0
Hey all!

Ranjib, you do such a great job with this opensource reef-controller project. Do yo have a *donate* button, or a way I could contribute to your project? I am absolutely happy to do so ;-)

Thank you for your work!

-FishFan
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hey all!

Ranjib, you do such a great job with this opensource reef-controller project. Do yo have a *donate* button, or a way I could contribute to your project? I am absolutely happy to do so ;-)

Thank you for your work!

-FishFan
These kind words are good enough for me :)
thank you
 

Fish Fan

Valuable Member
View Badges
Joined
Dec 8, 2017
Messages
1,271
Reaction score
1,702
Rating - 0%
0   0   0
^^You say that now, but I am going to have A LOT of questions about this build ;-) Thank you for your help though, I really appreciate it!

-FF
 

cooltowncorals

Active Member
View Badges
Joined
Aug 27, 2017
Messages
327
Reaction score
247
Rating - 0%
0   0   0
Ranjib amazing stuff...looking into ordering parts now couple quick questions when I look at your build list for temperature sensor set up it suggests 3.5 mm aux jacks and I do not understand what they are used for and the link at the bottom which shows the pi support shows it wired through an additional temp module which is not on your parts list I am confused at what I need to run this. 2nd question if running perlistic dosing pumps is that done only through the relays or can it be done through the PWM?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Can i update to the latest from 1.0 without deleting any timer stuff?
1.0 /1.1 upgrade should be fine. If you are updating to 1.2, please delete timers before. What version you are in?
1.2 will give you some extra stuff, just in case,
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
^^You say that now, but I am going to have A LOT of questions about this build ;-) Thank you for your help though, I really appreciate it!

-FF
No worries. I expect individual builders to have lots of question. This is an opportunity for me to improve the documentation as well.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Ranjib amazing stuff...looking into ordering parts now couple quick questions when I look at your build list for temperature sensor set up it suggests 3.5 mm aux jacks and I do not understand what they are used for and the link at the bottom which shows the pi support shows it wired through an additional temp module which is not on your parts list I am confused at what I need to run this. 2nd question if running perlistic dosing pumps is that done only through the relays or can it be done through the PWM?
3.5 mm Audio jack (aux) is used in both Kessil controller (LED/light) as well as to connect temperature probe.
Currently, you can only do dosing by timers, through relays. and without any pwm/speed control.

That said, I am working on the doser sub-system as we speak, which will allow PWM control of dosing pumps. The UI is almost done, once the backend is completed, I'll cut 1.2 release (and doser sub-system will be available from 1.2 onwards).

Does that answer your question?
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Can I update to the latest from 1.0 without deleting any timer stuff?
Nope. Delete the timer stuff, or wait till I cut a new (1.3) release which will have the code to detect timers in old format and convert them into new ones.
 

cooltowncorals

Active Member
View Badges
Joined
Aug 27, 2017
Messages
327
Reaction score
247
Rating - 0%
0   0   0
So the temp prob gets wired into the aux jack and that signal goes to the reef pi software which interprets it into a temperature? So no temperature reading hardware is needed is my understanding.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So the temp prob gets wired into the aux jack and that signal goes to the reef pi software which interprets it into a temperature? So no temperature reading hardware is needed is my understanding.
Yes, probe is the hardware , you need a 4.7k resistor . Did you check the temperature build guide? If not take a look at it, it has some relevant details as well as circuit diagrams
 

Reefing threads: Do you wear gear from reef brands?

  • I wear reef gear everywhere.

    Votes: 42 16.5%
  • I wear reef gear primarily at fish events and my LFS.

    Votes: 16 6.3%
  • I wear reef gear primarily for water changes and tank maintenance.

    Votes: 1 0.4%
  • I wear reef gear primarily to relax where I live.

    Votes: 30 11.8%
  • I don’t wear gear from reef brands.

    Votes: 147 57.6%
  • Other.

    Votes: 19 7.5%
Back
Top