SHARE
TWEET

Untitled

a guest Aug 21st, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. !/usr/bin/python
  2. # -*- coding: ascii -*-
  3. import os, sys
  4.  
  5. from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
  6. import time
  7. import json
  8.  
  9. host =  "a2c7vpgkmq05d0-ats.iot.us-west-2.amazonaws.com"
  10. clientId = "c-sdk-client-id"
  11. port = 443
  12. rootCAPath = "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA$
  13. privateKeyPath = "2a5c7ce20d-private.pem.key"
  14. certificatePaht = "2a5c7ce20d-certificate.pem.key"
  15. topic = "Raspberry/TESTabc"
  16.  
  17. #Custom MQTT message callback
  18. def customCallback(client, userdata, message):
  19.    print("Received a new message: ")
  20.    print(message.payload)
  21.    print("from topic: ")
  22.    print(message.topic)
  23.    print("--------------\n\n")
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top