# local.py is run on the local machine that will be sending
# heartbeat connections to remote.py
import paho.mqtt.client as mqtt
import time

def on_connect(client, userdata, flags, rc):
    print("Connected with code: %i" % rc)

client = mqtt.Client()
client.on_connect = on_connect
client.connect('test.mosquitto.org', 1883)

while True:
    client.publish('marcel_status', 'alive')
    time.sleep(1)

client.loop_forever()

2c842b2f201bb105b3dec68e616f1b150658853c
<mask token>


def on_connect(client, userdata, flags, rc):
    print('Connected with code: %i' % rc)


<mask token>

<mask token>


def on_connect(client, userdata, flags, rc):
    print('Connected with code: %i' % rc)


<mask token>
client.connect('test.mosquitto.org', 1883)
while True:
    client.publish('marcel_status', 'alive')
    time.sleep(1)
client.loop_forever()

<mask token>


def on_connect(client, userdata, flags, rc):
    print('Connected with code: %i' % rc)


client = mqtt.Client()
client.on_connect = on_connect
client.connect('test.mosquitto.org', 1883)
while True:
    client.publish('marcel_status', 'alive')
    time.sleep(1)
client.loop_forever()

import paho.mqtt.client as mqtt
import time


def on_connect(client, userdata, flags, rc):
    print('Connected with code: %i' % rc)


client = mqtt.Client()
client.on_connect = on_connect
client.connect('test.mosquitto.org', 1883)
while True:
    client.publish('marcel_status', 'alive')
    time.sleep(1)
client.loop_forever()

# local.py is run on the local machine that will be sending
# heartbeat connections to remote.py
import paho.mqtt.client as mqtt
import time

def on_connect(client, userdata, flags, rc):
    print("Connected with code: %i" % rc)

client = mqtt.Client()
client.on_connect = on_connect
client.connect('test.mosquitto.org', 1883)

while True:
    client.publish('marcel_status', 'alive')
    time.sleep(1)

client.loop_forever()
