Sunday, 25 June 2017

How to send Text to MQTT Cloud Server.

How to send Text to MQTT Cloud Server.



from Adafruit_IO import Client
aio = Client('Your Adafruit IO Key')

import RPi.GPIO as GPIO
import time
import signal
import sys

# use Raspberry Pi board pin numbers
GPIO.setmode(GPIO.BCM)

while True:

aio.send('text', "Hello")
print('Received value: {0}'.format(data.value))

Circuit Diagram:



0 comments:

Post a Comment

if you have any doubt please let me know