https://github.com/dtgreene/ivy2
Python API for the Canon Ivy 2 mini photo printer
https://github.com/dtgreene/ivy2
bluetooth bluetooth-printer canon printer python raspberry-pi
Last synced: 7 months ago
JSON representation
Python API for the Canon Ivy 2 mini photo printer
- Host: GitHub
- URL: https://github.com/dtgreene/ivy2
- Owner: dtgreene
- Created: 2023-04-08T21:22:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-04T16:30:14.000Z (11 months ago)
- Last Synced: 2025-04-15T18:51:05.717Z (10 months ago)
- Topics: bluetooth, bluetooth-printer, canon, printer, python, raspberry-pi
- Language: Python
- Homepage:
- Size: 234 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ivy 2

A Python API to control the [Canon Ivy 2 mini photo printer](https://www.usa.canon.com/shop/p/ivy-2-mini-photo-printer).
Note: So far, this has only been tested on a Raspberry PI 3b+. The underlying PyBluez library should be cross-compatible but the pairing process will likely vary from platform to platform.
### Installation steps (Raspberry PI)
1. Install deb packages
```
sudo apt install bluetooth bluez libbluetooth-dev
```
2. Install pip packages (you may need to create a [virtual environment](https://docs.python.org/3/library/venv.html) first)
```
pip install -r requirements.txt
```
3. Install BlueZ directly from the source ([see this comment](https://github.com/pybluez/pybluez/issues/431#issuecomment-1107884273))
```
pip install git+https://github.com/pybluez/pybluez.git#egg=pybluez
```
4. Disable legacy pairing
This will need to be done each time the computer reboots. Otherwise you may get an "Invalid exchange" error when trying to connect with the printer.
```
sudo hciconfig 0 sspmode 0
```
5. Pair with the printer
This only needs to be done the first time.
Start the BlueZ CLI
```
bluetoothctl
```
If this is your first time messing with Bluetooth on the PI, first register an agent:
- `agent on`
- `default-agent`
Turn on the printer and wait about 30 seconds. Then enable scanning:
- `scan on`
You should start to see local Bluetooth devices popping up. Most of the devices will just show a mac address but the printer should have the name listed as well making it easy to spot. You should see something like this:
```
[NEW] Device 04:7F:0E:B7:46:0B Canon (46:0B) Mini Printer
^ mac address
```
Once you've located the printer, take note of the mac address and attempt to pair:
- `pair `
- `trust `
You can now disable scanning and exit the BlueZ CLI:
- `scan off`
- `exit`
### Usage
See [example.py](example.py) for basic usage.