Aller au contenu


Contenu de Gamepigeek

Il y a 52 élément(s) pour Gamepigeek (recherche limitée depuis 04-avril 13)



#113558 Photos

Posté par Gamepigeek sur 15 mai 2021 - 10:41 dans Vigibot

Voici qq photos des miens 😋

Image(s) jointe(s)

  • IMG_20210504_213338.jpg
  • IMG_20210512_115844.jpg
  • IMG_20210504_213401.jpg
  • IMG_20210512_115850.jpg
  • IMG_20210512_115850.jpg
  • IMG_20210502_172136.jpg
  • IMG_20210502_172127.jpg
  • IMG_20210501_171048.jpg
  • IMG_20210513_210125.jpg
  • IMG_20210407_170551.jpg
  • IMG_20210405_190644.jpg
  • IMG_20210511_115149.jpg
  • IMG_20210504_221231.jpg
  • IMG_20210505_220002.jpg
  • IMG_20210509_114244.jpg
  • IMG_20210502_145052.jpg
  • IMG_20210407_233841.jpg
  • IMG_20210405_232015.jpg
  • IMG_20210404_205430.jpg
  • IMG_20210403_202709.jpg
  • IMG_20210321_172422.jpg
  • IMG_20210312_163130.jpg
  • IMG_20210304_155436.jpg
  • IMG_20210305_155937.jpg
  • IMG_20210221_151600.jpg
  • IMG_20210316_183124.jpg
  • IMG_20210511_150830.jpg
  • IMG_20210506_125603.jpg
  • IMG_20210504_221240.jpg
  • IMG_20210430_225706.jpg
  • IMG_20210404_201314.jpg



#113509 Vigibot Pi arduino Serial Communication Example

Posté par Gamepigeek sur 07 mai 2021 - 10:25 dans Vigibot

Hello,

 

I finished my code with the help of Mike118 and Firened ! Thank you so much


#include <WiFi.h>
#include <ESPmDNS.h>

int pwmChannel = 0; //Choisit le canal 0
int frequence = 50; //Fréquence PWM de 5 KHz
int resolution = 16; //Résolution de 16 bits, 65535 valeurs possibles
int pwmPin = 13;
int MaxRev = 8192;// duty cycle pour avancer fond
int MaxFor = 1638;// duty cycle pour reculer a fond



const char* ssid = "My Wifi";
const char* pass = "My Pass";
// Set your Static IP address
IPAddress local_IP(192, 168, 0, 61);
// Set your Gateway IP address
IPAddress gateway(192, 168, 0, 254);
IPAddress subnet(255, 255, 255, 0);


// Meta Type :

typedef struct {
  union {
    struct {
      int16_t x;
      int16_t y;
    };
    int16_t coordonnees[2];
    uint8_t bytes[4];
  };
} Point;

typedef struct {
  union {
    struct {
      int8_t x;
      int8_t y;
      int8_t z;
    };
    uint8_t bytes[3];
  };
} Vitesses;


// CONFIG

//#define PISERIAL Serial
#define NBPOSITIONS 2
#define FAILSAFE 250 // ms

// TTS

#define TTSBUFFERSIZE 255
uint8_t ttsBuffer[TTSBUFFERSIZE];
uint8_t ttsCurseur = 0;


// TX

#define TXFRAMESIZE (NBPOSITIONS * 4 + 17)

typedef struct {
  union {
    struct {
      uint8_t sync[4];               // 4
      Point positions[NBPOSITIONS];  // NBPOSITIONS * 4
      uint16_t val16[2];             // 2 * 2
      uint8_t choixCameras;          // 1
      Vitesses vitesses;             // 3
      uint8_t interrupteurs;         // 1
      uint8_t val8[4];               // 4
    };

    uint8_t bytes[TXFRAMESIZE];
  };
} TrameTx;

// RX

#define RXFRAMESIZE (NBPOSITIONS * 4 + 9)

typedef struct {
  union {
    struct {                       // Sizes
      uint8_t sync[4];              // 4
      Point positions[NBPOSITIONS]; // NBPOSITIONS * 4      
      uint8_t choixCameras;         // 1
      Vitesses vitesses;            // 3
      uint8_t interrupteurs;        // 1
    };

    uint8_t bytes[RXFRAMESIZE];
  };
} TrameRx;


TrameTx trameTx;
TrameRx trameRx;

uint32_t lastTrameTimestamp = millis();
uint32_t lastSleepBeacon;

WiFiServer server(7070);  //ESP server port
WiFiClient client;

void setup()
{
  Serial.begin(115200);
  
  ledcSetup(pwmChannel, frequence, resolution);
  ledcAttachPin(pwmPin, pwmChannel);
  // We start by connecting to a WiFi network

  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.mode(WIFI_STA);
  WiFi.config(local_IP, gateway, subnet);
  WiFi.setHostname("Vigibot_ESP_0");
  WiFi.begin(ssid, pass);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");    delay(5000);
    ESP.restart();
  }

  server.begin();

  Serial.println("WiFi connected.");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());


  // add all your init here
}

void loop() {
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("WLAN Connection Failed! reconnecting...");
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, pass);
    delay(10000);
  }

  if (readPiSerial()) {
    // each time we receive a full trame run repeatedly:
    // use values inside trameRx to tell your robot how to move ...
    // trameRx.vitesses.x , trameRx.vitesses.y, trameRx.vitesses.z
    // trameRx.positions[i].x trameRx.positions[i].y  etc....

    

    writePiSerial();
    lastTrameTimestamp = millis();
  }
  if ( millis() - lastTrameTimestamp > FAILSAFE ) {
    if ((millis() - lastSleepBeacon > 10000) ) { // every 10 seconds
      writePiSerial();                        // Beacon to say that the robot is alive
      lastSleepBeacon = millis();
    }
    // Stop the robot in case the robot lost connection with the Pi
    ledcWrite(pwmChannel, 0); //stop the train

  } else {
    // put your main code here, to run repeatedly:
    // avoid abstacle, run speed ...
    
    // mixage pour obtenir les vitesses moteurs
    int speed = map(trameRx.vitesses.y, -128, 128, MaxFor, MaxRev); // 128 recu par vigibot
    
    ledcWrite(pwmChannel, speed); //envoyer la consigne vitesse au moteur via la lib
    
  }
  
}


bool readPiSerial() {
  uint8_t current;
  static uint8_t lastType = 0;
  static uint8_t n = 0;
  static uint8_t frame[RXFRAMESIZE];
  static byte lastClientState = 0;
  if (client.connected()) {
    if (!lastClientState) {
      lastClientState = 1;
      Serial.println("New Client.");
    }
    while (client.available()) {
      current = client.read();
      //Serial.write(current); //debug

      switch (n) {

        case 0:
          if (current == '$')
            n = 1;
          break;

        case 1:
          if (current != 'T' && lastType == 'T')
            writeTtsBuffer('\n');

          if (current == 'S' || current == 'T') {
            lastType = current;
            n = 2;
          } else
            n = 0;
          break;

        default:
          frame[n++] = current;

          if (n == RXFRAMESIZE) {

            if (lastType == 'T') {

              for (uint8_t i = 4; i < RXFRAMESIZE; i++) // Do not send the 4 sync data in tts
                writeTtsBuffer(frame[i]);

            } else if (lastType == 'S') {

              for (uint8_t p = 0; p < RXFRAMESIZE; p++)
                trameRx.bytes[p] = frame[p];

            }
            n = 0;
            return true;
          }
          //break;
      }
    }
  } else { //if current client is not actively connected anymore, disconnect and wait for new client
    if (lastClientState) {
      lastClientState = 0;
      // close the connection:
      client.stop();
      Serial.println("Client Disconnected.");
    }
    client = server.available();   // listen for incoming clients
  }
  return false;
}

void writePiSerial() {
  // Header, do not modify
  trameTx.sync[0] = '$';
  trameTx.sync[1] = 'R';
  trameTx.sync[2] = ' ';
  trameTx.sync[3] = ' ';

  // modify the feedback according your need. By default we copy the trameRx content ...
  for (uint8_t i = 0; i < NBPOSITIONS; i++) {
    trameTx.positions[i].x = trameRx.positions[i].x;
    trameTx.positions[i].y = trameRx.positions[i].y;
  }
  trameTx.val16[0] = 0;   // Voltage (will be updated by Raspberry pi)
  trameTx.val16[1] = 0;   // Percent (will be updated by Raspberry pi)
  trameTx.choixCameras = trameRx.choixCameras;
  trameTx.vitesses.x = trameRx.vitesses.x;
  trameTx.vitesses.y = trameRx.vitesses.y;
  trameTx.vitesses.z = trameRx.vitesses.z;
  trameTx.interrupteurs = trameRx.interrupteurs;
  trameTx.val8[0] = 0;   // CPU load (will be updated by Raspberry pi)
  trameTx.val8[1] = 0;   // Soc temp (will be updated by Raspberry pi)
  trameTx.val8[2] = 0;   // link (will be updated by Raspberry pi)
  trameTx.val8[3] = 0;   // RSSI (will be updated by Raspberry pi)

  for ( uint8_t i = 0; i < TXFRAMESIZE; i++)
    client.write(trameTx.bytes[i]);
}

void displayTtsBuffer (uint8_t * ttsBuffer, uint8_t bufferSize) {
  // you can modify this function to display text on a screen depending on your hardware...
  for ( uint8_t i = 0; i < bufferSize; i++) {
    Serial.write(ttsBuffer[i]);
  }
  Serial.println("");
}

void writeTtsBuffer( uint8_t ttsChar) {
  static uint8_t ttsCurseur = 0;
  if ( ttsCurseur < TTSBUFFERSIZE && ttsChar != '\n') {
    ttsBuffer[ttsCurseur] = ttsChar;
    ttsCurseur ++;
  }
  if ( ttsCurseur == TTSBUFFERSIZE || ttsChar == '\n') {
    displayTtsBuffer (ttsBuffer, ttsCurseur);
    ttsCurseur = 0;
  }
}



#113485 Vigibot Pi arduino Serial Communication Example

Posté par Gamepigeek sur 05 mai 2021 - 01:15 dans Vigibot

Hello everyone ! 

 

Je vais Vigiboter mon train légo. Pour ce faire, j'utilise un ESP32. 

 

J'ai donc repris le code d'exemple de @Mike118 que j'ai adapté :


#include <WiFi.h>
#include <ESPmDNS.h>
#include "esp32-hal-ledc.h"

const char* ssid = "ssid";
const char* pass = "mdp";
// Set your Static IP address
IPAddress local_IP(192, 168, 0, 61);
// Set your Gateway IP address
IPAddress gateway(192, 168, 0, 254);
IPAddress subnet(255, 255, 255, 0);


// Meta Type :

typedef struct {
  union {
    struct {
      int16_t x;
      int16_t y;
    };
    int16_t coordonnees[2];
    uint8_t bytes[4];
  };
} Point;

typedef struct {
  union {
    struct {
      int8_t x;
      int8_t y;
      int8_t z;
    };
    uint8_t bytes[3];
  };
} Vitesses;


// CONFIG

//#define PISERIAL Serial
#define NBPOSITIONS 2
#define FAILSAFE 250 // ms

#define MAX_SPEED              1275 // max motor speed
#define SPEED_RANGE            256 //


// TTS

#define TTSBUFFERSIZE 255
uint8_t ttsBuffer[TTSBUFFERSIZE];
uint8_t ttsCurseur = 0;


// TX

#define TXFRAMESIZE (NBPOSITIONS * 4 + 17)

typedef struct {
  union {
    struct {
      uint8_t sync[4];               // 4
      Point positions[NBPOSITIONS];  // NBPOSITIONS * 4
      uint16_t val16[2];             // 2 * 2
      uint8_t choixCameras;          // 1
      Vitesses vitesses;             // 3
      uint8_t interrupteurs;         // 1
      uint8_t val8[4];               // 4
    };

    uint8_t bytes[TXFRAMESIZE];
  };
} TrameTx;

// RX

#define RXFRAMESIZE (NBPOSITIONS * 4 + 9)

typedef struct {
  union {
    struct {                       // Sizes
      uint8_t sync[4];              // 4
      Point positions[NBPOSITIONS]; // NBPOSITIONS * 4      
      uint8_t choixCameras;         // 1
      Vitesses vitesses;            // 3
      uint8_t interrupteurs;        // 1
    };

    uint8_t bytes[RXFRAMESIZE];
  };
} TrameRx;


TrameTx trameTx;
TrameRx trameRx;

uint32_t lastTrameTimestamp = millis();
uint32_t lastSleepBeacon;

WiFiServer server(7070);  //ESP server port
WiFiClient client;

void setup()
{
  Serial.begin(115200);
  ledcSetup(1, 50, 16); // channel 1, 50 Hz, 16-bit width
  ledcAttachPin(13, 1);   // GPIO 13 assigned to channel 1


  // We start by connecting to a WiFi network

  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.mode(WIFI_STA);
  WiFi.config(local_IP, gateway, subnet);
  WiFi.setHostname("Vigibot_ESP_0");
  WiFi.begin(ssid, pass);
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("Connection Failed! Rebooting...");    delay(5000);
    ESP.restart();
  }

  server.begin();

  Serial.println("WiFi connected.");
  Serial.println("IP address: ");
  Serial.println(WiFi.localIP());


  // add all your init here
}

void loop() {
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
    Serial.println("WLAN Connection Failed! reconnecting...");
    WiFi.mode(WIFI_STA);
    WiFi.begin(ssid, pass);
    delay(10000);
  }

  if (readPiSerial()) {
    // each time we receive a full trame run repeatedly:
    // use values inside trameRx to tell your robot how to move ...
    // trameRx.vitesses.x , trameRx.vitesses.y, trameRx.vitesses.z
    // trameRx.positions[i].x trameRx.positions[i].y  etc....

    

    writePiSerial();
    lastTrameTimestamp = millis();
  }
  if ( millis() - lastTrameTimestamp > FAILSAFE ) {
    if ((millis() - lastSleepBeacon > 10000) ) { // every 10 seconds
      writePiSerial();                        // Beacon to say that the robot is alive
      lastSleepBeacon = millis();
    }
    // Stop the robot in case the robot lost connection with the Pi
    ledcWrite(1, 0); //stop the train

  } else {
    // put your main code here, to run repeatedly:
    // avoid abstacle, run speed ...
    
    int speed;
    
    // mixage pour obtenir les vitesses moteurs
    speed = (trameRx.vitesses.y * MAX_SPEED / SPEED_RANGE) - (trameRx.vitesses.z * MAX_SPEED / SPEED_RANGE);


    // Saturation des vitesse
    speed = min(max(speed, -MAX_SPEED), MAX_SPEED);

    ledcWrite(1, speed);
    
  }
  
}


bool readPiSerial() {
  uint8_t current;
  static uint8_t lastType = 0;
  static uint8_t n = 0;
  static uint8_t frame[RXFRAMESIZE];
  static byte lastClientState = 0;
  if (client.connected()) {
    if (!lastClientState) {
      lastClientState = 1;
      Serial.println("New Client.");
    }
    while (client.available()) {
      current = client.read();
      //Serial.write(current); //debug

      switch (n) {

        case 0:
          if (current == '$')
            n = 1;
          break;

        case 1:
          if (current != 'T' && lastType == 'T')
            writeTtsBuffer('\n');

          if (current == 'S' || current == 'T') {
            lastType = current;
            n = 2;
          } else
            n = 0;
          break;

        default:
          frame[n++] = current;

          if (n == RXFRAMESIZE) {

            if (lastType == 'T') {

              for (uint8_t i = 4; i < RXFRAMESIZE; i++) // Do not send the 4 sync data in tts
                writeTtsBuffer(frame[i]);

            } else if (lastType == 'S') {

              for (uint8_t p = 0; p < RXFRAMESIZE; p++)
                trameRx.bytes[p] = frame[p];

            }
            n = 0;
            return true;
          }
          //break;
      }
    }
  } else { //if current client is not actively connected anymore, disconnect and wait for new client
    if (lastClientState) {
      lastClientState = 0;
      // close the connection:
      client.stop();
      Serial.println("Client Disconnected.");
    }
    client = server.available();   // listen for incoming clients
  }
  return false;
}

void writePiSerial() {
  // Header, do not modify
  trameTx.sync[0] = '$';
  trameTx.sync[1] = 'R';
  trameTx.sync[2] = ' ';
  trameTx.sync[3] = ' ';

  // modify the feedback according your need. By default we copy the trameRx content ...
  for (uint8_t i = 0; i < NBPOSITIONS; i++) {
    trameTx.positions[i].x = trameRx.positions[i].x;
    trameTx.positions[i].y = trameRx.positions[i].y;
  }
  trameTx.val16[0] = 0;   // Voltage (will be updated by Raspberry pi)
  trameTx.val16[1] = 0;   // Percent (will be updated by Raspberry pi)
  trameTx.choixCameras = trameRx.choixCameras;
  trameTx.vitesses.x = trameRx.vitesses.x;
  trameTx.vitesses.y = trameRx.vitesses.y;
  trameTx.vitesses.z = trameRx.vitesses.z;
  trameTx.interrupteurs = trameRx.interrupteurs;
  trameTx.val8[0] = 0;   // CPU load (will be updated by Raspberry pi)
  trameTx.val8[1] = 0;   // Soc temp (will be updated by Raspberry pi)
  trameTx.val8[2] = 0;   // link (will be updated by Raspberry pi)
  trameTx.val8[3] = 0;   // RSSI (will be updated by Raspberry pi)

  for ( uint8_t i = 0; i < TXFRAMESIZE; i++)
    client.write(trameTx.bytes[i]);
}

void displayTtsBuffer (uint8_t * ttsBuffer, uint8_t bufferSize) {
  // you can modify this function to display text on a screen depending on your hardware...
  for ( uint8_t i = 0; i < bufferSize; i++) {
    Serial.write(ttsBuffer[i]);
  }
  Serial.println("");
}

void writeTtsBuffer( uint8_t ttsChar) {
  static uint8_t ttsCurseur = 0;
  if ( ttsCurseur < TTSBUFFERSIZE && ttsChar != '\n') {
    ttsBuffer[ttsCurseur] = ttsChar;
    ttsCurseur ++;
  }
  if ( ttsCurseur == TTSBUFFERSIZE || ttsChar == '\n') {
    displayTtsBuffer (ttsBuffer, ttsCurseur);
    ttsCurseur = 0;
  }
}

Ca fonctionne parfaitement sauf que quand j'accélère sur Vigibot ca n'avance pas comme je veux vu que les math n'ont pas été faites.

 

Je parle de :

#define MAX_SPEED              1275 // max motor speed
#define SPEED_RANGE            256 //

ou/et de :

ledcSetup(1, 50, 16); // channel 1, 50 Hz, 16-bit width

en sachant que vigibot envoi les consignes moteurs en 8 bit .. 

 

Je n'ai pas encore le niveau pour améliorer comme je veux ce genre de réglage PWM Hertz etc..

 

Le calcul reste le meme que pour Zumo.

 

Merci de votre aide !

 

Pierre




#113260 Erreur dans mon code pour mon robot à base d'ESP8266

Posté par Gamepigeek sur 06 avril 2021 - 09:30 dans Vigibot

Bonjour a toutes et tous,

 

Je cherche a connecter un NodeMCU a base d'ESP8266 pour "vigiboter" un train lego.

 

J'ai utilisé l'exemple de @Mike118 modifié par @Firened sans succès car j'obtiens l'erreur : 

void writePiSerial()':
sketch_apr06a:237:34: error: 'struct TrameRx' has no member named 'choixCameras'
   trameTx.choixCameras = trameRx.choixCameras;
                                  ^
exit status 1
'struct TrameRx' has no member named 'choixCameras'

le code est : 

#include <WiFi.h>
#include <ESP8266WiFi.h>
 
//ici c'est simplement en tant que serveur :P
const char* ssid = "your_ssid";
const char* pass = "your_pass";
// Set your Static IP address
IPAddress local_IP(192, 168, 1, 61);
// Set your Gateway IP address
IPAddress gateway(192, 168, 1, 1);
IPAddress subnet(255, 255, 255, 0);
 
 
// Meta Type :
 
typedef struct {
  union {
    struct {
      int16_t x;
      int16_t y;
    };
    int16_t coordonnees[2];
    uint8_t bytes[4];
  };
} Point;
 
typedef struct {
  union {
    struct {
      int8_t x;
      int8_t y;
      int8_t z;
    };
    uint8_t bytes[3];
  };
} Vitesses;
 
 
// CONFIG
 
//#define PISERIAL Serial
#define NBPOSITIONS 2
#define FAILSAFE 250 // ms
 
 
// TTS
 
#define TTSBUFFERSIZE 255
uint8_t ttsBuffer[TTSBUFFERSIZE];
uint8_t ttsCurseur = 0;
 
 
// TX
 
#define TXFRAMESIZE (NBPOSITIONS * 4 + 17)
 
typedef struct {
  union {
    struct {
      uint8_t sync[4];               // 4
      Point positions[NBPOSITIONS];  // NBPOSITIONS * 4
      uint16_t val16[2];             // 2 * 2
      uint8_t choixCameras;          // 1
      Vitesses vitesses;             // 3
      uint8_t interrupteurs;         // 1
      uint8_t val8[4];               // 4
    };
 
    uint8_t bytes[TXFRAMESIZE];
  };
} TrameTx;
 
 
// RX
 
#define RXFRAMESIZE (NBPOSITIONS * 4 + 9)
 
typedef struct {
  union {
    struct {                       // Sizes
      uint8_t sync[4];              // 4
      Point positions[NBPOSITIONS]; // NBPOSITIONS * 4      uint8_t choixCameras;         // 1
      Vitesses vitesses;            // 3
      uint8_t interrupteurs;        // 1
    };
 
    uint8_t bytes[RXFRAMESIZE];
  };
} TrameRx;
 
 
TrameTx trameTx;
TrameRx trameRx;
 
uint32_t lastTrameTimestamp = millis();
uint32_t lastSleepBeacon;
 
WiFiServer server(7070);  //ESP server port
WiFiClient client;
 
void setup()
{
  Serial.begin(115200);
  Serial.println();
 
  WiFi.begin("SSID", "PASS");
 
  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
  Serial.println();
 
  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}
 
void loop() {
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(500);
    Serial.print(".");
  }
 
  if (readPiSerial()) {
    // each time we receive a full trame run repeatedly:
    // use values inside trameRx to tell your robot how to move ...
    // trameRx.vitesses.x , trameRx.vitesses.y, trameRx.vitesses.z
    // trameRx.positions[i].x trameRx.positions[i].y  etc....
 
    
 
    writePiSerial();
    lastTrameTimestamp = millis();
  }
  if ( millis() - lastTrameTimestamp > FAILSAFE ) {
    if ((millis() - lastSleepBeacon > 10000) ) { // every 10 seconds
      writePiSerial();                        // Beacon to say that the robot is alive
      lastSleepBeacon = millis();
    }
    // Stop the robot in case the robot lost connection with the Pi
    
  } else {
    // put your main code here, to run repeatedly:
    // avoid abstacle, run speed ...
    
  }
  
}
 
 
bool readPiSerial() {
  uint8_t current;
  static uint8_t lastType = 0;
  static uint8_t n = 0;
  static uint8_t frame[RXFRAMESIZE];
  static byte lastClientState = 0;
  if (client.connected()) {
    if (!lastClientState) {
      lastClientState = 1;
      Serial.println("New Client.");
    }
    while (client.available()) {
      current = client.read();
      //Serial.write(current); //debug
 
      switch (n) {
 
        case 0:
          if (current == '$')
            n = 1;
          break;
 
        case 1:
          if (current != 'T' && lastType == 'T')
            writeTtsBuffer('\n');
 
          if (current == 'S' || current == 'T') {
            lastType = current;
            n = 2;
          } else
            n = 0;
          break;
 
        default:
          frame[n++] = current;
 
          if (n == RXFRAMESIZE) {
 
            if (lastType == 'T') {
 
              for (uint8_t i = 4; i < RXFRAMESIZE; i++) // Do not send the 4 sync data in tts
                writeTtsBuffer(frame[i]);
 
            } else if (lastType == 'S') {
 
              for (uint8_t p = 0; p < RXFRAMESIZE; p++)
                trameRx.bytes[p] = frame[p];
 
            }
            n = 0;
            return true;
          }
          //break;
      }
    }
  } else { //if current client is not actively connected anymore, disconnect and wait for new client
    if (lastClientState) {
      lastClientState = 0;
      // close the connection:
      client.stop();
      Serial.println("Client Disconnected.");
    }
    client = server.available();   // listen for incoming clients
  }
  return false;
}
 
void writePiSerial() {
  // Header, do not modify
  trameTx.sync[0] = '$';
  trameTx.sync[1] = 'R';
  trameTx.sync[2] = ' ';
  trameTx.sync[3] = ' ';
 
  // modify the feedback according your need. By default we copy the trameRx content ...
  for (uint8_t i = 0; i < NBPOSITIONS; i++) {
    trameTx.positions[i].x = trameRx.positions[i].x;
    trameTx.positions[i].y = trameRx.positions[i].y;
  }
  trameTx.val16[0] = 0;   // Voltage (will be updated by Raspberry pi)
  trameTx.val16[1] = 0;   // Percent (will be updated by Raspberry pi)
  trameTx.choixCameras = trameRx.choixCameras;
  trameTx.vitesses.x = trameRx.vitesses.x;
  trameTx.vitesses.y = trameRx.vitesses.y;
  trameTx.vitesses.z = trameRx.vitesses.z;
  trameTx.interrupteurs = trameRx.interrupteurs;
  trameTx.val8[0] = 0;   // CPU load (will be updated by Raspberry pi)
  trameTx.val8[1] = 0;   // Soc temp (will be updated by Raspberry pi)
  trameTx.val8[2] = 0;   // link (will be updated by Raspberry pi)
  trameTx.val8[3] = 0;   // RSSI (will be updated by Raspberry pi)
 
  for ( uint8_t i = 0; i < TXFRAMESIZE; i++)
    client.write(trameTx.bytes[i]);
}
 
void displayTtsBuffer (uint8_t * ttsBuffer, uint8_t bufferSize) {
  // you can modify this function to display text on a screen depending on your hardware...
  for ( uint8_t i = 0; i < bufferSize; i++) {
    Serial.write(ttsBuffer[i]);
  }
  Serial.println("");
}
 
void writeTtsBuffer( uint8_t ttsChar) {
  static uint8_t ttsCurseur = 0;
  if ( ttsCurseur < TTSBUFFERSIZE && ttsChar != '\n') {
    ttsBuffer[ttsCurseur] = ttsChar;
    ttsCurseur ++;
  }
  if ( ttsCurseur == TTSBUFFERSIZE || ttsChar == '\n') {
    displayTtsBuffer (ttsBuffer, ttsCurseur);
    ttsCurseur = 0;
  }
}

Merci de votre aide !

 

Pierre




#110976 Comment piloter ses appareils ESPEASY ?

Posté par Gamepigeek sur 03 septembre 2020 - 09:46 dans Vigibot

Hey  :thank_you:  salut a tous, aujourd'hui un mini tutoriel si vous avez des esp32 genre sonoff sous ESPEASY qui traînent et que vous voulez les commandés avec Vigibot.com x)

 

Etape 1 :

(vous pouvez prendre la dernière version en espeasymega ca ne change pas grand chose !)

 

Etape 2 : 

 

* Connectez vous en SSH au robot qui pilotera votre ESPEASY

 

* Faites : sudo nano /boot/robot.json enlevez la ligne CMDTTS et mettre :  "CMDTTS": "cat /tmp/tts.txt | /usr/bin/php /usr/local/sonoff.php"

Enregistrez et fermez avec CTRL + X

 

* sudo nano /usr/local/sonoff.php et mettez ceci dans le fichier

 

<?php
$ttschat = file_get_contents("/tmp/tts.txt");
 
if ($ttschat == 'motpourallumer'){
echo exec('sudo wget http://IPESPEASY/control?cmd=event,T1-O /dev/null');
}
//IPESPEASY étant l'ip de votre appareil et /control?cmd=event,T1 ou T0 les rules présent dans la vidéo.
elseif($ttschat == 'motpoureteindre'){
echo exec('sudo wget http://IPESPEASY/control?cmd=event,T0-O /dev/null');
}
 
?>
 
voila il y a d'autres manières de le faire meme en BASH mais j'ai chosis PHP x)
 
donc si vous tapez motpourallumer sur vigibot (après redémarrage de vigiclient.service) il va faire un WGET de http://IPESPEASY/control?cmd=event,T1-O /dev/null 
 
A+ pour de nouveaux tutoriels x)
 
 
 
 

 




#110682 BigWheels, le robot tout terrain piloté par Vigibot.com

Posté par Gamepigeek sur 29 juillet 2020 - 11:18 dans Robots roulants, chars à chenilles et autres machines sur roues

Hello les makers x)

 

 

Un petit message pour vous dire que le sujet est toujours d'actualité ! J'attend le pack de batterie 18650 je vais faire un 4S3P  :Koshechka_08:

 

Dessus normalement il y aura une synthèse vocal ainsi qu'un GPS (tout visible sur https://www.vigibot.com!)

 

Voila  :thank_you:

 

 

Image(s) jointe(s)

  • 20200716_225131.jpg
  • 20200713_135827.jpg



#110572 Photos

Posté par Gamepigeek sur 20 juillet 2020 - 11:33 dans Vigibot

Lardon :  

Image(s) jointe(s)

  • WhatsApp Image 2020-07-20 at 12.32.04.jpeg
  • WhatsApp Image 2020-07-20 at 12.32.04 (2).jpeg
  • WhatsApp Image 2020-07-20 at 12.32.04 (1).jpeg



#110571 Photos

Posté par Gamepigeek sur 20 juillet 2020 - 11:28 dans Vigibot

Bigwheels :

Image(s) jointe(s)

  • WhatsApp Image 2020-07-20 at 11.58.16 (1).jpeg
  • WhatsApp Image 2020-07-20 at 11.58.16 (2).jpeg
  • WhatsApp Image 2020-07-20 at 11.58.16 (3).jpeg
  • WhatsApp Image 2020-07-20 at 11.58.16 (4).jpeg
  • WhatsApp Image 2020-07-20 at 11.58.16.jpeg



#110185 Documentation de l'UPS

Posté par Gamepigeek sur 12 juin 2020 - 12:50 dans Documentation Vigibot Française

Bonjours à tous, 

 

pour l'interrupteur, j'ai essayé de trouver discret.. pas si facile.. 

 

Je vous propose donc ceci : Interrupteur pour UPS

 

c'est le meilleurs que j'ai trouvé pour le moment hors aliexpress..

 

la meilleurs solution pour moi est de le mettre entre la rapsberry et l'ups et le faire sortir a l'avant.

 

Si un de vous fais la modification avec cette inter, vous pouvez poster les photos.

 

Merci




#107596 BigWheels, le robot tout terrain piloté par Vigibot.com

Posté par Gamepigeek sur 02 février 2020 - 09:05 dans Robots roulants, chars à chenilles et autres machines sur roues

Salut les Makers  :ignat_02:

 

Bon, ça va faire 2 années que je n'ai pas posté de nouveau sujet j'espère que je ne vous ai pas manqué.  :zsmoke:

 

J'ai pour projet de faire un gros robot du genre le machin qui passe dans les champs et tout un truc bien off road.

 

j'ai eu l'idée de prendre une plaque d'alu en 350x300 pour faire un robot assez gros avec des grosses roues.

 

Je vais donc prendre ces moteurs  (oui c'est du lourd) et avec 4 pneus ci-dessous.

 

 

Les idées sont les bienvenues car une plaque d'aluminium agrémenter avec du PET-G c'est bien mais vous avez certainement de meilleurs idées que moi  :king: .

 

Le but étant d'avoir une bonne garde au sol évidemment.

 

Il sera contrôlable depuis Vigibot avec Une clé 4G enfin un truc bien amusant  :yahoo: .

 

C'est tout pour aujourd'hui, post a suivre !  :thank_you:

Image(s) jointe(s)

  • 2609136a-281e-44ab-a09d-98ebeda00c00.png
  • b8033c29-513b-431b-9497-b72ef8d7a47c.png



#101452 Nouvelle Bannière

Posté par Gamepigeek sur 12 janvier 2019 - 06:08 dans Les annonces Robot Maker

Superbe idée !




#101450 Nouvelle Bannière

Posté par Gamepigeek sur 12 janvier 2019 - 02:16 dans Les annonces Robot Maker

Je préfère la mienne PTDR  




#101441 Nouvelle Bannière

Posté par Gamepigeek sur 12 janvier 2019 - 09:15 dans Les annonces Robot Maker

Tient par contre c'est en JPG :(

Image(s) jointe(s)

  • robotmakeur.jpg



#101387 Nouvelle Bannière

Posté par Gamepigeek sur 10 janvier 2019 - 07:21 dans Les annonces Robot Maker

Voila une petite version toute fraîche pas terminée du tout 

 

c'est de la bouine...

Image(s) jointe(s)

  • Sans titre-1.png



#101245 Création de Loungebot ! Mon robot connecté à Vigibot

Posté par Gamepigeek sur 05 janvier 2019 - 10:13 dans News dans le domaine de la robotique

Merci :)

Il y a encore pas mal de choses qui vont changer ( par exemple un autre système d'alimentation)




#101239 Bonne Année !!

Posté par Gamepigeek sur 04 janvier 2019 - 11:15 dans Les annonces Robot Maker

Bonne année pleine de robotique !  :yahoo:




#101238 Création de Loungebot ! Mon robot connecté à Vigibot

Posté par Gamepigeek sur 04 janvier 2019 - 11:10 dans News dans le domaine de la robotique

Le premier post a été changé les 4 derniers post de servent donc a rien :)
 
Bref Voici une petite vidéo (attention j'ai vraiment une petite ADSL mais ça fonctionne !) et Photos avec mon robot connecté a Vigibot ! (Voir lien ci dessous et pièces jointes)
 
Tout le Matériel nécessaire est indiqué dans le premier post !
 
Bon visionnage  :zsmoke:   :drinks:(le robot n'est pas fini)

https://streamable.com/7nyg8

Image(s) jointe(s)

  • IMG_1160.JPG
  • IMG_1159.JPG
  • IMG_1161.JPG
  • IMG_1162.JPG
  • IMG_1163.JPG



#100813 Création de Loungebot ! Mon robot connecté à Vigibot

Posté par Gamepigeek sur 15 décembre 2018 - 09:58 dans News dans le domaine de la robotique

Donc maintenant a quoi me sert le connecteur XT60 du coup ?




#100799 Création de Loungebot ! Mon robot connecté à Vigibot

Posté par Gamepigeek sur 14 décembre 2018 - 06:38 dans News dans le domaine de la robotique

Hello

 

Je voudrais savoir si quelq'un pouvez me proposer un shéma de cablage complet avec :

 

Un BMS de Lipo 3s

 

Une Batterie Lipo 3s

 

et Un convertisseur 5v

 

Merci ;)

Image(s) jointe(s)

  • convertisseur-5v-7a.jpg
  • 3-S-4A-11-1-V-lipo-lithium-Polym-re-BMS-PCM-PCB-circuit-de-protection.jpg
  • batterie-lipo-3s-5000-mah-30c-xt60-eps-p-image-179728-grande.jpg



#100428 Création de Loungebot ! Mon robot connecté à Vigibot

Posté par Gamepigeek sur 28 novembre 2018 - 06:18 dans News dans le domaine de la robotique

Bonjour a tous  :zsmoke:

 

Cela fais plusieurs mois que je me tâte a faire un robot, et comme par miracle Pascal (de Serveurperso.com) et Mike118 créent l'entreprise Vigirobotics ! N'hésite pas à y aller faire un tour ;)

 

Donc je me lance :

 

L'idée est de faire un robot capable de se déplacer indépendamment avec une Raspberry.

 

Liste du Matériel pour mon robot :

 

Un châssis 

Une Raspberry 3B +

Un Kit minimal Vigibot Minus

Kit Batterie Lipo 3S Complet (Pour faire un robot économique et simple je vous le déconseille) prenez plutôt Une Lipo 1s

Connecteur XT60

Convertisseur 5V (Pour alimenter mon raspberry par les GPIO)

Un pack de Batteries 18650

Un UPS RPI Power Pack v1.1 (bientôt disponible dans la boutique) avec un cable micro-USB

Une roue Folle

Un microphone avec une carte son USB (Pour avoir le son sur Vigibot)

Un Pan Tilt  (Pour bouger la caméra)

Une Raspicam (Par pitier ne prenez pas les raspicam de base ! Prenez une grand angle minimum 165° ! Ça ne coûte pas plus cher et c'est vachement mieux  :yahoo:)

 

Ah et si vous n'en n'avez pas n'oubliez pas les fils ça peut vous sauvez la vie  :ignat_02:

 

et avec tout ça on peut déjà se faire un robot sympa !

 

A suivre prochainement  :ok:




#100419 Minus V1.0 Un vigibot simplifié pour Noël en précommande ?

Posté par Gamepigeek sur 28 novembre 2018 - 10:53 dans Archives vigibot

Concernant le BMS pour Lipo 3S

 

Quel est le schéma de câblage svp ?

 

 

 

Image(s) jointe(s)

  • schema_assemblage_bms.png



#100348 Création d'un robot pilotable par internet

Posté par Gamepigeek sur 25 novembre 2018 - 01:21 dans Robots roulants, chars à chenilles et autres machines sur roues

Ok donc changement de programme lol

 

j'ai abandonner l'idée de faire mon propre système manquant encore de connaissances. 

 

CEPENDANT ! J'ai décider de faire des robots connectés a https://www.vigibot.com.

 

 

Vous pouvez bien sur demander a piloter mes robots sur le chat x)

 

A+ 




#100346 Minus V1.0 Un vigibot simplifié pour Noël en précommande ?

Posté par Gamepigeek sur 25 novembre 2018 - 01:14 dans Archives vigibot

Mais mon c'est abusé je comprend pas même si j'utilise ma connexion a mort, j'ai toujours le même débit sur speedtest ! la navigation est fluide et tout c'est bizarre !




#100344 Minus V1.0 Un vigibot simplifié pour Noël en précommande ?

Posté par Gamepigeek sur 25 novembre 2018 - 11:22 dans Archives vigibot

Pascal :

 

Avec la qualité vidéo H264 que toi tu as actuellement avec la fibre a Paris  :dash2:

A ton avis , pourrais-je avoir la même qualité vidéo que toi avec ma petite ADSL 1Mpbs d'Upload stable et 8Mpbs de Download ?

 

:ignat_02: ou  :o ? 

 

 

:drag_03:




#100196 Minus V1.0 Un vigibot simplifié pour Noël en précommande ?

Posté par Gamepigeek sur 17 novembre 2018 - 11:44 dans Archives vigibot

Petite question sur vigibot :

 

quand le robot se met en veille les GPIO du raspberry par exemple se coupent ?

 

si oui ca serait le top