Gateway Python Module
geoscope_gateway.emulator module
- class geoscope_gateway.emulator.GeoEmulator(client_id: str, broker='127.0.0.1', port=18884)
Bases:
object- async run(interval)
- async geoscope_gateway.emulator.emulate_sensors(client_list=[], broker='PigServer-USMARC.pignet', port=18884, interval=0.5)
geoscope_gateway.logger module
- class geoscope_gateway.logger.GeoAggregator(task_group: TaskGroup, storage_root='/mnt/hdd/PigNet/', log_name='GEOSCOPE.Subscriber', timestamp_conversion: Callable[[int], int] = None)
Bases:
object- bg_task_manager = None
- async flush()
- async log_json_status(message)
- async log_sensor(message, timestamp)
- async log_status(message)
- payloads = {}
- async save_sensor_data(node_id, data)
- save_trigger_count = {}
- async geoscope_gateway.logger.delete_bad_json(folder)
geoscope_gateway.pignet module
- class geoscope_gateway.pignet.geophonePriorityQueue(maxsize=0)
Bases:
PriorityQueue
- async geoscope_gateway.pignet.maintain_mqtt(main_func, *args, **kwargs)
- async geoscope_gateway.pignet.pignet(root_dir='/mnt/hdd/PigNet/', broker_host='127.0.0.1', broker_port=18884)
geoscope_gateway.timesync module
- class geoscope_gateway.timesync.ESPSerialTime(serial_port: Serial, gpio_port: GPIO, interval_sec=2.0, poly_order=2, buf_len=500)
Bases:
object- async get_serial_ts()
- loop = None
- model = None
- async start()
- async stop()
- async timestamp_update()
- async geoscope_gateway.timesync.UDPMicrosLoop(target_address='10.244.0.255', port=2323, rep_sec=1)
- class geoscope_gateway.timesync.UDPTimestampBroadcaster(repeat_sec, loop, disconn_future)
Bases:
DatagramProtocol- connection_lost(exc)
Called when the connection is lost or closed.
The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed).
- connection_made(transport)
Called when a connection is made.
The argument is the transport representing the pipe connection. To receive data, wait for data_received() calls. When the connection is closed, connection_lost() is called.
- send()
- async geoscope_gateway.timesync.mqttMicrosLoop(topic='geoscope/micros', broker_host='127.0.0.1', broker_port='18884', **kwargs)
- async geoscope_gateway.timesync.serialMicrosLoop(port='/dev/ttyUSB0', baudrate=115200, **kwargs)
- geoscope_gateway.timesync.system_micros_timestamp()
- async geoscope_gateway.timesync.timestampMicrosLoop(output_context_mgr, repeat_sec=1, interrupt_pin=None)