Spend along time trying Pope and call subprocess scripts and could not get the temp value out the
temp = subprocess.Popen(“mosquitto_sub -t /tinkerforge/bricklet/temperature/t6Q/temperature”,shell=True)
removing all the humidity, air-pressure I made a cayenne-mqtt-test.py file with
while True: try: temp = subprocess.call("mosquitto_sub -t /tinkerforge/bricklet/temperature/t6Q/temperature",shell=True) print (temp) temp = str(dict(temp).get("temperature")) print (temp) time.sleep(5) except (EOFError, SystemExit, KeyboardInterrupt): mqttc.disconnect() sys.exit()
keeping the fist part intact to try to see what value is in temp and different stages. Runinning it gives me this:
pi@pi20:~/tinkerforge $ python cayenne-mqtt-test.py
tried print with () and without but nothing prints on the screen.
How to I “debug” the value of temp during the running of this test script?