The following are instructions for connecting a Bluetooth device for serial communication on Arch Linux using BlueZ 5.31.
The following packages are required:
bluez:bluetoothdbluez-utils:bluetoothctl,rfcomm
| ################################ | |
| # LVGL config loader | |
| # @hpsaturn 2022 | |
| ################################ | |
| # Put this file on the root of your PlatformIO LVGL project | |
| # and add the next line on your env board in the platformio.ini file. | |
| # | |
| # extra_scripts = pre:prebuild.py | |
| # | |
| # The lv_conf.h file should be placed in the root lib folder |
| #!/bin/bash | |
| # Secondary display resolution | |
| W=1920 # Virtual display width | |
| H=1080 # Virtual display height | |
| # Primary display config | |
| P="HDMI-A-0" #is the main screen, it can be calle eDP-1 or eDP1 depending on the driver | |
| O="DisplayPort-0" #can be a virtual (recommended if possible) or real output accepted by the xog driver. | |
| #more info: https://wiki.archlinux.org/title/Extreme_Multihead#VNC |
| [platformio] | |
| src_dir = . | |
| [wifi] | |
| ; ssid = **s | |
| ; password = *** | |
| ssid = ${sysenv.PIO_WIFI_SSID} | |
| password = ${sysenv.PIO_WIFI_PASSWORD} | |
| [common_env_data] |
| import machine | |
| import utime | |
| sensor = machine.ADC(4) | |
| factor = 3.3 / (65355) | |
| led = machine.Pin(25,machine.Pin.OUT) | |
| while True: | |
| read = sensor.read_u16() * factor | |
| temp = 27 - (read - 0.706)/0.001721 |
| #!/bin/bash | |
| cmd=$1 | |
| mem=`ps -eo %mem,cmd --sort=-%mem | grep -i $cmd | awk -F ' ' '{sum += $1} END {print sum}'` | |
| memtotal=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'` | |
| memcmd=`awk 'BEGIN{printf "%.2f\n", (("'$mem'"*"'$memtotal'")/100000)}'` | |
| echo "${memcmd} Mb (${mem}%)" |
| #!/bin/bash | |
| # Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7 | |
| # Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n | |
| # Install Oracle JDK 8 | |
| add-apt-repository ppa:webupd8team/java | |
| apt-get update | |
| apt-get install -y oracle-java8-installer | |
| apt-get install -y unzip make expect # NDK stuff |
| import sys | |
| import time | |
| import getopt | |
| import alsaaudio | |
| def usage(): | |
| sys.stderr.write('usage: recordtest.py [-c <card>] <file>\n') | |
| sys.exit(2) | |
| if __name__ == '__main__': |
| #!/usr/bin/env sh | |
| set -e | |
| if [ -z "$NDK_ROOT" ] && [ "$#" -eq 0 ]; then | |
| echo 'Either $NDK_ROOT should be set or provided as argument' | |
| echo "e.g., 'export NDK_ROOT=/path/to/ndk' or" | |
| echo " '${0} /path/to/ndk'" | |
| exit 1 | |
| else | |
| NDK_ROOT="${1:-${NDK_ROOT}}" |