ESP32 camera with printer
Esp32 AI THINKER camera slapped onto a really sketchy soldered perfboard, with a screen, working microSD, a battery, and breakout pins to attach a thermal printer.
This was supposed to be one unit with the printer but for the life of me nothing would draw actual 2A from the battery so I gave up and decided it'll work through USB-C
The AI THINKER doesn't have enough pins so the microSD slot only works before the display initializes. I plan to make some sort or SPIFFS <-> SD sync for saving or accessing images.
https://github.com/blackshibe/arduino-thermal-cam
https://github.com/blackshibe/Adafruit-Thermal-Printer-Library-POS58
GitHub
GitHub - blackshibe/arduino-thermal-cam
Contribute to blackshibe/arduino-thermal-cam development by creating an account on GitHub.
GitHub
GitHub - blackshibe/Adafruit-Thermal-Printer-Library-POS58: Adafrui...
Adafruit Thermal Printer Library fork with working bitmap printing on POS58 printers - blackshibe/Adafruit-Thermal-Printer-Library-POS58
64 Replies
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
Very cool project, but I agree with the guy above. Did it load the picture of the wolf from the SD card or a buffer (if you can even have so many buffers)?
Sd card -> spiffs -> printer
Update:
The first demo is taken with a fox image loaded off the SD card, to the SPIFFS, then printed directly. I had to write the bitmap printing drivers to get this specific printer working.
2 days ago I killed my camera by plugging it in wrong. Today it's back and works as a proper camera now, saving images to SD
Images are saved intermittently to SPIFFS, so the results are slow as shit


I also stuck on several of these pads on to prevent constant overheating
the OV5640 loves getting hot

Cool project :D. Hope those came with proper thermal pads and not double sided tape
the thermal pads have decent tape (I hope...?), the one the camera goes on top of just glues off after 5 minutes
well, maybe more now that it has passive cooling
The same type of heatsinks I ordered, and others have ordered came with double sided tape, which is an insulator. Had to dissolve the glue and then use real thermal paste
well they do get hot
i hope that's a good sign
I suppose yeah
it also holds battery really well, i haven't had to charge it yet
I guesstimate a 300-500mA current consumption. Have you measured it? Or do you know the capacity and how much time has it been on?
I've only measured the printer when i was getting it to work, but 300mA seems about right
it definitely hasn't been on for 7 hours straight

this cable is annoying
i have to connect to it with jumpers it's well below 2.54mm
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
that looks like a nightmare

Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I tried to save pictures today to an SD cards but I had problems with anything above a certain size. May I ask how you are saving the images?


(First pic is low quality, second pic should be higher but only has like 15% of it correctly saved, the rest looks like blank pixels)
Like this, if discord didn't load it correctly

are you allocating the file size correctly?
I don't remember but some of the issues i experienced were:
-> writing the buffer to a file the size of the width, not size of the actual buffer
-> running out of space in SPIFFS, or SD
Try copying a file from the SD to the SD. That rules out write errors
I did that for SD->SPIFFS and back, to figure out I screwed up the image writing and it wasn't my hardware being damaged
Probably not. That's why I'm asking. Found some code online, modified it to work with my SD card and that's it. This is how they allocate the space
camera_fb_t * fb = NULL;
Show your whole code
I'm not at home but it is basically this.
https://randomnerdtutorials.com/esp32-cam-take-photo-save-microsd-card/
Random Nerd Tutorials
ESP32-CAM Take Photo and Save to MicroSD Card | Random Nerd Tutorials
Learn how to take photos with the ESP32-CAM board and save them to a microSD card using Arduino IDE. We'll be using the ESP32-CAM board labelled as AI-Thinker module
Try the WebServer arduino example
see if it streams video
As for this, if it doesn't work I'd be really puzzled
I haven't compiled it but it should work
What do you have connected to it?
GPIO 16 breaks the camera stream
It works perfectly
Just the SD card connected to pins that the camera doesn't use. I had to reconfigure the SPI from the default because those pins were used by the camera
Have you confirmed it reads/writes txt files? I don't remember having to do that
Yes it does. When I used the default pins the camera was blocking the signal but after the reconfiguration it worked
And as you can see it writes images up until some size perfectly, above it it glitches out
I changed from SD_MMC to just SD, perhaps that could be an issue?
I use SD_MMC to read/write
GitHub
arduino-thermal-cam/src/main.cpp at main · blackshibe/arduino-therm...
Contribute to blackshibe/arduino-thermal-cam development by creating an account on GitHub.
I'll check this out when I get home
Thanks
Fails for me too, sometimes. Maybe it's something using the SPI pins when not intended


@KLevi lol
Haha. Guess we need to look into it deeper
Well, I declared separate SPI pins from the camera
Writing to SPIFFS is prone to failing for me
With a friend we found just rewriting the photo to spiffs until it works to fix it
A single skipped byte does shit like this
Great that you found a solution
For you it might be different though. You save to SD directly
Regardless, write byte by byte and handle write errors
Another thing - the SPIFFS is agonizingly slow
I'd rather pull RST low or something to get the display to stop taking up the SPI bus, or at least attempt to rely on RAM not being cleared after restart is called
Iirc I used a different SPI bus for the SD. It wouldn't even get recognized when I connected the reader and the Cam to the same pin
...can you even replug the built in sd card?
or are you talking about an external one
External one
I will revisit the topic sometimes so I'd actually know what I'm talking about
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
C++
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View

@KLevi :)

Seems like you got it all working 🙂
Nice job
Wow
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
That's a cool project! Is the printer an actual Adafruit one? I saw some similar on aliexpress and wanted one for a project, but I'm not sure it'd work work with the library.
It's not. It requires slightly different drivers
https://pl.aliexpress.com/item/1005005402581719.html
Thanks for the link!
ed
So cool! I imagine it inside a 3d printed case
do you process the image locally or send it to your computer and back?
its all local
i included batteries and took photos outside
woahhh