Předmět Autor Datum
AT+SAPBR=0,1
Wikan 30.08.2021 18:12
Wikan
Já se omlouvám jestli jsem tady s tím otravoval ale nevím si rady ,jaký je přenos binární nebo znako…
Víťa 30.08.2021 19:28
Víťa
Jako už obvykle jsi nenapsal žádné informace potřebné po radu. To ses to vážně ještě po těch X letec…
Wikan 30.08.2021 20:59
Wikan
Já se omlouvám tak tedy tady je příklad jak dostat pomocí FTP a domácí sítě obrázek na FTP server ht…
Víťa 31.08.2021 10:02
Víťa
Error tam máš, protože zapisuješ dřív, než ti přijde odpověď na předchozí commmand. Po: AT+FTPPUT=2…
Wikan 31.08.2021 10:33
Wikan
To vím taky ten paket dat se nepřenesl ,ale mě o to že na FTP serveru nemám data které jsou když pře…
Víťa 31.08.2021 10:47
Víťa
i na FTP se mě povedlo něco přenést na FTP serveru nemám data No tak se rozhodni, co vlastně máš n…
Wikan 31.08.2021 10:52
Wikan
Nemám stejné data které tam očekávám nový
Víťa 31.08.2021 10:57
Víťa
Nikde nenastavuješ typ přenosu. FTP je standardně textový/ASCII protokol, takže pokud chceš přenášet… nový
cif 31.08.2021 12:58
cif
Tak ještě jednou jsou tam chyby některé pakety nejsou přeneseny díky moc za pomoc nový
Víťa 31.08.2021 20:12
Víťa
Evidentně tam chybí začátek. A ten tam chybí, protože začínáš odesílat dříve, než ti přijde odpověď… nový
Wikan 31.08.2021 21:13
Wikan
Takže jak to upravit prodloužit čekání ? a taky se potřebují podívat tu část zdrojaku který dělá ten… nový
Víťa 01.09.2021 07:53
Víťa
while (!Serial.available()); https://www.arduino.cc/reference/en/language/functions/communication/s… nový
Wikan 01.09.2021 09:13
Wikan
Já to mám tak zatím tak že posílám AT příkazy s ESP32 CAM do modulu SiM800 a odpovědi s toho jdou na… poslední
Víťa 01.09.2021 10:46
Víťa

Já se omlouvám jestli jsem tady s tím otravoval ale nevím si rady ,jaký je přenos binární nebo znakový ?

void takePhoto() {

      
  camera_fb_t * fb = NULL;
  
  
  // Take Picture with Camera
  fb = esp_camera_fb_get();  
  if(!fb) {
    Serial.println("Camera capture failed");
    return;
  }

  /*
   * Upload to ftp server
   */
  

  ftp.ChangeWorkDir(ftp_path);
  ftp.InitFile("Type I");

  String nombreArchivo = "picture.jpg";
 // timeClient.getFormattedTime()+".jpg"; // AAAAMMDD_HHMMSS.jpg
  Serial.println("Nahravani  "+nombreArchivo);
  int str_len = nombreArchivo.length() + 1; 
 
  char char_array[str_len];
  nombreArchivo.toCharArray(char_array, str_len);
  
  ftp.NewFile(char_array);
  ftp.WriteData( fb->buf, fb->len );
  ftp.CloseFile();
  
  /*
   * Free
   */
  esp_camera_fb_return(fb); 

****************************************
a tady co dělám špatně ?

Serial.print("AT+FTPPUTNAME=\"picture.jpg\"\r");
Serial.flush();
delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
  Serial.print("AT+FTPPUT=1\r");
Serial.flush();
delay(3000);
 while(Serial.available()){
    mesage=mesage+Serial.read();
  }
  int c=(fb->len)/1024;
for(int l=0;l<=c;l++){

Serial.print("AT+FTPPUT=2,1024\r");

Serial.flush();
delay(3000); 
 while(Serial.available()){
    mesage=mesage+Serial.read();
  } 
  for(int i=0;i<=1024;i++)
     Serial.print(fb->buf[poz]);
     poz++;
  // put your setup code here, to run once:
delay(3000);
}
int z=(fb->len)%1024;
Serial.print("AT+FTPPUT=2,");
Serial.print(z);
Serial.print("\r");
Serial.flush();
 for(int i=0;i<=z;i++){
     Serial.print(fb->buf[poz]);
     poz++;
 }
Serial.print("AT+FTPPUT=2,0\r");
Serial.flush(); 
  esp_camera_fb_return(fb); 
   Serial.print("AT+SAPBR=0,1\r"); 
 Serial.flush();

díky

Já se omlouvám tak tedy tady je příklad jak dostat pomocí FTP a domácí sítě obrázek na FTP server https://www.youtube.com/watch?v=8e4fjskXfoI&ab_channel=GuillermoSampallo a mě napadlo nebýt vázaný na domácí WiFi a použít pro přenos fotky mobilní internet

#include "esp_camera.h"

// Pin definition for CAMERA_MODEL_AI_THINKER
#define PWDN_GPIO_NUM     32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27

#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22

camera_config_t config;

void setup() {
   
  Serial.begin(9600);
  initCamera();
  takePhoto();
  ATInternet();
}

void loop() {
  //takePhoto();
  //delay(10000);
//}
}

void initCamera() {
  config.ledc_channel = LEDC_CHANNEL_0;
  config.ledc_timer = LEDC_TIMER_0;
  config.pin_d0 = Y2_GPIO_NUM;
  config.pin_d1 = Y3_GPIO_NUM;
  config.pin_d2 = Y4_GPIO_NUM;
  config.pin_d3 = Y5_GPIO_NUM;
  config.pin_d4 = Y6_GPIO_NUM;
  config.pin_d5 = Y7_GPIO_NUM;
  config.pin_d6 = Y8_GPIO_NUM;
  config.pin_d7 = Y9_GPIO_NUM;
  config.pin_xclk = XCLK_GPIO_NUM;
  config.pin_pclk = PCLK_GPIO_NUM;
  config.pin_vsync = VSYNC_GPIO_NUM;
  config.pin_href = HREF_GPIO_NUM;
  config.pin_sscb_sda = SIOD_GPIO_NUM;
  config.pin_sscb_scl = SIOC_GPIO_NUM;
  config.pin_pwdn = PWDN_GPIO_NUM;
  config.pin_reset = RESET_GPIO_NUM;
  config.xclk_freq_hz = 20000000;
  config.pixel_format = PIXFORMAT_JPEG;
 
  if(psramFound()){
    config.frame_size = FRAMESIZE_XGA;//FRAMESIZE_UXGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA
    config.jpeg_quality = 10;
    config.fb_count = 2;
  } else {
    config.frame_size = FRAMESIZE_UXGA;
    config.jpeg_quality = 12;
    config.fb_count = 1;
  } 
  // Init Camera
  esp_err_t err = esp_camera_init(&config);
  if (err != ESP_OK) {
    Serial.printf("Camera init failed with error 0x%x", err);
    return;
  } 
}

void takePhoto() { 
 byte dat=0;
  camera_fb_t * fb = NULL;
  // Take Picture with Camera
  fb = esp_camera_fb_get(); 
  Serial.print("Velikost obrazu: ");
  Serial.print(fb->len);
  Serial.print(" B,");
  Serial.print((fb->len)/1024);
 
  Serial.println(" KB");
  Serial.print((fb->len) % 1024);
  //Serial.print("0x");
  /*for(int i=0;i<fb->len;i++)
     Serial.print(fb->buf[i], HEX);*/
Serial.println("");
//  dat = HEX(fb->buf);
  //Serial.write(fb->buf,fb->len);
  if(!fb) {
    Serial.println("Camera capture failed");

   while(fb->len){
//      dat=fb->buf,fb->len;
    //Serial.print(fb->buf,fb->len); 
    }
    return;
  }
  /*
   * Free buffer cam
   */
  esp_camera_fb_return(fb);
}
void ATInternet(){
  int poz=0;
  int dopocet=1024;
  camera_fb_t * fb = NULL;
  // Take Picture with Camera
  fb = esp_camera_fb_get(); 
  String mesage="";
  delay(10000);
  Serial.print("AT+SAPBR=3,1,\"Contype\",\"GPRS\"\r");
  Serial.flush();
  delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
  Serial.print("AT+SAPBR=3,1,\"APN\",\"internet\"\r");
  Serial.flush();
  delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
 Serial.print("AT+SAPBR=1,1\r");
 Serial.flush();
 delay(1000);
 while(Serial.available()){
    mesage=mesage+Serial.read();
  }
 Serial.print("AT+SAPBR=2,1\r");
 Serial.flush();
 delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
Serial.print("AT+FTPCID=1\r");
Serial.flush();
 delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
 
  Serial.print("AT+FTPSERV=\"***********\"\r");
  Serial.flush();
 delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }

Serial.print("AT+FTPUN=\"*********\"\r");
Serial.flush();
  delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
 
Serial.print("AT+FTPPW=\"********\"\r");
Serial.flush();
delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
 
Serial.print("AT+FTPPUTPATH=\"/**************/\"\r");
Serial.flush();
delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
 
Serial.print("AT+FTPPUTNAME=\"picture.jpg\"\r");
Serial.flush();
delay(1000);
  while(Serial.available()){
    mesage=mesage+Serial.read();
  }
  Serial.print("AT+FTPPUT=1\r");
Serial.flush();
delay(3000);
 while(Serial.available()){
    mesage=mesage+Serial.read();
  }
  int c=(fb->len)/1024;
for(int l=0;l<=c;l++){

Serial.print("AT+FTPPUT=2,1024\r");

Serial.flush();
delay(3000);
 while(Serial.available()){
    mesage=mesage+Serial.read();
  }
  for(int i=0;i<=1024;i++)
     Serial.print(fb->buf[poz]);
     poz++;
  // put your setup code here, to run once:
delay(3000);
}
int z=(fb->len)%1024;
Serial.print("AT+FTPPUT=2,");
Serial.print(z);
Serial.print("\r");
Serial.flush();
 for(int i=0;i<=z;i++){
     Serial.print(fb->buf[poz]);
     poz++;
 }
Serial.print("AT+FTPPUT=2,0\r");
Serial.flush();
}

tady je výpis ze seriového monitoru i na FTP se mě povedlo něco přenést ale pár desitek KB ale něco je tam špatně nevím co ? díky

Zpět do poradny Odpovědět na původní otázku Nahoru