Control Printoid with ADB

You can send commands from your Raspberry Pi (or any other computed) to Printoid, if your phone (or your tablet) is plugged on it over USB.

The interface is called ADB: Android Debug Bridge.

SETUP YOUR DEVICES

The Premium version of Printoid can be piloted by using the Android Debug Bridge (ADB).

Discover ADB →

Controlling Printoid through ADB is a bit more difficult than from a physical keyboard since it’s not plug-n-play. But this is also more powerful, since you are able to send extra values with some commands. Typically, this is the solution I use to control Printoid with physical keys & buttons: my actuators are connected to the GPIO ports of my Raspberry Pi, then I perform a simple conversion from “GPIO action” to “Printoid command”.

You have to ensure first that ADB is properly installed on your Raspberry Pi. Then, you have to activate the developer options on your device and activate ADB.

Install ADB on a Raspberry Pi →

Activate the developer options →

The first time you’ll plug your device to the Raspberry, execute the adb devices command to check if your device is properly recognized. May you will have to accept the debug bridge from the device (don’t forget to check to “remember” box)

Once you’re able to communicate with the device, here’s how to communicate with Printoid. First start the application manually, or by sending the following command:

am start -n fr.yochi76.printoid.phones.premium/fr.yochi376.octodroid.HomeActivity

Then, each control commands should be executed while the app is in the foreground, with the following schemes:

adb shell am broadcast -a PRINTOID_COMMAND --es PRINTOID_ACTION XXXX

or by passing a float value as argument (when the command requests a float value):

adb shell am broadcast -a PRINTOID_COMMAND --es PRINTOID_ACTION XXXX --ef PRINTOID_VALUE YY.YY

or by passing a string value as argument (when the command requests a string value):

adb shell am broadcast -a PRINTOID_COMMAND --es PRINTOID_ACTION XXXX --ez PRINTOID_VALUE YY.YY

Where you have to replace the XXXX by one of the following action, and when available you can complete the command with an optional value (so you have to replace YY.YY by your own float value, as for example 1.0, 5.2, 12.9…)

AVAILABLE COMMANDS

FunctionAction keyParameter (unit) [type]
Toggle printer connection
CONNECT❌ (no param)
Toggle feature fullscreenFULLSCREEN❌ (no param)
Toggle streamingSTREAMING❌ (no param)
Toggle commandsCOMMANDS❌ (no param)
Toggle OctoPrint web-appWEBAPP❌ (no param)
Toggle the filesFILES❌ (no param)
Toggle timelapsesTIMELAPSES❌ (no param)
Toggle Printoid web-siteWEBSITE❌ (no param)
Toggle printer profilesPRINTER_PROFILES❌ (no param)
Toggle app settingsSETTINGS❌ (no param)
Toggle app infosINFOS❌ (no param)
Move X axis to leftX_LEFT distance (mm) [float]
Move X axis to rightX_RIGHT distance (mm) [float]
Move Y axis to backY_TOP distance (mm) [float]
Move Y axis to frontY_BOTTOM distance (mm) [float]
Move Z axis to topZ_UP distance (mm) [float]
Move Z axis to bottomZ_DOWN distance (mm) [float]
Set XY homeXY_HOME❌ (no param)
Set Z homeZ_HOME❌ (no param)
ExtrusionEXTRUSION length (mm) [float]
RetractionRETRACTION length (mm) [float]
Increment fan speedINC_FAN delta [float]
Decrement fan speedDEC_FAN delta [float]
Increment extruder 1 temp.INC_EXT1 delta (°) [float]
Decrement extruder 1 temp.DEC_EXT1 delta (°) [float]
Increment extruder 2 temp.INC_EXT2 delta (°) [float]
Decrement extruder 2 temp.DEC_EXT2 delta (°) [float]
Increment extruder 3 temp.INC_EXT3 delta (°) [float]
Decrement extruder 3 temp.DEC_EXT3 delta (°) [float]
Increment extruder 4 temp.INC_EXT4 delta (°) [float]
Decrement extruder 4 temp.DEC_EXT4 delta (°) [float]
Increment extruder 5 temp.INC_EXT5 delta (°) [float]
Decrement extruder 5 temp.DEC_EXT5 delta (°) [float]
Increment extruder 6 temp.INC_EXT6 delta (°) [float]
Decrement extruder 6 temp.DEC_EXT6 delta (°) [float]
Increment extruder 7 temp.INC_EXT7 delta (°) [float]
Decrement extruder 7 temp.DEC_EXT7 delta (°) [float]
Increment extruder 8 temp.INC_EXT8 delta (°) [float]
Decrement extruder 8 temp.DEC_EXT8 delta (°) [float]
Increment extruder 9 temp.INC_EXT9 delta (°) [float]
Decrement extruder 9 temp.DEC_EXT9 delta (°) [float]
Increment extruder 10 temp.INC_EXT10 delta (°) [float]
Decrement extruder 10 temp.DEC_EXT10 delta (°) [float]
Increment bed temp.INC_BED delta (°) [float]
Decrement bed temp.DEC_BED delta (°) [float]
Increment chamber temp.INC_CHAMB delta (°) [float]
Decrement chamber temp.DEC_CHAMB delta (°) [float]
Select a tool (printer head)SELECT_TOOL tool index (0->9) [float]
Print selected filePRINT❌ (no param)
Pause printPAUSE❌ (no param)
Stop printSTOP❌ (no param)
Send GCODE command(s)GCODE GCODE command(s) [string]

For the GCODE command, you can send multiple commands at the same time (a batch of GCODE commands). Simply separate all your commands by a comma (for example: M106 S255, G0 X0 Y0 Z0, M110 S210)