embeded/raspberry pi2015. 7. 30. 09:50

composite 해상도 관련

ssh로 하니 안되서 마우스 + 키보드 연결하고 파일로 저장해서 읽어옴 -_-

$ xdpyinfo

$ cat xdpy.txt

name of display:    :0.0

version number:    11.0

vendor string:    The X.Org Foundation

vendor release number:    11204000

X.Org version: 1.12.4

maximum request size:  16777212 bytes

motion buffer size:  256

bitmap unit, bit order, padding:    32, LSBFirst, 32

image byte order:    LSBFirst

number of supported pixmap formats:    7

supported pixmap formats:

    depth 1, bits_per_pixel 1, scanline_pad 32

    depth 4, bits_per_pixel 8, scanline_pad 32

    depth 8, bits_per_pixel 8, scanline_pad 32

    depth 15, bits_per_pixel 16, scanline_pad 32

    depth 16, bits_per_pixel 16, scanline_pad 32

    depth 24, bits_per_pixel 32, scanline_pad 32

    depth 32, bits_per_pixel 32, scanline_pad 32

keycode range:    minimum 8, maximum 255

focus:  window 0x1200005, revert to Parent

number of extensions:    27

    BIG-REQUESTS

    Composite

    DAMAGE

    DOUBLE-BUFFER

    DPMS

    DRI2

    GLX

    Generic Event Extension

    MIT-SCREEN-SAVER

    MIT-SHM

    RANDR

    RECORD

    RENDER

    SECURITY

    SGI-GLX

    SHAPE

    SYNC

    X-Resource

    XC-MISC

    XFIXES

    XFree86-DGA

    XFree86-VidModeExtension

    XINERAMA

    XInputExtension

    XKEYBOARD

    XTEST

    XVideo

default screen number:    0

number of screens:    1


screen #0:

  dimensions:    656x416 pixels (174x110 millimeters)

  resolution:    96x96 dots per inch

  depths (7):    16, 1, 4, 8, 15, 24, 32

  root window id:    0xe2

  depth of root window:    16 planes

  number of colormaps:    minimum 1, maximum 1

  default colormap:    0x20

  default number of colormap cells:    64

  preallocated pixels:    black 0, white 65535

  options:    backing-store NO, save-unders NO

  largest cursor:    656x416

  current input event mask:    0x7a003c

    ButtonPressMask          ButtonReleaseMask        EnterWindowMask

    LeaveWindowMask          StructureNotifyMask      SubstructureNotifyMask

    SubstructureRedirectMask FocusChangeMask          PropertyChangeMask

  number of visuals:    33

  default visual id:  0x21

  visual:

    visual id:    0x21

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    8 bits

  visual:

    visual id:    0xc2

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc3

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc4

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc5

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc6

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc7

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc8

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xc9

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xca

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xcb

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xcc

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xcd

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xce

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xcf

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd0

    class:    TrueColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd1

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd2

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd3

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd4

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd5

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd6

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd7

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd8

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xd9

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xda

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xdb

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xdc

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xdd

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xde

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xdf

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0xe0

    class:    DirectColor

    depth:    16 planes

    available colormap entries:    64 per subfield

    red, green, blue masks:    0xf800, 0x7e0, 0x1f

    significant bits in color specification:    6 bits

  visual:

    visual id:    0x41

    class:    TrueColor

    depth:    32 planes

    available colormap entries:    256 per subfield

    red, green, blue masks:    0xff0000, 0xff00, 0xff

    significant bits in color specification:    8 bits 


$ cat xran.txt

Screen 0: minimum 656 x 416, current 656 x 416, maximum 656 x 416

default connected 656x416+0+0 0mm x 0mm

   656x416         0.0* 


[링크 : http://www.cyberciti.biz/faq/how-do-i-find-out-screen-resolution-of-my-linux-desktop/]


composite + HDMI는 불가능 하다고..

듀얼 모니터로 쓸수 있을까 아니면 clone 모드로 가능할까 싶었는데

물건너 간 듯하다 ㅠㅠ

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=4034&p=53117]




+

심심해서 해보는 뻘짓

음.. 작게 나오네...


gimp에서 fb 덤프해서 복구

RGB565 ㄷㄷㄷ


아무튼 이렇게 아담하게 나온다.



+

2015.07.31

아무것도 연결안하니 composite 출력이 기본으로 설정되는 듯

Posted by 구차니
embeded/raspberry pi2015. 7. 18. 22:16

초음파 관련 루틴을 while로 처리해서

오차가 있을것으로 생각되다 보니..

인터럽트 처리방식 검색...


gpio 유틸에도 존재는 한다.

gpio edge <pin> rising/falling/both/none

This enables the given pin for edge interrupt triggering on the rising, falling or both edges. (Or none which disables it)

[링크 : http://wiringpi.com/the-gpio-utility/] 


python 버전

GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback, bouncetime=300)  GPIO.add_event_detect(23, GPIO.FALLING, callback=my_callback2, bouncetime=300)  

[링크 : http://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio-part-3] 


c 버전

void myInterrupt(void) {

   eventCounter++;

}


int main(void) {

  if (wiringPiSetup () < 0) {

      fprintf (stderr, "Unable to setup wiringPi: %s\n", strerror (errno));

      return 1;

  }


  // set Pin 17/0 generate an interrupt on high-to-low transitions

  // and attach myInterrupt() to the interrupt

  if ( wiringPiISR (BUTTON_PIN, INT_EDGE_FALLING, &myInterrupt) < 0 ) {

      fprintf (stderr, "Unable to setup ISR: %s\n", strerror (errno));

      return 1;

  }


  // display counter value every second.

  while ( 1 ) {

    printf( "%d\n", eventCounter );

    eventCounter = 0;

    delay( 1000 ); // wait 1 second

  }


  return 0;

}

[링크 : http://cs.smith.edu/dftwiki/index.php/Tutorial:_Interrupt-Driven_Event-Counter_on_the_Raspberry_Pi] 



Posted by 구차니
embeded/raspberry pi2015. 7. 17. 10:52

전에 쓴적이 있던가?

아무튼.. 지금글을 보고 있노라니..

국제화 관련 설정에서

gb가 기본값이었던거 같은데..

영국에서 만든게 왜...중국이 기본값이 된걸까?

+

2017.09.12

gb는 영국임. Great Britain



키보드 레이아웃은 집에가서 테스트 해봐야지 ..



[링크 : http://raspberrypi.stackexchange.com/questions/1042/why-is-my-symbol-not-working]


~!@#$%^&*()_+| 를 입력한 화면 확실히 먼가 이상하게 나온다.

프랑이라던가? 이.. 미묘한 기호순서라니!

XKBLAYOUT을 gb에서 us로 바꾸고

pi@raspberrypi ~ $ sudo cat /etc/default/keyboard

# KEYBOARD CONFIGURATION FILE


# Consult the keyboard(5) manual page.


XKBMODEL="pc105"

XKBLAYOUT="gb"

XKBVARIANT=""

XKBOPTIONS=""


BACKSPACE="guess" 


setupcon을 해주면 빠르게 설정이 된다는데 ssh나 터미널로는 안된다

pi@raspberrypi ~ $ sudo setupcon

We are not on the console, the console is left unconfigured. 


pi@raspberrypi ~ $ sudo service lightdm stop

ctrl -alt - f1

pi@raspberrypi ~ $ sudo setupcon


아무튼 리부팅 하고 오니

~!@#$%^&*()_+| 

원하는대로 잘 나온다.



Posted by 구차니
embeded/raspberry pi2015. 7. 13. 23:44

음.. 막상해보려니 125KHz 카드가 없다...

신용카드의 교통카드는.. 125KHz가 아니라 무리려나?

나중에 다른 카드 생기면 해봐야 할 듯.. ㅠㅠ


Voltage: 4.75-5.25V

Working Frequency: 125 KHz

Sensing Distance(Max): 70mm

TTL Output: 9600 baudrate, 8 data bits, 1 stop bit, and no verify bit

Wiegand Output: 26 bits Wiegand format, 1 even verify bit, 24 data bits, and 1 odd verify bit

[링크 : http://www.seeedstudio.com/wiki/Grove_-_125KHz_RFID_Reader] 


125Khz  EM카드

저렴하고 광범위하게 사용되고 있는카드


13.56Mhz MF카드

카드의 데이터값을 수정할 수 있으며

교통카드가 대표적인 MF카드임.

[링크 : http://korearfidtag.com/] 


+

2015.07.14

9600bps로 UART 모드 설정시 그냥 읽히는데..

putty 특성상 출력 안되는건 패스하니까 log로 분석


위는 카드에 써있는 숫자

아래는 읽힌 데이터

일치하진 않네...


인식해서 날아오는데 까지 약 1초 정도 소요되는 듯.



카드에 기재된 거랑 동일하게 읽히진 않네...



Posted by 구차니
embeded/raspberry pi2015. 7. 13. 23:27

릴레이는 단순하게 HI/LO 입력에 따라 on/off 스위치라 별거 없으니 대충~

당연히(!) 귀차니즘으로 wiring pi 기준 1번 / GPIO18번에 연결


$ gpio mode 1 output

$ gpio write 1 1


$ gpio write 1 0



[링크 : http://www.seeedstudio.com/depot/Grove-Relay-p-769.html]

Posted by 구차니
embeded/raspberry pi2015. 7. 13. 23:14

3.3-5V 이나 5V추천

탐지거리 3cm-4m

[링크 : http://www.seeedstudio.com/depot/Grove-Ultrasonic-Ranger-p-960.html]


다른 소스들의 예제와 다르게 이녀석...

Trigger / Echo가 아닌 Signal 하나 뿐이다


그래서 Trigger로 output 모드 설정후 전송하고 재빠르게

Echo로 input 모드로 설정후 받아 시간을 재도록 수정해야 한다.


포트는 만만한(?) GPIO18번 PWM 포트(wiring pi 기준 1번)으로 설정

흰색 - 5V

검정 - GND

보라 - GPIO18 ->A0




$ cat ultrasonic_1.py

#!/usr/bin/python

#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

#|R|a|s|p|b|e|r|r|y|P|i|-|S|p|y|.|c|o|.|u|k|

#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

#

# ultrasonic_1.py

# Measure distance using an ultrasonic module

#

# Author : Matt Hawkins

# Date   : 09/01/2013

# -----------------------


# Import required Python libraries

import time

import RPi.GPIO as GPIO


# Use BCM GPIO references

# instead of physical pin numbers

GPIO.setmode(GPIO.BCM)


# Define GPIO to use on Pi

GPIO_TRIGGER = 18

GPIO_ECHO    = 18


print "Ultrasonic Measurement"


# Set pins as output and input

GPIO.setup(GPIO_TRIGGER,GPIO.OUT)  # Trigger


# Set trigger to False (Low)

GPIO.output(GPIO_TRIGGER, False)


# Allow module to settle

time.sleep(0.5)


# Send 10us pulse to trigger

GPIO.output(GPIO_TRIGGER, True)

time.sleep(0.00001)

GPIO.output(GPIO_TRIGGER, False)

start = time.time()


GPIO.setup(GPIO_ECHO,GPIO.IN)      # Echo

while GPIO.input(GPIO_ECHO)==0:

  start = time.time()


while GPIO.input(GPIO_ECHO)==1:

  stop = time.time()


# Calculate pulse length

elapsed = stop-start


# Distance pulse travelled in that time is time

# multiplied by the speed of sound (cm/s)

distance = elapsed * 34300


# That was the distance there and back so halve the value

distance = distance / 2


print "Distance : %.1f" % distance


# Reset GPIO settings

GPIO.cleanup() 


자가 없어서 대충 한뼘(21cm)로 해봤는데 얼추 맞는 기분

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 154.8

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 3.0

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 9.1

pi@raspberrypi ~/src/sonic $ sudo python ultrasonic_1.py

Ultrasonic Measurement

Distance : 26.3 


대충 소스 받아서 수정

[링크 : http://www.raspberrypi-spy.co.uk/2012/12/ultrasonic-distance-measurement-using-python-part-1/]

Posted by 구차니
embeded/raspberry pi2015. 7. 7. 06:54

그냥 쏘고 받고

그 시간 간격재고 끝인가? 굳이.. 몇개의 파형을 안보내는 되는 걸려나..


[링크 : http://www.modmypi.com/blog/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi]

[링크 : http://www.raspberrypi-spy.co.uk/2012/12/ultrasonic-distance-measurement-using-python-part-1/]

Posted by 구차니
embeded/raspberry pi2015. 7. 6. 23:40

귀찮아서 여전히 USB to RS232로 하면서 뻔뻔한 제목 ㅋㅋ

땜질 안되어 있는 녀석이라 핀 몇개만 일단 박고 대충 결선하고 테스트!


핀이 하나도 없네?!?!


으쌰으쌰 대충 땜질하자


귀찮으니.. 3.3V를 내줄수 있는 USB to 232를 애용합시다? ㅋㅋ

일단 당연하지만 RX와 TX는 서로 엇갈리게 연결해준다.


232의 RXBT의 TX

232의 TXBT의 RX


전원도 대충~ GND와 3.3V 연결


3.3V 입력

TTL 레벨에 38400 으로 연결하고

명령어를 치면되는데.. \r\n 이라 그냥 입력이 불가능해서

Putty로는 테스트 불가 -_ㅠ


1. Set work mode

\r\n+STWMOD=1\r\n Set work mode Master




[링크 : http://www.seeedstudio.com/wiki/Serial_port_bluetooth_module_(Master/Slave)]

[링크 : http://www.seeedstudio.com/wiki/images/e/e8/BTSoftware_Instruction.pdf]

    [링크 : http://www.seeedstudio.com/wiki/Bluetooth_Shield]


Posted by 구차니
embeded/raspberry pi2015. 7. 6. 18:47

결국은 비표준 통신이라.

GPIO로 쌩 고생을 시켜야하나...


/*

 *  dht11.c:

 * Simple test program to test the wiringPi functions

 * DHT11 test

 */


#include <wiringPi.h>


#include <stdio.h>

#include <stdlib.h>

#include <stdint.h>

#define MAXTIMINGS 85

#define DHTPIN 7

int dht11_dat[5] = { 0, 0, 0, 0, 0 };


void read_dht11_dat()

{

uint8_t laststate = HIGH;

uint8_t counter = 0;

uint8_t j = 0, i;

float f; /* fahrenheit */


dht11_dat[0] = dht11_dat[1] = dht11_dat[2] = dht11_dat[3] = dht11_dat[4] = 0;


/* pull pin down for 18 milliseconds */

pinMode( DHTPIN, OUTPUT );

digitalWrite( DHTPIN, LOW );

delay( 18 );

/* then pull it up for 40 microseconds */

digitalWrite( DHTPIN, HIGH );

delayMicroseconds( 40 );

/* prepare to read the pin */

pinMode( DHTPIN, INPUT );


/* detect change and read data */

for ( i = 0; i < MAXTIMINGS; i++ )

{

counter = 0;

while ( digitalRead( DHTPIN ) == laststate )

{

counter++;

delayMicroseconds( 1 );

if ( counter == 255 )

{

break;

}

}

laststate = digitalRead( DHTPIN );


if ( counter == 255 )

break;


/* ignore first 3 transitions */

if ( (i >= 4) && (i % 2 == 0) )

{

/* shove each bit into the storage bytes */

dht11_dat[j / 8] <<= 1;

if ( counter > 16 )

dht11_dat[j / 8] |= 1;

j++;

}

}


/*

 * check we read 40 bits (8bit x 5 ) + verify checksum in the last byte

 * print it out if data is good

 */

if ( (j >= 40) &&

     (dht11_dat[4] == ( (dht11_dat[0] + dht11_dat[1] + dht11_dat[2] + dht11_dat[3]) & 0xFF) ) )

{

f = dht11_dat[2] * 9. / 5. + 32;

printf( "Humidity = %d.%d %% Temperature = %d.%d *C (%.1f *F)\n",

dht11_dat[0], dht11_dat[1], dht11_dat[2], dht11_dat[3], f );

}else  {

printf( "Data not good, skip\n" );

}

}


int main( void )

{

printf( "Raspberry Pi wiringPi DHT11 Temperature test program\n" );


if ( wiringPiSetup() == -1 )

exit( 1 );


while ( 1 )

{

read_dht11_dat();

delay( 1000 ); /* wait 1sec to refresh */

}


return(0);

}


[링크 : http://www.uugear.com/portfolio/dht11-humidity-temperature-sensor-module/] 


+

2015.07.14

입김불고 얼음대고 온도 변화주기

$ gcc dht11.c -lwiringPi

$ sudo ./a.out

Raspberry Pi wiringPi DHT11 Temperature test program

Humidity = 63.0 % Temperature = 26.0 *C (78.8 *F)

Data not good, skip

...

Humidity = 85.0 % Temperature = 30.0 *C (86.0 *F)

...

Humidity = 80.0 % Temperature = 25.0 *C (77.0 *F)
Humidity = 73.0 % Temperature = 24.0 *C (75.2 *F)
Humidity = 73.0 % Temperature = 23.0 *C (73.4 *F)
Humidity = 71.0 % Temperature = 22.0 *C (71.6 *F)


소스상 GPIO 4 / 7번 핀을 사용하므로 적절하게 연결!


전체구성은 대충 이런 느낌적인 느낌으로



Posted by 구차니
embeded/raspberry pi2015. 7. 5. 18:16

라즈베리에서 하긴 귀차나서 ㅋㅋㅋ

일단 PC에서 테스트



데이터 시트 상으로는.. 이런 순서로 데이터가 되어잇고

38400bps 로 전송한다고 하는데.. jpeg라고는 하지만..

하나 받으려면 꽤 걸리겠네 ㄷㄷ

[링크 : http://www.linksprite.com/upload/file/1291522825.pdf]


프로그램은.. 다른 사이트에서 찾아서 테스트

기본값대로 테스트 했고, USB 시리얼 포트만 COM2로 이동 시켜서 수행

속도를 올리기 위해서는 baudrate를 올리는 것도 방법 일 듯 하다.


320x240

38400  14초

115200 5초

드럽게 오래걸리네.. 그런데 640x480이랑 차이가 없는거 보면.. 프로그램 문제일수도..

(그냥 640x480으로 받는게 아닐까 싶다.


배선은..

가지고 있는 녀석들이 순서가 안 맞아 케이블을 꼬아서

RX -TX - Vcc - GND로 연결되는걸

RX -TX - GND - Vcc 로 바꾸어주고


시리얼이니 당연히(!) RX-TX꼬아서 USB to Serial에 연결해 주었다.


USB 시리얼 부터

TXD - 주황 - D2 - RXD

RXD - 노랑 - D3 - TXD

GND - 갈색 - GND - GND

Vcc - 빨강 - Vcc - Vcc(5V)


[링크 : http://store.cutedigi.com/infrared-jpeg-color-camera-serial-uart-rs232-level/]

[링크 : https://s3.amazonaws.com/linksprite/camera/JPEG_camera_uartinterface_TTL/LSY201evaluationsoftware.exe]

Posted by 구차니