Интернет вещей
1
Вклад в тег
url = 'https://site.ru/upload2'
path_img = 'grey3.jpg'
head = {"session-key": session_key , "user-id": userid}
files = {'uploaded_photo': open(path_img, 'rb')}
r = requests.post(url,headers=head, files=files)
select count(*) from (select distinct w.id from words w join test t on t.word_id_1=w.id) ww ;
первый /// GSM Датчик удара
#include
SoftwareSerial gsm(7, 8);
int dver=12;
int bag=4;
#define LED 13
#define ShockPin 3 // датчик удара
int ShockVal;
#define TELLNUMBER "ATD+79021039665;" // номер на который будет звонить датчик#define pinBOOT 5
void setup() {
Serial.begin(9600);
delay(1000);
gsm.begin(19200);
pinMode(LED, OUTPUT);
pinMode(ShockPin, INPUT);
delay(1000);
digitalWrite(LED, HIGH);
delay(2000);
while(gsm.find("STARTUP"));
gsm.println("ATE0");
while(1){
gsm.println("AT+COPS?");
if (gsm.find("+COPS: 0")) break;
delay(50);
digitalWrite(LED, HIGH);
delay(500);
}
digitalWrite(LED, LOW);
delay(1500);
digitalWrite(LED, HIGH);
delay(250);
digitalWrite(LED, LOW);
RemoteReceiver::init(0, 3, showCode);
pinMode (dver,OUTPUT);
pinMode (bag,OUTPUT);
}
void showCode(unsigned long receivedCode, unsigned int period)
{
Serial.print("Code: ");
Serial.print(receivedCode);
Serial.print(", period duration: ");
Serial.print(period);
Serial.println("us.");
// открытие и зокрытие дверей
if (receivedCode == 411878) // закрыто
{
digitalWrite(dver,LOW)
}
if (receivedCode == 411810) // открыто
{
digitalWrite(dver,HIGH);
}
// багажник
if (receivedCode == 411864)
{
digitalWrite(bag,HIGH);
delay(100000);
digitalWrite(bag,LOW);
}
}
void loop() {
Serial.println(ShockVal);
ShockVal = digitalRead(ShockPin);
if(ShockVal == LOW){
digitalWrite(LED,HIGH);
gsm.println(TELLNUMBER);
delay(2500);
}
else
{
digitalWrite(LED, LOW);
}
}