月度归档:2023年04月

mqtt的docker

docker run -d --name=mosquitto --privileged \
-p 1883:1883 -p 9001:9001 \
-v /home/mosquitto/config:/mosquitto/config \
-v /home/mosquitto/data:/mosquitto/data \
-v /home/mosquitto/log:/mosquitto/log \
eclipse-mosquitto
mosquitto_passwd -b mosquitto/config/userpass.conf user user123

 

tuic配置

配置TUIC代理+V2Ray分流

[Unit]
Description=Delicately-TUICed high-performance proxy built on top of the QUIC protocol
Documentation=https://github.com/EAimTY/tuic
After=network.target

[Service]
User=root
WorkingDirectory=/usr/local/bin
ExecStart=/usr/local/bin/tuic-server -c /usr/local/etc/tuic/config.json
Restart=on-failure
RestartPreventExitStatus=1
RestartSec=5

[Install]
WantedBy=multi-user.target

config

{
    // The socket address to listen on
    "server": "[::]:443",

    // User list, contains user UUID and password
    "users": {
        "00000000-0000-0000-0000-000000000000": "PASSWORD_0",
        "00000000-0000-0000-0000-000000000001": "PASSWORD_1"
    },

    // The path to the certificate file
    "certificate": "PATH/TO/CERTIFICATE",

    // The path to the private key file
    "private_key": "PATH/TO/PRIVATE_KEY",

    // Optional. Congestion control algorithm, available options:
    // "cubic", "new_reno", "bbr"
    // Default: "cubic"
    "congestion_control": "cubic",

    // Optional. Application layer protocol negotiation
    // Default being empty (no ALPN)
    "alpn": ["h3", "spdy/3.1"],

    // Optional. If the server should create separate UDP sockets for relaying IPv6 UDP packets
    // Default: true
    "udp_relay_ipv6": true,

    // Optional. Enable 0-RTT QUIC connection handshake on the server side
    // This is not impacting much on the performance, as the protocol is fully multiplexed
    // WARNING: Disabling this is highly recommended, as it is vulnerable to replay attacks. See https://blog.cloudflare.com/even-faster-connection-establishment-with-quic-0-rtt-resumption/#attack-of-the-clones
    // Default: false
    "zero_rtt_handshake": false,

    // Optional. Set if the listening socket should be dual-stack
    // If this option is not set, the socket behavior is platform dependent
    "dual_stack": true,

    // Optional. How long the server should wait for the client to send the authentication command
    // Default: 3s
    "auth_timeout": "3s",

    // Optional. Maximum duration server expects for task negotiation
    // Default: 3s
    "task_negotiation_timeout": "3s",

    // Optional. How long the server should wait before closing an idle connection
    // Default: 10s
    "max_idle_time": "10s",

    // Optional. Maximum packet size the server can receive from outbound UDP sockets, in bytes
    // Default: 1500
    "max_external_packet_size": 1500,

    // Optional. Maximum number of bytes to transmit to a peer without acknowledgment
    // Should be set to at least the expected connection latency multiplied by the maximum desired throughput
    // Default: 8MiB * 2
    "send_window": 16777216,

    // Optional. Maximum number of bytes the peer may transmit without acknowledgement on any one stream before becoming blocked
    // Should be set to at least the expected connection latency multiplied by the maximum desired throughput
    // Default: 8MiB
    "receive_window": 8388608,

    // Optional. Interval between UDP packet fragment garbage collection
    // Default: 3s
    "gc_interval": "3s",

    // Optional. How long the server should keep a UDP packet fragment. Outdated fragments will be dropped
    // Default: 15s
    "gc_lifetime": "15s",

    // Optional. Set the log level
    // Default: "warn"
    "log_level": "warn"
}

https://github.com/EAimTY/tuic/tree/dev/tuic-server

树莓派获取发送433信号

安装wiringpi

sudo apt install swig python-dev git python-pip python3-pip -y
git clone --recursive https://ghproxy.com/https://github.com/neuralpi/WiringPi-Python.git
cd WiringPi-Python/WiringPi
sudo ./build
cd ..
swig -python wiringpi.i
sudo python setup.py install
sudo python3 setup.py install

一通操作之后,gpio终于有了响应

安装433Utils

由于我买的是个433MHz的控制器,所以直接git上面下载一个就是了,好在这个433Utils比较方便一下子就找到了

git clone --recursive https://ghproxy.com/https://github.com/ninjablocks/433Utils.git
cd 433Utils/RPi_utils
make

https://zhuanlan.zhihu.com/p/34219448

 

重点是不要修改默认的pin值

 

https://damaoooo.github.io/2020/05/06/%E6%A0%91%E8%8E%93%E6%B4%BE%E6%8A%98%E8%85%BE%E8%AE%B0%E2%80%94%E2%80%94%E5%B0%84%E9%A2%91%E6%8E%A7%E5%88%B6%E5%BC%80%E5%85%B3/

https://bbs.hassbian.com/thread-1314-1-1.html

https://bbs.hassbian.com/thread-1110-1-1.html

 

Decode 433 MHz signals w/ Raspberry Pi & 433 MHz Receiver

树莓派GPIO引脚图,详解查看和调试树莓派引脚