Skip to content

PinePhone

omfreebdy includes a small set of phone-specific helpers for the FreeBSD PinePhone Pro port. They assume the kernel exposes the current device nodes and sysctls:

  • dev.stk3311.0.* for the Sensortek proximity/light sensor
  • dev.mpu6500.0.* for the InvenSense accelerometer/gyro
  • /dev/led/led-red, /dev/led/led-green, /dev/led/led-blue for the notification LED

When working from a development host, use the repeatable mise tasks instead of ad hoc scp or one-off shell fragments:

PHONE_SSH=pinephone mise run phone:install
PHONE_SSH=pinephone mise run phone:status
PHONE_SSH=pinephone mise run phone:sensors json
PHONE_SSH=pinephone mise run phone:led notify blue 2

wifi-manager is the phone-facing network UI. It auto-detects the native FreeBSD wlan* path first, starts or talks to wpa_supplicant, scans through wpa_cli, and opens a fuzzel picker. Saved networks are marked with +; the current network is marked with *; secure networks prompt for a password only when the SSID is not already saved.

wifi-manager # fuzzel picker
wifi-manager scan # noninteractive scan
wifi-manager status # current WPA/DHCP state
wifi-manager connect "SSID" "password"
wifi-manager disconnect

The privileged pieces go through /usr/local/libexec/omfreebdy-wifi-root and /usr/local/etc/sudoers.d/omfreebdy-wifi, not a general root shell. On the PinePhone Pro this expects boot to create wlan0 from bwfm_sdio0; if the driver is loaded but no VAP exists, fix the rc.conf WiFi path rather than teaching the UI to guess a wlandev.

screen-toggle controls the active Wayland output. phone-screen-setup installs the managed Sway binding for the side power key.

screen-toggle off
screen-toggle on
screen-toggle toggle
screen-toggle status
phone-screen-setup

start-lisgd-sway runs the phone swipe gestures under Sway. It finds the Goodix touchscreen from kern.evdev, repairs the Sway session environment when restarted from SSH, and expects /dev/input/event* to be group-readable by input.

start-lisgd-sway

The phone install task applies the matching devfs rule:

add path 'input/event*' mode 0660 group input

phone-sensors is a read-only status tool around the kernel sysctls.

phone-sensors
phone-sensors json
phone-sensors near
phone-sensors watch 1

The values are intentionally raw right now. near is the only policy-level value: 1 means the proximity sensor says something is close, 0 means clear.

phone-proximity-monitor is opt-in. It is not installed as an autostart daemon yet because false positives should not blank the phone until the threshold is tuned.

phone-proximity-monitor status
phone-proximity-monitor dry-run 10
phone-proximity-monitor run

The SSH task refuses the long-running live monitor by default:

mise run phone:proximity status
mise run phone:proximity dry-run 10
PHONE_ALLOW_PROXIMITY_RUN=1 mise run phone:proximity run

By default it requires two consecutive near samples before turning the screen off and two consecutive far samples before turning it back on. Tune with environment variables:

PHONE_PROXIMITY_INTERVAL=1 \
PHONE_PROXIMITY_OFF_COUNT=3 \
PHONE_PROXIMITY_ON_COUNT=2 \
phone-proximity-monitor run

phone-led controls the RGB LED through a narrow root helper installed at /usr/local/libexec/omfreebdy-phone-root. The helper only accepts LED commands and is exposed through /usr/local/etc/sudoers.d/omfreebdy-phone.

phone-led status
phone-led blue
phone-led amber
phone-led notify green 2
phone-led off