'2021/09'에 해당되는 글 58건

  1. 2021.09.23 rpi 4 lirc tx, rx
  2. 2021.09.22 먼가 만들어 볼까
  3. 2021.09.21 220V 전원
  4. 2021.09.20 피곤피곤
  5. 2021.09.19 odroid c2 OTG와 mass storage
  6. 2021.09.19 odroid c2 ADC
  7. 2021.09.19 경험이 능력을 만든다.
  8. 2021.09.18 별이 병원
  9. 2021.09.18 odroid c2 lircd output 성공
  10. 2021.09.17 lirc irrecord, odroid c2 성공 (ubuntu 18.04.3)
embeded/raspberry pi2021. 9. 23. 14:43

config.txt에서 gpio-ir 관련해서 두개를 활성화 한다.

rx,tx를 반대로 하는게 영향을 주는진 모르겠지만, 아무튼 바꾸라고 하는데가 많으니 바꾸어서 시도

2018의 경우 lirc-gpio 였나? 이런 명칭인데 2020 이후에는 바뀐 것 같은데 changelog를 좀 추적해 봐야 할 듯.

$ cat /boot/config.txt 
# Uncomment this to enable infrared communication.
dtoverlay=gpio-ir-tx,gpio_pin=17,invert=1
dtoverlay=gpio-ir,gpio_pin=18

 

하드웨어는

gpio 17핀에 IR LED의 +극(좁은 쪽) / GND에 IR LED의 -극(넓은쪽)

gpio 18핀에 IR 리시버의 signal / VCC에 3.3 / GND에 적당히 연결

 

lircd 환경설정은 아래와 같이

device /dev/lirc1 으로 하면 입력은 되는데 출력이 안되는 듯 하다.

그리고 irsend는 output 항목의 socket을 통해 전송하게 되니 참조.

$ cat 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/arm-linux-gnueabihf/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 = /usr/sbin/modprobe lirc_serial
# code1 = /usr/bin/setfacl -m g:lirc:rw /dev/uinput
# code2 = ...


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

 

odroid에서 modprobe에서 invert=1을 해서 했었으니 얘도 동일하게 dtoverlay에 invert=1를 추가해서 해보니 성공

$ dtoverlay -h gpio-ir-tx
Name:   gpio-ir-tx

Info:   Use GPIO pin as bit-banged infrared transmitter output.
        This is an alternative to "pwm-ir-tx". gpio-ir-tx doesn't require
        a PWM so it can be used together with onboard analog audio.

Usage:  dtoverlay=gpio-ir-tx,<param>=<val>

Params: gpio_pin                Output GPIO (default 18)

        invert                  "1" = invert the output (make it active-low).
                                Default is "0" (active-high).

 

아래의 명령을 통해서 저장한 리모컨 명령을 전송!

$ irsend send_once samsung key_power -d /var/run/lirc/lircd

 

는 실패 ㅋ

hardware does not support sending

 

의외로 장치를 lirc1으로 하면 tx가 안되는 문제가 있는 것 같아서 /dev/lirc0으로 하니 문제 없이 되네

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=263689]

 

+

root 권한이 필요한데

/sys/kernel/debug/gpio 파일을 열어 보면 현재 gpio이 설정 상태를 볼 수 있다.

근데 별.. 도움은 안됨 ㅠㅠ

[링크 : https://youtu.be/TSJ2gYvsVGc?t=59]

 

+

아래는 invert 넣지 않은 것

$ sudo cat  /sys/kernel/debug/gpio
 gpio-17  (GPIO17              |gpio-ir-transmitter@) out lo
 gpio-18  (GPIO18              |ir-receiver@12      ) in  hi IRQ ACTIVE LOW

 

아래는 invert 넣은 것

$ sudo cat  /sys/kernel/debug/gpio
 gpio-17  (GPIO17              |gpio-ir-transmitter@) out hi ACTIVE LOW
 gpio-18  (GPIO18              |ir-receiver@12      ) in  hi IRQ ACTIVE LOW

'embeded > raspberry pi' 카테고리의 다른 글

rpi 2b g_mass_storage  (0) 2021.09.25
rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc 제조사별 키코드  (0) 2021.09.16
Posted by 구차니

흐음.. 돈이 되어야 하냐

돈이 되지 않아도 상관이 없냐..

 

그것이 문제로다

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

피곤엔 낮잠이 꿀잠이네  (0) 2021.10.03
으아아아아 야근  (0) 2021.09.28
피곤피곤  (0) 2021.09.20
경험이 능력을 만든다.  (0) 2021.09.19
하얗게 불태움  (0) 2021.09.14
Posted by 구차니
이론 관련/전기 전자2021. 9. 21. 22:34

접지,  hot,  중성으로 해서

릴레이로 끊을시 hot(220V)를 끊어주는게 그나마 낫다는데

테스터가 없으면 어떻게 판별을 하지?

 

2.1.7 배선의 색상은 다음과 같이 색상별 전선을 사용하거나 흑색전선에 라벨 또는 절연수축튜브를 사용한다.
a. 전압측 : 흑색, 적색, 청색
b. 중성선 : 백색
c. 접지선 : 녹색전선
d. 조작용 배선 : AC : 황색, DC : 청색

[링크 : https://www.codil.or.kr/filebank/original/MA/OTKNMA500117/OTKNMA500117.pdf?stream=T]

'이론 관련 > 전기 전자' 카테고리의 다른 글

MPPT 컨트롤러  (0) 2021.10.10
인산철 배터리  (0) 2021.10.09
current loop  (0) 2021.09.02
라즈베리 파이 3B+ USB boot  (0) 2021.08.23
칩 안테나 특성(방사패턴)  (0) 2021.08.18
Posted by 구차니

으아아아아아

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

으아아아아 야근  (0) 2021.09.28
먼가 만들어 볼까  (0) 2021.09.22
경험이 능력을 만든다.  (0) 2021.09.19
하얗게 불태움  (0) 2021.09.14
으아아아아  (0) 2021.09.07
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  (0) 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 구차니

어떻게 보면 역설적인 이야기이도 하고

도치가 되어도 맞아들어가는 이야기인데

 

사람의 능력을 키우기 위해서는 다양한 경험을 겪어야 하고

쌓여진 경험은 그 사람의 능력이 된다.

 

경험이 능력을 만들기도

능력이 경험을 만들기도 하니

 

참 아이러니 하구만.

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

먼가 만들어 볼까  (0) 2021.09.22
피곤피곤  (0) 2021.09.20
하얗게 불태움  (0) 2021.09.14
으아아아아  (0) 2021.09.07
휴가인데 야근  (0) 2021.09.03
Posted by 구차니

젊어서(?) 그런가 어떻게 된게 예전 복실이 보다 유지비가 많이 드냐 ㅠㅠ

 

동물등록 2만

진료비 1.1만

피부약 2만?

검사비 2만?

약 값 얼마

머 대충 이렇게 합산되서 8.2만 정도 나왔던 듯

 

아무튼 세균성 피부병이라 언넝 낫길

 

 

그 와중에 냄새 이상해서 버리려고 놔둔 햄을 (1kg) 한 200g 남기고 다 먹으심 -_-

어쩐지 물을 미친듯이 마시고 밥을 잘 먹더라니 -_-

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

내일 백신 2차!  (0) 2021.10.07
코로나 3273  (0) 2021.09.25
장보기  (0) 2021.09.12
필터구매!  (0) 2021.09.08
별이 털 밈  (0) 2021.09.06
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  (0) 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  (0) 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 구차니