embeded/odroid2021. 9. 27. 17:21

odroid c2용 18.04 버전정보를 보니 커널이 3.16

# uname -a
Linux odroid 3.16.72-46 #1 SMP PREEMPT Tue Aug 13 18:09:58 -03 2019 aarch64 aarch64 aarch64 GNU/Linux

 

20.04는 커널 버전이 올라갔으려나?

ubuntu-18.04.3-3.16-minimal-odroid-c2-20190814.img
ubuntu-20.04-3.16-minimal-odroid-c2-20210201.img

파일명을 보아하니.. 커널은 둘다 동일하게 3.16이고 배포판 버전만 올라간듯..

 

[링크 : https://wiki.odroid.com/getting_started/os_installation_guide#tab__odroid-c2]

[링크 : https://dn.odroid.com/S905/Ubuntu/]

 

4.17에 대한 글은 2018년도에 멈춰있네..

[링크 : https://www.hardkernel.com/ko/tag/odroid-c2/]

[링크 : https://forum.odroid.com/viewtopic.php?f=135&t=22717&start=850#p226092]

 

'embeded > odroid' 카테고리의 다른 글

g_mass_storage rpi - odroid c2  (0) 2021.09.28
g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
odorid c2 usb otg gadget keyboard as hid  (0) 2021.09.23
odroid c2 OTG와 mass storage  (0) 2021.09.19
Posted by 구차니
embeded/odroid2021. 9. 26. 08:51

방법들은 비슷한데.. 따라하는데 영 안되네?

functions 디렉토리에 hid.usb0 디렉토리를 생성하는데 에러가 발생.

#!/bin/bash
# From the README at https://github.com/girst/hardpass

dtoverlay dwc2
modprobe dwc2
modprobe libcomposite
cd /sys/kernel/config/usb_gadget/
mkdir -p g1
cd g1
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
mkdir -p strings/0x409
echo "fedcba9876543210" > strings/0x409/serialnumber
echo "girst" > strings/0x409/manufacturer
echo "Hardpass" > strings/0x409/product

N="usb0"
mkdir -p functions/hid.$N
echo 1 > functions/hid.usb0/protocol
echo 1 > functions/hid.usb0/subclass
echo 8 > functions/hid.usb0/report_length

echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x85\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x05\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0\\x05\\x01\\x09\\x02\\xa1\\x01\\x09\\x01\\xa1\\x00\\x85\\x02\\x05\\x09\\x19\\x01\\x29\\x03\\x15\\x00\\x25\\x01\\x95\\x03\\x75\\x01\\x81\\x02\\x95\\x01\\x75\\x05\\x81\\x03\\x05\\x01\\x09\\x30\\x09\\x31\\x15\\x81\\x25\\x7f\\x75\\x08\\x95\\x02\\x81\\x06\\xC0\\xC0 > functions/hid.usb0/report_desc

C=1
mkdir -p configs/c.$C/strings/0x409
echo "Config $C: ECM network" > configs/c.$C/strings/0x409/configuration
echo 250 > configs/c.$C/MaxPower
ln -s functions/hid.usb0 configs/c.$C/

ls /sys/class/udc > UDC

[링크 : https://ndb796.tistory.com/481]

[링크 : https://www.isticktoit.net/?p=1383]

[링크 : https://www.sysnet.pe.kr/2/0/11363]

 

혹시 권한 문제인가 해서 추가해도 안되고..

sysfs 특성이라 드라이버에서 허가되지 않는 파일은 생성이 안되는 것 같은데 왜 일까..

# ls -al
drwxr-xr-x 2 root root    0 Sep 26 09:15 functions

# chmod 777 functions/
# ls -al
drwxrwxrwx 2 root root    0 Sep 26 09:15 functions

# mkdir hid.usb0
mkdir: cannot create directory 'hid.usb0': No such file or directory
# touch hid.usb0
touch: cannot touch 'hid.usb0': Permission denied

 

 

+

3.16 커널인데 3.19 이후 부터 된다고. 드라이버 지원(하드웨어 가속)을 포기하고 신버전을 써봐야 할지도?

# ll /lib/modules/3.16.72-46/kernel/drivers/usb/gadget/
total 804
drwxr-xr-x 2 root root  4096 Aug 13  2019 ./
drwxr-xr-x 7 root root  4096 Aug 13  2019 ../
-rw-r--r-- 1 root root 14424 Aug 13  2019 g_acm_ms.ko
-rw-r--r-- 1 root root 23784 Aug 13  2019 g_audio.ko
-rw-r--r-- 1 root root 12048 Aug 13  2019 g_cdc.ko
-rw-r--r-- 1 root root 14920 Aug 13  2019 g_ether.ko
-rw-r--r-- 1 root root 19632 Aug 13  2019 g_ffs.ko
-rw-r--r-- 1 root root 24208 Aug 13  2019 g_hid.ko

# insmod g_hid
insmod: ERROR: could not load module g_hid: No such file or directory

# modprobe g_hid
modprobe: ERROR: could not insert 'g_hid': No such device

# uname -a
Linux odroid 3.16.72-46 #1 SMP PREEMPT Tue Aug 13 18:09:58 -03 2019 aarch64 aarch64 aarch64 GNU/Linux

[링크 : https://forum.odroid.com/viewtopic.php?t=36602]

[링크 : https://forum.odroid.com/viewtopic.php?t=30267]

'embeded > odroid' 카테고리의 다른 글

g_mass_storage ins/rm 실패  (0) 2021.09.28
odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
odorid c2 usb otg gadget keyboard as hid  (0) 2021.09.23
odroid c2 OTG와 mass storage  (0) 2021.09.19
odroid c2 ADC  (1) 2021.09.19
Posted by 구차니
embeded/odroid2021. 9. 23. 18:57

 

# zcat /proc/config.gz  | grep -i dwc
CONFIG_USB_DWC_OTG_HCD=y
# CONFIG_USB_DWC3 is not set
# CONFIG_USB_DWC2 is not set

# dmesg | grep dwc2
[    2.488359] dwc_otg dwc2_b: DWC OTG Controller
[    2.492647] dwc_otg dwc2_b: new USB bus registered, assigned bus number 1
[    2.499387] dwc_otg dwc2_b: irq 63, io mem 0x00000000
[    2.572237] dwc_otg dwc2_a: DWC OTG Controller
[    2.576584] dwc_otg dwc2_a: new USB bus registered, assigned bus number 2
[    2.583313] dwc_otg dwc2_a: irq 62, io mem 0x00000000

# modprobe libcomposite
# lsmod | grep -i libcomposite
libcomposite           46311  0

# dmesg | tail
[  119.062507] SRP: Device mode
[  119.062520] SRP Fail

# ls -al /sys/kernel/config/usb_gadget/
total 0
drwxr-xr-x 2 root root 0 Sep 26 08:44 .
drwxr-xr-x 3 root root 0 Sep 26 08:44 ..

[링크 : https://forum.odroid.com/viewtopic.php?t=36602]

 

hid.usb0 라는걸 생성하려고 하니 생성이 불가능하다고 나온다. 왜일까 ㅠㅠ

# /usr/bin/isticktoit_usb
mkdir: cannot create directory 'functions/hid.usb0': No such file or directory
/usr/bin/isticktoit_usb: line 19: functions/hid.usb0/protocol: No such file or directory
/usr/bin/isticktoit_usb: line 20: functions/hid.usb0/subclass: No such file or directory
/usr/bin/isticktoit_usb: line 21: functions/hid.usb0/report_length: No such file or directory
/usr/bin/isticktoit_usb: line 22: functions/hid.usb0/report_desc: No such file or directory
ln: failed to create symbolic link 'configs/c.1/hid.usb0': No such file or directory
ls: write error: Invalid argument

[링크 : https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/]

 

'embeded > odroid' 카테고리의 다른 글

odroid c2 ubuntu 18.04, 20.04 kernel 버전 정보  (0) 2021.09.27
odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
odroid c2 OTG와 mass storage  (0) 2021.09.19
odroid c2 ADC  (1) 2021.09.19
odroid c2 lircd output 성공  (0) 2021.09.18
Posted by 구차니
embeded/odroid2021. 9. 19. 20:01

J1핀을 제거하면 USB OTG 포트를 전원 입력으로 사용할 수 없게 된다.

이 것은 전원 소비와 발열을 크게 감소시킬 것이다.

odroid-c2는 비디오 재생이나 몇몇 주변장치를 사용하는데 0.8Amp 이상을 소비하는데

USB port에 장치가 연결되면 1.5 A 이상을 연결하길 권장한다.

 

그런데 OTG가 도대체 (?) 머길래 전원 소비와 발열을 줄인다는거지?

Remove the Jumper on J1 if you don't use the USB OTG port as a power input
It will reduce the power consumption and heat significantly.

Since ODROID-C2 can consume current more than 0.8Amp by itself while playing a video file or with some peripherals - keyboard/mouse/WiFi dongle - are attached to USB port, we strongly recommend to use 5V USB charger with minimal 1.5Amp+ can be supplied. Please note that still DC jack works with the same specification of ODROID-C2 apart from USB OTG for power supplying.

[링크 : https://wiki.odroid.com/odroid-c2/hardware/otg_power_enable]

 

일단은 다행히(!) odroid u3에 쓰던 어댑터가 맞는것 같으니 바로 테스트 해봐야겠다..

 

+

 

# modprobe g_mass_storage
modprobe: ERROR: could not insert 'g_mass_storage': Invalid argument
modprobe g_mass_storage file=/dev/mmcblk0p1
# dmesg
[  267.930878] Mass Storage Function, version: 2009/09/11
[  267.930893] LUN: removable file: (no medium)
[  267.930919] no file given for LUN0
[  267.931020] g_mass_storage dwc2_a: failed to start g_mass_storage: -22
[  283.639994] Mass Storage Function, version: 2009/09/11
[  283.640008] LUN: removable file: (no medium)
[  283.640082] LUN: file: /dev/mmcblk0p1
[  283.640088] Number of LUNs=1
[  283.640097] Number of LUNs=1
[  283.640233] g_mass_storage gadget: Mass Storage Gadget, version: 2009/09/11
[  283.640239] g_mass_storage gadget: userspace failed to provide iSerialNumber
[  283.640244] g_mass_storage gadget: g_mass_storage ready

 

아쉽게도(?) otg 꽂힌채로는 바로 인식되진 않고 한번 뽑았다 꽂아주어야 인식을 한다.=

# dmesg
[  352.483089] USB RESET
[  352.562416] usb 1-1.4: new high-speed USB device number 3 using dwc_otg
[  352.566533] USB RESET
[  352.664381] g_mass_storage gadget: high-speed config #1: Linux File-Backed Storage
[  352.665021] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[  352.666447] usb-storage 1-1.4:1.0: Quirks match for vid 0525 pid a4a5: 10000
[  352.666520] scsi0 : usb-storage 1-1.4:1.0
[  353.663221] scsi 0:0:0:0: Direct-Access     Linux    File-Stor Gadget 0316 PQ: 0 ANSI: 2
[  353.664962] sd 0:0:0:0: [sda] 262144 512-byte logical blocks: (134 MB/128 MiB)
[  353.665053] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[  353.674196] sd 0:0:0:0: Attached scsi generic sg0 type 0
[  353.772882] sd 0:0:0:0: [sda] Write Protect is off
[  353.772895] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[  353.773086] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[  353.882776] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[  353.883855] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[  353.993016] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[  354.103316]  sda:
[  354.104539] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[  354.213075] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process
[  354.322785] sd 0:0:0:0: [sda] Attached SCSI disk
[  354.323219] WARN::dwc_otg_pcd_ep_halt:2432: 1 IN XFer In process

 

일단 /dev/sda로 인식이 되었으니 마운트 하고 쓰고 sync도 해보고, umount도 해봄

OTG를 통해 쓰는거다 보니 바로 써지진 않고 sync나 umount 이후에 갱신되는게 확인된다.

# mount /dev/sda /mnt
# ls -al /mnt
total 20862
drwxr-xr-x  3 root root    16384 Jan  1  1970  .
drwxr-xr-x 21 root root     4096 Jan 28  2018  ..
-rwxr-xr-x  1 root root 13622832 Aug 13  2019  Image
drwxr-xr-x  2 root root     2048 Sep 17 21:05 'System Volume Information'
-rwxr-xr-x  1 root root     6816 Jun 12  2018  boot.ini
-rwxr-xr-x  1 root root      988 Jan  5  2017  boot.ini.default
-rwxr-xr-x  1 root root      120 Jan  1  1980  display.bin
-rwxr-xr-x  1 root root      256 Jan  1  1980  edid.bin
-rwxr-xr-x  1 root root    29959 Aug 13  2019  meson64_odroidc2.dtb
-rwxr-xr-x  1 root root  7671719 Aug 13  2019  uInitrd

/mnt# touch test
/mnt# ls -al
total 20862
drwxr-xr-x  3 root root    16384 Sep 19 14:55  .
drwxr-xr-x 21 root root     4096 Jan 28  2018  ..
-rwxr-xr-x  1 root root 13622832 Aug 13  2019  Image
drwxr-xr-x  2 root root     2048 Sep 17 21:05 'System Volume Information'
-rwxr-xr-x  1 root root     6816 Jun 12  2018  boot.ini
-rwxr-xr-x  1 root root      988 Jan  5  2017  boot.ini.default
-rwxr-xr-x  1 root root      120 Jan  1  1980  display.bin
-rwxr-xr-x  1 root root      256 Jan  1  1980  edid.bin
-rwxr-xr-x  1 root root    29959 Aug 13  2019  meson64_odroidc2.dtb
-rwxr-xr-x  1 root root        0 Sep 19 14:55  test
-rwxr-xr-x  1 root root  7671719 Aug 13  2019  uInitrd

# cd /media/boot/
media/boot# ls -al
total 20862
drwxrwxrwx 3 root root    16384 Jan  1  1970  .
drwxr-xr-x 3 root root     4096 Jun 12  2018  ..
-rwxrwxrwx 1 root root 13622832 Aug 13  2019  Image
drwxrwxrwx 2 root root     2048 Sep 17 21:05 'System Volume Information'
-rwxrwxrwx 1 root root     6816 Jun 12  2018  boot.ini
-rwxrwxrwx 1 root root      988 Jan  5  2017  boot.ini.default
-rwxrwxrwx 1 root root      120 Jan  1  1980  display.bin
-rwxrwxrwx 1 root root      256 Jan  1  1980  edid.bin
-rwxrwxrwx 1 root root    29959 Aug 13  2019  meson64_odroidc2.dtb
-rwxrwxrwx 1 root root  7671719 Aug 13  2019  uInitrd

/media/boot# sync
/media/boot# ls -al
total 20862
drwxrwxrwx 3 root root    16384 Jan  1  1970  .
drwxr-xr-x 3 root root     4096 Jun 12  2018  ..
-rwxrwxrwx 1 root root 13622832 Aug 13  2019  Image
drwxrwxrwx 2 root root     2048 Sep 17 21:05 'System Volume Information'
-rwxrwxrwx 1 root root     6816 Jun 12  2018  boot.ini
-rwxrwxrwx 1 root root      988 Jan  5  2017  boot.ini.default
-rwxrwxrwx 1 root root      120 Jan  1  1980  display.bin
-rwxrwxrwx 1 root root      256 Jan  1  1980  edid.bin
-rwxrwxrwx 1 root root    29959 Aug 13  2019  meson64_odroidc2.dtb
-rwxrwxrwx 1 root root        0 Sep 19 14:55  test
-rwxrwxrwx 1 root root  7671719 Aug 13  2019  uInitrd

/media/boot# touch /mnt/t2
:/media/boot# ls -al
total 20862
drwxrwxrwx 3 root root    16384 Jan  1  1970  .
drwxr-xr-x 3 root root     4096 Jun 12  2018  ..
-rwxrwxrwx 1 root root 13622832 Aug 13  2019  Image
drwxrwxrwx 2 root root     2048 Sep 17 21:05 'System Volume Information'
-rwxrwxrwx 1 root root     6816 Jun 12  2018  boot.ini
-rwxrwxrwx 1 root root      988 Jan  5  2017  boot.ini.default
-rwxrwxrwx 1 root root      120 Jan  1  1980  display.bin
-rwxrwxrwx 1 root root      256 Jan  1  1980  edid.bin
-rwxrwxrwx 1 root root    29959 Aug 13  2019  meson64_odroidc2.dtb
-rwxrwxrwx 1 root root        0 Sep 19 14:55  test
-rwxrwxrwx 1 root root  7671719 Aug 13  2019  uInitrd

/media/boot# umount /mnt
/media/boot# ls -al
total 20862
drwxrwxrwx 3 root root    16384 Jan  1  1970  .
drwxr-xr-x 3 root root     4096 Jun 12  2018  ..
-rwxrwxrwx 1 root root 13622832 Aug 13  2019  Image
drwxrwxrwx 2 root root     2048 Sep 17 21:05 'System Volume Information'
-rwxrwxrwx 1 root root     6816 Jun 12  2018  boot.ini
-rwxrwxrwx 1 root root      988 Jan  5  2017  boot.ini.default
-rwxrwxrwx 1 root root      120 Jan  1  1980  display.bin
-rwxrwxrwx 1 root root      256 Jan  1  1980  edid.bin
-rwxrwxrwx 1 root root    29959 Aug 13  2019  meson64_odroidc2.dtb
-rwxrwxrwx 1 root root        0 Sep 19 14:56  t2
-rwxrwxrwx 1 root root        0 Sep 19 14:55  test
-rwxrwxrwx 1 root root  7671719 Aug 13  2019  uInitrd

 

다른 리눅스 노트북과는 연결이 되는데, 윈도우에서도 시도는 해봐야 할 듯.

[링크 : https://forum.odroid.com/viewtopic.php?t=32840]

 

+

멀티 가젯은 머지?

[링크 : https://ndb796.tistory.com/479]

 

+

21.09.26

msg  ㅋㅋㅋㅋ

[링크 : https://www.kernel.org/doc/html/latest/usb/mass-storage.html]

'embeded > odroid' 카테고리의 다른 글

odroid c2 usb otg, libcomposite usb hid  (0) 2021.09.26
odorid c2 usb otg gadget keyboard as hid  (0) 2021.09.23
odroid c2 ADC  (1) 2021.09.19
odroid c2 lircd output 성공  (0) 2021.09.18
lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)  (0) 2021.09.17
Posted by 구차니
embeded/odroid2021. 9. 19. 18:40

1.8 V를 머하는데 쓰지 -ㅁ-?!?!? ㅠㅠ

 

Pin #37 Pin #40
ADC.AIN1 ADC.AIN

/sys/class/saradc/ch1 /sys/class/saradc/ch0

 

ADC's maximum sample rate is 50kSPS. ODROID-C2 has 10bit resolution (0~1023). ODROID-C4/N2 has 12bit resolution (0~4095).
But the actual sample rate is 8kSPS if you access it via sysfs due to the limited file IO speed.

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/adc]

'embeded > odroid' 카테고리의 다른 글

odorid c2 usb otg gadget keyboard as hid  (0) 2021.09.23
odroid c2 OTG와 mass storage  (0) 2021.09.19
odroid c2 lircd output 성공  (0) 2021.09.18
lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)  (0) 2021.09.17
odroid c2 lirc  (0) 2021.09.14
Posted by 구차니
embeded/odroid2021. 9. 18. 00:43

irrecord가 ubuntu 20.04 에서 안되서 일단 18.04로 시도해서 성공.

ubuntu-18.04.3-3.16-minimal-odroid-c2-20190814.img

 

다시 한번 irrecord -f 옵션으로 20.04에서 시도해봐야 할 듯.

+

20.04 에서 해봤는데 -f 옵션으로 raw 처리하니 입력은 받을 수 있는 듯.

값이 미묘하게 다르긴 하지만 되는 것 같기도 하고?

 

 

GPIO IR 회로.

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/lirc_gpio_blaster]

 

간단하게 IR LED를  9번과(IR LED -극) 11번(IR LED +극)에 연결하면 된다.

거리가 60cm 정도만 떨어져도 인식이 안되기 시작해서 문제지 -_-

그래서 TR을 이용해서 전원을 공급받고 GPIO로 On/Off만 해주는 건가..

[링크 : https://wiki.odroid.com/odroid-c2/hardware/expansion_connectors]

 

환경설정 파일

# cat /etc/lirc/lirc_options.conf
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
driver          = default
device          = /dev/lirc0
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/aarch64-linux-gnu/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600

[lircmd]
uinput          = False
nodaemon        = False

[modinit]
code = /sbin/modprobe meson-ir

[lircd-uinput]
add-release-events = True
release-timeout = 50
release-suffix = _EVUP

 

커스텀(?) 리모컨 파일 추가.

서비스 재기동 전에는 해당 디렉토리의 파일을 새로 불러들이진 않는다.

# cat /etc/lirc/lircd.conf.d/monex.lircd.conf

# Please take the time to finish this file as described in
https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.10.0(default) on Fri Sep 17 12:28:52 2021
# Command line used: -d /dev/lirc0
# Kernel version (uname -r): 3.16.72-46
#
# Remote name (as of config file): monex
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr:
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
#     usb dongle? :
# For bundled USB devices: usb vendor id, product id
#     and device string (use dmesg or lsusb):
# Type of device controlled
#     (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:

begin remote

  name  monex
  bits           32
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       8970  4517
  one           561  1692
  zero          561   569
  ptrail        563
  repeat       8970  2289
  gap          107503
  toggle_bit_mask 0x0
  frequency    38000

      begin codes
          key_power                0x10EFEB14 0xFFFFFFFF
          key_menu                 0x10EF3BC4 0xFFFFFFFF
          key_up                   0x10EF49B6 0xFFFFFFFF
          key_down                 0x10EF1BE4 0xFFFFFFFF
          key_left                 0x10EFE916 0xFFFFFFFF
          key_right                0x10EFF906 0xFFFFFFFF
          key_ok                   0x10EF51AE 0xFFFFFFFF
          key_exit                 0x10EF2BD4 0xFFFFFFFF
          key_mute                 0x10EFFB04 0xFFFFFFFF
      end codes

end remote

 

서비스 재기동 및 gpio ir tx 설정

irsend를 통해서 보낼대 조금 귀찮게 디바이스 설정을 해주어야 한다.

$ service lircd stop
$ modprobe lirc_dev
$ modprobe lirc_odroid gpio_out_pin=247 softcarrier=1 invert=1
$ service lircd restart
$ lircd --driver=default --device=/dev/lirc1 --output=/var/run/lirc/lirc1 --pidfile=/var/run/lirc/lirc1.pid
$ irsend SEND_ONCE monex KEY_POWER -d /var/run/lirc/lirc1

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/lirc_gpio_blaster/irblaster_lirc_setup_ubuntu18.04]

'embeded > odroid' 카테고리의 다른 글

odroid c2 OTG와 mass storage  (0) 2021.09.19
odroid c2 ADC  (1) 2021.09.19
lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)  (0) 2021.09.17
odroid c2 lirc  (0) 2021.09.14
odroid c2 i2c  (0) 2021.09.11
Posted by 구차니
embeded/odroid2021. 9. 17. 21:52

ubuntu-18.04.3-3.16-minimal-odroid-c2-20190814.img.xz 파일을 받아서 시도하니 된다.

2020년 중반 이후로 먼가 안된다는 글이 보이던데.. 구버전으로 가니 단번에 되네 -_-

 

아래의 명령어로

$ irrecord -d /dev/lirc0

monex 43인치 UHD 모니터 리모컨 읽은 내용

 $ cat monex.lircd.conf

# Please take the time to finish this file as described in
https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.10.0(default) on Fri Sep 17 12:28:52 2021
# Command line used: -d /dev/lirc0
# Kernel version (uname -r): 3.16.72-46
#
# Remote name (as of config file): monex
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr:
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
#     usb dongle? :
# For bundled USB devices: usb vendor id, product id
#     and device string (use dmesg or lsusb):
# Type of device controlled
#     (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:

begin remote

  name  monex
  bits           32
  flags SPACE_ENC|CONST_LENGTH
  eps            30
  aeps          100

  header       8970  4517
  one           561  1692
  zero          561   569
  ptrail        563
  repeat       8970  2289
  gap          107503
  toggle_bit_mask 0x0
  frequency    38000

      begin codes
          key_power                0x10EFEB14 0xFFFFFFFF
          key_menu                 0x10EF3BC4 0xFFFFFFFF
          key_up                   0x10EF49B6 0xFFFFFFFF
          key_down                 0x10EF1BE4 0xFFFFFFFF
          key_left                 0x10EFE916 0xFFFFFFFF
          key_right                0x10EFF906 0xFFFFFFFF
          key_ok                   0x10EF51AE 0xFFFFFFFF
          key_exit                 0x10EF2BD4 0xFFFFFFFF
          key_mute                 0x10EFFB04 0xFFFFFFFF
      end codes

end remote

 

아래의 명령어로

$ irrecord -d /dev/lirc0 -r

monex 43인치 UHD 모니터 리모컨 읽은 내용

$ cat mo_raw.lircd.conf

# Please take the time to finish this file as described in
https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.10.0(default) on Fri Sep 17 12:39:22 2021
# Command line used: -d /dev/lirc0 -f
# Kernel version (uname -r): 3.16.72-46
#
# Remote name (as of config file): mo_raw
# Brand of remote device, the thing you hold in your hand:
# Remote device model nr:
# Remote device info url:
# Does remote device has a bundled capture device e. g., a
#     usb dongle? :
# For bundled USB devices: usb vendor id, product id
#     and device string (use dmesg or lsusb):
# Type of device controlled
#     (TV, VCR, Audio, DVD, Satellite, Cable, HTPC, ...) :
# Device(s) controlled by this remote:

begin remote

  name  mo_raw
  flags RAW_CODES|CONST_LENGTH
  eps            30
  aeps          100

  gap          107463

      begin raw_codes

          name key_power
             8956    4523     570     559     569     558
              569     561     567    1687     568     559
              568     559     569     560     568     559
              568    1685     569    1685     569    1686
              569     560     568    1685     569    1686
              569    1685     569    1685     570    1686
              569    1685     570    1686     568     562
              566    1687     568     561     567    1685
              569    1686     569     561     567     560
              567     561     567    1686     568     561
              567    1685     569     560     568     560
              567

          name key_menu
             8985    4496     520     608     519     609
              519     608     519    1734     521     608
              519     611     517     608     520     608
              519    1734     521    1733     522    1732
              522     608     520    1733     521    1733
              521    1733     522    1733     522     608
              519     608     520    1733     522     631
              496    1733     522     607     520    1733
              522    1733     522    1733     521    1733
              521     609     518    1734     521     635
              493    1735     523     605     540     589
              540

          name key_exit
             8956    4522     571     560     567     584
              544     560     567    1686     572     557
              568     558     569     562     566     560
              568    1685     569    1686     569    1684
              570     559     569    1684     570    1685
              570    1685     569    1685     569     561
              567    1686     568     560     567     561
              567    1685     569     561     567     560
              568    1686     568    1686     568     564
              564    1686     568    1686     569     561
              567    1685     569    1686     568     560
              568

          name key_up
             8958    4523     570     559     568     560
              567     562     565    1686     569     559
              568     560     568     561     567     561
              566    1684     571    1684     570    1684
              570     560     568    1685     569    1687
              568    1686     568    1685     570     560
              567    1686     568     560     568     561
              566    1686     569     584     543     560
              568    1685     569    1686     569     584
              543    1686     569    1685     569     560
              568    1686     568    1686     572     581
              544

          name key_down
             8957    4525     566     585     543     563
              565     563     565    1685     569     585
              543     561     567     560     567     561
              566    1687     546    1708     546    1710
              545     584     543    1710     545    1711
              544    1712     543    1711     545     583
              544     583     545     585     542    1711
              544    1710     546     585     542    1710
              545    1710     547    1708     545    1710
              545    1709     546     585     542     584
              544    1710     545     585     543     608
              520

          name key_left
             8958    4525     544     584     543     583
              545     585     543    1709     546     584
              543     585     543     583     544     584
              567    1687     571    1683     571    1685
              570     558     570    1684     571    1684
              571    1683     572    1684     571    1683
              572    1682     572    1683     571     559
              569    1684     570     559     569     559
              569    1684     571     558     569     561
              567     559     569    1684     570     561
              567    1684     570    1685     570     583
              544

          name key_right
             8936    4543     576     552     575     553
              575     553     575    1678     577     552
              576     553     574     554     574     577
              554    1677     574    1679     577    1678
              577     553     574    1679     577    1678
              577    1678     577    1678     576    1679
              576    1679     576    1678     577    1677
              578    1678     577     554     574     553
              575    1679     575     553     575     553
              575     552     576     557     571     555
              573    1679     577    1678     576     553
              575

      end raw_codes

end remote

 

irrecord -r  옵션을 주니 세세하게 내용이 다르게 생성된다.

그래도.. raw 옵션주고 만드는데 나중에 추가하기 편하려나? mode2로 생성할때도 raw로 나오니까?

 

이제 odroid c2에 IR LED 달고 출력도 되면 개꿀~!

'embeded > odroid' 카테고리의 다른 글

odroid c2 ADC  (1) 2021.09.19
odroid c2 lircd output 성공  (0) 2021.09.18
odroid c2 lirc  (0) 2021.09.14
odroid c2 i2c  (0) 2021.09.11
odroid c2 wiringpi pinout  (0) 2021.09.10
Posted by 구차니
embeded/odroid2021. 9. 14. 20:21

 

$ cat /etc/lirc/lirc_options.conf
# These are the default options to lircd, if installed as
# /etc/lirc/lirc_options.conf. See the lircd(8) and lircmd(8)
# manpages for info on the different options.
#
# Some tools including mode2 and irw uses values such as
# driver, device, plugindir and loglevel as fallback values
# in not defined elsewhere.

[lircd]
nodaemon        = False
#driver          = devinput
#device          = auto
driver          = default
device          = /dev/lirc0
output          = /var/run/lirc/lircd
pidfile         = /var/run/lirc/lircd.pid
plugindir       = /usr/lib/aarch64-linux-gnu/lirc/plugins
permission      = 666
allow-simulate  = No
repeat-max      = 600
#effective-user =
#listen         = [address:]port
#connect        = host[:port]
#loglevel       = 6
#release        = true
#release_suffix = _EVUP
#logfile        = ...
#driver-options = ...

[lircmd]
uinput          = False
nodaemon        = False

[modinit]
code = /sbin/modprobe meson-ir
# code = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...


[lircd-uinput]
add-release-events = True
release-timeout    = 50
release-suffix     = _EVUP
# add-release-events = False
# release-timeout    = 200
# release-suffix     = _EVUP

 

 

$ ls -al /dev/lirc*
ls: cannot access '/dev/lirc*': No such file or directory
$ sudo service lircd restart
$ ls -al /dev/lirc*
crw-rw---- 1 root video 230, 0 Sep 14 10:35 /dev/lirc0

 

[링크 : https://wiki.odroid.com/odroid-c2/application_note/lirc/lirc_ubuntu18.04]

 

 

[링크 : https://wiki.odroid.com/common/application_note/gpio/ir/lirc_gpioir_ubuntu18.04#tab__odroid-c2]

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/ir]

 

 

[링크 : https://forum.odroid.com/viewtopic.php?t=14201]

  [링크 : https://odroid.com/dokuwiki/doku.php?id=en:c2_enhancement_gpio40]

  [링크 : https://odroid.com/dokuwiki/doku.php?id=en:c2_hardware#expansion_connectors]]

 

+

Pin #11 (GPIO #247) /  왼쪽 위에서 6번째(5번째는 GND)

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/lirc_gpio_blaster#tab__odroid-c2]

 

$ service lircd stop
$ modprobe lirc_dev
$ modprobe lirc_odroid gpio_out_pin=247 softcarrier=1 invert=1
$ service lircd restart

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/lirc_gpio_blaster/irblaster_lirc_setup_ubuntu18.04#tab__odroid-c2]

'embeded > odroid' 카테고리의 다른 글

odroid c2 lircd output 성공  (0) 2021.09.18
lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)  (0) 2021.09.17
odroid c2 i2c  (0) 2021.09.11
odroid c2 wiringpi pinout  (0) 2021.09.10
odroid c2 gpio wiringpi  (0) 2021.09.09
Posted by 구차니
embeded/odroid2021. 9. 11. 23:36

odroid도 i2c가 되긴 한데, 라즈베리 처럼 dt에 통합되지 않아서 조금 아쉽긴 하네

$ modprobe aml_i2c

 

[링크 : https://wiki.odroid.com/odroid-c2/application_note/gpio/i2c#how_to_change_the_i2c_clock_speed]

'embeded > odroid' 카테고리의 다른 글

lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)  (0) 2021.09.17
odroid c2 lirc  (0) 2021.09.14
odroid c2 wiringpi pinout  (0) 2021.09.10
odroid c2 gpio wiringpi  (0) 2021.09.09
odroid c2 계륵이 되었네 (opencl 미지원)  (0) 2021.09.09
Posted by 구차니
embeded/odroid2021. 9. 10. 00:14

'embeded > odroid' 카테고리의 다른 글

odroid c2 lirc  (0) 2021.09.14
odroid c2 i2c  (0) 2021.09.11
odroid c2 gpio wiringpi  (0) 2021.09.09
odroid c2 계륵이 되었네 (opencl 미지원)  (0) 2021.09.09
odroid c2 boot.ini  (0) 2021.09.05
Posted by 구차니