Normal Topic Feed the fish reminder - programming help (Read 1595 times)
Jstyles
New Member
*
Offline


Posts: 7
Feed the fish reminder - programming help
Nov 6th, 2020 at 8:12pm
Print Post Print Post  
You've seen me already annoy you in the kickstarter chat, as I'm trying again to get some use out of the sib.  So I've got a practical use idea for it that I can use right now.   Help me program it.

I want to remember to feed my fish.  One day I'll feed him, some days my girlfriend will.  And we dont know when the other has done it.  So I'd like the sib to light up red (maybe slow blink red if that saves some battery), to indicate its time to feed.   He gets fed just once a day.  Light should be red and then on a button press turn green just for a few seconds to confirm its done, I think it would need to delay or power off completely for 24 hours after the button was pressed.   If the fish is fed before the light turns red, you press the button to confirm its fed and it all starts over.

I'm not so clear on some of the variables in the programming documentation, and my tests arent work, this should be something simple.

If you can give me a hand with this one please.
  
Back to top
 
IP Logged
 
Jstyles
New Member
*
Offline


Posts: 7
Re: Feed the fish reminder - programming help
Reply #1 - Nov 6th, 2020 at 8:41pm
Print Post Print Post  
What am I doing wrong.  Pretty much anything I do with comments seems to error out.  But even if I do this sequence without comments, I dont get the first blue light to turn on

PROG S
WA BLUE 1023; light up blue to confirm done
DL 4s; keep light on for 4 seconds
WA BLUE 0; turn off blue ight
DL 10s; wait sleep 1410 mins before next nudge example 10 seconds
WA GREEN 1023; nudge light up green light as reminder
DL 20s; keep light on 30 minutes example 20 seconds
WA GREEN 0; turn off nudge
WA RED 1023; turn on red light to remind that overdue
DL 10s; keep red on for  24hr example 10sec
HALT

Also need to know what is the correct type of delay to put during the middle long waiting period
  
Back to top
 
IP Logged
 
Jstyles
New Member
*
Offline


Posts: 7
Re: Feed the fish reminder - programming help
Reply #2 - Nov 6th, 2020 at 9:07pm
Print Post Print Post  
Here it is without comment, the first blue light doesnt work

PROG S
WA BLUE 1023
DL 4s
WA BLUE 0
DL 10s
WA GREEN 1023
DL 20s
WA GREEN 0
WA RED 1023
DL 10s
HALT

Also, I had anticipated if I pressed again while that final red light was on, that it wood restart the sequence, but it doesnt.
  
Back to top
 
IP Logged
 
Mark Baum
Forum Administrator
*****
Offline


Posts: 91
Re: Feed the fish reminder - programming help
Reply #3 - Nov 7th, 2020 at 4:33am
Print Post Print Post  
Ok, so for this program to work you're going to have to update the firmware in your SiB to the latest. Seeing that you got your SiB a while back you need to follow the post in this forum https://www.sib.me/forum/index.cgi?num=1603395649 about updating - the process is very specific, if not followed your SiB could become useless.

The very last f/w (not listed in that page is 723) you might as well send status to the SiB to ensure you got the latest before continuing with the following:

UPDATE 723

Set your Timezone by sending either of these 2 commands:

tz est
tz pst

Send STATUS to see your current time; ensure it is correct:

STATUS (press SiB)

Send the following program:

Prog fish
Prew
Post
Wakeatb 20:00
Post
im Time to feed the fish
Blink:
Hold red 1
SLB 5s
Hold red 0
If buttonwake
Wd green 1
Post
im Fish are fed!
Loop
Ei
SLB 5s
If buttonwake
Wd green 1
Post
im Fish are fed!
Loop
Ei
Loop blink:

Enter SID mode
MODE SID

Send :

run fish

(press SiB)

Explanations:
1) The program's first line is "PREW".  PREW instructs the SiB to always wake up WITHOUT starting WiFi, to save battery.  After every sleep command, the SiB will wake up without WiFi on until a POST is encountered
2) There is a "POST" Immediately before "WAKEATB".  This is because the WakeAt command must know the current time properly before calculating the duration of sleep. The SiB does not keep time while powered off or sleeping, it only gets the time when WiFi connects.
3) WakeAtB and WakeAt are the same commands; but 'B' instructs the SiB to also be awoken from a button press.  Without the B, there is no way to wake up the SiB other than waiting out the timer!   
    The command WakeAt takes a value in 24-hour clock. 20:00 is 8PM
    The command WakeAt puts the SiB into a deep sleep until the provided time.
4) After WakeAT (after the SiB wakes up at 8PM), we immediately send POST as we want to send an IM notifying that it's time to feed the fish.  The SiB must be connected to WiFi for this step.
5) IM : Sends the message! You can change the message if you wish.  In addition, you can replace this command with "IMTO" if you want to send the IM to multiple people. For example, if you and a significant other have SiMP installed, you can include both your numbers as recipients:
IMTO 12345556789,12345551234 Time to feed the fish!
The recipient numbers must be presented without spaces or special characters, and separated by a comma
6) After sending the IM, the SiB enters a loop to blink the LED Red
7) The SiB uses "SLB" to sleep with the LED Red ON, and then the LED Red OFF.  We use SLB , as we want to be able to interrupt the blinking by pressing the SiB.  Because PREW was specified at the very start, the SiB will blink the LED without ever starting WiFi, preserving battery. 
8) If the SiB wakes up from a button press (if buttonwake), we send the IM "Fish are fed" and then LOOP- back to the beginning, of PREW/POST/WAKEAT
9) The condition to check for 'buttonwake' is there twice, because we need to check for button wake after each Sleep (for RED on and for red OFF).  In future versions of the SiB this will be reduced to a single blink/wake command.
  
Back to top
 
IP Logged