BG7IYN 发布的文章

emuelec evtest the keypad

ark@rgb10:~$ evtest
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0: rk8xx_pwrkey
/dev/input/event1: rockchip,rk817-codec Headphones
/dev/input/event2: odroidgo2_joypad
Select the device event number [0-2]: 2
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x101
Input device name: "odroidgo2_joypad"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)

Event code 304 (BTN_SOUTH)
Event code 305 (BTN_EAST)
Event code 307 (BTN_NORTH)
Event code 308 (BTN_WEST)
Event code 310 (BTN_TL)
Event code 311 (BTN_TR)
Event code 312 (BTN_TL2)
Event code 313 (BTN_TR2)
Event code 544 (BTN_DPAD_UP)
Event code 545 (BTN_DPAD_DOWN)
Event code 546 (BTN_DPAD_LEFT)
Event code 547 (BTN_DPAD_RIGHT)
Event code 704 (BTN_TRIGGER_HAPPY1)
Event code 705 (BTN_TRIGGER_HAPPY2)
Event code 706 (BTN_TRIGGER_HAPPY3)
Event code 707 (BTN_TRIGGER_HAPPY4)
Event code 708 (BTN_TRIGGER_HAPPY5)
Event code 709 (BTN_TRIGGER_HAPPY6)

Event type 3 (EV_ABS)

Event code 0 (ABS_X)
  Value      0
  Min     -900
  Max      899
  Fuzz      32
  Flat      32
Event code 1 (ABS_Y)
  Value      0
  Min     -900
  Max      899
  Fuzz      32
  Flat      32

Properties:
Testing ... (interrupt to exit)
Event: time 1611323493.496528, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323493.496528, -------------- SYN_REPORT ------------
Event: time 1611323493.616278, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323493.616278, -------------- SYN_REPORT ------------
Event: time 1611323496.080396, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 1
Event: time 1611323496.080396, -------------- SYN_REPORT ------------
Event: time 1611323496.228346, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 0
Event: time 1611323496.228346, -------------- SYN_REPORT ------------
Event: time 1611323496.732352, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323496.732352, -------------- SYN_REPORT ------------
Event: time 1611323496.860450, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323496.860450, -------------- SYN_REPORT ------------
Event: time 1611323497.264413, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 1
Event: time 1611323497.264413, -------------- SYN_REPORT ------------
Event: time 1611323497.372320, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 0
Event: time 1611323497.372320, -------------- SYN_REPORT ------------
Event: time 1611323497.696433, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323497.696433, -------------- SYN_REPORT ------------
Event: time 1611323497.808297, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323497.808297, -------------- SYN_REPORT ------------
Event: time 1611323498.416461, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 1
Event: time 1611323498.416461, -------------- SYN_REPORT ------------
Event: time 1611323498.540424, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 0
Event: time 1611323498.540424, -------------- SYN_REPORT ------------
Event: time 1611323498.940350, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323498.940350, -------------- SYN_REPORT ------------
Event: time 1611323499.028463, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323499.028463, -------------- SYN_REPORT ------------
Event: time 1611323499.636405, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323499.636405, -------------- SYN_REPORT ------------
Event: time 1611323499.760405, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323499.760405, -------------- SYN_REPORT ------------
Event: time 1611323500.084310, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 1
Event: time 1611323500.084310, -------------- SYN_REPORT ------------
Event: time 1611323500.512354, type 1 (EV_KEY), code 545 (BTN_DPAD_DOWN), value 0
Event: time 1611323500.512354, -------------- SYN_REPORT ------------
Event: time 1611323500.724398, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323500.724398, -------------- SYN_REPORT ------------
Event: time 1611323501.132367, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323501.132367, -------------- SYN_REPORT ------------
Event: time 1611323501.388362, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 1
Event: time 1611323501.388362, -------------- SYN_REPORT ------------
Event: time 1611323501.732448, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 0
Event: time 1611323501.732448, -------------- SYN_REPORT ------------
Event: time 1611323502.112278, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 1
Event: time 1611323502.112278, -------------- SYN_REPORT ------------
Event: time 1611323502.376336, type 1 (EV_KEY), code 544 (BTN_DPAD_UP), value 0
Event: time 1611323502.376336, -------------- SYN_REPORT ------------
Event: time 1611323502.668349, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 1
Event: time 1611323502.668349, -------------- SYN_REPORT ------------
Event: time 1611323502.888432, type 1 (EV_KEY), code 546 (BTN_DPAD_LEFT), value 0
Event: time 1611323502.888432, -------------- SYN_REPORT ------------
Event: time 1611323503.160290, type 1 (EV_KEY), code 547 (BTN_DPAD_RIGHT), value 1
Event: time 1611323503.160290, -------------- SYN_REPORT ------------
Event: time 1611323503.328259, type 1 (EV_KEY), code 547 (BTN_DP

在 emuelec-autostart.service 里, 执行了/storage/.config/autostart.sh

在autostart.sh的结尾, 又执行了 /storage/.config/custom_start.sh

最后一步, 通过 emustation.service, 把/usr/bin/emulationstation启动起来

通过ScreenScraper自动下载游戏说明和截图
首先到 https://www.screenscraper.fr/ 注册一个帐号, 需要邮箱验证

在EmuELEC界面上, 通过 SCRAPE 菜单, 填充帐号和口令, 依次选择
Scrape From: SCREENSCRAPER
Image Source: SCREENSHOT(游戏运行画面), TITLE SCREENSHOT(游戏开始画面), MIX (游戏运行截图+游戏盒子合并在一起的一张图)
Box Source: NONE (游戏包装, 2d或3d, 因为色深为24bit, 文件size会比较大, 都是200~400K大小, 如果用列表展示, 就不需要下载这个)
Logo Source: WHEEL
Scrape Ratings: YES
Scrape Videos: NO
然后点击Scrape Now, 选择要下载的集合, 选择处理冲突的方式, 建议自动.

系统就会在后台自动下载, 因为来源在国外所以速度会比较慢.

修改时区
系统默认时区为墨西哥, 界面上没有修改时区的地方, 需要命令行登录后修改 /emuelec/configs/emuelec.conf , 里面有timezone配置. 改为

1
system.timezone=Asia/Shanghai
连发键的设置Autofire, Turbo Button, Duty Cycle
这个其实是RetroArch的配置, 和以往的连发键设置不太一样, RetroArch用的是开关触发的机制, 有三处相关的设置
Settings->Input->Turbo Period, 连发键开启时, 在连发当中每次按下的时间长度(多少帧)
Settings->Input->Duty Cycle, 连发键开启时, 在连发当中按下的时间占空比
Settings->Input->User/Port[1,2,3,4] Binds->User/Port[1,2,3,4] Turbo, 开启连发的键

使用方法是, 按住需要连发的按键后, 按一下开启连发的键, 这个按住的键就开启连发了. 这个开启连发的效果只在按住时有效, 松开按键后连发的效果就消失, 需要再来一遍.

输入设备按键测试
查看所有输入设备, 列出各设备对应的event编号

1
cat /proc/bus/input/devices
输入设备测试

1
2
3
4

手柄测试, 需要对应上面命令输出的js编号

jstest --event /dev/input/js0

通用的输入事件测试, 需要对应上面命令产生的event编号

evtest /dev/input/event3
对于乐视尚酷版手柄, 无法设置select键的问题: 这个手柄在输入设备里会产生两个设备, 分别是

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
I: Bus=0003 Vendor=0101 Product=1d79 Version=0110
N: Name="MY-POWER LeWGP-201"
P: Phys=usb-xhci-hcd.0.auto-1.4/input0
S: Sysfs=/devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.4/1-1.4:1.0/0003:0101:1D79.0003/input/input4
U: Uniq=
H: Handlers=js0 event4
B: PROP=0
B: EV=1b
B: KEY=7fff0000 0 0 0 0 0 0 0 0 0
B: ABS=3063f
B: MSC=10

I: Bus=0003 Vendor=0101 Product=1d79 Version=0110
N: Name="MY-POWER LeWGP-201"
P: Phys=usb-xhci-hcd.0.auto-1.4/input1
S: Sysfs=/devices/c9000000.dwc3/xhci-hcd.0.auto/usb1/1-1/1-1.4/1-1.4:1.1/0003:0101:1D79.0004/input/input5
U: Uniq=
H: Handlers=kbd event5
B: PROP=0
B: EV=1f
B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 120c13 b17c000 267bfa d941dfed 9e1680 4400 0 10000002
B: REL=40
B: ABS=1 0
B: MSC=10
其中js0:event4设备可以响应除了back键和底下一排三个键以外其他所有按键, 而kbd:event5设备则正好相反. 可以通过evremap将event5的按键映射到event4

1
2

Enable 'BACK' key on LeWGP-201 gamepad

evremap /dev/input/by-id/usb-MY-POWER_LeWGP-201-event-if01 /dev/input/by-id/usb-MY-POWER_LeWGP-201-event-joystick
将其添加到 /storage/.config/custom_start.sh 文件中, 将来开机就会自动生效.

另外对于乐视尚酷版手柄在连接后每隔几秒钟会断开一秒(断开时可以看到手柄上方4个灯一起闪, 连接好以后应该是只亮一个灯的)的问题, 这个通过dmesg看并无硬件通断事件, 如果连接头连接在usbhub上就容易有这个问题, 在R3300L上, 通过otg口连接到盒子的microusb口, 就不会出现断开的问题了. 推断是因为乐视这个接收头对电压的要求较高, usbhub的电压不足以使其稳定工作所致.

portapack h2+ v3.4 pcb support wm8731 portapack.cpp change to support codec

portapach h2+ v3.4 pcb support wm8731

change portapack.cpp to support wm8731 codec replace ak4951

https://github.com/eried/portapack-mayhem/blob/next/firmware/application/portapack.cpp

static const portapack::cpld::Config& portapack_cpld_config() {

return (portapack_model() == PortaPackModel::R2_20170522)
    ? portapack::cpld::rev_20170522::config
    : portapack::cpld::rev_20170522::config    //2. Change 20150901 to 20170522 support H1/H2 TFT  20150901 cpld is old tft driver
    ;

}

Backlight* backlight() {

return (portapack_model() == PortaPackModel::R2_20170522)
    ? static_cast<portapack::Backlight*>(&backlight_cat4004)
    : static_cast<portapack::Backlight*>(&backlight_cat4004);  //1.Change ON_OFF to cat 4004

}

download changed fw v.1.3.0
download changed fw v.1.3.0 site 2

pistar 4.1.2 Oled Display Close not boot problem sloved

admin->live log

I: 2020-12-23 08:49:41.579 Loaded 162513 IDs to lookup table - /usr/local/etc/DMRIds.dat
I: 2020-12-23 08:49:41.580 DMR RF Parameters
I: 2020-12-23 08:49:41.580 Id: 3116449
I: 2020-12-23 08:49:41.580 Color Code: 1
I: 2020-12-23 08:49:41.580 Self Only: no
I: 2020-12-23 08:49:41.580 Embedded LC Only: no
I: 2020-12-23 08:49:41.580 Dump Talker Alias Data: yes
I: 2020-12-23 08:49:41.580 Prefixes: 0
I: 2020-12-23 08:49:41.580 Call Hang: 3s
I: 2020-12-23 08:49:41.580 TX Hang: 4s
I: 2020-12-23 08:49:41.580 Mode Hang: 20s
I: 2020-12-23 08:49:41.581 OVCM: off
I: 2020-12-23 08:49:41.581 DMR Roaming Beacons Type: off
I: 2020-12-23 08:49:41.582 Started the DMR Id lookup reload thread
I: 2020-12-23 08:49:41.726 Interfaces Info
I: 2020-12-23 08:49:41.728 IPv4: lo:127.0.0.1
I: 2020-12-23 08:49:41.728 IPv4: wlan0:192.168.83.123
I: 2020-12-23 08:49:41.728 Default interface is : wlan0
I: 2020-12-23 08:49:41.728 IP to show: wlan0:192.168.83.123
M: 2020-12-23 08:49:41.728 MMDVMHost-20200503_Pi-Star_v4 is running
M: 2020-12-23 08:50:12.114 Unknown packet from the master
M: 2020-12-23 08:50:12.114 0000: 4D 53 54 4E 41 43 00 2F 8D A1 MSTNAC./..
M: 2020-12-23 08:50:22.149 Unknown packet from the master
M: 2020-12-23 08:50:22.149 0000: 4D 53 54 4E 41 43 00 2F 8D A1 MSTNAC./..
M: 2020-12-23 08:50:32.171 Unknown packet from the master
M: 2020-12-23 08:50:32.171 0000: 4D 53 54 4E 41 43 00 2F 8D A1 MSTNAC./..
E: 2020-12-23 08:50:51.988 DMR, Connection to the master has timed out, retrying connection
M: 2020-12-23 08:50:51.988 DMR, Closing DMR Network
M: 2020-12-23 08:50:51.988 DMR, Opening DMR Network
M: 2020-12-23 08:51:22.712 DMR, Logged into the master successfully
M: 2020-12-23 08:52:41.672 Closing the MMDVM
I: 2020-12-23 08:52:42.616 Stopped the DMR Id lookup reload thread
M: 2020-12-23 08:52:42.616 DMR, Closing DMR Network
I: 2020-12-23 08:52:42.617 MMDVMHost-20200503_Pi-Star_v4 exited on receipt of SIGTERM

problem is Unknown packet from the master

go to http://pi-star/admin/expert/ssh_access.php

so run
sudo pistar-mmdvmhshatflash hs_hat
to update fw to 1.5.2 problem sloved.
after update:
Radio Info
Trx Listening DMR
Tx 432.330000 MHz
Rx 432.330000 MHz
FW HS_Hat:v1.5.2
TCXO 14.7456 MHz

update new hs firmware log

pi-star login: pi-star
Password:
Linux pi-star 4.19.97+ #1294 Thu Jan 30 13:10:54 GMT 2020 armv6l

╔═══════════════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██╗ ███████╗████████╗ █████╗ ██████╗ ║
║ ██╔══██╗██║ ██╔════╝╚══██╔══╝██╔══██╗██╔══██╗ ║
║ ██████╔╝██║█████╗███████╗ ██║ ███████║██████╔╝ ║
║ ██╔═══╝ ██║╚════╝╚════██║ ██║ ██╔══██║██╔══██╗ ║
║ ██║ ██║ ███████║ ██║ ██║ ██║██║ ██║ ║
║ ╚═╝ ╚═╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ║
║ ║
╚═══════════════════════════════════════════════════════════════════════╝
The Pi-Star Dashboard can be found at one of the following locations:
http://pi-star/ http://pi-star.local/ http://192.168.83.123/

Pi-Star's disk is read-only by default, enable read-write with "rpi-rw".
Pi-Star built by Andy Taylor (MW0MWZ), pi-star tools all start "pistar-".

                                                                         
                 Welcome to Pi-Star: v4.1.2
                                                                         

pi-star@pi-star(rw):~$ sudo pistar-mmdvmhshatflash hs_hat
MMDVM_HS_Hat-v1.4.7 20180821 14.7456MHz ADF7021 FW by CA6JAU GitID #b14548e
Press any key to write the hs_hat firmware to this modem or Ctrl-C to quit...
Flashing your hs_hat modem to the latest version
--2020-12-23 09:04:23-- http://github.com/juribeparada/MMDVM_HS/releases/dow
nload/v1.5.2/install_fw_hshat.sh
Resolving github.com (github.com)... 13.250.177.223
Connecting to github.com (github.com)|13.250.177.223|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/juribeparada/MMDVM_HS/releases/download/v1.5.2/i
nstall_fw_hshat.sh [following]
--2020-12-23 09:04:23-- https://github.com/juribeparada/MMDVM_HS/releases/do
wnload/v1.5.2/install_fw_hshat.sh
Connecting to github.com (github.com)|13.250.177.223|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/805
89711/1bfc6b00-21fa-11eb-88dd-be66d5eded92?X-Amz-Algorithm=AWS4-HMAC-SHA256&X
-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201223%2Fus-east-1%2Fs3%2Faws4_reque
st&X-Amz-Date=20201223T090424Z&X-Amz-Expires=300&X-Amz-Signature=810ba991f211
b063377c30b7a3991b787e90b9675426b90f7eb45fdf99ac6a53&X-Amz-SignedHeaders=host
&actor_id=0&key_id=0&repo_id=80589711&response-content-disposition=attachment
%3B%20filename%3Dinstall_fw_hshat.sh&response-content-type=application%2Focte
t-stream [following]
--2020-12-23 09:04:24-- https://github-production-release-asset-2e65be.s3.am
azonaws.com/80589711/1bfc6b00-21fa-11eb-88dd-be66d5eded92?X-Amz-Algorithm=AWS
4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20201223%2Fus-east-1%2F
s3%2Faws4_request&X-Amz-Date=20201223T090424Z&X-Amz-Expires=300&X-Amz-Signatu
re=810ba991f211b063377c30b7a3991b787e90b9675426b90f7eb45fdf99ac6a53&X-Amz-Sig
nedHeaders=host&actor_id=0&key_id=0&repo_id=80589711&response-content-disposi
tion=attachment%3B%20filename%3Dinstall_fw_hshat.sh&response-content-type=app
lication%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-pro
duction-release-asset-2e65be.s3.amazonaws.com)... 52.216.106.107
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github
-production-release-asset-2e65be.s3.amazonaws.com)|52.216.106.107|:443... con

  1. HTTP request sent, awaiting response... 200 OK

Length: 3064 (3.0K) [application/octet-stream]
Saving to: ‘/tmp/mmdvmhshatfirmware/flash.sh’

/tmp/mmdvmhshatfirm 100%[================>] 2.99K --.-KB/s in 0.003s

2020-12-23 09:04:26 (1.05 MB/s) - ‘/tmp/mmdvmhshatfirmware/flash.sh’ saved [3
064/3064]

FINISHED --2020-12-23 09:04:26--
Total wall clock time: 4.5s
Downloaded: 1 files, 3.0K in 0.003s (1.05 MB/s)
./flash.sh: line 29: [: =: unary operator expected
Downloading latest firmware (stable)...
% Total % Received % Xferd Average Speed Time Time Time Curre
nt

                             Dload  Upload   Total   Spent    Left  Speed

0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--
0 643 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:--
100 643 100 643 0 0 341 0 0:00:01 0:00:01 --:--:-- 34
1
0 0 0 0 0 0 0 0 --:--:-- 0:00:02 --:--:--
0 50900 0 0 0 0 0 0 --:--:-- 0:00:04 --:--:--
0 50900 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:--
0 50900 0 0 0 0 0 0 --:--:-- 0:00:05 --:--:--
0 50900 0 0 0 0 0 0 --:--:-- 0:00:06 --:--:--
33 50900 33 16972 0 0 2167 0 0:00:23 0:00:07 0:00:16 327
52 50900 52 26564 0 0 3041 0 0:00:16 0:00:08 0:00:08 572
52 50900 52 26564 0 0 2728 0 0:00:18 0:00:09 0:00:09 572
52 50900 52 26564 0 0 2499 0 0:00:20 0:00:10 0:00:10 530
52 50900 52 26564 0 0 2290 0 0:00:22 0:00:11 0:00:11 530
100 50900 100 50900 0 0 4128 0 0:00:12 0:00:12 --:--:-- 754
2
Cloning into 'STM32F10X_Lib'...
remote: Enumerating objects: 193, done.
remote: Total 193 (delta 0), reused 0 (delta 0), pack-reused 193
Receiving objects: 100% (193/193), 3.28 MiB | 100.00 KiB/s, done.
Resolving deltas: 100% (71/71), done.
Raspberry Pi 2 or Pi Zero W detected
stm32flash Arduino_STM32_0.9

http://github.com/rogerclarkmelbourne/arduino_stm32

Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version : 0x22
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0410 (Medium-density)

  • RAM : 20KiB (512b reserved by bootloader)
  • Flash : 128KiB (sector size: 4x1024)
  • Option RAM : 16b
  • System RAM : 2KiB
    Write to memory

Erasing memory
Wrote and verified address 0x0800c6d4 (100.00%) Done.

Starting execution at address 0x08000000... done.

Flashing your hs_hat modem complete, press any key to reboot your Pi-Star Sys
tem...
pi-star@pi-star(rw):~$
pi-star@pi-star(rw):~$
Session closed.

White On Black
Color Terminal