Thursday, November 5, 2015

-----As a long time fan and user of IFTTT.com we would see the Numerous Channel from time to time and wonder what it did, how it could be used, etc. The Numerous tagline is "Numerous follows the most important numbers in your life and keeps them all up to date, all in one place" and that certainly got our attention.-----Numerous runs on the iPhone and the app has a fantastic UI. The developer must be some rare artist/SWE hybrid type or something. The app flows well, takes advantage of new iOS features (TouchID, Apple Watch, etc.) and is easy to personalize. The graphs are clear and it even lets you customize when you get notifications (value to big/small, value change, change percentage exceeded, comments updated) and more. It short; it is a joy to use.Also, there are dozens of pre-programmed "metrics" that you can follow. Check them out. They are interesting and useful, but could get boring and after a while you will want to roll your own metrics to track more personal data useful for your applications.-----That's where this blog post steps in. Numerous is really easy to get your personal data into it. After only a short time we had created "numerous" Numerous App metrics to: - track temperature/humidity sensors scattered around the house - track Internet UP/DOWN status - track security system triggers - track UP/DOWN status of LAN devices (security cams, Raspbery PIs, Imps, etc.) - several other miscellaneous things.... ------How to get data into Numerous?One way is to use the Maker Channel on IFTTT.com as a trigger to the Numerous Channel on IFTTT.com. This requires no coding and is an easy way to pass three variables in one Maker Channel event trigger. If you want to include the Maker Channel trigger URL into a Python or PHP script the applications are endless.If you don't mind a little extra Python code, the task is almost as easy and offers more power and flexibility. To give credit where credit is due, it is made simple with the Python API App by outofmbufs. Here's my simple example using Python and a Raspberry PI to get data to the iPhone. The example shows how to create a Numerous metric, write data and comments to it, and view a graph of the data.-----Run the Numerous app on the iPhone and create a new 'metric'. See the "+" sign in the upper right. Click that.

-----Give your metric a name. Don't worry about what you call it, you can change it later. Remember, I told you the app was flexible....

-----After you create the metric you can customize the way it looks. Change the title and description to suit your needs, add a meaningful background image, input data manually, set privacy and notification setting, etc. There is even a way to set the units. I put the units as "megaFonzies" in the example to denote how cool the Numerous App is.

-----Making the appearance pretty is fine, but what we want is to feed the metric data from the Raspberry PI via a Python script. For that you need two numbers: - your personal and secret API key: Get this by selecting "Settings/Developer Info" from the main screen of the Numerous app. Don't share this API key. It will start with "nmrs_" and is shown as "nmrs_xxxxxxxxxxx" in the source code example below. - the METRIC ID that you are writing to: In the Numerous app click on the tile for the metric you just created and customized. In the upper right you will see the classic "menu bar" icon. Click that then "Developer Info" to find your METRIC ID.

-----

Modify the Python script below with your API Key and METRIC ID values and run it. Your metric will start recording the values that you feed it:

-----Want a graph of the data? Turn the iPhone to landscape mode. You can pinch to zoom in and out for both the X and Y axis! How cool is that? At least 52 megaFonzies!

-----That's pretty much it. The Python script example below will introduce you to all the basics. It writes the system clock seconds value to the metric, but that could be any value your RasPI can produce or scrape from the web. The Numerous metric in the example is 'Public' that anyone can view, update, and comment on. Feel free to use it for testing. Good luck!----- # WhiskeyTangoHotel.com [OCT2015]

# Super easy way to track/graph RasPI data to your mobile device using NumerousApp.# This simple prog logs the "seconds" value of the localtime value to a Numerous metric.# The Numerpus mobile app will log, track, and graph the data for you.# Of course, this value could be a sensor reading, CPU usage, Core Temp, or any other numerical value.

# D/L the NumerousApp and install it on your mobile device.# iPhone: https://itunes.apple.com/us/app/numerous-lifes-most-important/id797642904?mt=8# Google Play: https://play.google.com/store/apps/details?id=com.numerousapp## See http://numerousapp.com/ for full APIs and other really cool applications.

# https://github.com/outofmbufs/Nappy/blob/master/README.md

# Also check out the Numerous integration to IFTTT.com for more awesomeness.# Numerous can act as a trigger and receive triggers from most IFTTT.com channels# Teaming the Maker channel on IFTTT.com with Numerous is VERY powerful!

# 1st, do a one time install from the terminal using "sudo pip install numerous"# Must have pip installed to do this: "sudo apt-get install python-pip"# Needed for the following import line.from numerous import Numerous

import time # Needed to get the system clock settings

MyKey = "nmrs_xxxxxxxxxxx" # Your personal Numerous App API secret key. MyMetric = "2884060434653363716" # Get this by clicking "Developer Info" from the numerous app # "2884060434653363716" is set as an open/public metric # Anyone can write to, so you just enter your personal API key to test. # Link to load the metric to the app: https://nmrs.co/m/lwtm3kymv2tg# Set up for callsnr = Numerous(apiKey=MyKey)metric = nr.metric(MyMetric)

# This will return the current value of the metricCurrent_value = str((metric.read()))

# Let's get the current seconds value of the system clock, convert that # to a number, and write that seconds value to the Numerous metricTimestamp_seconds = int(time.strftime("%S", time.localtime()))metric.write(Timestamp_seconds)

# Uncomment the next line to add a like (a thumbs up) to the Numerous metric#metric.like()

Tuesday, September 1, 2015

It is a pretty commonly uttered question (sometimes loudly) around the home or office; "Is the internet up?" As the goto IT Support Manager around the house this can get a little tiresome. Most of the time the internet is up and it's a user or personal device problem that can be solved with a re-boot, re-load, re-etc. Sometimes the internet is really down requiring a router and cable modem reboot or a call to the ISP. Wouldn't a simple visual check that anyone could quickly understand be helpful? Plus, as a bonus, provide some general network health statistics with a screen print and an hourly update to a Google Drive spreadsheet.

This project is amazingly useful and incredibly simple to duplicate. If you already have a Raspberry PI it is very cheap to implement.
-----What it does and how it works:
The Raspberry PI runs a Python program that test pings 10 internet sites that you to determine to provide the status of your internet connection.

GREEN: 7 or more sites return a successful ping.
Green LED on. Updates the stats.YELLOW: 6 to 4 sites return a successful ping.
Yellow LED on. Updates the stats.RED: 3 or fewer sites return a successful ping.
Red LED on. Updates the stats.

To make the program run faster and not burden the network with outgoing pings, all 10 sites are not pinged on each run. The ping test rotates through the 10 sites. If the selected site does fail the ping test, the program goes into "Deep Probe" and checks all 10 sites to determine the connection status. "Deep Probe" runs are tracked for the status report that prints to the screen.

Each hour a status report is appended to a Google Drive spreadsheet via the Maker channel at IFTTT.Com.
-----
For a visual output we went with a device that anyone can identify with, a simple $8 toy traffic light from Amazon. For $8 you get a lot. The light is well build, looks great, and is a full 7" tall with three LEDs already installed. It also comes with 12 little toy cars that you can give away; you don't need those. Next remove the four screws at the bottom of the base. You are going to see four wires that lead up to the three LEDs in the traffic light. Cut those wires and free them from the little ON/OFF switch and microcontroller that was meant to control the blink patterns for the non-hacker. Now you should only be left with four wires. The LEDs are wired common athode (+). The simple schematic below shows the hookup for each LED and their connection to the Raspberry PI. Double check the wiring for your traffic light with a button cell battery to see what wire lights each LED.
-----
You don't need to open the back, but if you did it would look like this:

-----
After you wire in the toy traffic light it will look something like this:

-----
Now you will need to load the Python source code provided below, but before you do, a few simple edits are required:
- Find in the code where it says "# Identify ten PING 'friendly' sites". In that section put in ten IP addresses or DNS names that are "ping friendly". Not all sites allow you to ping them, so test ping them manually first from a command line.
- Find the variable named "Delay_between_tests". In the program it is set to 15 (for 15 seconds). Adjust this if you want to test more or less frequently.
-----
That's about it, now run the program. The RasPI will take the traffic light through an LED self test. Then it will do an initial first run deep probe ping test on all ten of the test sites; the LEDs will self test during this as well.

-----
From then on the little toy traffic light will answer that all too common "Is the internet up?" question. In addition, as the local IT Support Manager, you will have access to a running history in a Google Drive spreadsheet and the status output table below to impress your friends:

-----
Here is the Python code that makes it all work. Of course, as mentioned above, you will need to supply your own list of ten ping friendly internet sites instead of "yourtestsite-1.com", etc.

# Is the Internet UP? / August 2015
#
# Project details at:
# http://whiskeytangohotel.com/internetup
#
# Using a Raspberry PI we ping a 10 IP addresses and light up a Red, Yellow, or Green LED
# to display the 'health' of our internet connection.
#
# SEPT 3, 2015: Adding IFTTT.com Maker channel to log status to Google Drive each hour.
#
# At least 7 of 10 successful pings to light the Green LED
# 3 or fewer of 10 successful pings for Red LED
# Anything in between and light the Yellow LED
#
# Program does not ping all 10 sites each time. For speed, etc. one of the sites
# is tested at each run. If that ping fails, 'deep probe' mode involkes and all sites are tested
# to determine latest Red/Yellow/Green status.
#
# As an output device we used a $7 toy stoplight from Amazon.com. Search:
# "Dazzling Toys Racer Cars and Traffic Set - 7" Traffic Light with 12 Pull Back 2" Racer Cars"
#
# In addition to the LED stop light status. The details below are screen printed on each run.
#
# Tue, 01 Sep 2015 05:03:32. Update interval: 15 seconds.
# Status report: GREEN. Runs: 1812. DeepProbes: 6. Runtime: 8:42:44.448047
# -----------------------------------------------------------------------------------
# Last check: UP pingfriendlysite-1.com was UP 188 of 189 pings. 99% uptime.
# >>>Last check: UP pingfriendlysite-2.com was UP 189 of 189 pings. 100% uptime.
# Last check: UP pingfriendlysite-3.com was UP 187 of 188 pings. 99% uptime.
# Last check: UP pingfriendlysite-4.com was UP 187 of 188 pings. 99% uptime.
# Last check: UP pingfriendlysite-5.com was UP 188 of 188 pings. 100% uptime.
# Last check: UP pingfriendlysite-6.com was UP 188 of 188 pings. 100% uptime.
# Last check: UP pingfriendlysite-7.com was UP 188 of 188 pings. 100% uptime.
# Last check: UP pingfriendlysite-8.com was UP 188 of 188 pings. 100% uptime.
# Last check: UP pingfriendlysite-9.com was UP 188 of 188 pings. 100% uptime.
# Last check: UP pingfriendlysite-10.com was UP 185 of 188 pings. 98% uptime.
# ------------------------------------------------------------------------------------
#
# RED: 0 events. Last event: none detected
# YELLOW: 0 events. Last event: none detected
# GREEN: 1812 events. Last event: Tue, 01 Sep 2015 05:03:32
#

from __future__ import division # don't round interger division to 'zero'
import time
import datetime # used for timestamp math
t0 = datetime.datetime.now() # for timestamp math. t0 is the time the program run started
runtime = 0 # localtime minus t0 = total runtime of the program

# Set up for IFTTT triggering
import requests # needed to get https request to IFTTT web page
Current_hr = time.strftime("%H", time.localtime()) # use this var to update trigger IFTTT at each hour change
IFTTT_hr = "999" # we will only trigger IFTTT if this is diffent from Current_hr
MAKER_SECRET_KEY = "xxxx-my-maker-ifft-key-xxx" #this is my IFTTT Maker Channel secret key

Delay_between_tests = 15 #in seconds. Delay is in last line of code
Loop_count = 0 # track how many times the Red/Yellow/Green status was updated.
Deep_probe = 0 # how many times was a deep probe required; Single_test_site ping test failed
Single_test_site = 0 # used to select non deep probe ping test. Rotates thru the 10 IPs

#Turn off all the LEDs
GPIO.output(15,GPIO.HIGH)
GPIO.output(18,GPIO.HIGH)
GPIO.output(22,GPIO.HIGH)

SiteStatus = [1,2,3,4,5,6,7,8,9,10,11] # Pass/Fail of the site ping
UpTally = [1,2,3,4,5,6,7,8,9,10,11] # count succesful pings for each site
PingCount = [1,2,3,4,5,6,7,8,9,10,11] # count how many times each site is pinged
PingSite = [1,2,3,4,5,6,7,8,9,10,11] # holds the IP or DNS name of the site being pinged

while True: #Loop forever to check and display ping test status
Loop_count = Loop_count + 1
# Only test ping all sites if the one site tested sites fails the ping
# Here we test ping a single site. Next time we ping test the next site on our list of 10.
if Single_test_site < 10: # single test site selection
Single_test_site = Single_test_site + 1
else:
Single_test_site = 1

Saturday, August 22, 2015

The Charger Doctor is a sub $2 device that displays voltage and current levels while charging a USB device. There have been several teardown write ups on the Charger Doctor. It's useful, but does have some limitations. For example, it doesn't charge iOS devices and it seems to effect the reliability of the WiFi connection on our Raspberry PIs. This made us want to take a closer look at what the output was doing.

Here we use a Keithley DMM7510 to monitor the Charger Doctor output. The DMM7510 is a precision instrument with 7.5 digits of resolution and 14 PPM accuracy. It has a touch screen interface with graphical output, advanced triggering options, cursors, and a whole lot more. Plus, it is fast (very very fast); capable of sampling at 1M/s. To sum it up, it's pretty darn cool!
-----

In the video the DMM7510 shows a decrease in voltage when the Charger Doctor displays current. Also, some instability when displaying voltage. But remember, the Keithley DMM7510 is a very sensitive instrument. The change in voltage looks big on the screen, but it is really very small.
-----

The overall voltage swing is only 7.536mV or 0.00753 Volts. That's not a lot.
-----

And taking a closer look at that instability when the Charger Doctor displays voltage we see that it is only 1.256mv peak to peak; that's just 0.001256 Volts. Really, that seems exceptional for a sub $2USD device.
-----
There is a lot of discussion on the web as to why iOS devices don't charge via the Charger Doctor. With the stability shown, I'm not sure why the Charger Doctor effects the WiFi reliability of the Raspberry PI, but I can say it does. We set the Keithley DMM7510 to camp on the Charger Doctor output signal and trigger on a larger glitch or voltage spike to give us a clue. After about 15 minutes the Charger Doctor remained stable within the trigger limits and we moved on with our life. We do have to take into account that the Charger Doctor was effectively unloaded while making these measurements and that could make a big difference.
-----
Thanks for stopping by.
-----

Saturday, May 23, 2015

What hobbyist doesn't want a CNC machine? But realistically, how many can really justify the need for one? Not me, but we did want to learn about CNC machines and experiment with GCODE. If you are wanting to do the same; keep reading...

We had an Arduino UNO sitting around doing nothing as well as some stepper motors we rescued out of an old laser jet printer. That's a good start for the project, but some hardware/software to drive and control those stepper motors was still needed. Oh, and some PVC pipe and connecting joints to construct a mill platform, don't forget that.

-----

After a bit of searching we decided to use the Protoneer CNC Shield for Arduino. You can get this shield for about $20US. It comes completely unassembled, but a soldering iron and an hour or so of time fixes that.

Before assembly it looks like a bag of parts. After assembly it looks like this:

-----

The Protoneer CNC Shield plugs right into the Arduino UNO just like any other shield. Of course, after you get it assembled you will want to test it. But wait, first you will need some software to communicate with the Arduino and drive the Protoneer CNC Shield.

The Protoneer CNC Shield is 100% GRBL compatible. This is great because it provides you with several software options for CNC control. I wanted something that was 1) free and 2) could be used with Windows or LINUX. I experimented with SketchUp, f-engrave, and GCODESENDER. In the end, I seemed to prefer GCODESENDER the best. YMMV.

-----

Here is my first test run controlling the X and Y axis steppers. Ahhhh, the sweet sound of progress:

Then added the Z axis:

-----
Before constructing the PVC "mill" I tested the rig on a Etch-a-Sketch. Seems to work well enough to continue.

-----

Next, thanks to Home Depot and their endless assortment of PVC accessories, the rig below was constructed. I did not use any PVC glue and the slide rails for the milling tray were held on with P-clamps and larger diameter PVC 'sleeves' for bushing/linear bearing.

-----

Here are a few first run tests of the rig in motion:

-----
Example of simple text:

-----
A bit more elaborate example:

-----

The rig works. Could you create an elaborate 3D design with it? Heck no, but that wasn't the point. It was; however, a great learning experience. With some effort, anyone could take this concept and improve it to something more useful if they desired. If you choose to take that path, drop us a line to let us know how it turned out. Thanks!

Wednesday, March 18, 2015

Nosey spouse? NSA tracking you? Just want to made sure you are not "available"?

If for some reason you want make certain your phone (or a visitors phone) is "blind" to location tracking, showing that iMessages are delivered, confirmation emails, GPS, etc. place the phone in a microwave oven.

Here we use a Tektronix RSA306 Real Time Spectrum Analyzer (which is located behind the PC screen) to demonstrate the effectiveness of a microwave oven as a RF screen room. Notice the RSA306 can "see" WIFI/Bluetooth signals when the door is open. When the door is closed anything inside the oven is "blinded" to all cell phone communications. All of them.

If you want to hide your phone (or hide someone else's) from all network communications, put it inside a microwave oven.

Oh, and don't turn on the microwave with your phone inside like this guy did!

Tuesday, February 10, 2015

-----
Braille is a Pebble smartwatch app that allows the vision impaired or anyone wanting to be discrete to check the time. If you are interested in installing this free app on your smartwatch just go to the Pebble App store and search for "Braille" or click on the image below.

Give us a "like" heart while you're there.

-----
If you haven't heard about the Pebble smartwatch you probably have been living under a rock (or a pebble). The Pebble has been one of the more successful KickStarter campaigns. We got ours a few months ago and immediately put it to use. Overall, the Pebble is a great value.
-----
One thing that is often handy is to be able to tell what time it is without looking at your watch. This can be useful in business meetings, on dates, or when it is dark like at a movie. Nothing says "I'd rather be doing something else" like checking the time. Also, this is an absolute requirement for the vision impaired.

Before getting the Pebble I solved this problem with the very innovative Bradley Timepiece; a watch specifically designed for the vision impaired. The challenge was to bring vision impaired features to the Pebble. Fortunately, Pebble has a nice cloud based SDK that allows a developer to upload custom apps to the watch and make them available to the public. With a bit of studying and some help from the Pebble Developer forums we were off and coding....

-----

How the "Braille" app works:

- Press UP button: Count one watch vibration for each hour.

- Press DOWN button: Count one watch vibration for every 10 minutes past the hour. An additional quick two vibrations is added if the time is closer to the next larger 10 minute interval. This gives a very quick resolution of <5 minutes (if you need to be more accurate, them it's time to look at your watch). For example: If it is 30-34 minutes past the hour the watch will give 3 long vibrations. For 35-39 minutes past the hour the watch will give 3 long vibrations plus two quick vibrations.

- Press SELECT button: Light the Pebble if the backlight is enabled.

- Bluetooth Alert: "Braille" also does a vibration alert for 5 seconds and inverts the screen if Bluetooth is disconnected. Handy for making sure you are not separated from your phone. Upon re-connection "Braille" will vibration alert again and turn the screen back to normal.

For the curious, the icon on the watchface is in the Braille pattern for the letter "B".

Thanks for checking us out. Enjoy the "Braille" app and let us know if you have any suggestions for improvement.