Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Serial
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Mon Jun 01, 2020 5:19 pm

I tried it and still no luck. I've attached the images of the IDE and the Serial Monitor.

One thing I did notice is that when I attempted to close the serial monitor, it would fail to close, and then the IDE would be frozen until I disconnect the M0 from my laptop.
Attachments
Capture6.PNG
Capture6.PNG (7.49 KiB) Viewed 251 times
Capture5.PNG
Capture5.PNG (29.63 KiB) Viewed 251 times

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by adafruit_support_carter on Mon Jun 01, 2020 6:34 pm

OK, let's back up and sanity check the Serial Monitor behavior. Try running the two sketches below and report back what you get in the Serial Monitor.

This one just prints a single line and then parks:
Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Serial Monitor Test.");
}

void loop() {
  // do nothing
}


This ones prints an increasing number forever:
Code: Select all | TOGGLE FULL SIZE
void setup() {
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Serial Monitor Test.");
}

int count = 0;

void loop() {
  Serial.print("count = "); Serial.println(count++);
  delay(500);
}

adafruit_support_carter
 
Posts: 15963
Joined: Tue Nov 29, 2016 2:45 pm

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Mon Jun 01, 2020 8:26 pm

That was a really great call, I attempted the sanity check and it still didn't. I realized that my "USB Stack:" in the tools menu was set to TinyUSB and not Arduino. I remember in the past that Arduino didn't work, it just froze which I believe was why I switched it to TinyUSB, especially since it worked for other programs, however I switched it back to Arduino just now and uploaded the code which did end up working it just took a little longer to upload the code to the M0.

I've attached images of the original EInkFeatherWing.ino file to this post so you can see. The image still does not get uploaded but it gets to the point highlighted in the image "Loading blinka.bmp to canvas..." before it stops the program from continuing.
Attachments
Capture1.PNG
Capture1.PNG (39.05 KiB) Viewed 249 times
Capture2.PNG
Capture2.PNG (12.85 KiB) Viewed 249 times

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by MakerMelissa on Tue Jun 02, 2020 5:19 pm

Hi jbharuchi,

I got the same results as you using a Feather M4, so it's quite likely that something changed in one of the libraries and made this sketch stop working.

I've created an issue on GitHub at https://github.com/adafruit/Adafruit_Im ... /issues/28.

Thanks,
Melissa

MakerMelissa
 
Posts: 146
Joined: Wed Jun 05, 2013 2:10 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Tue Jun 02, 2020 5:38 pm

Hi Melissa,

Thank you so much for letting me know! I look forward to the revision in the GitHub repo. Hopefully we can get this fully resolved soon.

Jayson

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by adafruit_support_carter on Tue Jun 02, 2020 6:52 pm

Thanks for continuing to work out the Serial Monitor issue so we could see the serial prints. That helped narrow in on the location of the issue.

adafruit_support_carter
 
Posts: 15963
Joined: Tue Nov 29, 2016 2:45 pm

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by MakerMelissa on Wed Jun 03, 2020 6:04 pm

Hi jbharuchi

I was able to get it working on mine. I noticed in the code you posted you had the USE_SD_CARD line commented out, which makes it use the flash file system. I just wanted to verify that you have the files in flash and that it is named blinka.bmp.

Melissa

MakerMelissa
 
Posts: 146
Joined: Wed Jun 05, 2013 2:10 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Mon Jun 29, 2020 11:22 am

Hi Melissa,

Apologies on not having seen your reply. I'm not sure exactly what you're talking about as I haven't commented out the USE_SD_CARD line and I'm still having the same issue. It stops at "Loading blinka.bmp to canvas..."

I'm trying to use access the image on my SD card and it still does not work.

As for having the image in the flash file system, no I don't have the image in flash. I'm strictly trying to access the image through the SD card rather than flash as I'm not quite sure how to put the image into the onboard flash memory.

Jayson

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by adafruit_support_carter on Mon Jul 06, 2020 10:53 am

@jbharuchi Are you still using the Feather M0 WiFi?

@MakerMelissa Could this be an issue with not handling the CS for the ATWINC1500 (wifi module)?

adafruit_support_carter
 
Posts: 15963
Joined: Tue Nov 29, 2016 2:45 pm

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Mon Jul 06, 2020 11:02 am

Yes I am still using the M0 Wi-Fi. I tried a Feather 32u4 Adalogger but that gave me an error of not having sufficient memory and I was told it won't work here in this forum.

Those are the only 2 MPUs I have other than an Arduino Uno.

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by MakerMelissa on Mon Jul 06, 2020 11:26 am

> @MakerMelissa Could this be an issue with not handling the CS for the ATWINC1500 (wifi module)?

I wondered that too, but it looks like according to https://cdn-learn.adafruit.com/assets/a ... 1504885927, the WiFi CS pin isn't sharing a standard feather pin.

The M0 library should have enough memory. Is it possible to try it on a different computer?

MakerMelissa
 
Posts: 146
Joined: Wed Jun 05, 2013 2:10 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by adafruit_support_carter on Mon Jul 06, 2020 11:46 am

Right, but even if the wifi's CS is not broken out, it still needs to be (possibly) managed to make sure the ATWINC is not messing up the SPI bus for everything else.

@jbharuchi Try adding something like this at the top of your setup():
Code: Select all | TOGGLE FULL SIZE
pinMode(8, OUTPUT);
digitalWrite(8, HIGH);

adafruit_support_carter
 
Posts: 15963
Joined: Tue Nov 29, 2016 2:45 pm

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by MakerMelissa on Mon Jul 06, 2020 11:57 am

Oh, I see what you're saying. That's a good thing to keep in mind.

MakerMelissa
 
Posts: 146
Joined: Wed Jun 05, 2013 2:10 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Mon Jul 06, 2020 12:40 pm

I'm going to give as much information as I can so we're all up to speed with things. I've tried this on both Mac and Windows and have had no luck.

The following are the pins I've been using.
Pins:
Code: Select all | TOGGLE FULL SIZE
#else // Anything else!
  #define SD_CS       5
  #define SRAM_CS     6
  #define EPD_CS      9
  #define EPD_DC      10 
#endif

I tried changing SD_CS to 8 and added the code you mentioned to the top of the setup():
Code: Select all | TOGGLE FULL SIZE
pinMode(8, OUTPUT);
digitalWrite(8, HIGH);

and got the following error: "Initializing filesystem...SD begin() failed"

I did also alter the pinout from 8 to 5 to see if this would make a difference and no difference was made.

My code right now is as follows. This code was tested without any luck:
Code: Select all | TOGGLE FULL SIZE
// Adafruit_ImageReader test for Adafruit E-Ink Breakouts.
// Demonstrates loading images from SD card or flash memory to the screen,
// to RAM, and how to query image file dimensions.
// Requires BMP file in root directory of QSPI Flash:
// blinka.bmp.

#include <Adafruit_GFX.h>         // Core graphics library
#include "Adafruit_EPD.h"         // Hardware-specific library for EPD
#include <SdFat.h>                // SD card & FAT filesystem library
#include <Adafruit_SPIFlash.h>    // SPI / QSPI flash library
#include <Adafruit_ImageReader_EPD.h> // Image-reading functions

// Comment out the next line to load from SPI/QSPI flash instead of SD card:
#define USE_SD_CARD

#if defined(ESP8266)
   #define SD_CS    2
   #define SRAM_CS 16
   #define EPD_CS   0
   #define EPD_DC   15
#elif defined(ESP32)
  #define SD_CS       14
  #define SRAM_CS     32
  #define EPD_CS      15
  #define EPD_DC      33 
#elif defined(TEENSYDUINO)
  #define SD_CS       8
  #define SRAM_CS     3
  #define EPD_CS      4
  #define EPD_DC      10 
#elif defined(ARDUINO_STM32_FEATHER)
   #define TFT_DC   PB4
   #define TFT_CS   PA15
   #define STMPE_CS PC7
   #define SD_CS    PC5
#elif defined(ARDUINO_NRF52832_FEATHER) // BSP 0.6.5 and higher!
  #define SD_CS       27
  #define SRAM_CS     30
  #define EPD_CS      31
  #define EPD_DC      11
#else // Anything else!
  #define SD_CS       5
  #define SRAM_CS     6
  #define EPD_CS      9
  #define EPD_DC      10 
#endif

#define EPD_RESET   -1 // can set to -1 and share with microcontroller Reset!
#define EPD_BUSY    -1 // can set to -1 to not use a pin (will wait a fixed delay)

/* Uncomment the following line if you are using 2.13" tricolor EPD */
//Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
//#define FLEXIBLE_213

/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);

/* Uncomment the following line if you are using 2.9" EPD with E-Ink Feather Friend */
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
//#define FLEXIBLE_290

#if defined(USE_SD_CARD)
  SdFat                SD;         // SD card filesystem
  Adafruit_ImageReader reader(SD); // Image-reader object, pass in SD filesys
#else

// SPI or QSPI flash filesystem (i.e. CIRCUITPY drive)
  #if defined(__SAMD51__) || defined(NRF52840_XXAA)
    Adafruit_FlashTransport_QSPI flashTransport(PIN_QSPI_SCK, PIN_QSPI_CS,
      PIN_QSPI_IO0, PIN_QSPI_IO1, PIN_QSPI_IO2, PIN_QSPI_IO3);
  #else
    #if (SPI_INTERFACES_COUNT == 1 || defined(ADAFRUIT_CIRCUITPLAYGROUND_M0))
      Adafruit_FlashTransport_SPI flashTransport(SS, &SPI);
    #else
      Adafruit_FlashTransport_SPI flashTransport(SS1, &SPI1);
    #endif
  #endif
  Adafruit_SPIFlash    flash(&flashTransport);
  FatFileSystem        filesys;
  Adafruit_ImageReader reader(filesys); // Image-reader, pass in flash filesys
#endif

Adafruit_Image_EPD   img;        // An image loaded into RAM
int32_t              width  = 0, // BMP image dimensions
                     height = 0;

void setup(void) {

  /*PinMode Set Up*/
  pinMode(8, OUTPUT);
  digitalWrite(8, HIGH);

  ImageReturnCode stat; // Status from image-reading functions

  Serial.begin(9600);
  while(!Serial);           // Wait for Serial Monitor before continuing

  display.begin(); 

 
#if defined(FLEXIBLE_213) || defined(FLEXIBLE_290)
  // The flexible displays have different buffers and invert settings!
  display.setBlackBuffer(1, false);
  display.setColorBuffer(1, false);
#endif

  // The Adafruit_ImageReader constructor call (above, before setup())
  // accepts an uninitialized SdFat or FatFileSystem object. This MUST
  // BE INITIALIZED before using any of the image reader functions!
  Serial.print(F("Initializing filesystem..."));
  // SPI or QSPI flash requires two steps, one to access the bare flash
  // memory itself, then the second to access the filesystem within...
#if defined(USE_SD_CARD)
  // SD card is pretty straightforward, a single call...
  if(!SD.begin(SD_CS, SD_SCK_MHZ(10))) { // Breakouts require 10 MHz limit due to longer wires
    Serial.println(F("SD begin() failed"));
    for(;;); // Fatal error, do not continue
  }
#else
  // SPI or QSPI flash requires two steps, one to access the bare flash
  // memory itself, then the second to access the filesystem within...
  if(!flash.begin()) {
    Serial.println(F("flash begin() failed"));
    for(;;);
  }
  if(!filesys.begin(&flash)) {
    Serial.println(F("filesys begin() failed"));
    for(;;);
  }
#endif
  Serial.println(F("OK!"));

  // Load full-screen BMP file 'tricolor-blinka.bmp' at position (0,0) (top left).
  // Notice the 'reader' object performs this, with 'epd' as an argument.
  Serial.print(F("Loading blinka.bmp to canvas..."));
  stat = reader.loadBMP((char *)"/blinka.bmp", img);
  reader.printStatus(stat); // How'd we do?

  Serial.print(F("Drawing canvas to EPD..."));
  display.clearBuffer();
  img.draw(display, 0, 0);
  display.display();

  delay(15 * 1000); // Pause 15 seconds before moving on to loop()
}

void loop() {
  for(int r=0; r<4; r++) { // For each of 4 rotations...
    display.setRotation(r);    // Set rotation
    display.fillScreen(0);     // and clear screen
    display.clearBuffer();
    img.draw(display, 0, 0);
    display.display();
    delay(15 * 1000); // Pause 15 sec.
  }
}

I'm attaching screenshots (This time on Mac) so you can see what's happening. The following screenshots are:
1. The board configuration
2. The console output
3. The Serial Monitor result where is gets stuck

Let me know if any other information/ pictures are required.

Thanks!
Jayson
Attachments
Screen Shot 2020-07-06 at 11.41.53 AM-min.png
Screen Shot 2020-07-06 at 11.41.53 AM-min.png (33.72 KiB) Viewed 14 times
Screen Shot 2020-07-06 at 11.38.45 AM-min.png
Screen Shot 2020-07-06 at 11.38.45 AM-min.png (339.75 KiB) Viewed 14 times
Screen Shot 2020-07-06 at 11.37.24 AM-min.png
Screen Shot 2020-07-06 at 11.37.24 AM-min.png (116.64 KiB) Viewed 14 times

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Re: Unable to Upload Image (.BMP) to E-Ink Feather Wing/ Ser

by jbharuchi on Mon Jul 06, 2020 12:57 pm

Could it be that the MicroSD card is not being read due to an incorrect filesystem? I just noticed that my MicroSD card is of FAT32 format. The blinka.bmp file is in my root directory of my MicroSD card.

jbharuchi
 
Posts: 18
Joined: Mon May 11, 2020 11:24 am

Please be positive and constructive with your questions and comments.