x6100-armbian/README.md

258 wiersze
7.1 KiB
Markdown

2022-04-05 18:58:06 +00:00
# x6100-armbian
tools and scripts to build armbian for the x6100
2022-04-05 19:37:27 +00:00
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2022-04-05 19:55:42 +00:00
![armbian on x6100](docs/armbian_on_x6100.jpg)
2022-04-05 19:37:27 +00:00
# requirements
2022-04-16 08:57:44 +00:00
- SD card update image
2022-04-05 19:37:27 +00:00
- access to the x6100 (or a way to extract files form the update image)
2022-04-08 18:20:22 +00:00
# Bootup OS selection
2022-04-16 08:57:44 +00:00
the Image build by this repo has multiple boot options,
based on which button is pressed on startup of the Device.
2022-04-08 18:20:22 +00:00
currently the buttons under the screen are used.
2022-04-09 18:26:21 +00:00
- no Button: Boot internal storage (X6100 orginal OS)
- 1 Button: stock Kernel + Armbian with X6100 APP on screen
2022-04-18 16:34:14 +00:00
- 2 Button: stock Kernel + Armbian with xfce on screen + X6100 APP hidden but running for CAT and VNC on port 5901
2022-04-08 18:20:22 +00:00
- 3 Button: Armbian Kernel + boot to console
Notes:
- you can release the button as soon the button backlight LED come on.
- Armbian Kernel currently has no support for the screen
2022-04-16 08:57:57 +00:00
# Status
| | WiFi | BT | Local | USB-C |
|:----------- |:---- |:---- |:----- | :----- |
| CAT | ✅ | ❔ | ✅ | ✅ |
| RF Audio RX | ✅ | ❔ | ✅ | ✅ |
| RF Audio TX | ❌ | ❔ | ❌ | ✅ |
| I/Q | ⁉ | ⁉ | ⁉ | ⁉ |
✅ = Tested and working
❔ = Needs testing and most likely little code changes
❌ = Not working at the moment but possible in theory
2022-04-16 17:42:03 +00:00
⁉ = unknown if possible needs research
2022-04-16 08:57:57 +00:00
Note:
local means running on the SoC in Linux on the X6100
2022-04-08 18:20:22 +00:00
# VNC
2022-04-16 08:57:44 +00:00
after armbian init setup, a VNC server will be running on port 5900 powered by lightdm.
Note:
the bad build in WiFi Antenna can make a VNC connection Instable very fast.
2022-04-14 12:16:21 +00:00
## noVNC
the VNC server can be accessed via a webbrowser:
```
http://<x6100 IP>:6080/vnc_auto.html
```
# WiFi / Network config
2022-04-16 08:57:44 +00:00
on the command line use `nmtui` or use the Network Manager UI after login.
## open network ports
| Port | Software |
|:--------- |:--------------------------------------------------------- |
| TCP 9090 | RAW CAT |
| TCP 7000 | RF RX (audio/x-raw,rate=16000,channels=2,format=S16LE) |
| TCP 6080 | noVNC |
2022-04-18 16:34:14 +00:00
| TCP 6081 | noVNC APP (Only running when Button 2 where pressed) |
2022-04-16 17:42:03 +00:00
| TCP 5900 | VNC (xfce) |
2022-04-18 16:34:14 +00:00
| TCP 5901 | VNC APP (Only running when Button 2 where pressed) |
| TCP 4532 | rigctld |
| TCP 3389 | xrdp (untested) |
| TCP 22 | SSH |
# Audio via Network
with armbian booted the X6100 will open a TCP server on port 7000 to allow access to the RX audio stream.
## getting RX audio steam (Linux)
this will create a `X6100_RX.monitor` pulse device and connect in to the X6100
```sh
2022-04-16 08:26:10 +00:00
export X6100_IP=<IP of the x6100>
pactl load-module module-null-sink sink_name=X6100_RX sink_properties=device.description=X6100_RX
2022-04-16 08:26:10 +00:00
gst-launch-1.0 tcpclientsrc port=7000 host=${X6100_IP} ! audio/x-raw,rate=16000,channels=2,format=S16LE ! pulsesink device=X6100_RX client-name=X6100
```
# CAT via Network
the X6100 runs a `rigctld` on TCP port 4532.
2022-04-16 08:57:44 +00:00
for RAW Serial access via Network use TCP port 9990.
2022-04-16 08:26:10 +00:00
## Virtual Serial port on Linux
```sh
export X6100_IP=<IP of the x6100>
sudo socat pty,link=/dev/ttyX6100Cat,raw,echo=0,user=${USER} tcp:${X6100_IP}:9990
```
2022-04-16 08:57:44 +00:00
## wsjtx config
for network or local access via Hamlib use `Hamlib NET rigctl` with the IP of the X6100.
`127.0.0.1` is fine for local use.
![wsjtx rigctld config](docs/wsjtx_network.png
)
2022-04-16 08:26:10 +00:00
# Xorg
## virtual FHD
2022-04-16 08:57:44 +00:00
for setting up the screen with a virtual FHD resolution
2022-04-16 08:26:10 +00:00
```sh
xrandr --output None-1 --mode 480x800 --panning 1920x1080
```
2022-04-05 19:37:27 +00:00
# build steps
## extract uboot:
```sh
2022-04-05 19:37:27 +00:00
dd if=X6100-sdcard-20220219.img of=uboot_sdcard.bin bs=1024 skip=8 count=512 seek=0
```
## extract kernel and kernel modules
we need:
- zImage
- sun8i-r16-x6100.dtb
2022-04-16 08:57:44 +00:00
- kernel modules found in /lib/modules/5.8.9
2022-04-05 19:37:27 +00:00
put the files to /userpatches/overlay/extracted
example:
```
└── userpatches
└── overlay
...
├── extracted
│   ├── modules
│   │   └── 5.8.9
│   │   ├── kernel
...........
│   │   ├── modules.alias
│   │   ├── modules.alias.bin
│   │   ├── modules.builtin
│   │   ├── modules.builtin.bin
│   │   ├── modules.builtin.modinfo
│   │   ├── modules.dep
│   │   ├── modules.dep.bin
│   │   ├── modules.devname
│   │   ├── modules.order
│   │   ├── modules.softdep
│   │   ├── modules.symbols
│   │   └── modules.symbols.bin
│   ├── sun8i-r16-x6100.dtb
│   └── zImage
```
## build armbian:
```sh
2022-04-05 19:37:27 +00:00
git clone https://github.com/armbian/build --depth=1
cp -r userpatches/ build/
cd build
./compile.sh docker BOARD=lime-a33 BSPFREEZE=yes BRANCH=current RELEASE=sid BUILD_MINIMAL=no BUILD_DESKTOP=yes KERNEL_ONLY=no KERNEL_CONFIGURE=no DESKTOP_ENVIRONMENT=xfce DESKTOP_ENVIRONMENT_CONFIG_NAME=config_base DESKTOP_APPGROUPS_SELECTED="3dsupport browsers" COMPRESS_OUTPUTIMAGE=sha,gpg,img
2022-04-05 19:37:27 +00:00
```
## install on sdcard
install armbian:
```sh
2022-04-05 19:37:27 +00:00
dd if=output/images/Armbian_22.05.0-trunk_Lime-a33_buster_current_5.15.32_xfce_desktop.img of=/dev/<SDCARD>
```
install uboot:
```sh
2022-04-05 19:37:27 +00:00
dd if=uboot_sdcard.bin of=/dev/<SDCARD> bs=1024 seek=8
```
# booting armbian kernel
Note:
currently the screen driver src is not public, resulting in no screen output.
(kernel/drivers/gpu/drm/panel/panel-jlt4013a-pss.ko)
change:
/userpatches/overlay/boot.cmd
from:
```sh
2022-04-05 19:37:27 +00:00
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}/zImage_org
```
to:
```sh
2022-04-05 19:37:27 +00:00
load ${devtype} ${devnum} ${kernel_addr_r} ${prefix}/zImage
```
if changed live on the x6100 rebuild:
```sh
mkimage -C none -A arm -T script -d boot.cmd boot.scr
```
# starting radio UI
Using ssh or serial:
```sh
/etc/init.d/lightdm stop
/root/chroot_onboard.sh
/etc/init.d/S99userappstart start
```
# working with the device tree
```sh
dtc -I dtb -O dts sun8i-r16-x6100.dtb > sun8i-r16-x6100.dts
dtc -I dts -O dtb sun8i-r16-x6100.dts > sun8i-r16-x6100.dtb
2022-04-07 19:07:57 +00:00
```
# uboot
2022-04-08 15:27:59 +00:00
## get all gpio
```sh
gpio status -a
```
2022-04-07 19:07:57 +00:00
## get button state
this code checks the buttons below the screen.
number 1 is the left most.
```sh
#set matrix row
gpio clear PG6
if gpio input PE16 ; then
echo 1
elif gpio input PE17 ; then
echo 2
elif gpio input PE11 ; then
echo 3
else
echo none
fi
#reset matrix
gpio input PG6
```