Skip to content

Commit 7c8788c

Browse files
committed
readme update
1 parent 1c9a855 commit 7c8788c

1 file changed

Lines changed: 55 additions & 33 deletions

File tree

README.md

Lines changed: 55 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,21 @@ The script provided here was built based on an analysis of captured Bluetooth tr
1313

1414
Essentially, the script takes an input images, scales it to the printers native X resolution of 384 pixels, and then sends it to the printer.
1515

16-
## Current abilities
16+
## Features
1717

1818
* Printing text of any length encoded in ASCII
1919
* Printing Images using PIL library
20-
* Printing raw bytes representing image in binary (black/white) form
21-
* Printing a page break of desired size (in pixels)
22-
* Printing using generator/iterator which returns image row by row in form of bytes or PIL Images
20+
* Printing Images row-by row using binary row representation
21+
* Printing page breaks using paper feed
22+
* Printing using generator/iterator that return bytes for each row, chunks of bytes for each row, images
2323
* Requesting printer details (Serial Number, Name, Battery Level, Hardware Info and an option the meaning of which i don't know)
24-
* Configuring print concentration (light, gray, black)
24+
* Configuring print concentration (temperature)
25+
* Changing printer serial number
2526
* Configuring printer poweroff timeout
2627

27-
## Prerequirements
28-
* Peripage A6/A6+ printer
28+
## Prerequisites
29+
30+
* Peripage A6/A6+/A40/e.t.c printer
2931
* Python 3
3032

3133
## Installation
@@ -44,31 +46,14 @@ pip install peripage
4446
```
4547

4648
## Dependencies
47-
* `PyBluez==0.30`
48-
* `Pillow==8.1.2`
49-
* `argparse==1.1` (for CLI)
49+
50+
* `PyBluez>=0.30`
51+
* `Pillow>=8.1.2`
52+
* `argparse>=1.1`
5053

5154
Install dependencies with
5255
`pip install -r requirements.txt`
5356

54-
On windows you may need to install PyBluez 0.3
55-
```
56-
git clone https://github.com/pybluez/pybluez
57-
cd pybluez
58-
pip install . --user
59-
```
60-
61-
On raspberry pi it may require to install additional libraries
62-
```
63-
sudo apt install libbluetooth-dev libopenjp2-7 libtiff5
64-
```
65-
66-
And in some cases you will have to restart the bluetooth adapter and service on raspberry pi when it fails to connect or device is busy
67-
```
68-
sudo systemctl restart bluetooth
69-
sudo hciconfig hci0 reset
70-
```
71-
7257
## Identify printer Bluetooth MAC address
7358

7459
**On linux:**
@@ -100,6 +85,27 @@ Scanning bluetooth devices... please wait.
10085
00:15:83:15:bc:5f Imaging PeriPage+BC5F
10186
```
10287

88+
## Troubleshooting
89+
90+
> Windows installation requires installing PyBluez from master branch as pypi module is not updated
91+
92+
```
93+
pip install git+https://github.com/pybluez/pybluez@master#egg=pybluez --user
94+
```
95+
96+
> Raspberry PI installation requires additional libraries
97+
98+
```
99+
sudo apt install libbluetooth-dev libopenjp2-7 libtiff5
100+
```
101+
102+
> Some cases may require restarting bluetooth adapter
103+
104+
```
105+
sudo systemctl restart bluetooth
106+
sudo hciconfig hci0 reset
107+
```
108+
103109
## CLI usage
104110

105111
**On linux**
@@ -152,7 +158,7 @@ peripage -m 00:15:83:15:bc:5f -p A6p -b 100 -t "HONK" -n
152158
```
153159
Newline is required to fush the internal printer buffer and force it to print all text without cutting
154160

155-
### Print Service example
161+
## Print Service
156162

157163
**Print 50 text tasks on A6+**
158164
```python
@@ -171,7 +177,8 @@ for i in range(50):
171177
```
172178
Newline is required to fush the internal printer buffer and force it to print all text without cutting
173179

174-
### Suggestions
180+
## Recommendations
181+
175182
* Don't forget about concentration, this can make print brighter and better visible.
176183
* Split long images into multiple print requests with cooldown time for printer (printer may overheat during a long print and will stop printing for a while. This will result in partial print loss because the internal buffer is about 250px height). For example, when you print [looooooooooooooooooooooooooooooongcat.jpg](http://lurkmore.so/images/9/91/Loooooooooooooooooooooooooooooooooooooooooongcat.JPG), split it into at least 20 pieces with 1-2 minutes delay because you will definetly loose something without cooling. Printer gets hot very fast. Yes, it was the first that i've printed.
177184
* Be carefull when printing lots of black or using max concentration, as i said, printer heats up very fast.
@@ -183,6 +190,8 @@ Newline is required to fush the internal printer buffer and force it to print al
183190

184191
View this [python notebook](https://github.com/bitrate16/peripage-python/blob/main/notebooks/peripage-tutorial.ipynb) for tutorial
185192

193+
View this [python notebook](https://github.com/bitrate16/peripage-python/blob/main/notebooks/Test-notebook.ipynb) for test
194+
186195
## Printer disassembly
187196

188197
[Disassembly for A6+](https://imgur.com/a/6LLwuaD)
@@ -194,17 +203,30 @@ View this [python notebook](https://github.com/bitrate16/peripage-python/blob/ma
194203
* Python 2.7 support
195204
* Implement overheat protection
196205
* Implement cover open handler
197-
* Tweak wait timings to precisely match the printing speed
206+
* Tweak wait timings to precisely match printing speed
198207
* Implement printer renaming
199208
* Implement printing stop operation
200209
* Reverse-engineer USB driver and add support for it
201-
* **FIX:** Print randomly gets cropped (some images getting cropped)
202-
* **FIX:** 1 type conversion is low quality
210+
* Print randomly gets cropped (some images getting cropped)
211+
* 1 type conversion is low quality
212+
213+
## Contribution
214+
215+
> Q: How to contribute?
216+
>
217+
> A: Implement some features and make a pull request in this repo. For example, you could add info about USB communication, write a any-font printing using PIL text drawing, make an additional research in protocol and other cool things.
218+
219+
> Q: How to get my printer supported?
220+
>
221+
> A: If you own a peripage printer that is currently unsupported, you can reverse-engineer the bluetooth packets captured from the oficial printing app and find out the specs of your printer (the main and the only spec is bytes per row). Another way is to find how many letters can fit in a row when using `printASCII()`.
222+
>
223+
> If you would like to participate, please make an issue and I will guide you on how to obtain required parameters.
203224
204225
## Credits
205226

206227
* [Elias Weingärtner](https://github.com/eliasweingaertner) for initial work in reverse-engineering bluetooth protocol
207228
* [bitrate16](https://github.com/bitrate16) for additional research and python module
229+
* [henryleonard](https://github.com/henryleonard) for specs of A40 printer
208230

209231
## Disclaimer
210232

0 commit comments

Comments
 (0)