comparison service/arduinoNode/arduinoNode.py @ 190:ad20e5cb4feb

serve ipv6 and use localhost's ipv6 name for getting updates Ignore-this: f44a03e61aa84e5db046ecacd7ec0dd6
author drewp@bigasterisk.com
date Sun, 30 Aug 2015 01:17:08 -0700
parents 2161c71c7b02
children 6c6897a139da
comparison
equal deleted inserted replaced
189:fc184ea1416d 190:ad20e5cb4feb
78 return { 78 return {
79 'uri': self.uri, 79 'uri': self.uri,
80 'dev': self.dev, 80 'dev': self.dev,
81 'baudrate': self.baudrate, 81 'baudrate': self.baudrate,
82 'devices': [d.description() for d in self._devs], 82 'devices': [d.description() for d in self._devs],
83 'graph': 'http://%s6:9059/graph' % socket.gethostname(), #todo
83 } 84 }
84 85
85 def open(self): 86 def open(self):
86 self.ser = LoggingSerial(port=self.dev, baudrate=self.baudrate, 87 self.ser = LoggingSerial(port=self.dev, baudrate=self.baudrate,
87 timeout=2) 88 timeout=2)
414 415
415 log.info('open boards') 416 log.info('open boards')
416 for b in boards: 417 for b in boards:
417 b.startPolling() 418 b.startPolling()
418 419
419 reactor.listenTCP(9059, cyclone.web.Application([ 420
421 app = cyclone.web.Application([
420 (r"/()", cyclone.web.StaticFileHandler, { 422 (r"/()", cyclone.web.StaticFileHandler, {
421 "path": "static", "default_filename": "index.html"}), 423 "path": "static", "default_filename": "index.html"}),
422 (r'/static/(.*)', cyclone.web.StaticFileHandler, {"path": "static"}), 424 (r'/static/(.*)', cyclone.web.StaticFileHandler, {"path": "static"}),
423 (r'/boards', Boards), 425 (r'/boards', Boards),
424 (r"/graph", GraphPage), 426 (r"/graph", GraphPage),
425 (r'/output', OutputPage), 427 (r'/output', OutputPage),
426 (r'/arduinoCode', ArduinoCode), 428 (r'/arduinoCode', ArduinoCode),
427 (r'/dot', Dot), 429 (r'/dot', Dot),
428 ], config=config, boards=boards)) 430 ], config=config, boards=boards)
431 reactor.listenTCP(9059, app, interface='::')
429 reactor.run() 432 reactor.run()
430 433
431 main() 434 main()