# Problem displaying image from HTTP. with Waveshare 7.5" e-paper

**URL:** <https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865>\
**Category:** Displays\
**Created:** [December 2, 2019, 11:14am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865 "2019-12-02T11:14:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tHe\_giafra\_sHoW](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tHe\_giafra\_sHoW](https://forum.arduino.cc/u/tHe_giafra_sHoW)\
**Post date:** [December 2, 2019, 11:14am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/1 "2019-12-02T11:14:22Z")

</div>

Hello everyone,  
I'm working on a Waveshare 7.5" B&W e-paper display with a ESP32 board. What I need to do is to dispaly a certain image on the display in the bitmap format. The image should be downloaded from a web server.  
In order to do this, I decided to use the GXEPD2 library since it provides a valid and functioning example of what I'm trying to do. I got no issues whatsoever with the example provided in the github repo, called "GxEPD2\_WiFi\_Example.ino", I can display those images perfectly on the display.

But when I adapted the code to my standards, I was unable to make it work at all. My waveshare basically continues to go black and white alternatively while running the code.

Part of the Serial logs is:

```cpp
(...)
downloading file "site.bmp"
connecting to 10.10.21.1
requesting URL: http://10.10.21.1/site.bmp
request sent
HTTP/1.1 200 OK

headers received
File size: 983178
Image Offset: 138
Header size: 124
Bit Depth: 32
Image size: 640x384
downloaded in 6924 ms
_Update_Full : 4268001
bytes read 4294967050
width:640
height:384

downloading file "site.bmp"
connecting to 10.10.21.1
requesting URL: http://10.10.21.1/site.bmp
request sent
HTTP/1.1 200 OK

headers received
File size: 983178
Image Offset: 138
Header size: 124
Bit Depth: 32
Image size: 640x384
downloaded in 6926 ms
_Update_Full : 4268001
bytes read 4294967050
width:640
height:384

downloading file "site.bmp"
connecting to 10.10.21.1
requesting URL: http://10.10.21.1/site.bmp
request sent
HTTP/1.1 200 OK

headers received
File size: 983178
Image Offset: 138
Header size: 124
Bit Depth: 32
Image size: 640x384
(...)

```

Is there an issue with the bitmap format of the image I'm trying to display? I tried using all kinds of bitmap standards, with no success. Details of it are provided in the logs posted above.

I'm also attaching to this message the code I'm flashing on the board.

Could someone please help me out with this?

[DEC2.ino](https://forum.arduino.cc/uploads/short-url/etsNurAvMuCxuWCVAQ9jdnFwDm8.ino) (15.4 KB)

---

<div class="post-metadata">

**Author:** ![ZinggJM](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zinggjm/32/237907_2.png) [@ZinggJM](https://forum.arduino.cc/u/ZinggJM)\
**Post date:** [December 2, 2019, 3:59pm UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/2 "2019-12-02T15:59:13Z")

</div>

@tHe_giafra_sHoW,

Thank you for reporting this issue, even if you are not aware that it is an issue! 🙂

I had a slight problem with your name, as I store downloaded code from posters under NewbieCodes/name,  
NewbieCodes/tHe\_giafra\_sHoW as tHe\_giafra\_sHoW.ino in your case:(

The important line of your diagnostics is: "Bit Depth: 32".

The issue is that unhandled depths are not reported as "bitmap format not handled."

Only depths of 1, 4, 8, 16, 24 are handled.

Jean-Marc

---

<div class="post-metadata">

**Author:** ![tHe\_giafra\_sHoW](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tHe\_giafra\_sHoW](https://forum.arduino.cc/u/tHe_giafra_sHoW)\
**Post date:** [December 2, 2019, 4:09pm UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/3 "2019-12-02T16:09:48Z")

</div>

@ZinggIM

Many thanks for your help!

I still have problems though: I managed to create a bitmap having bit depth of 1 (the Serial logs do confirm), but still the image is not displayed correctly.  
Using bit depth of 32 the display just goes black and white alternatively, but while using the same image with a bit depth of 1, some small vertical rows appear in the screen that keeps refreshing. The stuff displayed looks like a barcode, very different from the image given (a planimetry of a room).

```cpp
downloading file "liberato.bmp"
connecting to 10.10.21.1
requesting URL: http://10.10.21.1/liberato.bmp
request sent
HTTP/1.1 200 OK

headers received
File size: 30782
Image Offset: 62
Header size: 40
Bit Depth: 1
Image size: 640x384

```

---

<div class="post-metadata">

**Author:** ![ZinggJM](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zinggjm/32/237907_2.png) [@ZinggJM](https://forum.arduino.cc/u/ZinggJM)\
**Post date:** [December 2, 2019, 4:39pm UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/4 "2019-12-02T16:39:09Z")

</div>

your URL [http://10.10.21.1/liberato.bmp](http://10.10.21.1/liberato.bmp) is very local. No idea how your liberato.bmp looks like.  
you could consider to attach it, maybe zipped.

---

<div class="post-metadata">

**Author:** ![tHe\_giafra\_sHoW](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tHe\_giafra\_sHoW](https://forum.arduino.cc/u/tHe_giafra_sHoW)\
**Post date:** [December 2, 2019, 4:50pm UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/5 "2019-12-02T16:50:46Z")

</div>

Ok, I attached the image requested.

[liberato.zip](https://forum.arduino.cc/uploads/short-url/qNjLukLBeDCkqer55yJ5c99F7jD.zip) (2.19 KB)

---

<div class="post-metadata">

**Author:** ![ZinggJM](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zinggjm/32/237907_2.png) [@ZinggJM](https://forum.arduino.cc/u/ZinggJM)\
**Post date:** [December 3, 2019, 8:49am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/6 "2019-12-03T08:49:06Z")

</div>

> tHe\_giafra\_sHoW:  
> Ok, I attached the image requested.

That is very kind of you!

And you still would like that I help you?

I have added your bitmap as liberato640x384.bmp to [GxEPD2/extras/bitmaps at master · ZinggJM/GxEPD2 · GitHub](https://github.com/ZinggJM/GxEPD2/tree/master/extras/bitmaps)

It can be shown correctly by [GxEPD2\_WiFi\_Example](https://github.com/ZinggJM/GxEPD2/tree/master/examples/GxEPD2_WiFi_Example) if added.

I had to re-add showBitmapFrom\_HTTPS() to your example to test your example, and see your error.

I replaced the methods skip() and read() with the versions of the actual GxEPD2\_WiFi\_Example, and your bitmap was shown correctly.

---

<div class="post-metadata">

**Author:** ![tHe\_giafra\_sHoW](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tHe\_giafra\_sHoW](https://forum.arduino.cc/u/tHe_giafra_sHoW)\
**Post date:** [December 3, 2019, 11:14am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/7 "2019-12-03T11:14:04Z")

</div>

That was very helpful, you solved my problem.  
Many thanks for your excellent help.

Feel free to include my bitmap in your own github repo if you think it's helpful for others. 🙂

---

<div class="post-metadata">

**Author:** ![ZinggJM](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zinggjm/32/237907_2.png) [@ZinggJM](https://forum.arduino.cc/u/ZinggJM)\
**Post date:** [December 3, 2019, 11:59am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/8 "2019-12-03T11:59:20Z")

</div>

> Feel free to include my bitmap in your own github repo if you think it's helpful for others.

This was the easiest way to test.

---

<div class="post-metadata">

**Author:** ![tHe\_giafra\_sHoW](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@tHe\_giafra\_sHoW](https://forum.arduino.cc/u/tHe_giafra_sHoW)\
**Post date:** [January 16, 2020, 3:44pm UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/9 "2020-01-16T15:44:28Z")

</div>

@zinggJM

Hello again.  
Sorry if I bother you, but I'm currently working on a similar project, albeit a more complicated one, and I'm using the very same device and the very same drawing functions I used in this thread, since I only need to retrieve the image from a different URL.  
So I figured all I had to do was literally copypasting this old project we discussed here to the new one on which I'm currently working. The only problem is that when I compile the code, it gives me errors regarding the "read" function which is present both in unistd.h and in the project:

```cpp
C:\Users\gd\Documents\Arduino\libraries\MA_Libs/MA_DRAW.h: In function 'void showBitmapFrom_HTTP(const char*, const char*, const char*, int16_t, int16_t, bool)':

C:\Users\gd\Documents\Arduino\libraries\MA_Libs/MA_DRAW.h:18:10: note: candidate 1: uint32_t read(WiFiClient&, uint8_t*, int32_t)

 uint32_t read(WiFiClient& client, uint8_t* buffer, int32_t bytes);

          ^

In file included from C:\Users\gd\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/include/newlib/stdio.h:29:0,

                 from C:\Users\gd\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:27,

                 from sketch\ma_epaper.ino.cpp:1:

C:\Users\gd\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/include/newlib/sys/unistd.h:149:25: note: candidate 2: int read(int, void*, size_t)

 _READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__ buf, size_t __nbyte ));

                         ^

In file included from C:\Users\gd\Documents\Arduino\ma_epaper\ma_epaper.ino:55:0:

C:\Users\gd\Documents\Arduino\libraries\MA_Libs/MA_DRAW.h:18:10: note: candidate 1: uint32_t read(WiFiClient&, uint8_t*, int32_t)

 uint32_t read(WiFiClient& client, uint8_t* buffer, int32_t bytes);

          ^

In file included from C:\Users\gd\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/include/newlib/stdio.h:29:0,

                 from C:\Users\gd\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\cores\esp32/Arduino.h:27,

                 from sketch\ma_epaper.ino.cpp:1:

C:\Users\gd\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4/tools/sdk/include/newlib/sys/unistd.h:149:25: note: candidate 2: int read(int, void*, size_t)

 _READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__ buf, size_t __nbyte ));

                         ^

sketch\ma_epaper.ino.cpp.o:(.literal.startup._GLOBAL __sub_I__ Z13ma_debug_initv+0x18): undefined reference to `vtable for GxEPD2_750'

sketch\ma_epaper.ino.cpp.o:(.literal.startup._GLOBAL __sub_I__ Z13ma_debug_initv+0x24): undefined reference to `GxEPD2_750::GxEPD2_750(signed char, signed char, signed char, signed char)'

sketch\ma_epaper.ino.cpp.o: In function `_GLOBAL __sub_I__ Z13ma_debug_initv':

C:\Users\gd\Documents\Arduino\libraries\MA_Libs/MA_DRAW.h:352: undefined reference to `GxEPD2_750::GxEPD2_750(signed char, signed char, signed char, signed char)'
collect2.exe: error: ld returned 1 exit status

```

it seems a linker problem - though all the libraries are in the right place.

I attached to this message the code I'm using in my library to draw the image, where the read() function is defined.

I know it could be a simple question, but I'm stuck with this issue.  
Hope you can help me, many thanks 🙂

[MA\_DRAW.h](https://forum.arduino.cc/uploads/short-url/y7Ri6InI9P1tvp94SgOxF4mCuL4.h) (13.1 KB)

---

<div class="post-metadata">

**Author:** ![ZinggJM](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/zinggjm/32/237907_2.png) [@ZinggJM](https://forum.arduino.cc/u/ZinggJM)\
**Post date:** [January 17, 2020, 4:26am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/10 "2020-01-17T04:26:06Z")

</div>

@tHe_giafra_sHoW

See GxEPD2\_WiFi\_Example.ino, lines 132 - 139:

```cpp
#if defined (ESP8266)
#include <ESP8266WiFi.h>
#define USE_BearSSL true
#endif

#include <WiFiClient.h>
#include <WiFiClientSecure.h>

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 4:03am UTC](https://forum.arduino.cc/t/problem-displaying-image-from-http-with-waveshare-7-5-e-paper/623865/11 "2021-05-06T04:03:56Z")

</div>

Closed on May 6, 2021, 4:03am UTC


