A
Arduino•10mo ago
blackshibe

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
Unknown User•10mo ago
Message Not Public
Sign In & Join Server To View
KLevi
KLevi•10mo ago
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)?
blackshibe
blackshibeOP•10mo ago
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
blackshibe
blackshibeOP•10mo ago
blackshibe
blackshibeOP•10mo ago
Images are saved intermittently to SPIFFS, so the results are slow as shit
blackshibe
blackshibeOP•10mo ago
No description
No description
blackshibe
blackshibeOP•10mo ago
I also stuck on several of these pads on to prevent constant overheating the OV5640 loves getting hot
blackshibe
blackshibeOP•10mo ago
No description
KLevi
KLevi•10mo ago
Cool project :D. Hope those came with proper thermal pads and not double sided tape
blackshibe
blackshibeOP•10mo ago
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
KLevi
KLevi•10mo ago
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
blackshibe
blackshibeOP•10mo ago
well they do get hot i hope that's a good sign
KLevi
KLevi•10mo ago
I suppose yeah
blackshibe
blackshibeOP•10mo ago
it also holds battery really well, i haven't had to charge it yet
KLevi
KLevi•10mo ago
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?
blackshibe
blackshibeOP•10mo ago
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
blackshibe
blackshibeOP•10mo ago
No description
blackshibe
blackshibeOP•10mo ago
this cable is annoying i have to connect to it with jumpers it's well below 2.54mm
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
blackshibe
blackshibeOP•9mo ago
that looks like a nightmare
No description
Unknown User
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
KLevi
KLevi•9mo ago
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?
No description
No description
KLevi
KLevi•9mo ago
(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)
KLevi
KLevi•9mo ago
Like this, if discord didn't load it correctly
No description
blackshibe
blackshibeOP•9mo ago
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
KLevi
KLevi•9mo ago
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;
blackshibe
blackshibeOP•9mo ago
Show your whole code
KLevi
KLevi•9mo ago
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
blackshibe
blackshibeOP•9mo ago
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
KLevi
KLevi•9mo ago
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
blackshibe
blackshibeOP•9mo ago
Have you confirmed it reads/writes txt files? I don't remember having to do that
KLevi
KLevi•9mo ago
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?
blackshibe
blackshibeOP•9mo ago
I use SD_MMC to read/write
blackshibe
blackshibeOP•9mo ago
KLevi
KLevi•9mo ago
I'll check this out when I get home Thanks
blackshibe
blackshibeOP•9mo ago
Fails for me too, sometimes. Maybe it's something using the SPI pins when not intended
blackshibe
blackshibeOP•9mo ago
No description
No description
blackshibe
blackshibeOP•9mo ago
@KLevi lol
KLevi
KLevi•9mo ago
Haha. Guess we need to look into it deeper Well, I declared separate SPI pins from the camera
blackshibe
blackshibeOP•8mo ago
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
KLevi
KLevi•8mo ago
Great that you found a solution
blackshibe
blackshibeOP•8mo ago
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
KLevi
KLevi•8mo ago
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
blackshibe
blackshibeOP•8mo ago
...can you even replug the built in sd card? or are you talking about an external one
KLevi
KLevi•8mo ago
External one I will revisit the topic sometimes so I'd actually know what I'm talking about
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
blackshibe
blackshibeOP•8mo ago
C++
Unknown User
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
blackshibe
blackshibeOP•8mo ago
blackshibe
blackshibeOP•8mo ago
No description
blackshibe
blackshibeOP•8mo ago
@KLevi :)
blackshibe
blackshibeOP•8mo ago
No description
KLevi
KLevi•8mo ago
Seems like you got it all working 🙂 Nice job
basel
basel•7mo ago
Wow
Unknown User
Unknown User•7mo ago
Message Not Public
Sign In & Join Server To View
Charlie
Charlie•7mo ago
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.
blackshibe
blackshibeOP•7mo ago
It's not. It requires slightly different drivers https://pl.aliexpress.com/item/1005005402581719.html
Charlie
Charlie•7mo ago
Thanks for the link!
☦Karma☦
☦Karma☦•3mo ago
ed
Alby
Alby•2mo ago
So cool! I imagine it inside a 3d printed case
wtf
wtf•2mo ago
do you process the image locally or send it to your computer and back?
blackshibe
blackshibeOP•2mo ago
its all local i included batteries and took photos outside
wtf
wtf•2mo ago
woahhh

Did you find this page helpful?