embeded/raspberry pi2015. 8. 24. 15:30


raspi-config 면 기본 설정을 될테고..

나머지는 간단한(?) 테스트용 유틸리티 설치?


$ sudo apt-get install i2c-tools libi2c-dev python-smbus

$ sudo i2cdetect -y 1

[링크 : http://www.rasplay.org/?p=6409]

[링크 : https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c]


예제코드 / 스켈레톤 코드

char *fileName = "/dev/i2c-0";

fd = open(fileName, O_RDWR);

ioctl(fd, I2C_SLAVE, address);

write(fd, buf, 1);

read(fd, buf, 2); 

[링크 : http://www.robot-electronics.co.uk/files/rpi_sd21.c]

    [링크 : http://www.robot-electronics.co.uk/htm/raspberry_pi_examples.htm]


pi@raspberrypi ~ $ i2cdetect

Error: No i2c-bus specified!

Usage: i2cdetect [-y] [-a] [-q|-r] I2CBUS [FIRST LAST]

       i2cdetect -F I2CBUS

       i2cdetect -l

  I2CBUS is an integer or an I2C bus name

  If provided, FIRST and LAST limit the probing range. 


활성화 시키지 않으면 이런 에러가 발생한다.

pi@raspberrypi ~ $ i2cdetect -y 1

Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory 


근데..

전에 처럼 또.. 연결 안하고 안켜면 활성화도 안되는 기분?

pi@raspberrypi ~ $ sudo i2cdetect -y 1

Error: Could not open file `/dev/i2c-1' or `/dev/i2c/1': No such file or directory


pi@raspberrypi ~ $ dmesg | grep i2c

[    3.872815] bcm2708_i2c_init_pinmode(1,2)

[    3.874707] bcm2708_i2c_init_pinmode(1,3)

[    3.877782] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 79) (baudrate 100000) 



Posted by 구차니
embeded/raspberry pi2015. 8. 23. 22:16

머.. fbtft 였나..

fb를 쓰는거니 당연히 되는 걸로 생각이 되긴 해야 하지만..

사이즈나 속도 면에서 무슨 제약이 걸려서 안되는게 아닐까 싶기도?

아무튼 되는거 보면 왜 놀라운걸까 ㅋㅋ




Posted by 구차니
embeded/raspberry pi2015. 8. 23. 16:01

음.. 다시 봤더니 뭔가 수정된 기분?

아무튼.. 나중에 다시 한번 바닥 부터 만들어 봐야지...

rootfs에 dtb 관련해서 추가되는게 은근 좀 있는 듯...


$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs

$ mkdir mnt/fat32

$ mkdir mnt/ext4

$ sudo mount /dev/sdb1 mnt/fat32

$ sudo mount /dev/sdb2 mnt/ext4

$ sudo make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=mnt/ext4 modules_install

$ sudo cp mnt/fat32/$KERNEL.img mnt/fat32/$KERNEL-backup.img

$ sudo scripts/mkknlimg arch/arm/boot/zImage mnt/fat32/$KERNEL.img

$ sudo cp arch/arm/boot/dts/*.dtb mnt/fat32/

$ sudo cp arch/arm/boot/dts/overlays/*.dtb* mnt/fat32/overlays/

$ sudo cp arch/arm/boot/dts/overlays/README mnt/fat32/overlays/

$ sudo umount mnt/fat32

$ sudo umount mnt/ext4


[링크 : https://www.raspberrypi.org/documentation/linux/kernel/building.md]


스크립트를 통해서 zImage 파일이 어떻게든 변경되나 보다..

$ sudo ./scripts/mkknlimg arch/arm/boot/zImage ~/KERNEL.img

Version: Linux version 4.1.6-v7+ (minimonk@devmini) (gcc version 4.8.3 20140303 (prerelease) (crosstool-NG linaro-1.13.1+bzr2650 - Linaro GCC 2014.03) ) #1 SMP PREEMPT Tue Aug 18 23:54:39 KST 2015

DT: y

283x: n


$ ls -al ~/KERNEL.img

-rw-r--r-- 1 root root 4031680  8월 23 16:19 /home/minimonk/KERNEL.img


$ file ~/KERNEL.img

/home/minimonk/KERNEL.img: Linux kernel ARM boot executable zImage (little-endian)


$ diff arch/arm/boot/zImage ~/KERNEL.img

Binary files arch/arm/boot/zImage and /home/minimonk/KERNEL.img differ  



2015/04/16 - [개소리 왈왈/라즈베리 파이(rpi)] - 라즈베리 파이 2 커널모듈 빌드

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

라즈베리 파이 i2c 사용하기  (0) 2015.08.24
라즈베리 파이 SPI LCD도.. openGL은 되네?  (0) 2015.08.23
라즈베리 카메라 관련  (0) 2015.08.21
motion는 쓸만한게 아니었나..  (0) 2015.08.21
MMAL motion 로그  (0) 2015.08.20
Posted by 구차니
embeded/raspberry pi2015. 8. 21. 14:37

나만 잘 안되나..

v4l2나 motion 관련해서 보는데 끄응...

일단 기본 문서들 조사중..



raspistill - Capturing still photographs with the camera module

raspiyuv - Capturing still photographs and generating raw unprocessed image files

raspivid - Capturing video with the camera module

[링크 : https://www.raspberrypi.org/documentation/usage/camera/raspicam/README.md]



$ sudo apt-get install python-picamera 

[링크 : https://www.raspberrypi.org/documentation/usage/camera/python/README.md]

[링크 : http://picamera.readthedocs.org/] pythin picamera API


module has a five megapixel fixed-focus camera that supports 1080p30, 720p60 and VGA90 video modes, as well as stills capture. It attaches via a 15cm ribbon cable to the CSI port on the Raspberry Pi.

[링크 : https://www.raspberrypi.org/products/camera-module/]

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

라즈베리 파이 SPI LCD도.. openGL은 되네?  (0) 2015.08.23
라즈베리 파이 빌드.. 다시?  (0) 2015.08.23
motion는 쓸만한게 아니었나..  (0) 2015.08.21
MMAL motion 로그  (0) 2015.08.20
MMAL motion  (0) 2015.08.19
Posted by 구차니
embeded/raspberry pi2015. 8. 21. 12:46

MMAL motion으로 돌리면

cpu 하나 100% 쳐묵쳐묵 하고 있고

framerate를 30으로 해줘도 1프레임도 안나와서

찾아보니.. 이거뭐..


v4l2 official driver 해도 시궁창이던데...

그냥 MMAL / CSI를 포기해야 하나


아니 그래서 사람들이 이거 관련 글이 별로 없었던 건가?


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

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

라즈베리 파이 빌드.. 다시?  (0) 2015.08.23
라즈베리 카메라 관련  (0) 2015.08.21
MMAL motion 로그  (0) 2015.08.20
MMAL motion  (0) 2015.08.19
라즈베리 파이 터치 LCD(3.5인치 waveshare) evtest  (0) 2015.08.19
Posted by 구차니
embeded/raspberry pi2015. 8. 20. 09:58


로그를 보니.. 2프레임이 머니.. 2프레임이 -_-

[1978205048] [NTC] [ALL] [Aug 19 22:48:49] motion_startup: Using log type (ALL) log level (WRN)

[1] [ALR] [VID] [Aug 19 22:48:49] mmalcam_start: MMAL Camera thread starting... for camera (vc.ril.camera) of 1024 x 576 at 2 fps

[1] [ALR] [VID] [Aug 19 22:48:49] mmalcam_start: MMAL Camera using video capture

[1] [ALR] [VID] [Aug 19 22:55:37] MMAL Camera cleanup 


아마도.. 여기 설정에 영향을 받는거 같은데..

프레임 바꾸고 해봐야겠다.

# Maximum number of frames to be captured per second.

# Valid range: 2-100. Default: 100 (almost no limit).

framerate 1


############################################################

# OpenMax/MMAL camera support for Raspberry Pi

############################################################

mmalcam_name vc.ril.camera


요건 카메라 장착 안하고 MMAL motion 실행파일 구동할때의 에러

조금은 속아주고 돌아갈줄 알았더니..췟

[1] [ERR] [VID] [Aug 20 09:54:36] Failed to create MMAL camera component create_camera_component 



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

라즈베리 카메라 관련  (0) 2015.08.21
motion는 쓸만한게 아니었나..  (0) 2015.08.21
MMAL motion  (0) 2015.08.19
라즈베리 파이 터치 LCD(3.5인치 waveshare) evtest  (0) 2015.08.19
wayland 설정  (0) 2015.08.19
Posted by 구차니
embeded/raspberry pi2015. 8. 19. 09:56


$ file *

motion:              ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0x9d62823dd8a3ad9bcbda27d7736ddbddcced768b, not stripped

motion-mmal.tar.gz:  gzip compressed data, from Unix, last modified: Mon Nov 18 03:06:06 2013

motion-mmalcam.conf: ASCII text, with very long lines



2015/08/09 - [개소리 왈왈/라즈베리 파이(rpi)] - MMAL - Multi-Media Abstraction Layer





$ sudo apt-get install motion

패키지 목록을 읽는 중입니다... 완료

의존성 트리를 만드는 중입니다

상태 정보를 읽는 중입니다... 완료

다음 패키지를 더 설치할 것입니다:

  ffmpeg libav-tools libavdevice53 libavfilter2 libavfilter3 libavresample1

  libmysqlclient18 libopencv-core2.3 libopencv-imgproc2.3 libpq5 mysql-common

제안하는 패키지:

  frei0r-plugins mysql-client postgresql-client

다음 새 패키지를 설치할 것입니다:

  ffmpeg libav-tools libavdevice53 libavfilter2 libavfilter3 libavresample1

  libmysqlclient18 libopencv-core2.3 libopencv-imgproc2.3 libpq5 motion

  mysql-common

0개 업그레이드, 12개 새로 설치, 0개 제거 및 0개 업그레이드 안 함.

6,247 k바이트 아카이브를 받아야 합니다.

이 작업 후 18.0 M바이트의 디스크 공간을 더 사용하게 됩니다.

계속 하시겠습니까 [Y/n]?


$ sudo apt-get remove motion

패키지 목록을 읽는 중입니다... 완료

의존성 트리를 만드는 중입니다

상태 정보를 읽는 중입니다... 완료

다음 패키지가 자동으로 설치되었지만 더 이상 필요하지 않습니다:

  ffmpeg libmysqlclient18 libpq5 mysql-common

Use 'apt-get autoremove' to remove them.

다음 패키지를 지울 것입니다:

  motion

0개 업그레이드, 0개 새로 설치, 1개 제거 및 0개 업그레이드 안 함.

이 작업 후 758 k바이트의 디스크 공간이 비워집니다.

계속 하시겠습니까 [Y/n]?

(데이터베이스 읽는중 ...현재 85877개의 파일과 디렉터리가 설치되어 있습니다.)

motion 패키지를 지우는 중입니다 ...

[....] Stopping motion detection daemon: motionNo /usr/bin/motion found running; none killed.

. ok

[....] Stopping motion detection daemon: motionNo /usr/bin/motion found running; none killed.

. ok

man-db에 대한 트리거를 처리하는 중입니다 ...


$ vi motion-mmalcam.conf

# Start in daemon (background) mode and release terminal (default: off)

daemon on


# Restrict stream connections to localhost only (default: on)

stream_localhost off


# Image width (pixels). Valid range: Camera dependent, default: 352

width 1024


# Image height (pixels). Valid range: Camera dependent, default: 288

height 576


# Maximum number of frames to be captured per second.

# Valid range: 2-100. Default: 100 (almost no limit).

framerate 1



$ sudo ./motion -c motion-mmalcam.conf

[1978205048] [NTC] [ALL] conf_load: Processing thread 0 - config file motion-mmalcam.conf

[1978205048] [NTC] [ALL] motion_startup: Motion mmaltest Started

[1978205048] [NTC] [ALL] motion_startup: Logging to file (/home/pi/motion.log) 


프레임이나 해상도 등은 좀 손을 봐야 할 듯.. 한 1/5 프레임 겨우 나오는 기분?



[링크 : https://www.dropbox.com/s/0gzxtkxhvwgfocs/motion-mmal.tar.gz]

    [링크 : http://embeddedday.com/.../a-step-further/install-motion-mmal/] June 21, 2014 at 22:52 ?


+ 2016.06.23

[링크 : https://www.dropbox.com/s/jw5r1wss32tdibb/motion-mmal-opt.tar.gz] Mon Apr 21, 2014 5:16 pm

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

[링크 : https://www.dropbox.com/s/xdfcxm5hu71s97d/motion-mmal.tar.gz]

    [링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=44966] Sat May 25, 2013 11:06 am

[링크 : http://www.hardcopyworld.com/gnuboard5/bbs/board.php?bo_table=lecture_rpi&wr_id=10]

    [링크 : https://github.com/dozencrows/motion/tree/mmal-test]



MMAL README

-----------

This is an experimental version of motion that adds support for the

Raspberry Pi's CSI camera module, via the MMAL API.


As such, this branch has been stripped down to just the code and

some supporting files, and does not at this time contain a means

to build the code. Generated code files have been pre-created

using the original's configure script (see config.h).


Downloading: a temporary prebuilt binary for Raspberry Pi is available at this link:

https://www.dropbox.com/s/jw5r1wss32tdibb/motion-mmal-opt.tar.gz


Known working resolutions:


352 x 288

512 x 288

640 x 480

768 x 432

768 x 576

1024 x 576


[링크 : https://github.com/dozencrows/motion/tree/mmal-test]

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

motion는 쓸만한게 아니었나..  (0) 2015.08.21
MMAL motion 로그  (0) 2015.08.20
라즈베리 파이 터치 LCD(3.5인치 waveshare) evtest  (0) 2015.08.19
wayland 설정  (0) 2015.08.19
라즈베리 파이 2 / wayland 도전.. ㅠㅠ  (0) 2015.08.18
Posted by 구차니
embeded/raspberry pi2015. 8. 19. 09:50

해당 모델에서 사용하는 칩셋은 ads7846


누르고

점점 세게 누르고

떼고


압력에 따라서 값이 달라지긴 한데..

이걸 써먹을수 있으려나? 보호필름 달면 드럽게 안올라가던데..


그냥 필름없이 바로 하니 205 까지는 올라간다.


Event: time 1439945224.789919, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 152

Event: time 1439945224.799965, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 153

Event: time 1439945224.822859, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 155

Event: time 1439945225.479842, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 162

Event: time 1439945225.509437, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 163

Event: time 1439945225.812238, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 173

Event: time 1439945225.830184, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 174

Event: time 1439945225.849968, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 175

Event: time 1439945225.869278, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 176

Event: time 1439945226.159871, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 187

Event: time 1439945226.179620, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 188

Event: time 1439945226.189809, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 189

Event: time 1439945226.219863, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 190

Event: time 1439945226.893102, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 203

Event: time 1439945227.319814, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 201

Event: time 1439945227.329829, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 200

Event: time 1439945227.339833, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 198

Event: time 1439945227.349994, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 195

Event: time 1439945227.369588, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 186

Event: time 1439945227.379788, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 172

Event: time 1439945227.389826, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 159

Event: time 1439945229.039928, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 116

Event: time 1439945229.049997, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 80

Event: time 1439945229.069485, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0



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

MMAL motion 로그  (0) 2015.08.20
MMAL motion  (0) 2015.08.19
wayland 설정  (0) 2015.08.19
라즈베리 파이 2 / wayland 도전.. ㅠㅠ  (0) 2015.08.18
라즈베리 파이 wayland(weston)은.. 실패 ㅠㅠ  (0) 2015.08.18
Posted by 구차니
embeded/raspberry pi2015. 8. 19. 09:37

음.. gnome 처럼 좀.. 간편하게 추가하는 유틸리티는 아직 없으려나.

죄다 weston.ini로 하는 듯한 스멜이.. 


[링크 : https://wiki.archlinux.org/index.php/Wayland]

Posted by 구차니
embeded/raspberry pi2015. 8. 18. 23:44

아따.. 빡세다..


To install Weston, just issue:

    sudo apt-get update

    sudo apt-get install weston

This will install also a script called weston-launch (not the real weston-launch program), which will automatically set up XDG_RUNTIME_DIR for you and run weston. Running Weston with this package is as simple as:


    weston-launch


A too old firmware may cause rpi-backend to malfunction on Raspberry Pi. 


[링크 : http://wayland.freedesktop.org/raspberrypi.html]

    [링크 : http://archlinuxarm.org/forum/viewtopic.php?f=5&t=4975]


rpi-update는 설치가 안되서 일단 raw로 해서 다운로드

그리고 rpi-update를 위한 패키지로 두개를 설치해준다.

# apt-get install curl binutils

[링크 : https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update]


설정파일에서 drm-backend.so를 바꾸라는데 흐음..

create ~/.config/weston.ini containing the following:

[core]

backend=fbdev-backend.so

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


올.. 된다 ㅋㅋㅋ

# cd ~

# mkdir .config

# cd .config

# vi weston.ini

[core]

backend=fbdev-backend.so


아직 도는게 없어서인지 메모리가 후덜덜하게 조금 먹는다.

기본으로 되는게 터미널 밖에 없어서 이것저것 좀 깔아봐야 할 듯..



[링크 : https://www.mankier.com/5/weston.ini]


음.. 그럼.. 굳이 rpi-update 안해도 되려나?

Posted by 구차니