Skip to content

Instantly share code, notes, and snippets.

View maxmacstn's full-sized avatar
🏠
Working from home

Sitinut Waisara maxmacstn

🏠
Working from home
View GitHub Profile
@vsigler
vsigler / _readme.md
Last active February 17, 2024 13:14 — forked from stecman/_readme.md
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.

@Ircama
Ircama / PT-P300BT.md
Last active March 26, 2024 08:55
Print to Brother PTP300BT from a computer

Printing to a Brother P-Touch Cube PT-P300BT label printer from a computer

Introduction

The Brother P-touch Cube PT-P300BT labelling machine is intended to be controlled from the official Brother P-touch Design&Print 2 app for Android and iOS devices, instead of from a computer.

This Gist provides small code revision and some additional scripts to the dogtopus/Pipfile one, which in turn is forked from the excellent stecman one, in order to print text labels via scripts on computers with different O.S. or subsystems.

The scripts are used to convert text labels to appropriate images compatible with 12mm width craft tapes like [TZe-131

// First, go to https://shopee.co.th/user/purchase, and open DevTools.
// Step 1 - Run this code to scroll all the way to the bottom.
const timer = setInterval(() => scrollTo(0, 10000000), 800)
setTimeout(() => {
// Step 2 - Stop scrolling after 1 minute.
clearInterval(timer)
// Step 3 - Sum the total purchase price!
@tiagofreire-pt
tiagofreire-pt / self-signed-certificate-with-custom-ca-for-home-assistant.md
Last active March 16, 2024 23:47 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA for Home Assistant

Create Root Certificate Authority and self-signed certificate for your Home Assistant. Compatible with Chrome browser > version 58, including the macOS Catalina 10.15 / iOS 13 (and above) new requirements.

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@stecman
stecman / _readme.md
Last active April 25, 2024 00:10
Brother P-Touch PT-P300BT bluetooth driver python

Controlling the Brother P-Touch Cube label maker from a computer

The Brother PTP300BT label maker is intended to be controlled using the official Brother P-Touch Design & Print iOS/Android app. The app has arbitrary limits on what you can print (1 text object and up to 3 preset icons), so I thought it would be a fun challenge to reverse engineer the protocol to print whatever I wanted.

Python code at the bottom if you want to skip the fine details.

Process

Intitially I had a quick peek at the Android APK to see if there was any useful information inside. The code that handles the communication with the printer in Print&Design turned out to be a native library, but the app clearly prepares a bitmap image and passes it to this native library for printing. Bitmaps are definitely something we can work with.