hello to both of you !!..
I just bought your super beautiful book on cameras...
I tested the esp32 cam several times before i purchased your e-bookwith with success
and suddenly I receive distorted photos
with the esp32cam and esp-eye ...at the beginning everything was correct but then after a
while the esp32 cam no longer works well...after having tried with several other esp32cam
(which no longer works either...laugh((maybe scrap now ))) I decided to try with
the esp-eye ....
after having uploaded the code (after having changed the configuration of the pins)
here are the photos sent by e-mail were very good ... the next day without having
changed anything
i think ...
it used to sent photos by e-mail deformed again... I have read several of your
tutorials and following your information I have changed the resolution ()
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 30;
config.fb_count = 2;
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 32;
config.fb_count = 1;
after these tests I have never been able to receive good photos by e-mail.....
but I am able to upload the code to view the mjpeg videos...???
i even add aluminium cool block on the esp32cam and that helped for a longer periode
to receive good picture by email....can we use 24 hrs on a longer periode of time???
can i only upload the code 1 time to take pictures and send by e-mail???
so i bought a brand new one esp-32 and programmer ftdi and now i just can't upload the code
anymore..even the reset button doesn't work...
in some other youtube tutorials some said to remove a resistor...and other said to install
another rest button ....???? it is so small oufff...
it is possible that i bought defected esp-cam ??? maybe ....well i would like to receive
some advise from you ....
some people said the esptool.py is no longer supported and the new arduino IDE is so slow
i can't wait alomost 5 minutes every time i upload any code so i still using the 1.8.16 version
any help is welcome ...thanks for your time.....( Denis Deschenes )
Hi.
I’m sorry for those issues.
Which specific project are you following?
Does the issue happen with all ESP32 camera boards? It is always at the same time that you start receiving deformed pictures?
Which is the board that you have that you mention you cannot upload code to? Do you get any errors when trying to upload?
Regards,
Sara
Hi Sara !!
I tried so many things that nothing worked anymore...laugh...I had to reinstall
arduino IDE 1.8.9 anew because the higher version does not work well with esp32cam...
I managed to install esp-mail-client but the sketch in the book I just bought from you
has a ""littlefs.h"" difference and that's where the problem arose ... I tried to
install several littlefs versions including esp8266littlefs...but no ..esp32littelefs..
but no ..I even changed littleFS to lowercase for LITTLEFS because one of the libraries
is written in uppercase ...everything has started to compile but here is this error
“”struct camera_config_t’ has no member named ‘grab_mode'””
I tried the links in the book for “”preference”” but it doesn’t seem to work..here are the ones I managed to find as a replacement ==
“” https://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json,https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json “”
I changed the camera from esp32cam to esp-eye...here is my code==
here ‘s the code
/*********
Rui Santos
Complete instructions at https://RandomNerdTutorials.com/esp32-cam-projects-ebook/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/
#include “esp_camera.h”
#include “SPI.h”
#include “driver/rtc_io.h”
#include <ESP_Mail_Client.h>
#include <FS.h>
#include <LITTLEFS.h> // i had to modify this part here so everywhere i LITTLEFS instead of littleFS
#include <WiFi.h>
// REPLACE WITH YOUR NETWORK CREDENTIALS
const char* ssid = “************”;
const char* password = “***********”;
// To send Email using Gmail use port 465 (SSL) and SMTP Server smtp.gmail.com
// You need to create an email app password
#define emailSenderAccount “***************”
#define emailSenderPassword “************”
#define smtpServer “smtp.gmail.com”
#define smtpServerPort 465
#define emailSubject “ESP32-CAM coucou !!”
#define emailRecipient “****************”
//#define CAMERA_MODEL_AI_THINKER // i had to modify this part
#define CAMERA_MODEL_ESP_EYE
#if defined(CAMERA_MODEL_ESP_EYE)
//#if defined(CAMERA_MODEL_AI_THINKER)
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 4
#define SIOD_GPIO_NUM 18
#define SIOC_GPIO_NUM 23
#define Y9_GPIO_NUM 36
#define Y8_GPIO_NUM 37
#define Y7_GPIO_NUM 38
#define Y6_GPIO_NUM 39
#define Y5_GPIO_NUM 35
#define Y4_GPIO_NUM 14
#define Y3_GPIO_NUM 13
#define Y2_GPIO_NUM 34
#define VSYNC_GPIO_NUM 5
#define HREF_GPIO_NUM 27
#define PCLK_GPIO_NUM 25
#else
#error “Camera model not selected”
#endif
/* The SMTP Session object used for Email sending */
SMTPSession smtp;
/* Callback function to get the Email sending status */
void smtpCallback(SMTP_Status status);
// Photo File Name to save in LittleFS
#define FILE_PHOTO “photo.jpg”
#define FILE_PHOTO_PATH “/photo.jpg”
void setup() {
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
#endif
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
Serial.begin(115200);
Serial.println();
// Connect to Wi-Fi
WiFi.begin(ssid, password);
Serial.print(“Connecting to WiFi…”);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println();
if (!LITTLEFS.begin(true)) {
Serial.println(“An Error has occurred while mounting LittleFS”);
ESP.restart();
}
else {
delay(500);
Serial.println(“LittleFS mounted successfully”);
}
// Print ESP32 Local IP Address
Serial.print(“IP Address: http://”);
Serial.println(WiFi.localIP());
camera_config_t config;
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;
config.grab_mode = CAMERA_GRAB_LATEST;
if(psramFound()){
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 30;
config.fb_count = 1;
} else {
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 32;
config.fb_count = 1;
}
// Initialize camera
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf(“Camera init failed with error 0x%x”, err);
return;
}
capturePhotoSaveLittleFS();
sendPhoto();
}
void loop() {
}
// Check if photo capture was successful
bool checkPhoto( fs::FS &fs ) {
File f_pic = fs.open( FILE_PHOTO_PATH );
unsigned int pic_sz = f_pic.size();
return ( pic_sz > 100 );
}
// Capture Photo and Save it to LittleFS
void capturePhotoSaveLittleFS( void ) {
camera_fb_t * fb = NULL; // pointer
bool ok = 0; // Boolean indicating if the picture has been taken correctly
do {
// Take a photo with the camera
Serial.println(“Taking a photo…”);
// Clean previous buffer
camera_fb_t * fb = NULL;
fb = esp_camera_fb_get();
esp_camera_fb_return(fb); // dispose the buffered image
fb = NULL; // reset to capture errors
// Get fresh image
fb = esp_camera_fb_get();
if(!fb) {
Serial.println(“Camera capture failed”);
delay(1000);
ESP.restart();
}
// Photo file name
Serial.printf(“Picture file name: %s\n”, FILE_PHOTO_PATH);
File file = LITTLEFS.open(FILE_PHOTO_PATH, FILE_WRITE);
// Insert the data in the photo file
if (!file) {
Serial.println(“Failed to open file in writing mode”);
}
else {
file.write(fb->buf, fb->len); // payload (image), payload length
Serial.print(“The picture has been saved in “);
Serial.print(FILE_PHOTO_PATH);
Serial.print(” – Size: “);
Serial.print(fb->len);
Serial.println(” bytes”);
}
// Close the file
file.close();
esp_camera_fb_return(fb);
// check if file has been correctly saved in LittleFS
ok = checkPhoto(LITTLEFS);
} while ( !ok );
}
void sendPhoto( void ) {
/** Enable the debug via Serial port
* none debug or 0
* basic debug or 1
*/
smtp.debug(1);
/* Set the callback function to get the sending results */
smtp.callback(smtpCallback);
/* Declare the session config data */
ESP_Mail_Session session;
/* Set the session config */
session.server.host_name = smtpServer;
session.server.port = smtpServerPort;
session.login.email = emailSenderAccount;
session.login.password = emailSenderPassword;
session.login.user_domain = “”;
/* Declare the message class */
SMTP_Message message;
/* Enable the chunked data transfer with pipelining for large message if server supported */
message.enable.chunking = true;
/* Set the message headers */
message.sender.name = “ESP32-CAM”;
message.sender.email = emailSenderAccount;
message.subject = emailSubject;
message.addRecipient(“Sara”, emailRecipient);
String htmlMsg = “<h2>Photo captured with ESP32-CAM and attached in this email.</h2>”;
message.html.content = htmlMsg.c_str();
message.html.charSet = “utf-8”;
message.html.transfer_encoding = Content_Transfer_Encoding::enc_qp;
message.priority = esp_mail_smtp_priority::esp_mail_smtp_priority_normal;
message.response.notify = esp_mail_smtp_notify_success | esp_mail_smtp_notify_failure | esp_mail_smtp_notify_delay;
/* The attachment data item */
SMTP_Attachment att;
/** Set the attachment info e.g.
* file name, MIME type, file path, file storage type,
* transfer encoding and content encoding
*/
att.descr.filename = FILE_PHOTO;
att.descr.mime = “image/png”;
att.file.path = FILE_PHOTO_PATH;
att.file.storage_type = esp_mail_file_storage_type_flash;
att.descr.transfer_encoding = Content_Transfer_Encoding::enc_base64;
/* Add attachment to the message */
message.addAttachment(att);
/* Connect to server with the session config */
if (!smtp.connect(&session))
return;
/* Start sending the Email and close the session */
if (!MailClient.sendMail(&smtp, &message, true))
Serial.println(“Error sending Email, ” + smtp.errorReason());
}
// Callback function to get the Email sending status
void smtpCallback(SMTP_Status status){
/* Print the current status */
Serial.println(status.info());
/* Print the sending result */
if (status.success())
{
Serial.println(“—————-“);
Serial.printf(“Message sent success: %d\n”, status.completedCount());
Serial.printf(“Message sent failled: %d\n”, status.failedCount());
Serial.println(“—————-\n”);
struct tm dt;
for (size_t i = 0; i < smtp.sendingResult.size(); i++)
{
/* Get the result item */
SMTP_Result result = smtp.sendingResult.getItem(i);
time_t ts = (time_t)result.timestamp;
Serial.printf(“Message No: %d\n”, i + 1);
Serial.printf(“Status: %s\n”, result.completed ? “success” : “failed”);
Serial.printf(“Date/Time: %d/%d/%d %d:%d:%d\n”, dt.tm_year + 1900, dt.tm_mon + 1, dt.tm_mday, dt.tm_hour, dt.tm_min, dt.tm_sec);
Serial.printf(“Recipient: %s\n”, result.recipients);
Serial.printf(“Subject: %s\n”, result.subject);
}
Serial.println(“—————-\n”);
// You need to clear sending result as the memory usage will grow up.
smtp.sendingResult.clear();
}
}
here’s the error message ==
C:\Users\propu\Documents\Arduino\esp_eye_send_pic_email_rui_new\esp_eye_send_pic_email_rui_new.ino: In function ‘void setup()’:
esp_eye_send_pic_email_rui_new:119:10: error: ‘struct camera_config_t’ has no member named ‘grab_mode’
config.grab_mode = CAMERA_GRAB_LATEST;
^
esp_eye_send_pic_email_rui_new:119:22: error: ‘CAMERA_GRAB_LATEST’ was not declared in this scope
config.grab_mode = CAMERA_GRAB_LATEST;
^
Plusieurs bibliothèque trouvées pour “SD.h”
Utilisé : C:\Users\propu\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.6\libraries\SD
Non utilisé : C:\Users\propu\Desktop\arduino-1.8.19\libraries\SD
exit status 1
‘struct camera_config_t’ has no member named ‘grab_mode’
i already succeded for sending picture by email but now i’m facing new difficulties ..i wanted to use the esp-eye because they look more tuff…i scraped many other esp32cam …i even use aluminium block for the heat ..i thought that what the problem cause after 2 or 3 days( 24hrs ) they just don’t woks anymore and i wasn’t able to upload any code anymore to the esp32 ….reset button doesn’t want to work anymore… so i thought that esp-eye would solve this problem….here’s the code i was using and suddenly received deformed picture
here’s the code i was using before ==
/*********
Rui Santos
Complete instructions at https://RandomNerdTutorials.com/esp32-cam-projects-ebook/
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*********/
#include “esp_camera.h”
#include “SPI.h”
#include “driver/rtc_io.h”
#include “ESP32_MailClient.h”
#include <FS.h>
#include <SPIFFS.h>
#include <WiFi.h>
// REPLACE WITH YOUR NETWORK CREDENTIALS
const char* ssid = “*********”;
const char* password = “************8”;
// To send Emails using Gmail on port 465 (SSL), you need to create an app password: https://support.google.com/accounts/answer/185833
#define emailSenderAccount “*********************”
#define emailSenderPassword “****************”
#define smtpServer “smtp.gmail.com”
#define smtpServerPort 465
#define emailSubject “ESP32_cam_A”
#define emailRecipient “*******************”
#define CAMERA_MODEL_ESP_EYE
//#define CAMERA_MODEL_AI_THINKER
#if defined(CAMERA_MODEL_ESP_EYE)
//#if defined(CAMERA_MODEL_AI_THINKER)
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 4
#define SIOD_GPIO_NUM 18
#define SIOC_GPIO_NUM 23
#define Y9_GPIO_NUM 36
#define Y8_GPIO_NUM 37
#define Y7_GPIO_NUM 38
#define Y6_GPIO_NUM 39
#define Y5_GPIO_NUM 35
#define Y4_GPIO_NUM 14
#define Y3_GPIO_NUM 13
#define Y2_GPIO_NUM 34
#define VSYNC_GPIO_NUM 5
#define HREF_GPIO_NUM 27
#define PCLK_GPIO_NUM 25
#else
#error “Camera model not selected”
#endif
int photoo = 0;
int detec = 13;
int detecc = 0;
int d = 0;
int dd = 0;
int swf = 12;
int swff = 0;
#define LED 4 // flash
// The Email Sending data object contains config and data to send
SMTPData smtpData;
// Photo File Name to save in SPIFFS
#define FILE_PHOTO “/photo.jpg”
void setup() {
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
#endif
WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
pinMode(LED, OUTPUT);
Serial.begin(115200);
Serial.println();
digitalWrite(LED, LOW);
digitalWrite(swf, INPUT);
// Connect to Wi-Fi
WiFi.begin(ssid, password);
Serial.print(“Connecting to WiFi…”);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(“.”);
}
Serial.println();
if (!SPIFFS.begin(true)) {
Serial.println(“An Error has occurred while mounting SPIFFS”);
ESP.restart();
}
else {
delay(500);
Serial.println(“SPIFFS mounted successfully”);
}
// Print ESP32 Local IP Address
Serial.print(“IP Address: http://”);
Serial.println(WiFi.localIP());
camera_config_t config;
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;
// select the lower framsize if the camera doesn’t support psram
if(psramFound()){
config.frame_size = FRAMESIZE_UXGA;
config.jpeg_quality = 30; //40// 10-63 lower number = higher quality
config.fb_count = 2;
} else {
config.frame_size = FRAMESIZE_SVGA;
config.jpeg_quality = 32; // 42
config.fb_count = 1;
}
// Initialize camera
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf(“Camera init failed with error 0x%x”, err);
return;
}
capturePhotoSaveSpiffs();
sendPhoto();
}
void loop() {
detecc = digitalRead(detec);
if (detecc == HIGH)
{
d++;
if (d == 1)
{
capturePhotoSaveSpiffs();
sendPhoto();
//delay(5000);
photoo++;
Serial.print(“photo == “);
Serial.println(photoo);
//delay(1000);
}// if d
Serial.print(“d == “);
Serial.println(d);
if (d > 7)
{
d = 0;
}
}// if detecc
if (detecc == LOW)
{
Serial.print(“photo == off “);
d = 0;
}
}
// Check if photo capture was successful
bool checkPhoto( fs::FS &fs ) {
File f_pic = fs.open( FILE_PHOTO );
unsigned int pic_sz = f_pic.size();
return ( pic_sz > 100 );
}
// Capture Photo and Save it to SPIFFS
void capturePhotoSaveSpiffs( void ) {
camera_fb_t * fb = NULL; // pointer
bool ok = 0; // Boolean indicating if the picture has been taken correctly
do {
// Take a photo with the camera
Serial.println(“Taking a photo…”);
swff = digitalRead(swf);
if (swff == HIGH) //////////////swicth flash
{
digitalWrite(LED, HIGH); // flash = on
}
if (swff == LOW)
{
// flash = off
}
//delay(200);//////////////////////////////SOIT ICI
fb = esp_camera_fb_get();
//delay(200);//////////////////////////////SOIT ICI***********
digitalWrite(LED, LOW); // flash = off
if (!fb) {
Serial.println(“Camera capture failed”);
return;
}
// Photo file name
Serial.printf(“Picture file name: %s\n”, FILE_PHOTO);
File file = SPIFFS.open(FILE_PHOTO, FILE_WRITE);
// Insert the data in the photo file
if (!file) {
Serial.println(“Failed to open file in writing mode”);
}
else {
file.write(fb->buf, fb->len); // payload (image), payload length
Serial.print(“The picture has been saved in “);
Serial.print(FILE_PHOTO);
Serial.print(” – Size: “);
Serial.print(file.size());
Serial.println(” bytes”);
}
// Close the file
file.close();
esp_camera_fb_return(fb);
// check if file has been correctly saved in SPIFFS
ok = checkPhoto(SPIFFS);
} while ( !ok );
delay(100);
digitalWrite(LED, LOW); // flash = off
}
void sendPhoto( void ) {
// Preparing email
Serial.println(“Sending email…”);
// Set the SMTP Server Email host, port, account and password
smtpData.setLogin(smtpServer, smtpServerPort, emailSenderAccount, emailSenderPassword);
// Set the sender name and Email
smtpData.setSender(“ESP32-CAM”, emailSenderAccount);
// Set Email priority or importance High, Normal, Low or 1 to 5 (1 is highest)
smtpData.setPriority(“High”);
// Set the subject
smtpData.setSubject(emailSubject);
// Set the email message in HTML format
smtpData.setMessage(“<h2>Photo captured with ESP32-CAM and attached in this email.</h2>”, true);
// Set the email message in text format
//smtpData.setMessage(“Photo captured with ESP32-CAM and attached in this email.”, false);
// Add recipients, can add more than one recipient
smtpData.addRecipient(emailRecipient);
//smtpData.addRecipient(emailRecipient2);
// Add attach files from SPIFFS
smtpData.addAttachFile(FILE_PHOTO, “image/jpg”);
// Set the storage type to attach files in your email (SPIFFS)
smtpData.setFileStorageType(MailClientStorageType::SPIFFS);
smtpData.setSendCallback(sendCallback);
// Start sending Email, can be set callback function to track the status
if (!MailClient.sendMail(smtpData))
Serial.println(“Error sending Email, ” + MailClient.smtpErrorReason());
// Clear all data from Email object to free memory
smtpData.empty();
}
// Callback function to get the Email sending status
void sendCallback(SendStatus msg) {
//Print the current status
Serial.println(msg.info());
}
Hi.
First of all, you need to use the following link in the Preferences:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
Then, you need to go to Boards > Boards Manager, search for ESP32, and update to the latest version.
After that, the problem with LittlFS and the GRAB_LATEST not defined will be solved.
Let me know if this helps.
Regards,
Sara
Thank you so much Sara !!
i finaly found the bugs that i was searching for since so long…
1= i was trying on 2 computer(1 is 32bits and 2 is 64bits ..then i found out that esp32cam libraries doesn’t support anymore the 32bits window computer ..dam…
2= i had to get as you said the latest version on arduino IDE with the right preference link that you sent to me
3= i change to littleFS instead of spiff…
4= i had to buy another programmer (the one with the boot button on the side ) i was using only the ftdi programmer and it was working only half time …i had so many problems with that ..
but now with the latest version and the right preference with the right programmer it is ok …
it’s the first time i had so many troubles that i coudn’t find any solutions but buying your book and having the possibility to talk with you made a great score!!
now i want to try to find a way to send ( sms ) with the esp32 or esp8266… if you have any book to recommand me for that let me know !!
thank you so much again for your time Sara !!
Hi.
Thank you for sharing the solution. I’m glad everything is working as expected now.
There are different methods to send SMS with the ESP32 and ESP8266. At the time, we have this tutorial for the ESP32:
I hope this helps.
Regards,
Sara
Hi sara !!
maybe you can help me one this one ….
i tried your tutorial on how to send email with esp8266 and everything works fine ,,
,but i’am tring to use a button to send the email everytime i need to press the button….
but didn’t worked so far and not so good …hihihi
i’ve tried to modify the basic code….i think i have to put the code into the void loop so i can send
anytime i want to
instead of in the void set up loop (only 1 time )
is their any examples available from your books or videos ???
i want to do this project and any help is welcome i am not a professionnal but hobby
but a big fan of your tutorial with Rui ….hihihi
thanks again !!!
Hi.
Yes.
You have to read the button in the loop or add an interrupt to the button to detect when it was pressed.
How are you checking the button?
What changes did you make to the code and what errors do you get?
Regards,
Sara
Oh (interrups),,,I’ve never used it in one of my sketches before…I have no idea how to use this (interrups)…..I tried to just copy the entire sketch into the void setup apart from some line like (serial.begin…) and a few other lines of code but nothing worked…..I had to use a relay to activate the entire board… laugh……I would like to learn how to use (interrups) do you have some examples???
I just bought your book (micropython with esp32) with the other books on promotion….wow there is a lot to learn in your work it’s great!!….I’m at the stage to install the (cp2101 driver)….I had deaj visual studio to install on my computer so I tried to make it compatible with esp32….but I only have the esp8266..hummm.. .I installed the (mu editor) but I haven’t finished the first installation pages of the book….I’m going to continue this (weekend)…it’s been a project of mine for a long time. start to deepen the language (python) with all its possibilities…but I have to learn a lot of new things…. Thank you for making this learning possible for me with your book!!.. 🙂
Hi.
To learn how to use interrupts, we have the following tutorial (it uses a PIR motion sensor, but if you understand the logic, you can use it for a button):
Alternatively, you can use a debounce button sketch:
I’m glad you’re enjoying our eBooks. Let me know if you need help with anything else.
Regards,
Sara
Hi Sara !!
thank you for those links for ( interrupts ) codes …..now Mu_editor has been installed on my computer i am at the 39 page of your esp32 book… but i can’t see the boot.py and main.py when i click the file button ??? that’ s about where i am stuck …….should i start a new title for this question ??? because it is not link to the esp32cam ????/ ….let me know …………………..here’s the message i got when i click on ( file )
//
there was a problem getting the list of files on the device.Please check Mu_logs for technical information..etc…
//
i tried all the solutions that’s in the book but didn’t worked…
–silicone lab CP 210x …. is on the right com and i can upload code from arduino IDE to the esp8266 board
i did the ESP firmware flasher correctly
THIS IS THE FOLDER LOCATION FOR THE .BIN FILE
C:\Users\use\AppData\Local\Programs\Mu Editor
HERE’S MY SAVE FOLDER LOCATION OF THE MAIN.py FILE
C:\Users\use\mu_code\blink2
EVERYTHING ‘S FINE FOR ERASE AND WRITE FIRMWARE .. with Mu_editor
but can’t see the boot.py and main.py …?????
thanks again for your Help !!
ps: i tried to install on visual studio the esp8266 as in your pymkr tutorial ,, i have the com port number but can’t upload the code ??
Hi.
Please open a new thread for this question.
Can you add a screenshot of your issue too? To share a picture, upload it to google drive or dropbox and then share a link to the file.
Alternatively, you may want to use Thonny IDE instead. Lately, that’s the IDE for micropython that’s been working better for me,
Regards,
Sara