DEVICE_FILE_ROOT = "./devices/"

    LDR_DEVICE_ID = "UL_LDR"
    LDR_ENTITY_ID = "LDR001"
    LDR_FILE_PATH = DEVICE_FILE_ROOT + "LDR.json"

    LED_DEVICE_ID = "UL_LED"
    LED_ENTITY_ID = "LED001"
    LED_FILE_PATH = DEVICE_FILE_ROOT + "LED.json"

    client_iot = FiwareIotClient("config.ini")
    client_context = FiwareContextClient("config.ini")

    if '--no-register-device' not in arguments:
        client_iot.register_device(LDR_FILE_PATH, LDR_DEVICE_ID, LDR_ENTITY_ID)
        client_iot.register_device(LED_FILE_PATH, LED_DEVICE_ID, LED_ENTITY_ID)

    if '--no-subscribe-cygnus' not in arguments:
        client_context.subscribe_cygnus(LDR_ENTITY_ID, ["luminosity"])
        client_context.subscribe_cygnus(LED_ENTITY_ID, ["state"])

    if '--no-subscribe-sth' not in arguments:
        client_context.subscribe_historical_data(LDR_ENTITY_ID, ["luminosity"])

    try:
        while True:
            reading = randint(0, 255)
            print('Sending LDR reading:', reading)
            client_iot.send_observation(LDR_DEVICE_ID, {'l': reading}, protocol='MQTT')
            time.sleep(10)
    #criando uma instância das classes iot e context da biblioteca fiotclient
    client_iot = FiwareIotClient("config.ini")
    client_context = FiwareContextClient("config.ini")

    #atribuindo o service e o service path
    if '--no-set-service' not in arguments:
        client_iot.set_service(SERVICE_NAME, SERVICE_PATH)

    #atribuindo a api_key
    if '--no-set-api-key' not in arguments:
        client_iot.set_api_key(API_KEY)

    #registrando o dispositivo
    if '--no-register-device' not in arguments:
        client_iot.register_device(DHT_FILE_PATH, DHT_DEVICE_ID, DHT_ENTITY_ID)

    #atribuindo a entidade
    if '--no-set-service' not in arguments:
        client_context.set_service(SERVICE_NAME, SERVICE_PATH)

    #fazendo a inscrição no cygnus, usando os argumentos (Entity_ID,[attrs..])
    if '--no-subscribe-cygnus' not in arguments:
        client_context.subscribe_cygnus(DHT_ENTITY_ID,
                                        ["humidity", "temperature"])

    #fazendo a inscrição para histórico de dados, usando os argumentos (Entity_ID,[attrs..])
    if '--no-subscribe-sth' not in arguments:
        client_context.subscribe_historical_data(DHT_ENTITY_ID,
                                                 ["humidity", "temperature"])