SOOCOO C30 WIFI Remote on ESP8266

MSW

New Member
Joined
Jul 8, 2016
Messages
6
Reaction score
2
Country
Ukraine
WIFI remote for Soocoo C30 on ESP8266 module
2 button:
1 - GPIO4 - make Photo
2- GPIO5 - start/stop Video
Button connect to gnd and pullup resistor (10k) to +3.3V

Code for Arduino (v 1.6.9) + https://github.com/esp8266/Arduino (v 2.0.0)

Code:
#include <ESP8266WiFi.h>

const char* ssid     = "C30               "; // 18 symbol
const char* password = "00000000"; // 8 symbol

int BTN_PHOTO = 4; //*** ESP-12: GPIO4 / ESP-01: GPIO0
int BTN_VIDEO = 5; //*** ESP-12: GPIO5 / ESP-01: GPIO2

bool statusVideo = false;

WiFiClient client;

void setup() {
  pinMode(BTN_PHOTO, INPUT);
  pinMode(BTN_VIDEO, INPUT);

  Serial.begin(115200);
  delay(10);
  Serial.println();

  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println(WiFi.localIP());
}

void loop() {
  if( digitalRead(BTN_PHOTO) == 0 ) {
    delay(100);
    if( digitalRead(BTN_PHOTO) == 0 ) {
      makeQuery("3001&par=0");
      makeQuery("1001");
      Serial.println("make Photo");
    }
  }

  if( digitalRead(BTN_VIDEO) == 0 ) {
    delay(100);
    if( digitalRead(BTN_VIDEO) == 0 ) {
      makeQuery("3001&par=1");
      if(statusVideo == true) {       //*** Stop Video
        statusVideo = false;
        makeQuery("2001&par=0");
        Serial.println("stop Video");
      } else {                        //*** Start Video
        statusVideo = true;
        makeQuery("2001&par=1");
        Serial.println("start Video");
      }
    }
  }
}

void makeQuery(String cmd) {
  if ( !client.connect("192.168.1.254", 80) ) {
    return;
  }
  client.print("GET /?custom=1&cmd=" + cmd + " HTTP/1.1\r\nUser-Agent: Dalvik/2.1.0\r\nHost: 192.168.1.254\r\nConnection: Keep-Alive\r\nAccept-Encoding: gzip\r\n\r\n");
}
plans for future releases:
if you press the photo button and turn on the power module, the module will create the access point and settings page to specify the data connection to the camera
 
OP
M

MSW

New Member
Joined
Jul 8, 2016
Messages
6
Reaction score
2
Country
Ukraine
New version firmware for C30-Remote and video -
 
Top