flask基本使用
app.py12345678910111213141516171819202122232425262728293031323334353637383940414243444546from flask import g, Flask, url_for, redirect, request, render_template, sessionfrom flask_migrate import Migratefrom exts import dbfrom decorations import login_requiredfrom models import Userimport configfrom blueprints.user import bp as user_bpfrom blueprints.device import bp as device_bpfrom blueprints.data import bp as data_bpfrom blueprints.register_requests import bp as register_requests_bpfrom bluepr ...
mybatis基本使用
来自@狂神说
mybatis-config.xml12345678910111213141516171819202122232425262728293031323334<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration> <properties resource="db.properties"/><typeAliases> <!--<typeAlias type="com.xxx.pojo.User" alias="User"></typeAlia ...
python与stm32串口通讯
win或linux通过串口与嵌入式通讯准备
插入usb并打开权限12ls /dev/ttyUSB*sudo chmod 777 /dev/ttyUSB*
python 上位机代码12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061import serial# 串口打开函数def open_ser(): port = 'com1' # 串口号 baudrate = 9600 # 波特率 try: global ser #ser = serial.Serial(port,baudrate,timeout=0.5) ser=serial.Serial("/dev/ttyUSB1",9600,timeout=0.5) #使用USB连接串行口 if(ser.isOpen()==True): print("串口打开成功") ...
rtmp-nginx
前言目的:为了实现将大疆无人机采集的视频推流到服务器端,将图像进行处理。使用公网ip,使推流服务不局限于局域网。
准备
环境腾讯云轻量服务器,操作系统为Ubuntu18.04,附带公网ip。
安装相关依赖包
123456sudo apt-get install autoconf automakesudo apt-get install libpcre3 libpcre3-devsudo apt-get install opensslsudo apt-get install libssl-devsudo apt-get install zlib1g-devsudo apt-get build-dep gcc
搭建
系统下创建安装文件夹
1234mkdir optcd optmkdir workspacecd workspace
下载nginx安装包
1wget http://nginx.org/download/nginx-1.18.0.tar.gz
下载nginx-rtmp-module
1wget https://github.com/arut/nginx-rtmp-mo ...