上次和大家分享了如何烧录和安装Openwrt到BananaPi R2,运行Openwrt的R2目前就具备路由器的功能了,这次我们来看看R2运行Openwrt的性能如何,同时也会讲解一些常用的网络知识. 首先看一下硬件上的设计: 可以看出硬件上,R2设计了一个wan口和4个lan口: 这里可能有人会有疑问,什么是wan口,什么是lan口? wan(Wide Area Network)表示广域网,lan(Local Area Network)表示局域网:简单的讲就是wan口是连接Internet上网…
RPi.GPIO是通过Python/C API实现的,C代码操作底层寄存器, python通过Python/C API调用这些C接口. 这是关于RPi.GPIO项目的介绍. 其中提到了有python 垃圾回收机制,并不适合于实时要求的应用. https://pypi.org/project/RPi.GPIO/ This package provides a class to control the GPIO on a Raspberry Pi. Note that this module is…
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import RPi.GPIO as GPIO from flask import Flask, request, jsonify app = Flask(__name__) pwm_dict = {} # set the mode of raspberry pi # when mod = 10 set the mode as GPIO.BOARD # when mod = 11 set the mod…