Skip to content

Instantly share code, notes, and snippets.

View pashinov's full-sized avatar
🦀

Alexey Pashinov pashinov

🦀
View GitHub Profile
@pashinov
pashinov / aws_iot_client_pub.py
Last active April 24, 2019 09:20
Connecting to AWS IoT MQTT and publishing to topic using Python Paho MQTT client
# Import package
import paho.mqtt.client as mqtt
import ssl
import time
# Define Variables
MQTT_PORT = 8883
MQTT_KEEPALIVE_INTERVAL = 45
MQTT_TOPIC = "MyTopic"
MQTT_MSG = "Hello, World!!!"
@pashinov
pashinov / aws_iot_client_sub.py
Last active April 24, 2019 09:19
Connecting to AWS IoT MQTT and subscribing to topic using Python Paho MQTT client
# Import package
import paho.mqtt.client as mqtt
import ssl
# Define Variables
MQTT_PORT = 8883
MQTT_KEEPALIVE_INTERVAL = 45
MQTT_TOPIC = "MyTopic"
MQTT_HOST = "aws-iot-host.amazonaws.com"