-->
Page 10 of 12

Re: ESP8266WebServer example

PostPosted: Thu Mar 31, 2016 8:11 am
by Hulkco
matkar wrote:To correct the missing images substitute function:
void handle_image() with
Code: Select allvoid handle_image() {
  WiFiClient client = server.client();
  client.write(image, sizeof(image));
  server.send(200, "image/png", "");
}


I was searching for an application that would transform png images to the necessary byte array. Unfortunately I couldn't find any. If anybody knows where to get one, please let us know.

Hi the pgrogram that i used is: LCDassistand you can downloa here: https://github.com/hulkco/Tools

But we carefull, I'd suggest the following page:
https://learn.adafruit.com/mini-thermal ... p-printing
Though this one's about thermal printers, the tips all apply to LCD/OLED use as well...pad to multiple of 8, add PROGMEM to array declaration, etc. (One change: use the original bitmap width when calling drawBitmap(), only round up when doing the conversion.) :mrgreen:

For smaller pictures the parsing can be done manually with the help of some tools. I used http://www.fileformat.info/tool/hexdump.htm online service to convert my PNG to hex. I copied the result to libreoffice writer where I removed the unnecessary portions (columns) and added "0x" columns and commas to the array. This way it takes only a few minutes for a small picture to adapt it to the correct format.

Regards,
Mat

Re: ESP8266WebServer example

PostPosted: Thu Mar 31, 2016 10:11 am
by martinayotte
For tools to convert PNG to Hex, there are several.

One of those is https://github.com/tristan2468/Hexy supporting drag-n-drop, which also provide an already compiled bin for Windows.

On Linux, there is the off-the-shelves "xxd" that does the job at command-line.

Re: ESP8266WebServer example

PostPosted: Fri Apr 08, 2016 3:27 pm
by ceyhunkeklik
I working with ESP8266-01 and these codes working when I choose Board as Generic ESP8266 Module. Connected AP, Working WebServer but digitalWrite command not working. I tried 2,7,8 and 13 pin but not working in my Arduino Uno. How can I fix this problem?

Re: ESP8266WebServer example

PostPosted: Sun Apr 10, 2016 11:16 pm
by RichardS
Are you sure its client.write, before server.send?

RichardS

Hulkco wrote:
matkar wrote:To correct the missing images substitute function:
void handle_image() with
Code: Select allvoid handle_image() {
  WiFiClient client = server.client();
  client.write(image, sizeof(image));
  server.send(200, "image/png", "");
}


I was searching for an application that would transform png images to the necessary byte array. Unfortunately I couldn't find any. If anybody knows where to get one, please let us know.

Hi the pgrogram that i used is: LCDassistand you can downloa here: https://github.com/hulkco/Tools

But we carefull, I'd suggest the following page:
https://learn.adafruit.com/mini-thermal ... p-printing
Though this one's about thermal printers, the tips all apply to LCD/OLED use as well...pad to multiple of 8, add PROGMEM to array declaration, etc. (One change: use the original bitmap width when calling drawBitmap(), only round up when doing the conversion.) :mrgreen:

For smaller pictures the parsing can be done manually with the help of some tools. I used http://www.fileformat.info/tool/hexdump.htm online service to convert my PNG to hex. I copied the result to libreoffice writer where I removed the unnecessary portions (columns) and added "0x" columns and commas to the array. This way it takes only a few minutes for a small picture to adapt it to the correct format.

Regards,
Mat