embeded/raspberry pi2016. 7. 28. 21:01

s6a0069 samsung

hd44780 hitachi


[링크 : https://forums.adafruit.com/viewtopic.php?f=47&t=37580]

     [링크 : http://www.avrfreaks.net/forum/what-difference-between-s6a0069-and-hd44780...]


[링크 : http://forum.arduino.cc/index.php?topic=98282.0]

[링크 : http://www.avrfreaks.net/forum/atmega16-lcd-interfacing-hd44780-compatible-s6a0069]

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

라즈베리 파이 16x2 clcd  (0) 2016.08.01
lcdproc  (0) 2016.07.30
리눅스 여러개의 wifi를 콘솔에서 잡기  (0) 2016.07.28
rpicam x3 x4배속  (0) 2016.07.28
rpicam 90fps...  (0) 2016.07.27
Posted by 구차니
embeded/raspberry pi2016. 7. 28. 20:41

희한한 파일이네


[링크 : http://raspberrypi.stackexchange.com/questions/11631/how-to-setup-multiple-wifi-networks]

[링크 : https://www.raspberrypi.org/documentation/configuration/wireless/wireless-cli.md]

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

lcdproc  (0) 2016.07.30
clcd driver  (0) 2016.07.28
rpicam x3 x4배속  (0) 2016.07.28
rpicam 90fps...  (0) 2016.07.27
freeRTOS on rpi  (0) 2016.07.18
Posted by 구차니
embeded/raspberry pi2016. 7. 28. 11:43

음.. 해보니 되긴한데..

vlc에서도 배속 재생이 되는거 첨 알았네 ㅋㅋ


아무튼... 기본적으로 무조건 30fps로 h.264 스트림이 저장되니

vlc 에서 4배속으로 재생해야 320x240@120fps로 저장된게 정상속도로 재생된다.


테스트 해보니...

원본은 팟플레이어 에서만 재생 VLC 재생불가

변환은 팟플레이어, VLC 빠르게 이상없음


흐음...




+

결론은 파일로 저장되는 스트림에 대해서 120p 90p 60p로 저장이 되고, 

해당 스트림은 30p로 설정되어 슬로우 모션으로 재생됨 끝


$ MP4Box -fps 30 -add video_120p.h264 video_120p.mp4

AVC-H264 import - frame size 320 x 240 at 30.000 FPS

AVC Import results: 1296 samples - Slices: 22 I 1274 P 0 B - 0 SEI - 22 IDR

Saving to video_120p.mp4: 0.500 secs Interleaving 


$ MP4Box -fps 30 -add video_120p.h264 video_120p.mp4 -v

[iso file] Current top box start before parsing 2

[iso file] Read Box type ftyp size 24 start 0

[iso file] Current top box start before parsing 2

[iso file] Read Box type moov size 6319 start 24

[iso file] Read Box type mvhd size 108 start 32

[iso file] Read Box type iods size 21 start 140

[iso file] Read Box type trak size 6182 start 161

[iso file] Read Box type tkhd size 92 start 169

[iso file] Read Box type mdia size 6082 start 261

[iso file] Read Box type mdhd size 32 start 269

[iso file] Read Box type hdlr size 59 start 301

[iso file] Read Box type minf size 5983 start 360

[iso file] Read Box type vmhd size 20 start 368

[iso file] Read Box type dinf size 36 start 388

[iso file] Read Box type dref size 28 start 396

[iso file] Read Box type url  size 12 start 412

[iso file] Read Box type stbl size 5919 start 424

[iso file] Read Box type stsd size 163 start 432

[iso file] Read Box type avc1 size 147 start 448

[iso file] Read Box type avcC size 41 start 534

[iso file] Read Box type btrt size 20 start 575

[iso file] Read Box type stts size 24 start 595

[iso file] Read Box type stss size 104 start 619

[iso file] Read Box type stsc size 52 start 723

[iso file] Read Box type stsz size 5204 start 775

[iso file] Read Box type stco size 364 start 5979

[iso file] Current top box start before parsing 2

[iso file] Read Box type mdat size 1620390 start 6343

[iso file] Current top box start before parsing 2

[iso file] Read Box type free size 59 start 1626733

AVC-H264 import - frame size 320 x 240 at 30.000 FPS

AVC Import results: 1296 samples - Slices: 22 I 1274 P 0 B - 0 SEI - 22 IDR

Saving video_120p.mp4: 0.500 secs Interleaving 


$ MP4Box

MP4Box [option] input [option]

 -h general           general options help

 -h hint              hinting options help

 -h dash              DASH segmenter help

 -h import            import options help

 -h encode            encode options help

 -h meta              meta handling options help

 -h extract           extraction options help

 -h dump              dump options help

 -h swf               Flash (SWF) options help

 -h crypt             ISMA E&A options help

 -h format            supported formats help

 -h rtp               file streamer help

 -h live              BIFS streamer help

 -h all               all options are printed


 -nodes               lists supported MPEG4 nodes

 -node NodeName       gets MPEG4 node syntax and QP info

 -xnodes              lists supported X3D nodes

 -xnode NodeName      gets X3D node syntax

 -snodes              lists supported SVG nodes

 -snode NodeName      gets SVG node syntax

 -languages           lists supported ISO 639 languages


 -quiet                quiet mode

 -noprog               disables progress

 -v                   verbose mode

 -logs                set log tools and levels, formatted as a ':'-separated list of toolX[:toolZ]@levelX

 -version             gets build version

 -- INPUT             escape option if INPUT starts with - character 




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

clcd driver  (0) 2016.07.28
리눅스 여러개의 wifi를 콘솔에서 잡기  (0) 2016.07.28
rpicam 90fps...  (0) 2016.07.27
freeRTOS on rpi  (0) 2016.07.18
redmine 백업  (0) 2016.07.14
Posted by 구차니
embeded/raspberry pi2016. 7. 27. 15:39

120fps 찾다가 보니 90fps만 무성히 나오는데..


이전테스트에서는 120fps는 실패인거 같았고


$ raspivid -w 320 -h 230 -t 0 -f -v -fps 120


raspivid Camera App v1.3.12


Width 320, Height 230, filename (null)

bitrate 17000000, framerate 120, time delay 0

H264 Profile high

H264 Quantisation level 0, Inline headers No

H264 Intra refresh type (null), period -1

Wait method : Capture forever

Initial state 'record'


2015/08/08 - [embeded/raspberry pi] - 라즈베리 파이 5M 카메라 - 지름도착!


다시 보니.. 파일로 저장안하고 화면으로 봐서 그런걸지도?



아래는 90p로 받아서 30p 로 3배 느린 영상 만드는 방법

$ raspivid -h 640 -w 480 -fps 90 -t 10000 -o video.h264

$ sudo apt-get install gpac

$ MP4Box -fps 30 -add video.h264 video.mp4


[링크 : http://www.raspberryconnect.com/video/item/165-raspberry-pi-camera-slow-motion]

[링크 : https://babaawesam.com/2014/03/24/shooting-slow-motion-videos-using-raspberry-pi-camera/]

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

리눅스 여러개의 wifi를 콘솔에서 잡기  (0) 2016.07.28
rpicam x3 x4배속  (0) 2016.07.28
freeRTOS on rpi  (0) 2016.07.18
redmine 백업  (0) 2016.07.14
초음파 거리 + 온/습도 센서  (0) 2016.07.10
Posted by 구차니
embeded/raspberry pi2016. 7. 18. 13:08

2012년에 이미 해둔게 있네.. ㄷㄷㄷ


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

[링크 : https://github.com/jameswalmsley/RaspberryPi-FreeRTOS]

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

rpicam x3 x4배속  (0) 2016.07.28
rpicam 90fps...  (0) 2016.07.27
redmine 백업  (0) 2016.07.14
초음파 거리 + 온/습도 센서  (0) 2016.07.10
초음파 센서 wiring pi 버전  (0) 2016.07.10
Posted by 구차니
embeded/raspberry pi2016. 7. 14. 17:28

올려진 파일 경로

./redmine/apps/redmine/htdocs/files


db설정 파일 경로

./apps/redmine/htdocs/config/database.yml



[링크 : http://meg-anero.blogspot.com/2014/12/redmine.html]

[링크 : http://sbkyun.blogspot.com/2013/12/redmine.html]

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

rpicam 90fps...  (0) 2016.07.27
freeRTOS on rpi  (0) 2016.07.18
초음파 거리 + 온/습도 센서  (0) 2016.07.10
초음파 센서 wiring pi 버전  (0) 2016.07.10
초음파/온습도 센서 데이터 시트 복사  (0) 2016.07.10
Posted by 구차니
embeded/raspberry pi2016. 7. 10. 16:18

어딜 좀 더 수정해야하려나..


1. 거리가 짧아지면 응답이 빨리 되니 짧을때는 더 빠르게 거리 측정

2. openMP나 thread이용 병렬처리

3. 클래스화?

4. 인터럽트 사용?


$ cat temp_ss.c

/*

 *  dht11.c:

 *      Simple test program to test the wiringPi functions

 *      DHT11 test

 */


#include <wiringpi.h>


#include <stdio.h>

#include <stdlib.h>

#include <stdint.h>

#include <sys/time.h>


#define TRIG_PIN        4

#define ECHO_PIN        5


float mach = 34300.0;


void read_sr04_dat()

{

        int counter = 0;

        struct timeval start_point, end_point;

        double operating_time;

        double len;


        pinMode(TRIG_PIN, OUTPUT);

        pinMode(ECHO_PIN, INPUT);

        digitalWrite(TRIG_PIN, LOW);

//      delay(500); // 500 msec


        digitalWrite(TRIG_PIN, HIGH);

        delayMicroseconds( 10 );

        digitalWrite(TRIG_PIN, LOW);


        while ( digitalRead(ECHO_PIN) == LOW)

        {

                counter++;

                delayMicroseconds( 1 );

                if ( counter == 38000 )

                {

                        return;

                }

        }

        gettimeofday(&start_point, NULL);



        while ( digitalRead(ECHO_PIN) == HIGH)

        {

                counter++;

                delayMicroseconds( 1 );

                if ( counter == 38000 )

                {

                        return;

                }

        }

        gettimeofday(&end_point, NULL);


        operating_time = (double)(end_point.tv_sec)+(double)(end_point.tv_usec)/1000000.0-(double)(start_point.tv_sec)-(double)(start_point.tv_usec)/1000000.0;

        len = operating_time * mach / 2;


        printf("%f sec %4.2f cm %d\n",operating_time, len, counter);

}


#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 );


                printf("%f -> ",mach);

                mach = 33150 + (60 * dht11_dat[2]);

                printf("%f\n",mach);

        }else  {


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

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

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


                printf( "- Data not good, skip j[%d] par[%d] calc[%d]\n",

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

                 );

        }

}


int main( void )

{

        unsigned char tempcount = 0;


        if ( wiringPiSetup() == -1 )

                exit( 1 );


        while ( 1 )

        {

                        if(tempcount % 10 == 0)

                                read_dht11_dat();

                        tempcount++;


                        read_sr04_dat();


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

        }


        return(0);

}  


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

freeRTOS on rpi  (0) 2016.07.18
redmine 백업  (0) 2016.07.14
초음파 센서 wiring pi 버전  (0) 2016.07.10
초음파/온습도 센서 데이터 시트 복사  (0) 2016.07.10
rpi gstreamer mux  (0) 2016.06.28
Posted by 구차니
embeded/raspberry pi2016. 7. 10. 12:31

파이썬만 보여서 대충 바꿔봄.

대충.. 2cm ~ 400cm로 제한을 줘야하나..

데이터 시트는 아래 링크 참조해서 작성

[링크 : https://docs.google.com/document/d/1Y-yZnNhMYy7rwhAgyL_pfa39RsB-x2qR4vP8saG73rE/edit]


시간재는건 아래 참조

[링크 : http://hwangdo83.tistory.com/123]


$ cat sr04.c

/*

 *  dht11.c:

 *      Simple test program to test the wiringPi functions

 *      DHT11 test

 */


#include <wiringPi.h>


#include <stdio.h>

#include <stdlib.h>

#include <stdint.h>

#include <sys/time.h>


#define TRIG_PIN        4

#define ECHO_PIN        5


void read_sr04_dat()

{

        int counter = 0;

        struct timeval start_point, end_point;

        double operating_time;

        double len;


        pinMode(TRIG_PIN, OUTPUT);

        pinMode(ECHO_PIN, INPUT);

        digitalWrite(TRIG_PIN, LOW);

//      delay(500); // 500 msec


        digitalWrite(TRIG_PIN, HIGH);

        delayMicroseconds( 10 );

        digitalWrite(TRIG_PIN, LOW);



        while ( digitalRead(ECHO_PIN) == LOW)

        {

                counter++;

                delayMicroseconds( 1 );

                if ( counter == 38000 )

                {

                        return;

                }

        }

        gettimeofday(&start_point, NULL);


        while ( digitalRead(ECHO_PIN) == HIGH)

        {

                counter++;

                delayMicroseconds( 1 );

                if ( counter == 38000 )

                {

                        return;

                }

        }


        gettimeofday(&end_point, NULL);


        operating_time = (double)(end_point.tv_sec)+(double)(end_point.tv_usec)/1000000.0-(double)(start_point.tv_sec)-(double)(start_point.tv_usec)/1000000.0;

        len = operating_time * 34300 / 2;


        printf("%f sec %4.2f cm %d\n",operating_time, len, counter);

}


int main( void )

{

        if ( wiringPiSetup() == -1 )

                exit( 1 );


        while ( 1 )

        {

                read_sr04_dat();

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

        }


        return(0);



한번 보냈는데 못 재면 이상한 값을 뱉는건 왜그럴까나..

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

redmine 백업  (0) 2016.07.14
초음파 거리 + 온/습도 센서  (0) 2016.07.10
초음파/온습도 센서 데이터 시트 복사  (0) 2016.07.10
rpi gstreamer mux  (0) 2016.06.28
beowulf / openMPI  (0) 2016.06.28
Posted by 구차니
embeded/raspberry pi2016. 7. 10. 10:59

백업용


초음파 센서 HC-SR04

           - Power Supply :+5V DC

           - Quiescent Current : <2mA

           - Working Currnt: 15mA

           - Effectual Angle: <15°

           - Ranging Distance : 2cm – 400 cm/1" - 13ft

           - Resolution : 0.3 cm

           - Measuring Angle: 30 degree

           - Trigger Input Pulse width: 10uS

           - Dimension: 45mm x 20mm x 15mm

[링크 : http://eleparts.co.kr/EPXF6C83]


온/습도 센서

어.. 의외로 온도 범위가 좁다?


Specifications

Temperature measuring range: 0℃~ 50℃  

Temperature tolerance: ±2℃ 

Humidity measuring range: 20% ~ 95% (0℃ ~ 50℃) 

Humidity tolerance: ±5% 

Dimension: 29.0mm * 18.0mm 

Mounting holes size: 2.0mm


Applications

Ambient temperature and humidity detection


How to Use

In the case of working with a MCU:


-VCC ↔ 3.3V ~ 5.5V 

-GND ↔ power supply ground 

-DOUT ↔ MCU.IO

[링크 : http://eleparts.co.kr/EPXF43N9]

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

초음파 거리 + 온/습도 센서  (0) 2016.07.10
초음파 센서 wiring pi 버전  (0) 2016.07.10
rpi gstreamer mux  (0) 2016.06.28
beowulf / openMPI  (0) 2016.06.28
redmine on raspberrypi  (9) 2016.06.23
Posted by 구차니
embeded/raspberry pi2016. 6. 28. 18:27


gst-launch-1.0 \

    v4l2src device=$VIDEO_DEVICE \

        ! $VIDEO_CAPABILITIES \

        ! mux. \

    alsasrc device=$AUDIO_DEVICE \

        ! $AUDIO_CAPABILITIES \

        ! mux. \

    avimux name=mux \

        ! filesink location=test-$( date --iso-8601=seconds ).avi


[링크 : https://www.linuxtv.org/wiki/index.php/GStreamer]


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

초음파 센서 wiring pi 버전  (0) 2016.07.10
초음파/온습도 센서 데이터 시트 복사  (0) 2016.07.10
beowulf / openMPI  (0) 2016.06.28
redmine on raspberrypi  (9) 2016.06.23
gsteamer rtspsink  (0) 2016.06.21
Posted by 구차니