어느덧 또 소멸되는 날이 다가온 듯.
내 돈 하나 안쓰고 생색내는 기부 완료!
'개소리 왈왈 > 블로그' 카테고리의 다른 글
홈페이지 호스팅.. 버릴까 (0) | 2022.02.27 |
---|---|
기부 시즌 (0) | 2022.01.21 |
으아아아 하루 안썼네 (0) | 2021.08.04 |
해피빈 기부 룰렛 (0) | 2021.07.14 |
해피빈 소멸예정! (2) | 2021.06.23 |
어느덧 또 소멸되는 날이 다가온 듯.
내 돈 하나 안쓰고 생색내는 기부 완료!
홈페이지 호스팅.. 버릴까 (0) | 2022.02.27 |
---|---|
기부 시즌 (0) | 2022.01.21 |
으아아아 하루 안썼네 (0) | 2021.08.04 |
해피빈 기부 룰렛 (0) | 2021.07.14 |
해피빈 소멸예정! (2) | 2021.06.23 |
방법들은 비슷한데.. 따라하는데 영 안되네?
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 |
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 |
존재는 하는데 쓸 수 있긴 한건가?
$ modinfo g_mass_storage filename: /lib/modules/5.10.60-v7+/kernel/drivers/usb/gadget/legacy/g_mass_storage.ko license: GPL author: Michal Nazarewicz description: Mass Storage Gadget srcversion: B6D70CE605D2CF6CF116805 depends: usb_f_mass_storage,libcomposite intree: Y name: g_mass_storage vermagic: 5.10.60-v7+ SMP mod_unload modversions ARMv7 p2v8 parm: idVendor:USB Vendor ID (ushort) parm: idProduct:USB Product ID (ushort) parm: bcdDevice:USB Device version (BCD) (ushort) parm: iSerialNumber:SerialNumber string (charp) parm: iManufacturer:USB Manufacturer string (charp) parm: iProduct:USB Product string (charp) parm: file:names of backing files or devices (array of charp) parm: ro:true to force read-only (array of bool) parm: removable:true to simulate removable media (array of bool) parm: cdrom:true to simulate CD-ROM instead of disk (array of bool) parm: nofua:true to ignore SCSI WRITE(10,12) FUA bit (array of bool) parm: luns:number of LUNs (uint) parm: stall:false to prevent bulk stalls (bool) |
$ lsmod | grep g_mass g_mass_storage 16384 0 usb_f_mass_storage 49152 1 g_mass_storage libcomposite 57344 2 g_mass_storage,usb_f_mass_storage |
rpi zero otg (0) | 2021.09.27 |
---|---|
스피커가 부실했군.. (0) | 2021.09.26 |
rpi4에서 gpio readall 실행 안될 때 (0) | 2021.09.24 |
rpi 4 lirc tx, rx (0) | 2021.09.23 |
rpi USB 메모리 스틱처럼 만들기? rpi zero (0) | 2021.09.17 |
항상 라즈3에서 하다가 라즈4에서 하려니 헉.. 뭥미?
아무튼 유지보수 안한다고 하던 wiringpi까지 업데이트 되어서 패키지 만들 정도라니!
$ gpio readall Oops - unable to determine board type... model: 17 $ gpio -v gpio version: 2.50 Copyright (c) 2012-2018 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty Raspberry Pi Details: Type: Unknown17, Revision: 02, Memory: 0MB, Maker: Sony * Device tree is enabled. *--> Raspberry Pi 4 Model B Rev 1.2 * This Raspberry Pi supports user-level GPIO access. $ wget https://project-downloads.drogon.net/wiringpi-latest.deb --2021-09-24 10:25:41-- https://project-downloads.drogon.net/wiringpi-latest.deb Resolving project-downloads.drogon.net (project-downloads.drogon.net)... 188.246.205.22, 2a03:9800:10:7b::2 Connecting to project-downloads.drogon.net (project-downloads.drogon.net)|188.246.205.22|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 52260 (51K) [application/x-debian-package] Saving to: ‘wiringpi-latest.deb’ wiringpi-latest.deb 100%[==========================>] 51.04K 59.8KB/s in 0.9s 2021-09-24 10:25:43 (59.8 KB/s) - ‘wiringpi-latest.deb’ saved [52260/52260] $ sudo dpkg -i wiringpi-latest.deb Selecting previously unselected package wiringpi. (Reading database ... 170594 files and directories currently installed.) Preparing to unpack wiringpi-latest.deb ... Unpacking wiringpi (2.52) ... Setting up wiringpi (2.52) ... Processing triggers for man-db (2.8.5-2) ... $ gpio -v gpio version: 2.52 Copyright (c) 2012-2018 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty Raspberry Pi Details: Type: Pi 4B, Revision: 02, Memory: 4096MB, Maker: Sony * Device tree is enabled. *--> Raspberry Pi 4 Model B Rev 1.2 * This Raspberry Pi supports user-level GPIO access. $ gpio readall +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ | | | 3.3v | | | 1 || 2 | | | 5v | | | | 2 | 8 | SDA.1 | ALT0 | 1 | 3 || 4 | | | 5v | | | | 3 | 9 | SCL.1 | ALT0 | 1 | 5 || 6 | | | 0v | | | | 4 | 7 | GPIO. 7 | IN | 1 | 7 || 8 | 1 | IN | TxD | 15 | 14 | | | | 0v | | | 9 || 10 | 1 | IN | RxD | 16 | 15 | | 17 | 0 | GPIO. 0 | OUT | 1 | 11 || 12 | 1 | IN | GPIO. 1 | 1 | 18 | | 27 | 2 | GPIO. 2 | IN | 0 | 13 || 14 | | | 0v | | | | 22 | 3 | GPIO. 3 | IN | 0 | 15 || 16 | 0 | IN | GPIO. 4 | 4 | 23 | | | | 3.3v | | | 17 || 18 | 0 | IN | GPIO. 5 | 5 | 24 | | 10 | 12 | MOSI | IN | 0 | 19 || 20 | | | 0v | | | | 9 | 13 | MISO | IN | 0 | 21 || 22 | 0 | IN | GPIO. 6 | 6 | 25 | | 11 | 14 | SCLK | IN | 0 | 23 || 24 | 1 | IN | CE0 | 10 | 8 | | | | 0v | | | 25 || 26 | 1 | IN | CE1 | 11 | 7 | | 0 | 30 | SDA.0 | IN | 1 | 27 || 28 | 1 | IN | SCL.0 | 31 | 1 | | 5 | 21 | GPIO.21 | IN | 1 | 29 || 30 | | | 0v | | | | 6 | 22 | GPIO.22 | IN | 1 | 31 || 32 | 0 | IN | GPIO.26 | 26 | 12 | | 13 | 23 | GPIO.23 | IN | 0 | 33 || 34 | | | 0v | | | | 19 | 24 | GPIO.24 | IN | 0 | 35 || 36 | 1 | IN | GPIO.27 | 27 | 16 | | 26 | 25 | GPIO.25 | IN | 0 | 37 || 38 | 0 | IN | GPIO.28 | 28 | 20 | | | | 0v | | | 39 || 40 | 0 | IN | GPIO.29 | 29 | 21 | +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+ | BCM | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | BCM | +-----+-----+---------+------+---+---Pi 4B--+---+------+---------+-----+-----+ |
[링크 : http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/]
[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=251297]
[링크 : https://m.blog.naver.com/PostView.naver?isHttpsRedirect=true&blogId=kiyeonah&logNo=221308783013]
스피커가 부실했군.. (0) | 2021.09.26 |
---|---|
rpi 2b g_mass_storage (0) | 2021.09.25 |
rpi 4 lirc tx, rx (0) | 2021.09.23 |
rpi USB 메모리 스틱처럼 만들기? rpi zero (0) | 2021.09.17 |
rpi stretch lirc irrecord 실패 (0) | 2021.09.16 |
리눅스 커널에서 보다 보니 USB에는 DWC 라는게 붙길래 찾아보니
DesignWare Core 라는 용어가 나온다.
synopsys는 회사명 designware(r)은 IP의 명칭이라고 해야하려나?
[링크 : https://www.synopsys.com/dw/ipdir.php?ds=dwc_usb_2_0_digital_controllers]
[링크 : https://www.kernel.org/doc/html/v5.0/driver-api/usb/dwc3.html]
digital twin (0) | 2022.04.13 |
---|---|
current loop to rs232 (0) | 2021.10.22 |
fp16 (0) | 2021.05.10 |
gps 체크섬 (0) | 2020.11.17 |
GPX, NMEA 포맷 변환 (0) | 2020.11.05 |
# 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/]
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 |
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 |
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 |
흐음.. 돈이 되어야 하냐
돈이 되지 않아도 상관이 없냐..
그것이 문제로다
피곤엔 낮잠이 꿀잠이네 (0) | 2021.10.03 |
---|---|
으아아아아 야근 (0) | 2021.09.28 |
피곤피곤 (0) | 2021.09.20 |
경험이 능력을 만든다. (0) | 2021.09.19 |
하얗게 불태움 (0) | 2021.09.14 |
접지, 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 |