-
code posted on github
02/26/2020 at 23:07 • 0 commentsI added a link to the code up in the details section, but here it is again:
-
Raspberry PI Code
02/17/2020 at 00:23 • 0 commentsThe raspberry pi is responsible for sending email notification(s) when an alert event is received from the watch. I booted up a fresh install of Raspbian and created an ~/alerter folder to house my code.
Inside the ~/alerter folder is an alerter.py script that runs at startup to listen for chronos events, and it is based on the following code:
When an "S1" button press is received, alerter executes sendalert.py which calls a function in email_handler.py to actually send the email. The recipients are hard-coded in sendalert.py. Email_handler.py uses the smtplib, MIMEMultipart and MIMEText libs to handle sending - more info and instructions can be found here:
I set up a special gmail account for sending the alert emails and the information for that account is stored in a settings.ini file. The destination addresses can be any valid email address... I'm using a destination address from my mobile phone provider that converts the email to sms, so I get a text message when there's an alert.
To run the alerter.py script at startup, I modified the /etc/rc.local file with the following line: python /home/myrpi/alerter/alerter.py
/home/myrpi/alerter/alerter.py
-
TI Chronos Code
02/17/2020 at 00:20 • 0 commentsMy chronos code strips down the UI on the watch to the barest essentials - showing the time and allowing the user to select and send an alert.
The watch runs on a modified version of the ez430_Chronos software that comes on the device and thankfully, their code is pretty easy to follow.
Here's a comment from their code that illustrates what shows on the display as you scroll through functions by pressing the * (top left) and # (bottom left) buttons:
LINE1: [Time] -> Alarm -> Temperature -> Altitude -> Heart rate -> Speed -> Acceleration LINE2: [Date] -> Stopwatch -> Battery -> ACC -> PPT -> SYNC -> Calories/Distance --> RFBSL
I didn't need any of that stuff, so I changed the function pointers in the menu options to skip over anything I didn't want when you pressed the * or # button.
My new help function was added in a new set of help.c/.h files, and I inserted that function into the linked list of menu options mentioned above. The help function uses the same SimpliciTI code that was used to send the power point commands.
I also disabled bluerobin and changed the processRequests function in the main.c file, to skip the temperature, pressure and altitude measurements, since I didn't care about that either.
For confirmation that the Help alert is being sent, the watch flashes while it transmits and beeps five times upon completion of the transmission. There is no acknowledgement from the pi that an alert was received - might be something for later, but it hasn't been necessary so far.