mt5225 / tel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

App for tel project

task one: read binary file

start API service

  • API Server : python api_srv.py

it will:

  • create the db telfire if not exist
  • and clean up all records in table alarms
  • start the sheduler with interval 10 minutes, which in turn clear all event in table
  • listening to port 9005

test fire API service

  • python api_srv.py
  • curl -i -X GET http://localhost:9006/fire returns: 2017-10-15 05:31:14|fire|017|3F-4#2017-10-15 05:31:14|recover|017|3F-4#2017-10-15 05:31:14|fire|019|3F-6#2017-10-15 05:31:14|recover|019|3F-6#2017-10-15 05:31:14|fire|016|3F-3#2017-10-15 05:31:14|recover|016|3F-3#2017-10-15 05:31:33|fire|017|3F-4#2017-10-15 05:31:33|recover|017|3F-4#2017-10-15 05:31:38|fire|017|3F-4#2017-10-15 05:31:38|recover|017|3F-4#2017-10-15 05:31:38|fire|019|3F-6

start mysql for gas sensor

  • cd /Users/mt5225/Projects/playground/mysql-box
  • vagrant up
  • http://192.168.33.10/phpmyadmin root:root
  • MySQL Select rows on first occurrence of each unique value select * from ( select * from alarm order by id desc) x group by tag;

test gas api

start socket client [fire alarm]

  • Socket Client: python socket_client.py

download tel scene

misc

  • fire sensor naming: 1F-3, get from fire_map.csv mapping file
  • gas sensor naming: G21_ALM, from intouch table/mysql

About


Languages

Language:Python 57.2%Language:JavaScript 42.8%