Browse Source

Robot changes after Test

master
Luis Waldhauser 1 year ago
parent
commit
847a424049

+ 4
- 4
software/roboter/raspy/mainProg.py View File

datefmt="%d-%m-%Y %H:%M:%S") datefmt="%d-%m-%Y %H:%M:%S")
logging.getLogger().addHandler(logging.StreamHandler(sys.stdout)) logging.getLogger().addHandler(logging.StreamHandler(sys.stdout))


client = mqtt.Client(RASPI_CLIENT_ID)
# client = mqtt.Client(RASPI_CLIENT_ID, transport="websockets") # Local Broker
# client = mqtt.Client(RASPI_CLIENT_ID)
client = mqtt.Client(RASPI_CLIENT_ID, transport="websockets") # Local Broker
client.on_connect = on_connect client.on_connect = on_connect
client.connect(MQTT_BROKER_GLOBAL)
# client.connect("192.168.137.197") # Local Broker
# client.connect(MQTT_BROKER_GLOBAL)
client.connect("192.168.137.197") # Local Broker


logging.info("Robot initialised") logging.info("Robot initialised")



BIN
software/roboter/raspy/picture.png View File


+ 3
- 2
software/roboter/raspy/raspy_sensors.py View File

try: try:
camera = PiCamera() camera = PiCamera()
except: except:
raise Exception("Camera not connected")
# raise Exception("Camera not connected")
pass
camera.start_preview() camera.start_preview()
camera.capture("picture.png") camera.capture("picture.png")
def main(): def main():
value = SENSORDATA value = SENSORDATA
try: try:
value |= readSensors()
readSensors(value)
except Exception as e: except Exception as e:
print(str(e)) print(str(e))



Loading…
Cancel
Save