Setup a cheap, simple bluetooth adapter as a serial console.
THIS IS VERY ADVANCED. YOU PROBABLY DON’T WANT TO DO THIS UNLESS YOU’RE WILLING TO PLAY WITH HARDWARE
This document assumes the Sparkfun Bluetooth Mate Silver (link) is used for the bluetooth serial console.
Connect to your device on the go
Connect the Bluetooth Mate Silver to the Orange Pi Zero UART 1 or 2 on expansion header.
Note: use UART1 if possible. It’s more likely to be present already
|BT Mate Silver Pin||UART 1 Pin||UART 2 Pin|
/boot/armbianEnv.txt and add
uart1 to the
Reboot after applying the changes
The below commands should be run to configure the Bluetooth Mate Silver. You’ll need to adapt these to your needs.
$$$ # Enter command mode V # Display firmware version D # Displays current config SF,1 # Restore to factory defaults ST,0 # Disable remote configuration SR,Z # Erase any stored addresses SU,115K # Set BT serial speed SA,4 # Force entering a pin code to connect SE,1 # Turn on crypo if firmware below 5.40 (on by default otherwise) SM,<value> # sets the mode (6 pairing) SN,<string(max 20 chars)> # Set device name SP,1234 # Set pin code (up to 20 alphanumeric) SY,0000 # Set a lower antenna power mode (0 in this case, FFF4 for -12, FFF8 for -8, FFFC for -4) S|,0A03 # Cycle on for 3 seconds and off for 10 seconds (adjust per how fiddly your bt is to connect) R,1 # Reboot device --- # Exit command mode
Start / enable a new serial tty with the following
# Adjust the default serial-getty config for the BT device/oPi cat > /etc/systemd/system/serial-getty@ttyS1.service <<EOF # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Serial Getty on %I Documentation=man:agetty(8) man:systemd-getty-generator(8) Documentation=http://0pointer.de/blog/projects/serial-console.html BindsTo=dev-%i.device After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service After=rc-local.service # If additional gettys are spawned during boot then we should make # sure that this is synchronized before getty.target, even though # getty.target didn't actually pull it in. Before=getty.target IgnoreOnIsolate=yes [Service] ExecStart=-/sbin/agetty 115200 %I $TERM Type=idle Restart=always UtmpIdentifier=%I TTYPath=/dev/%I TTYReset=yes TTYVHangup=no KillMode=process IgnoreSIGPIPE=no SendSIGHUP=no [Install] WantedBy=getty.target EOF ln -s /etc/systemd/system/serial-getty@ttyS1.service /etc/systemd/system/getty.target.wants systemctl start serial-getty@ttyS1 systemctl enable serial-getty@ttyS1