I got OF installed and working on my RPI 2 following the instructions provided. I also wanted to install ofxESCPOS to test a thermal printer. I saw the ofxESCPOS app but I’m not sure where it belongs within the OF framework. Are there instructions for its installation (along with its dependencies)?
Each addon goes in the “addons/” directory (in the openFrameworks root directory).
To install addons, you can usually look at the original addon’s addon_config.make file (e.g. https://github.com/bakercp/ofxESCPOS/blob/master/addon_config.mk) to see what dependencies it has. In this case, it requires ofxIO and ofxSerial. You can clone the addons into your addons directory using git, or you can download the latest release. If you download the addon, make sure that it unzips into the correct folder name (sometimes it will unzip into something like ofxIO-master) so the build system recognizes it.
Once you have the dependencies installed you should be able to go into one of the examples and run make.
Currently I use ofxESCPOS on a raspberry pi for lots of installations, so once you have the dependencies installed, it should work nicely.
I got everything loaded. I was able to compile the ofxIO and ofxSerial examples without any problems. With ofxESCPOS example, I’m getting a complication error:
src/ofApp.cpp:39:24: error: ‘SerialDevice’ has not been declared
src/ofApp.cpp:40:24: error: ‘SerialDevice’ has not been declared
src/ofApp.cpp:41:24: error: ‘SerialDevice’ has not been declared
src/ofApp.cpp:42:24: error: ‘SerialDevice’ has not been declared
I got everything compiled and change the path to the usb port the printer is connected to (/dev/usb/lp0). It throws an exception in printer.setup so I wanted to start some debugging. To both learn and fix the problem. I expected there to be some issues with the usb. I figured that once I get the usb connection established properly everything would work.
Did you get it working with straight usb printers?
I currently only have it working with serial printers that understand ESCPOS over serial. I use USB to Serial adapters (e.g. cheap PL2303-based adapters). If there is a way to configure your printer to use a raw serial connection over USB, then it should work …