embeded/raspberry pi2021. 9. 24. 10:26

항상 라즈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]

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

스피커가 부실했군..  (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
Posted by 구차니
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 구차니
embeded/raspberry pi2021. 9. 17. 13:46

라즈베리 파이 zero에서 USB 메모리 스틱처럼 인식을 시킬수 있다는데

2B나 3B 등에서는 아무래도 회로적으로 USB OTG 구성이 되어 있지 않으니 안될 것 같고

rpi CM4만 해도 OTG가 굽는 용도로 있으니 어떻게 든 가능할 것 같은데.. 확신은 없음

 

반대로 OTG가 존재하는 odroid 등에서는 가능하려나?

 

$ sudo modprobe g_mass_storage removable=1 ro=1

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

[링크 : https://linuxlink.timesys.com/docs/wiki/engineering/HOWTO_Use_USB_Gadget_File_Storage]

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

rpi4에서 gpio readall 실행 안될 때  (0) 2021.09.24
rpi 4 lirc tx, rx  (0) 2021.09.23
rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc 제조사별 키코드  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
Posted by 구차니
embeded/raspberry pi2021. 9. 16. 19:18

머가 문제일까..

 

[링크 : https://raspberrypi.stackexchange.com/questions/104008/lirc-irrecord-wont-record-buster-mode2-works]

 

+

stretch가 문제가 아니라

decoded에 문제가 있는지 raw로 하니 잘 된다.

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

rpi 4 lirc tx, rx  (0) 2021.09.23
rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
lirc 제조사별 키코드  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
rpi 에서 ir 읽기  (0) 2021.09.11
Posted by 구차니
embeded/raspberry pi2021. 9. 16. 15:57

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

rpi USB 메모리 스틱처럼 만들기? rpi zero  (0) 2021.09.17
rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
rpi 에서 ir 읽기  (0) 2021.09.11
rpi 3b update, install 실패  (0) 2021.09.10
Posted by 구차니
embeded/raspberry pi2021. 9. 13. 12:00

오.. 귀찮으니 해볼까

 

[링크 : https://www.raspberry-pi-geek.com/Archive/2015/10/Raspberry-Pi-IR-remote]

 

GPIO 18 IR Receiver     (IR RECEIVER)
GPIO 22 IR Transmitter  (IR LED)

$ sudo apt-get install  lirc
$ sudo vim /etc/modules
$ lirc_dev
$ lirc_rpi gpio_in_pin=18 gpio_out_pin=22

[링크 : https://lifeonroom.com/diy/aricon-on-using-lirc/]

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

rpi stretch lirc irrecord 실패  (0) 2021.09.16
lirc 제조사별 키코드  (0) 2021.09.16
rpi 에서 ir 읽기  (0) 2021.09.11
rpi 3b update, install 실패  (0) 2021.09.10
vc4cl - VideoCore IV OpenCL  (0) 2021.09.09
Posted by 구차니
embeded/raspberry pi2021. 9. 11. 23:39

ir tx 회로랑 rx 회뢰를 구성하고

lirc를 또 잘 구워삶아 봐야지

 

[링크 : https://www.instructables.com/How-To-Useemulate-remotes-with-Arduino-and-Raspber/]

 

 

 

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

lirc 제조사별 키코드  (0) 2021.09.16
lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
rpi 3b update, install 실패  (0) 2021.09.10
vc4cl - VideoCore IV OpenCL  (0) 2021.09.09
rpi 3b 4k 24p  (0) 2021.08.27
Posted by 구차니
embeded/raspberry pi2021. 9. 10. 17:16

먼가 설치하려면 죄다 에러가 나서 안되는데..

After this operation, 161 MB of additional disk space will be used.
Err:1 http://raspbian.raspberrypi.org/raspbian buster/main armhf libwebp6 armhf 0.6.1-2
  404  Not Found [IP: 93.93.128.193 80]
Err:2 http://raspbian.raspberrypi.org/raspbian buster/main armhf libtiff5 armhf 4.1.0+git191117-2~deb10u1
  404  Not Found [IP: 93.93.128.193 80]
Err:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf libproxy1v5 armhf 0.4.15-5
  404  Not Found [IP: 93.93.128.193 80]
Err:4 http://raspbian.raspberrypi.org/raspbian buster/main armhf libavahi-client3 armhf 0.7-4+b1
  404  Not Found [IP: 93.93.128.193 80]
Err:5 http://raspbian.raspberrypi.org/raspbian buster/main armhf libcups2 armhf 2.2.10-6+deb10u3
  404  Not Found [IP: 93.93.128.193 80]
Err:6 http://raspbian.raspberrypi.org/raspbian buster/main armhf libjs-jquery all 3.3.1~dfsg-3
  404  Not Found [IP: 93.93.128.193 80]
Err:7 http://raspbian.raspberrypi.org/raspbian buster/main armhf ruby2.5 armhf 2.5.5-3+deb10u2
  404  Not Found [IP: 93.93.128.193 80]
Err:8 http://raspbian.raspberrypi.org/raspbian buster/main armhf libruby2.5 armhf 2.5.5-3+deb10u2
  404  Not Found [IP: 93.93.128.193 80]

 

apt-get update 해보니 어라..? 에러 발생?

Suite 값이 stable에서 oldstable로 바뀌었다?

$ sudo apt-get update
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Reading package lists... Done
E: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'
N: This must be accepted explicitly before updates for this repository can be applied. See apt-secure(8) manpage for details.

 

메시지로 찾아보니 릴리즈 정보 변경을 허용하면 된다는데

$ sudo apt-get update --allow-releaseinfo-change

[링크 : https://github.com/NVIDIA/nvidia-docker/issues/1349]

 

확실히 에러는 발생하지 않고 넘어가긴 한데.. 매번 저 옵션을 주고 해야하나?

$ sudo apt-get update --allow-releaseinfo-change
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Get:2 http://raspbian.raspberrypi.org/raspbian buster InRelease [15.0 kB]
Get:3 http://raspbian.raspberrypi.org/raspbian buster/main armhf Packages [13.0 MB]
Get:4 http://raspbian.raspberrypi.org/raspbian buster/contrib armhf Packages [58.7 kB]
Get:5 http://raspbian.raspberrypi.org/raspbian buster/non-free armhf Packages [104 kB]
Fetched 13.2 MB in 34s (386 kB/s)
Reading package lists... Done
N: Repository 'http://raspbian.raspberrypi.org/raspbian buster InRelease' changed its 'Suite' value from 'stable' to 'oldstable'

 

 

+

stretch -> buster -> bullseye 로 배포판 명칭이 변경되면서 buster는 oldstable로 변경된 듯.

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

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

lirc를 이용한 리모컨 신호 복제  (0) 2021.09.13
rpi 에서 ir 읽기  (0) 2021.09.11
vc4cl - VideoCore IV OpenCL  (0) 2021.09.09
rpi 3b 4k 24p  (0) 2021.08.27
흐음.. 그냥 라즈베리 2나 1으로 내려갈까..  (0) 2021.08.26
Posted by 구차니
embeded/raspberry pi2021. 9. 9. 20:05

라즈베리 파이의 비디오 가속 하드웨어인 VideoCore 4를 openCL로 쓸 수 있도록 래핑한 프레임워크?

아무튼 라즈베리 1~3가 vc4 를 채용하고 있으니 의외로 범용성은 넓어 보이는데

성능이 얼마나 나올런지?

 

라즈베리파이 1-3 videocore iv 채용

라즈베리파이 4 videocore vi 채용

[링크 : https://en.wikipedia.org/wiki/VideoCore]

 

[링크 : https://github.com/doe300/VC4CL/wiki]

[링크 : https://www.element14.com/.../raspberry-pi-now-with-opencl-gpu-support-vc4cl-videocore-iv-opencl]

 

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

rpi 에서 ir 읽기  (0) 2021.09.11
rpi 3b update, install 실패  (0) 2021.09.10
rpi 3b 4k 24p  (0) 2021.08.27
흐음.. 그냥 라즈베리 2나 1으로 내려갈까..  (0) 2021.08.26
ubuntu 64bit server / rpi 로그인 느려!  (0) 2021.08.26
Posted by 구차니
embeded/raspberry pi2021. 8. 27. 12:24

4k 60p는 바라지 않았지만.. 30p는 무리인가?
[링크 : https://sysadmin-central.com/2019/08/14/raspberry-pi-how-to-output-4k-resolution-to-a-tv/]

 

2014년 글이면 라즈베리 2b인것 같은데.. 오호..

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=79330]

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

rpi 3b update, install 실패  (0) 2021.09.10
vc4cl - VideoCore IV OpenCL  (0) 2021.09.09
흐음.. 그냥 라즈베리 2나 1으로 내려갈까..  (0) 2021.08.26
ubuntu 64bit server / rpi 로그인 느려!  (0) 2021.08.26
rpi power led off  (0) 2021.08.24
Posted by 구차니