Unable to determine hardware version. I see: Hardware : BCM2835,
expecting BCM2708 or BCM2709. If this is a genuine Raspberry Pi then please report this to projects@drogon.net. If this is not a Raspberry Pi then you are on your own as wiringPi is designed to support the Raspberry Pi ONLY.
/* RFSniffer Usage: ./RFSniffer [<pulseLength>] [] = optional Hacked from http://code.google.com/p/rc-switch/ by @justy to provide a handy RF code sniffer */
intmain(int argc, char *argv[]){ // This pin is not the first pin on the RPi GPIO header! // Consult https://projects.drogon.net/raspberry-pi/wiringpi/pins/ // for more information. int PIN = 2;// 大概在这个位置,26行,改成你想要的针脚 if(wiringPiSetup() == -1) { printf("wiringPiSetup failed, exiting..."); return0; }
/* Usage: ./codesend decimalcode [protocol] [pulselength] decimalcode - As decoded by RFSniffer protocol - According to rc-switch definitions pulselength - pulselength in microseconds 'codesend' hacked from 'send' by @justy - The provided rc_switch 'send' command uses the form systemCode, unitCode, command which is not suitable for our purposes. Instead, we call send(code, length); // where length is always 24 and code is simply the code we find using the RF_sniffer.ino Arduino sketch. (Use RF_Sniffer.ino to check that RF signals are being produced by the RPi's transmitter or your remote control) */ #include"../rc-switch/RCSwitch.h" #include<stdlib.h> #include<stdio.h>
intmain(int argc, char *argv[]){ // This pin is not the first pin on the RPi GPIO header! // Consult https://projects.drogon.net/raspberry-pi/wiringpi/pins/ // for more information. int PIN = 0;// 大概在27行,改成你想要的针脚 // Parse the first parameter to this command as an integer int protocol = 0; // A value of 0 will use rc-switch's default value int pulseLength = 0;
send.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* Usage: ./send <systemCode> <unitCode> <command> Command is 0 for OFF and 1 for ON */
intmain(int argc, char *argv[]){ /* output PIN is hardcoded for testing purposes see https://projects.drogon.net/raspberry-pi/wiringpi/pins/ for pin mapping of the raspberry pi GPIO connector */ int PIN = 0;// 大概在17行,改成你想要的针脚 constchar* code[6] = { "00000", "10000", "01000", "00100", "00010", "00001" };
wget https://github.com/fatedier/frp/releases/download/v0.33.0/frp_0.33.0_linux_amd64.tar.gz tar -zxvf frp_0.33.0_linux_amd64.tar.gz cd frp_0.33.0_linux_amd64
然后编辑一下里面的frps.ini
1 2
[common] bind_port = 8844
开个screen或者是用tmux,运行./frps -c frps.ini挂着即可
随后在树莓派上面下载
1 2 3
wget https://github.com/fatedier/frp/releases/download/v0.33.0/frp_0.33.0_linux_arm.tar.gz tar -zxvf frp_0.33.0_linux_arm.tar.gz cd frp_0.33.0_linux_arm