This provides a server that allows communication with DTACQ cards use WebSockets (e.g. through a web browser). The server itself is written in python and requires the following packages:
twisted
- event-driven networking engineautobahn
- web-socket communicationclint
- for some nice command-line toolsnumpy
- arrays/data handlingpynedm
- communication with databaseparamiko
- SSH communicationFor running as a daemon
(e.g. in production), please see here.
This is as simple as running the code (make sure PYTHONPATH
is set correctly
to be able to pull in dtacq
):
from dtacq import ShipData
if __name__ == '__main__':
from twisted.python import log
from twisted.internet import reactor
import sys
log.startLogging(sys.stdout)
from autobahn.twisted.websocket import WebSocketServerFactory
factory = WebSocketServerFactory()
factory.protocol = ShipData
reactor.listenTCP(port=9000, factory=factory)
reactor.run()
dtacq
Modulesdtacq
is broken into several modules:
Please see the code for more details here.