This project is not yet complete, but has a lot of progress and will be completed soon :P Ran into some unsolvable hardware issues which delayed submission.
Alright, the idea here is to create a LifeAlert-like Safety Token that an elderly person or child could carry around with them. Basic functionality would be a single-button device that uses GPRS (Cellular) rather than a home phone line to send messages. Additionally, the device would be customizable, with different actions like texting a family member, emailing someone, etc. rather than calling the authorities for help. Elderly could get help from a friend if they fall, or children could "check in" with a single button press with their parents after reaching their destination.
- Wake device?
- Send location and other stats to parent?
Configurable hold (1 second):
- Text parent, asking for a call or help (configurable message)
Configurable hold (10 seconds):
- Text parent with emergency configurable text
- Call parent with onboard speakerphone (requires amp and phone service)
- Call emergency services (requires phone service). Pre-recorded message? Text-to-speech with location coordinates or emergency services txt / api?
- Can monitor child’s location, speed, (audio?)
- Max speed alert to make sure driving teenagers or their friends are being safe
- Alerts for periods of inactivity (has the device died? malfunctioned?
- Alerts for breaching or exiting a geofence
- i.e. coming home
- leaving home while grounded
- going to an undesirable person’s house
- timed geofence alerts : is child where they are supposed to be?
- At school on time?
- At home by midnight?
- Safely landed after a flight?
- To ensure device stays with child, tether it to phone with bluetooth. If either dies, text.
- LifeAlert-type device. Pressing the button will ask family members for help, broadcast location. Show on a web-based (AWS?) Google map. After press, for the next 120 minutes, monitors location, sends battery, movement, etc data to web interface and allows family members some power-saving control
- Better that LifeAlert, as it requires no phoneline, no subscription, no wifi, and can be used anywhere at any time as long as a cell connection is available. Also broadcasts location so full protection, even while an elderly person is taking a walk.
- Better than LifeAlert, as you can configure it to txt (call?) family members instead of emergency services, saving money and embarrassment
Configurable hold (5 seconds):
- Contact the authorities (911) to come assist with a fall, heart attack, etc. A pre-recorded message from the SD card could be played over the phone, or if local 911 service accepts texts, could be used as well and provide location.
- A service like IFTTT or Google might be able to call with text to speech, which would be another way of providing location information.
- GPS monitoring - monitor TIME and GPS LOCATION of device at each checkin, so a replay is possible
- Speed sensors
- Add heartrate / temperature monitors?
- SMS texting
- Motion detection via gyro/accelerometer
- Bluetooth connectivity to iOS partner app for easy configuration
- USB connectivity to computers for easy text or application-based configuration (security?)
- Can also be programmed to a Xadow-sized device like RePhone, possibly use RePhone Create screen to configure without partner app
- Rechargeable Lipo
- MicroUSB charging for easy use with battery packs and chargers
- Partner Application:
- Allows monitoring of device in user mode
- Allows wireless re-programming of the device in admin mode, requires passcode
- Can be disabled to conserve battery usage
- Reset button sets device back to defaults with first-time-pincode, or a permission token from the mothership (costs money?)
- Alerts parties that a reset has been initiated and asks for permission via email?
- Alerts user during configuration of things that would be spammy, estimates data and battery usage, shows battery history
- Sends this data to the AWS cloud for monitoring
- How much of this does FitBit do? Can this later be transitioned to a RePhone or Xadow-sized device for better longevity?
LinkIt One Setup Process (Up to date and actually works! - 12/19/2015)
The LinkIt One Setup Process is particularly problematic and very picky. Things have to be done in order and a specific Arduino version is required. Here's a full process I've written from scratch that should work properly every time :) This is built for version 1.6.4 of the Arduino IDE rather than the older 1.5.7 like most guides, so you'll be as up to date as possible.
First thing's first - the switches. There are 3 on the LinkIt One board, but what are they for? Let's quickly go over them.
MS/UART - This is the bootup mode switch.
- MS mode - This mode boots the LinkIt such that the internal 10MB storage and the SD Card show up as drives in My Computer. This mode is also used to update the firmware, aka "bootloader" of the board.
- UART mode - This mode is used when programming the board, or running code on the board. It exposes the two COM devices over the USB port, "Modem" and "Debug". You will almost always use "modem" (the first one).
USB/BAT - This chooses where to get power from. The board will always power itself when plugged into USB regardless of selection, and will always charge the battery, but if you're running off battery power, putting this switch in the USB position effectively turns the LinkIt off.
SPI/SD - The LinkIt can only use either the SPI bus/pins or the SD card at any given time. If the SD card is selected, the SPI pins (10-13) are effectively disabled as to prevent damage. If you wish to use SPI and an SD card concurrently, MediaTek recommends using an SD card shield.
1. Install compatible version of Arduino.
- As of today, 1.6.4 is proclaimed the latest compatible version. Technically it is still in beta. Some screenshots have shown 1.6.5 being used, and current is 1.6.6. Seems like 1.6.5 would probably be fine, but 1.6.4 is documented as compatible in the forum, so I don't recommend going above that. I confirmed 1.6.6 does have big problems that were not present in 1.6.4.
- [recommended - 1.6.4 win] http://arduino.cc/download.php?f=/arduino-1.6.4-windows.exe
- [recommended - 1.6.4 osx] http://arduino.cc/download.php?f=/arduino-1.6.4-macosx.zip
- [main page with more versions] https://www.arduino.cc/en/Main/Software
2. Install driver package:
3. Resolve Windows driver issues: (Mac users can skip to Step 4)
I wrote this guide on Windows 7, but I believe this issue applies to 8 and 10 as well. Even when you install MediaTek's driver package before plugging in your board for the first time, alternative Microsoft drivers are installed instead. This happens because Microsoft prefers theirs for some reason, and also Seeed/MediaTek's driver package isn't written correctly. No worries, we can fix it!
- Switch all switches on the board up. (That means MS/UART, USB/BAT, SPI/SD). Plug in the board.
- The first time you plug it in in MS mode, it will likely seem to install a few devices, one of which is likely named Alcatel Single RNDIS Interface. This is NOT the driver that should be installed for the LinkIT One.
- Open Device Manager. This can be done via Explorer. Right-click on (My) Computer, and click Manage. Go to Device Manager.
- Under Network Adapters, you will likely find the Alcatel Single RNDIS Interface device, possibly with a yellow triangle. Right-click it and select Update Driver Software.
- Select Browse My Computer.. then Let me pick... then choose the driver labeled MTK USB Port. The board should now function normally. You may have to repeat this process (or similar) when the board is in UART mode for the first time.
4. Fire up Arduino! Time to get the SDK from the new Boards Manager!
- Open Arduino. Go to File > Preferences. (Arduino > Preferences on Mac.)
- In the Additional Board Manager URLs field, enter the following:http://download.labs.mediatek.com/package_mtk_linkit_index.json
- Click OK, and quit then re-open the Arduino app.
- Once Arduino is open again, go to Tools > Board > Boards Manager. Scroll all the way to the bottom or type "linkit" in the search field to find LinkIt ONE by Seeed Studio in the list. Click the item, and action buttons will appear. Select the latest version and click Install. (1.1.17 is the latest as of this writing. It is also available as a standalone install for Arduino versions lower than 1.6.x.) The LinkIt One SDK will download and install libraries and such.
- When the download and install of the SDK is done, again close Arduino and reopen it. Change Tools > Board > to LinkIt ONE.
- Change Tools > Programmer > to LinkIt Firmware Updater, then click Tools > Burn Bootloader. This will launch the Firmware Updater.
5. Update that Firmware!
- Something a lot of people skip is updating firmware, and LinkIt One does NOT make it easy sometimes. I'll give you the foolproof steps, at least for Windows :) Mac shouldn't be much different.
- First, when in UART mode, plug in your board and check out Device Manager again. You should see two devices under COM/LTP Ports, called
- Double-check all 3 board switches are all in the "up" position as described above. Click the green button on the Firmware Updater app. Quickly plug in the board's USB. If the board is recognized, text on the Firmware Updater will turn pink and begin flashing the LinkIt One.If this doesn't work, try each of the following suggestions progressively:- Check that the PROPER drivers are installed within Device Manager using the method outlined above. If a device isn't showing up or something, try switching the MS/UART switch to UART. Then retry the driver process.- After pressing the green button on Firmware Updater and getting no response, quickly click the white and black Reset button on the side.- If that doesn't work, try again, this time holding it for a second or so. - If that still doesn't work, click the green button, hold down Reset while plugging in the board, and wait a few seconds. This can sometimes kick it into gear. - Uninstall any software or hardware pertaining to serial ports, USB to Serial, etc and try again.
- Enjoy your shiny new LinkIt One!
So, setting up LinkIt One alone is a bit of a pain in the butt, as there are incompatibilities everywhere and you never know when you're going to run into one. I developed this project using the following:
- - Arduino IDE version 1.6.4 on Windows 7.
- - LinkIt One SDK version 1.1.17, installed via Arduino Boards Manager.
- - MTKUSBCOMPortDriver version 188.8.131.52 (in UART mode)
- - LinkIt One flashed to firmware version:MRE_VER_3100;96X64;MT2502;MAUI.11CW1418SP4.W15.15
First thing's first, I loaded up the LGPS Example included with the LinkIt SDK. Found out pretty quickly that this board's GPS doesn't work too well indoors, as even after running it for several minutes I had exactly 0 sattellites connect :P
Looks like we'll need a way to throw this thing outside and get information back from it. This means either logging information to a file (kinda clumsy and not realtime) or alternatively pushing it to the web somewhere where we can watch it update. Either way, we need to get wifi working :)
To keep things simple for right now, I decided to load up the included LWifi > WifiWebServer example. This will allow us to view some basic data in the board's memory over the local network. Nothing too fancy needed just yet.
Using the WifiWebServer example and the LGPRS example, we now were able to send statistics over wifi! (See LinkIt_GPS_SafeAlert.ino)
Next was GPRS. Unfortunately, I got stuck here. No APN settings I tried for either my T-Mobile SIM or ATT SIM would work. This has me stuck for the moment as I think my LTE sims are not compable with the GPRS device on the LinkIT One. As soon as possible I'll be going in to ATT to get a SIM that would be compatible with GPRS, then it looks like everythin will run smoothly :)
To be continued 12-19-15.