예제 #1
0
from threading import Thread
from flask import Flask, render_template, session, request
from flask.ext.socketio import SocketIO, emit, disconnect

app = Flask(__name__)
app.template_folder = "."
app.debug = False
app.config["SECRET_KEY"] = "secret!"

socketio = SocketIO(app)

# configure Ublox for 230400 baudrate!
changeBaudrateTo230400()

rtk = RTKLIB(socketio)

perform_update = False

# at this point we are ready to start rtk in 2 possible ways: rover and base
# we choose what to do by getting messages from the browser

@app.route("/")
def index():
    return render_template("index.html")

@socketio.on("connect", namespace="/test")
def testConnect():
    print("Browser client connected")
    rtk.sendState()
예제 #2
0
from threading import Thread
from flask import Flask, render_template, session, request, send_file
from flask.ext.socketio import SocketIO, emit, disconnect
from subprocess import check_output

app = Flask(__name__)
app.template_folder = "."
app.debug = False
app.config["SECRET_KEY"] = "secret!"
app.config["UPLOAD_FOLDER"] = "../logs"

socketio = SocketIO(app)

# configure Ublox for 230400 baudrate!
changeBaudrateTo230400()
rtk = RTKLIB(socketio)

# at this point we are ready to start rtk in 2 possible ways: rover and base
# we choose what to do by getting messages from the browser

@app.route("/")
def index():
    rtk.logm.updateAvailableLogs()
    return render_template("index.html", logs = rtk.logm.available_logs, system_status = reach_tools.getSystemStatus())

@app.route("/logs/download/<path:log_name>")
def downloadLog(log_name):
    full_log_path = rtk.logm.log_path + "/" + log_name
    return send_file(full_log_path, as_attachment = True)

@socketio.on("connect", namespace="/test")
예제 #3
0
app.config["LOGIN_DISABLED"] = False
path_to_rtklib = "/usr/local/bin"

login = LoginManager(app)
login.login_view = 'login_page'
socketio = SocketIO(app)
bootstrap = Bootstrap(app)

#Get settings from settings.conf.default and settings.conf
rtkbaseconfig = RTKBaseConfigManager(
    os.path.join(os.path.dirname(__file__), "../settings.conf.default"),
    os.path.join(os.path.dirname(__file__), "../settings.conf"))

rtk = RTKLIB(
    socketio,
    rtklib_path=path_to_rtklib,
    log_path=app.config["DOWNLOAD_FOLDER"],
)

services_list = [
    {
        "service_unit": "str2str_tcp.service",
        "name": "main"
    },
    {
        "service_unit": "str2str_ntrip.service",
        "name": "ntrip"
    },
    {
        "service_unit": "str2str_local_ntrip_caster.service",
        "name": "local_ntrip_caster"
예제 #4
0
app = Flask(__name__)
app.template_folder = "."
app.debug = False
app.config["SECRET_KEY"] = "secret!"
app.config["UPLOAD_FOLDER"] = "../logs"

socketio = SocketIO(app)

# bluetooth init
bluetoothctl = reach_bluetooth.bluetoothctl.Bluetoothctl()
bluetooth_bridge = reach_bluetooth.tcp_bridge.TCPtoRFCOMMBridge()
bluetooth_bridge.start()

# configure Ublox for 230400 baudrate!
changeBaudrateTo230400()
rtk = RTKLIB(socketio)

# at this point we are ready to start rtk in 2 possible ways: rover and base
# we choose what to do by getting messages from the browser

@socketio.on("start bluetooth scan", namespace="/test")
def start_bluetooth_scan():
    print("Starting bluetooth scan")
    bluetoothctl.start_scan()
    socketio.emit("bluetooth scan started", namespace="/test")

@socketio.on("get discoverable bluetooth devices", namespace="/test")
def send_available_bluetooth_devices():
    print("Sending available bluetooth devices")
    devices = bluetoothctl.get_discoverable_devices()
    print(devices)