panoptes.peas package

Submodules

panoptes.peas.remote_sensors module

class panoptes.peas.remote_sensors.RemoteMonitor(endpoint_url=None, sensor_name=None, *args, **kwargs)[source]

Bases: object

Does a pull request on an endpoint to obtain a JSON document.

capture(store_result=True)[source]

Read JSON from endpoint url and capture data.

Note

Currently this doesn’t do any processing or have a callback.

Returns:Dictionary of sensors keyed by sensor name.
Return type:sensor_data (dict)
disconnect()[source]

panoptes.peas.sensors module

class panoptes.peas.sensors.ArduinoSerialMonitor(sensor_name=None, auto_detect=False, *args, **kwargs)[source]

Bases: object

Monitors the serial lines and tries to parse any data recevied as JSON.

Checks for the camera_box and computer_box entries in the config and tries to connect. Values are updated in the database.

capture(store_result=True)[source]

Helper function to return serial sensor info.

Reads each of the connected sensors. If a value is received, attempts to parse the value as json.

Returns:Dictionary of sensors keyed by sensor name.
Return type:sensor_data (dict)
disconnect()[source]
panoptes.peas.sensors.auto_detect_arduino_devices(comports=None)[source]
panoptes.peas.sensors.detect_board_on_port(port)[source]

Open a port and determine which type of board its producing output.

Returns: (name, serial_reader) if we can read a line of JSON from the
port, parse it and find a ‘name’ attribute in the top-level object. Else returns None.
panoptes.peas.sensors.find_arduino_devices()[source]

Find devices (paths or URLs) that appear to be Arduinos.

Returns://host:port arduino_simulator://?board=camera).
Return type:a list of strings; device paths (e.g. /dev/ttyACM1) or URLs (e.g. rfc2217

Module contents