The iFixit FixHub power station and smart soldering iron provide a serial interface for low-level communications.
Hardware damage caused by inventive tinkering is not covered under our warranty. But it's your FixHub, have fun! We left the locks off and the pins probe-able.
Improvements to this documentation are welcome; open a pull request.
This document provides information on the command-line interfaces (CLI) for two separate tools:
- A USB hub with one charge port in the back and two tool ports in the front
- A smart iron tool
Each tool has its own set of commands, which are detailed in their respective sections below.
Commands related to analog-to-digital conversion.
adc [subcommand]
stream <device>
: Continuously stream ADC values from the specified device- Not available on production firmware
read <device>
: Read a single ADC value from the specified devicelist
: List all controllable ADCs- Not available on production firmware
Reboot into MCUBoot serial recovery mode.
bootloader reboot
Replies with 'OK' then reboots the device into MCUBoot serial recovery mode.
MCU - MCU Communication Commands
comms [subcommand]
tx-test
: Transmit the Test commandg0version
: Get the G0's FW version- On error: 'Timeout. Is the other MCU subscribed?'
ErrorLog commands
errorlog [subcommand]
clear
: Clear the ErrorLogwrite <fault>
: Write a fault to the ErrorLog- Not available on production firmware
GPIO commands
gpio [subcommand]
write <name> <0|1>
: Set a gpio stateread <name>
: Read a gpio stateread <name>
: List gpios- Not available on production firmware
Caution: changing GPIO values can cause unexpected behavior. GPIO writes are reverted on restart. GPIO names are derived from the device tree and are printed using the cmd_gpio_list function.
Lists available commands.
help
Get the hardware ID of the device.
hwid get
Ex: hwid get
: DVT2
I2C commands
i2c [subcommand]
scan <device>
: Scan I2C devices on the specified bus
Ex:
i2c scan I2C_1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- 0b -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- 36 -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
3 devices found on I2C_1
Get idle timeout parameters
idle get
Ex: idle get
Idle timer running
Initial seconds: 1800 S
Remaining seconds: 1405 S
Already expired?: No
Logging related commands.
log [subcommand]
show
: Display current loglevel <level>
: Set log level (e.g., INFO, DEBUG, ERROR)
Not working in production.
Shell UART logging backend commands
logging [subcommand]
enable
: Enable the shell UART logging backenddisable
: Disable the shell UART logging backend
MAX17205 Fuel Gauge Commands
max17205 [subcommand]
-
read <virtual-device-number> <8b-register-address>
- Description: Read from the MAX17205 registers
- Parameters:
<virtual-device-number>
: The virtual device number (0 or 1)<8b-register-address>
: The 8-bit register address to read from (in hexadecimal)
- Note: Valid virtual device numbers are 0 or 1
- Example:
max17205 read 0 0x0D
-
configure
- Description: Perform the configuration routine for the MAX17205 Fuel gauge
- Note: This command completes the configuration but does not store values in NVM
- Example output:
Config complete, but registers values are not stored in NVM Use the 'nvm_programming' command to update the NVM
-
details
- Description: Display detailed information about the current state of the MAX17205 fuel gauge
- Example output:
Pack voltage: 11671mV Pack current: -3mA Pack soc: 79% IC die temp: 50C NTC1 temp: 54C NTC2 temp: 47C Battery state: Dischg Warning Hot
-
nvm_updates
- Description: Determine the number of NVM updates remaining
- Note: This command shows how many times the NVM has been updated and how many updates are left
-
nvm_programming
- Description: Program the Fuel gauge NVM
- Usage:
nvm_programming confirm
- Note: Use this command with extreme caution as it permanently alters the fuel gauge's configuration
- Example output:
Usage: nvm_programming confirm DO NOT run this command if you don't know what it does
-
hardreset
- Description: Perform a reset of the fuel gauge
- Usage:
hardreset confirm
- Note: This command performs a reset of the fuel gauge just like if the battery pack was removed and reinstalled. It doesn't reset the fuel gauge to the default state (it doesn't alter non-volatile memory, for instance).
-
health
- Description: Get the Battery health
- Example output:
100 %
-
version
- Description: Get the MAX17205 Fuel gauge configuration version
- Example output:
1
- The MAX17205 is a sophisticated fuel gauge IC that provides accurate battery state-of-charge (SOC) and other battery monitoring functions.
- Always exercise caution when using commands that modify the fuel gauge's configuration or perform resets, as these actions may affect the device's performance or battery monitoring accuracy.
- The
read
command allows direct access to the fuel gauge's registers. Refer to the MAX17205 datasheet for the meaning and location of specific registers. - The
configure
command sets up the fuel gauge but doesn't store values in non-volatile memory (NVM). Usenvm_programming
to update the NVM after configuration. - The
test_params
command: DEPRECATED. This command is removed from current firmware. Incorrect use of this command can cause hardware problems. - The
health
command provides a percentage indicating the overall health of the battery. - The
version
command returns the configuration version of the fuel gauge, which is used for tracking fuel gauge configuration changes.
Get the MCU serial number.
mcu_sn
Ex: mcu_sn
0026002C-58305007-20343452
Low Level USART commands
pubsub [subcommand]
enable <device>
: Enable controldisable <device>
: Disable control
Get the power source of the board
pwrsrc get
Ex: pwrsrc get
Rear
Reset the device.
reset
RT9490 PMIC (Power Management Integrated Circuit) Commands
rt9490 [subcommand]
...
-
get_adc <dev>
- Description: Read the value from a specific ADC channel of the RT9490 PMIC.
- Usage:
rt9490 get_adc <dev>
- Parameters:
<dev>
: The name of the ADC device to read from.
- Example usage:
rt9490 get_adc RT9490_ADC_VBUS rt9490 get_adc RT9490_ADC_IBAT
- Note: Use the exact ADC names as shown in the
all_adc
command output.
-
all_adc
-
Description: Display readings from all ADC channels of the RT9490 PMIC.
-
Usage:
rt9490 all_adc
-
Output: This command provides a comprehensive list of all ADC readings, including:
- RT9490_ADC_IBUS: Input bus current (mA)
- RT9490_ADC_IBAT: Battery current (mA)
- RT9490_ADC_VBUS: Input bus voltage (mV)
- RT9490_ADC_VAC1: AC input voltage 1 (mV)
- RT9490_ADC_VAC2: AC input voltage 2 (mV)
- RT9490_ADC_VBAT: Battery voltage (mV)
- RT9490_ADC_VSYS: System voltage (mV)
- RT9490_ADC_TS: Temperature sensor reading (°C)
- RT9490_ADC_TDIE: Die temperature (°C)
-
Example output:
RT9490_ADC_IBUS: 25mA RT9490_ADC_IBAT: 63mA RT9490_ADC_VBUS: 5258mV RT9490_ADC_VAC1: 0mV RT9490_ADC_VAC2: 0mV RT9490_ADC_VBAT: 12605mV RT9490_ADC_VSYS: 12905mV RT9490_ADC_TS : 0C RT9490_ADC_TDIE: 27C
-
- ADC readings can help in understanding the current power state of the system, including battery status, power consumption, and temperature.
Display the active connection status of iFixit tools on the device ports.
toolcomms
This command checks and displays the connection status of iFixit tools on the device's ports. It shows whether an active iFixit tool is plugged into each port.
Port1: [status]
Port2: [status]
Where:
Port1
refers to the port on the right side of the device.Port2
refers to the port on the left side of the device.[status]
is either 0 (no active tool connected) or 1 (active tool connected).
- 0: No active iFixit tool is plugged into the port.
- 1: An active iFixit tool is plugged into the port and communicating properly.
-
No tools connected:
Port1: 0 Port2: 0
-
Tool connected to right port only:
Port1: 1 Port2: 0
-
Tools connected to both ports:
Port1: 1 Port2: 1
UI Commands
ui [subcommand]
record
: Record UI eventsunsubscribe
: Unsubscribe from UI events
Get system uptime in milliseconds.
uptime
Ex: uptime
: 304993
USB Power Delivery (USB-PD) related commands for monitoring and managing USB-PD ports.
usbpd [subcommand]
-
status
- Description: Display detailed status information for USB-PD ports.
- Usage:
usbpd status
- Output: Provides comprehensive information about each USB-PD port, including:
- LoadSwitch status (En/Off)
- Attachment status (Y/N)
- Port role (UFP/DFP)
- Orientation (Swapped/Normal)
- Explicit Contract status (Y/N)
- Power role (SNK/SRC)
- Partner Known status (Y/N)
- Discovery Done status (Y/N)
- iFixit AltMode status (Y/N)
- Force Detach status (Y/N)
- This Device's Source (SRC) and Sink (SNK) Power Data Objects (PDOs)
- Port Partner's SRC and SNK PDOs
- Currently used PDO with detailed information
Example output:
Port 1: LoadSwitch: En Attached: Y Port: UFP Orientation Swapped: Y Explicit Contract: Y Power: SNK Partner Known: N Discovery Done: Y iFixit AltMode: N Force Detach: N This Device's SRC PDOs This Device's SNK PDOs Fixed: 5000mV @ 3000mA NoDRS NoDRP Fixed: 9000mV @ 3000mA NoDRS NoDRP Fixed: 15000mV @ 3000mA NoDRS NoDRP Fixed: 20000mV @ 2250mA NoDRS NoDRP Port Partner's SRC PDOs --> Fixed: 5000mV @ 3000mA DRS DRP Port Partner's SNK PDOs Object Used [1](0x2F01912C) => Fixed: 5000mV @ 3000mA DRS DRP USB | mismatch? N
-
vbus
- Description: Display current voltage and current for each USB-PD port.
- Usage:
usbpd vbus
- Output: Shows the voltage (in mV) and current (in mA) for each port.
Example output:
Port1: 5215mV @ 243mA
-
summary
- Description: Provide a summary of the state and power consumption for all USB-PD ports.
- Usage:
usbpd summary
- Output: Displays the state (as a hexadecimal value) and power consumption (in mW) for each port.
Example output:
TOOLPORT1 state: 0x05ee TOOLPORT1 power: 238 mW TOOLPORT2 state: 0x07ee TOOLPORT2 power: 1479 mW REAR state: 0x049e REAR power: 10014 mW
- The
status
command provides the most detailed information and is useful for debugging USB-PD issues. - The
vbus
command gives a quick view of the current power delivery situation on each port. - The
summary
command is helpful for a quick overview of all ports' states and power consumption.
-
In the
status
output:- UFP: USB Upstream Facing Port (in this case, the device is acting as a sink)
- SNK: Power Sink (confirming the device is receiving power)
- PDO: Power Data Object, describing power capabilities
- DRS: Data Role Swap supported (seen in the port partner's capabilities)
- DRP: Dual Role Power supported (seen in the port partner's capabilities)
-
The
vbus
output shows the actual voltage and current being delivered. In the example, Port1 is receiving 5215mV at 243mA. -
The
summary
output provides:- State information as a hexadecimal value for each port (e.g., 0x05ee, 0x07ee, 0x049e). The meaning of these specific values would require further information from the system documentation or source code.
- Power consumption in mW for each port, allowing quick comparison between ports.
-
The system recognizes three ports: TOOLPORT1, TOOLPORT2, and REAR.
Notes:
- The "Explicit Contract: Y" indicates that power negotiation has successfully completed.
Display detailed version and build information about the system.
version
This command provides information about the software versions, build environment, and platform details of the system.
The command returns the following information:
Zephyr Kernel Version: [kernel_version]
Zephyr Kernel Git: [kernel_git_version]
App Git: [app_git_hash]
Compile Time: [compilation_timestamp]
Compile OS: [build_os]
Platform: [board_name] ([soc_name])
Compile Author: [author_name]
Compiler: [compiler_name_and_version]
Build Type: [build_type]
Zephyr Kernel Version
: The version of the Zephyr RTOS kernel being used.Zephyr Kernel Git
: The Git commit or tag of the Zephyr kernel.App Git
: The Git commit hash of the application code.Compile Time
: The timestamp when the software was compiled.Compile OS
: The operating system where the compilation was performed.Platform
: The name of the board and the specific SoC (System on Chip) being used.Compile Author
: The name or identifier of the user who compiled the software.Compiler
: The name and version of the compiler used to build the software.Build Type
: The type of build (e.g., debug, release).
Zephyr Kernel Version: 3.6.0
Zephyr Kernel Git: v3.6.0-91-gace6e447cf3d
App Git: 3009749
Compile Time: 2024-07-14T05:45:37
Compile OS: Linux-6.5.0-1023-azure
Platform: ifixit_smarthub_l5 (stm32l552xx)
Compile Author: runner
Compiler: GCC 12.2.0
Build Type: release
version
Commands related to the soldering iron heater control and monitoring.
heater [subcommand]
-
details
- Description: Display detailed information about the heater's current state and settings.
- Usage:
heater details
- Output: Provides comprehensive information about the heater, including:
- Temperature settings (setpoint, active, idle)
- Current temperature readings (thermocouple, raw, filtered)
- PID control parameters and current values
- Power and duty cycle information
- Heater and tip status
Example output:
setpoint temp: 50 C active temp: 350 C idle temp: 200 C current thermocouple temp: 27.99 C current raw temp: 21.55 C current filtered temp: 21.55 C delta_C: 0.00 C delta_C_integrated: 0.00 C delta_C_derivative: 0.00 C tip power mW: 14750 pid output desired W: 0 pwm duty cycle: 0 switch on?: No tip installed?: Yes state: Off buck state: High power control loop P: 1.00 control loop I: 1.00 control loop D: 0.10 integral windup max: 40.00 control loop period: 300000 uS
-
controlloop
- Description: Likely intended to provide real-time control loop data or adjust control loop parameters.
- Usage:
heater controlloop
- Note: This subcommand currently locks up the serial interface. Use with caution.
-
tip_installed_uptime
- Description: Display the uptime (in seconds) since the current tip was installed or last detected.
- Usage:
heater tip_installed_uptime
- Output: A single integer representing the number of seconds.
Example output:
308
- Altering heater settings or behavior could affect soldering performance and potentially pose safety risks. Always follow proper safety guidelines when working with heating elements.
Commands related to the MXC4005 accelerometer.
mxc4005 [subcommand]
-
magnitude
- Description: Display the current magnitude of acceleration detected by the MXC4005 accelerometer.
- Usage:
mxc4005 magnitude
- Output: A single integer value representing the magnitude of acceleration.
Example output:
1062
- The threshold for the iron being considered in freefall is configured here: https://github.com/iFixit/ifixit-schooner-fw/blob/a248b91345161b3ef3e2e7005d969e072421ee5d/app/src/mxc4005xc.h#L29
- The calculation for detecting if the iron is idle is located here: https://github.com/iFixit/ifixit-schooner-fw/blob/a248b91345161b3ef3e2e7005d969e072421ee5d/app/src/mxc4005xc.c#L191-L192
- Detecting movement or orientation changes of the device.
Thank you for providing that output. I'll update the documentation to reflect this more accurate information:
Commands related to the thermocouple temperature sensor in the soldering iron.
thermocouple [subcommand]
-
get
- Description: Display the current temperature reading from the thermocouple sensor.
- Usage:
thermocouple get
- Output: Provides the temperature reading in Celsius from the thermocouple sensor.
Example output:
THERMOCOUPLE: 27.13 C
- The thermocouple is used for precise temperature measurements, especially for high-temperature applications like the soldering iron tip.
Commands related to the thermistor temperature sensor in the soldering iron.
thermistor [subcommand]
-
get
- Description: Display the current temperature reading from the cold junction thermistor sensor.
- Usage:
thermistor get
- Output: Provides the temperature reading in Celsius from the cold junction thermistor.
Example output:
COLD_JUNC_TEMP: 27.23 C
- The thermistor in this case is specifically used to measure the cold junction temperature.
- The cold junction temperature is important for accurate thermocouple readings, as it's used for temperature compensation.
- Temperature readings are provided in degrees Celsius.
The thermistor (cold junction) and thermocouple work together to provide accurate temperature measurements:
- The thermocouple measures the temperature at the tip of the soldering iron.
- The thermistor measures the temperature at the cold junction (where the thermocouple connects to the measuring circuit).
- The cold junction temperature is used to compensate for the thermocouple reading, improving overall accuracy.
Using both commands together can give you a complete picture of the temperature measurement system in the soldering iron.