"""
    cursor.execute(update_sensor_query,
                   (sensor_status, timestamp, sensor_status_idn))
    conn.commit()
    message = "Sensor data updated successfully"
    return message


def add_sensor_status(sensor_serial_no, sensor_status):
    """
        To add sensor data if first time sent
    """
    sensor_details_select_Query = """select * from sensor_details where serial_number = %s"""
    cursor.execute(sensor_details_select_Query, (sensor_serial_no, ))
    registered_sensor_records = cursor.fetchall()
    sensor_idn = registered_sensor_records[0][0]
    sql_insert_Query = """INSERT INTO sensor_status (sensor_serial_no, sensor_status, sensor_idn, crt_dt, upd_dt) 
                                  VALUES (%s, %s, %s, %s, %s)
                               """
    cursor.execute(
        sql_insert_Query,
        (sensor_serial_no, sensor_status, sensor_idn, timestamp, timestamp))
    conn.commit()
    message = "Sensor data added successfully"
    return message


if __name__ == '__main__':
    #get_sensor_data_from_gateway()
    app.run(host='0.0.0.0', debug=True, port=9001)
Example #2
0
def runserver():
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
    socketio.run(app, host='0.0.0.0', port=port)
Example #3
0
def runserver(debug, host, port):
    app.run(debug=debug, host=host, port=port)
Example #4
0
def runserver():
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port)
    socketio.run(app, host = '0.0.0.0', port=port)
Example #5
0
def runserver():
	port = int(os.environ.get('PORT', 5001))
	app.run(host='0.0.0.0', port=port)
Example #6
0
def runserver():
    port = int(os.environ.get('PORT', 3000))
    app.run(host='0.0.0.0', port=port,debug=True)
Example #7
0
def runserver():
    port = int(os.environ.get('PORT', 3000))
    app.run(host='0.0.0.0', port=port)
def runserver():
    app.run(host='0.0.0.0', debug=True, port=9001)
Example #9
0
from angular_flask import app as application

if __name__ == "__main__":
    application.run('0.0.0.0', port=8220)
def runserver():
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port, threaded=True)
Example #11
0
def runserver():
    port = int(os.environ.get('PORT', 5000))
    app.run(host='0.0.0.0', port=port, debug=True)
    reload(sys)
    sys.setdefaultencoding('utf-8')