Outils pour utilisateurs

Outils du site


projets:openpathview:hardware:hack_gopro

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
projets:openpathview:hardware:hack_gopro [2014/12/21 15:20] – [Préparation de l'EEPROM] arnaudrprojets:openpathview:hardware:hack_gopro [2024/04/16 22:28] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +====== Le hack des Go Pro Hero 2 ======
  
 +====== Câble de synchronisation des GoPro ======
 +
 +//Retour à la page principale -> [[projets:openstreetview|Open Path View]]//
 +
 +===== Problématique =====
 +
 +Nous devons pouvoir lancé la prise de vue sur tout les appareil en "même temps" bien sûr il est impossible de le faire exactement au même moment mais nous devons limiter le décalage entre 2 prises de vues.
 +
 +===== Solution =====
 +
 +GoPro a sorti un kit 3D, dans lequel on trouve 2 petits boîtiers rouges. Ces boîtiers sont la clé pour synchroniser 2 appareils.
 +
 +La communauté d'utilisateurs GoPro a examiné de très près le fonctionnement de ces boîtiers pour l'étendre a plus de 2 appareils. Pour cela nous allons tenté de réunir les infos présentes [[http://goprouser.freeforums.org/the-gopro-hero-hd-bus-interface-t797-260.html#p19184|ici]].
 +
 +Nous allons donc reproduire le circuit.
 +
 +===== Ressources =====
 +  * [[http://goprouser.freeforums.org/the-gopro-hero-hd-bus-interface-t797-260.html#p19184]]
 +  * [[http://mikenz.geek.nz/blog/gopro-hd-hero2-arduino/]]
 +  * [[http://www.bi3nary.com/billboard/gopro-hd-hero2-remote-control]]
 +  * [[http://www.hobbytronics.co.uk/arduino-external-eeprom]]
 +===== Matériel pour les tests =====
 +  * Connecteurs "ipod" (30 pins), pour les tests on prendra 2 [[https://www.sparkfun.com/products/8295|PodBreakout]]
 +  * 2 [[http://fr.farnell.com/microchip/24lc256-i-p/eeprom-serie-256k-24lc256-dip8/dp/9757970|Eeprom 24LC256]] ou [[http://uk.farnell.com/microchip/24lc01b-p/ic-eeprom-serial-1k-24lc01-dip8/dp/1200025|Eeprom 24LC01B]]
 +  * 2 supports  [[http://fr.farnell.com/te-connectivity-amp/1-1825093-2/connecteur-fiche-femelle-dip/dp/1654374|dip 8]]
 +  * des cables :)
 +  * Nous utlisons des EEPROM CMS. Le datasheet est disponible à cette adresse : [[http://ww1.microchip.com/downloads/en/DeviceDoc/21711J.pdf]]
 +===== Préparation de l'EEPROM =====
 +
 +<code C>
 +#if defined(ARDUINO) && ARDUINO >= 100  
 +#include "Arduino.h"  
 +#else  
 +#include "WProgram.h"  
 +#endif  
 +#include <Wire.h>
 +
 +#define ADDRESS 0x50
 +
 +void setup()
 +{
 +    Wire.begin();
 +
 +    /* Serial output */
 +    Serial.begin(9600);
 +    delay(5000);
 +
 +    Serial.println("Dumping eeprom first 8 bytes");
 +    dump();
 +
 +    Serial.println("Writing to first byte");
 +    Wire.beginTransmission(ADDRESS);
 +    Wire.write(0);
 +    Wire.write((byte)0x05);
 +    Wire.endTransmission();
 +
 +    Serial.println("Dumping eeprom first 8 bytes");
 +    dump();
 +
 +    Serial.println("Done");
 +}
 +
 +void loop() {
 +}
 +
 +void dump()
 +{
 +    Wire.beginTransmission(ADDRESS); 
 +    Wire.write(0);
 +    Wire.endTransmission();
 + 
 +   Wire.beginTransmission(ADDRESS);
 +   Wire.write(0);
 +   Wire.endTransmission();
 +
 +   Wire.beginTransmission(ADDRESS);
 +
 +   Wire.requestFrom(ADDRESS, 8);
 +
 +   while(Wire.available() < 8) {};
 +
 +   for (int j=0; j < 8; j++) {
 +         printInt(Wire.read());
 +         Serial.print("     ");
 +   }
 +    
 +   Serial.println(); 
 +   Wire.endTransmission();
 +}
 +
 +void printInt(int i)
 +{
 +  Serial.print("0x");
 + 
 +  if ( i<16 )
 +    Serial.print("0");
 +   
 +  Serial.print(i, HEX);
 +}
 +</code>
 +{{:projets:openstreetview:test_eeprom.png|}}
 +Le montage correspondant : \\
 +
 +{{ :projets:openstreetview:eeprom.png?direct&550 |}}
 +
 +{{:projets:openstreetview:arduino_eeprom.fz|Fichier Fritzing du schéma}}
 +
 +
 +
 +
 +
 +
 +
 +===== Sources =====
 +Hack GoPro Hero 2 : [[http://mikenz.geek.nz/blog/gopro-hd-hero2-arduino/]] \\
 +
 +
 +La GoPro fonctionnant en 3,3v, il faut éviter d'utiliser une tension de 5v, afin d'éviter l'utilisation d'un convertisseur nous utilisons un Arduino Pro Mini 3,3 v. \\
 +
 +**Contrôle d'une GoPro par un Arduino**
 +{{ :projets:openpathview:hardware:goproarduino_schem.jpg?direct&650 |}} 
 +
 +**Code Arduino contrôlant 6 GoPro**
 +
 +<code c++>
 +//GoPro Arduino control
 +#define GOPRO_TRIG      2
 +#define GOPRO_ID1       {7,8,9,10,11,12}
 +#define GOPRO_ID2       3
 +#define GOPRO_ID3       4
 +#define POW_MOD_1       13
 +#define POW_MOD_2       6
 +#define TIME_OUT        2000
 +
 +void GoPro_powerOn(){            //turn GoPro on
 +    digitalWrite(POW_MOD_1, LOW);
 +    digitalWrite(POW_MOD_2, LOW);
 +    
 +    delay(350);
 +    digitalWrite(POW_MOD_1, HIGH);    
 +    digitalWrite(POW_MOD_2, HIGH);
 +    delay(4500); //Booting time
 +    Serial.println("ON");    
 +}
 +
 +void GoPro_setMode(){            //turn GoPro in photo mode
 +    digitalWrite(POW_MOD_1, LOW);
 +    digitalWrite(POW_MOD_2, LOW);
 +    
 +    delay(350);
 +    digitalWrite(POW_MOD_1, HIGH);    
 +    digitalWrite(POW_MOD_2, HIGH);
 +    delay(350); //Security time
 +    Serial.println("PHOTO_MODE");    
 +}
 +
 +
 +void GoPro_powerOff(){          //turn GoPro off
 +    digitalWrite(POW_MOD_1, LOW);
 +    digitalWrite(POW_MOD_2, LOW);
 +    delay(3000);
 +    digitalWrite(POW_MOD_1, HIGH);
 +    digitalWrite(POW_MOD_2, HIGH);
 +    Serial.println("OFF");
 +}
 +
 +
 +void GoPro_takePic(){                //take picture
 +  
 +    int pinList[] = GOPRO_ID1; //get the pin list
 +    int start_n[6];            //list of pin initial stat
 +    for (int i = 0;i<6;i++){
 +      start_n[i] = digitalRead(pinList[i]);
 +    }
 +
 +    digitalWrite(GOPRO_ID2, LOW);
 +    delayMicroseconds(340);    
 +    digitalWrite(GOPRO_ID2, HIGH);
 +    Serial.println("ID2");
 +    unsigned long time = millis();
 +    bool notOkList[6];
 +    int notOk = 1;            //check if all statu are differente == ready
 +    while (notOk==1){
 +     notOk = 0;
 +     for (int i = 0;i<6;i++){
 +        if(digitalRead(pinList[i]) == start_n[i]){
 +          notOk = 1;
 +          notOkList[i]=1;
 +        }
 +        else{
 +          notOkList[i]=0;
 +        }
 +        if( (millis()-time)>=TIME_OUT){
 +          Serial.println("ERROR");
 +          for (int i = 0;i<6;i++){Serial.print(notOkList[i]);}
 +          Serial.println("");
 +          notOk = -1;
 +          break;          
 +        }
 +      }       
 +    }
 +    Serial.println("ID1s");    
 +    digitalWrite(GOPRO_TRIG, LOW); //take pic
 +    delayMicroseconds(340);
 +    digitalWrite(GOPRO_TRIG, HIGH);
 +    Serial.println("TAKEN");
 +
 +
 +void setup() {
 +    // Serial output
 +//    Serial.begin(38400);
 +
 +    pinMode(POW_MOD_1, OUTPUT);
 +    digitalWrite(POW_MOD_1, LOW);
 +    
 +    pinMode(POW_MOD_2, OUTPUT);
 +    digitalWrite(POW_MOD_2, LOW);
 +    
 +    Serial.begin(9600);
 +    Serial.println("OFF");
 +  
 +    int pinList[] = GOPRO_ID1;  //init all ID1
 +    for (int i = 0;i<=6;i++){
 +      pinMode(pinList[i], INPUT);
 +    }
 +    
 +    
 +    pinMode(GOPRO_ID2, OUTPUT);
 +    pinMode(GOPRO_ID3, OUTPUT);
 +    pinMode(GOPRO_TRIG, OUTPUT);
 +    // 1 photo taken
 +    
 +    // Set output lines to their default state
 +    digitalWrite(GOPRO_TRIG, HIGH);
 +    digitalWrite(GOPRO_ID2, HIGH);
 +    digitalWrite(GOPRO_ID3, LOW);     
 +    
 +/*    Serial.println("press any key once the camera is in photo mode");
 +    while (Serial.available() == 0) {}
 +    Serial.read();
 +*/
 +    // ID3 High to say we are going to control the camera, set this low when finished controlling the camera
 +    digitalWrite(GOPRO_ID3, HIGH); //May take a photo
 +    
 +    delay(1500);
 +//    Serial.println("Begining to take photos");
 +    
 +}
 +
 +void loop() {
 +
 +  int availableData = 0;
 +  char lastChar;
 +  if (Serial.available()>0){
 +    availableData = Serial.available();
 +    for (int i = 0; i<availableData;i++){
 +      lastChar = Serial.read();          
 +    }
 +    if (lastChar == 'I'){
 +      GoPro_powerOn();
 +    }
 +    else if(lastChar == 'O'){
 +      GoPro_powerOff();
 +    }
 +    else if(lastChar == 'T'){
 +      GoPro_takePic();
 +    }
 +    else if(lastChar == 'M'){
 +      GoPro_setMode();
 +    }    
 +    else{
 +      Serial.println("Error");
 +    }
 +  }
 +
 +}
 +</code>
 + ~~ODT~~

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki