Sibi Sankar
Published © GPL3+

Virtual Post Man.

Virtual Post Man maps the physical event of receiving a post card to an email notification thus bridging the digital and physical worlds.

IntermediateFull instructions provided1,685
Virtual Post Man.

Things used in this project

Hardware components

Grove starter kit plus for Intel Edison
Seeed Grove starter kit plus for Intel Edison
Intel Galileo Gen 2
Intel Galileo Gen 2

Software apps and online services

Amazon Web Services AWS IoT
Amazon Web Services AWS SNS


Read more

Custom parts and enclosures

Post Box

The necessary dimensions of the post box is identified using model of Intel Galileo Gen 2.


Circuit Connection

The groove starter kit makes it trivial to set it up.


MQTT Client.

After the necessary dependancies are met (ie) Placing the essential certificates in the auth folder the python works its magic.
# Library Imports
import paho.mqtt.client as mqtt
import ssl
import time
import thread
import pyupm_grove as grove
from wiringx86 import GPIOGalileoGen2 as GPIO

# Pin Definition
led = 5
light = grove.GroveLight(0)

# Stores the Previous LDR value
prev_ldr_data = 0

gpio = GPIO()
gpio.pinMode(led, gpio.OUTPUT)

#Set it to always on
gpio.digitalWrite(led, gpio.HIGH)

#defining topics
ldrTopic    = "topics/ldr"

def on_connect(client, userdata, flags, rc):
    print "Connected Successfully"

client = mqtt.Client()
client.on_connect = on_connect
client.tls_set(ca_certs='./auth/rootCA.pem', certfile='./auth/XXXXXXXXXX-certificate.pem.crt', keyfile='./auth/XXXXXXXXXX-private.pem.key', tls_version=ssl.PROTOCOL_SSLv23)
client.connect("", 8883, 60) #Taken from REST API endpoint

#Main Loop
#Publishing Analog Values to AWS
def publishNewPost(Variable):
    while (1):
        ldr_data = str(light.raw_value() )
        if prev_ldr_data:
            if ldr_data - prev_ldr_data > 300:
                client.publish(ldr_Topic, payload="A New Mail For You")
                print "Threshold crossed "
        prev_ldr_data = ldr_data



Sibi Sankar

Sibi Sankar

2 projects • 6 followers
I live by the maxim 'made made dane' (you still have a long way to go).


Add projectSign up / Login