elehshl / mqtt_exercise_2021

Exercise about MQTT
1 stars 0 forks source link

Name Error in Police.py #3

Closed beLipinski closed 3 years ago

beLipinski commented 3 years ago

Name Error at Line 77 array: "msg" is not defined

add msg to the method call or make it global

def receive_order_user():

    if "hshl/mqtt_exercise/user" == msg[0] and str(js['coordinates']) == str(coordinates):
        storePosition(js['coordinates'],js['coordinates_ziel'])

receive_order_user()

def receive_server():
    if msg[0] == "hshl/mqtt_exercise/server" and str(js['get_coordinates']):
        new_coordinates = coordinates_ziel + zahly
        send("hshl/mqtt_exercise/server/set_coordinates", json.dumps(new_coordinates))
        receive()
receive_server()

Screenshot 2021-06-14 175005