아이디어!2015. 4. 27. 20:24

문득 생각나서 퇴근길에 검색해보니..

토카막이던 머던.. 결론은

거기서 발생하는 열 에너지를 이용하여 물을 끓이고

이 뜨거운 증기를 이용해 터빈을 돌려 운동 에너지로 변환하고

운동 에너지를 발전기를 통해 전기 에너지로 변환한다.



변환이라는 과정 자체가 효율이 존재하기 때문에 100% 전환될수가 없긴 하지만

열 -> 운동 -> 전기 에너지라는 2단계 전환보다


물질 -> 전기 에너지 이런식으로

물질에서 에너지를 뽑아내는 기술이 발명되게 된다면 얼마나 대단해질까 라는 생각이 든다.



물론 현실적(?)으로는 반물질로 충돌시켜 발생하는 어마어마한 에너지를 이용해

결국에는 터빈을 돌리겠지만...


Posted by 구차니
embeded/raspberry pi2015. 4. 27. 20:14


OpenELEC:~ # modprobe lirc_rpi debug=1

OpenELEC:~ # cat /sys/kernel/debug/gpio
GPIOs 0-53, platform/3f200000.gpio, pinctrl-bcm2835:
 gpio-35  (led1                ) in  lo
 gpio-47  (led0                ) out lo

OpenELEC:~ # cat /proc/interrupts
            CPU0       CPU1       CPU2       CPU3
 16:          0          0          0          0   ARMCTRL  16  bcm2708_fb dma
 24:         98          0          0          0   ARMCTRL  24  DMA IRQ
 25:       1539          0          0          0   ARMCTRL  25  DMA IRQ
 32:     390117          0          0          0   ARMCTRL  32  dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
 49:          0          0          0          0   ARMCTRL  49  3f200000.gpio:bank0
 50:          0          0          0          0   ARMCTRL  50  3f200000.gpio:bank1
 65:         30          0          0          0   ARMCTRL  65  ARM Mailbox IRQ
 66:     290877          0          0          0   ARMCTRL  66  VCHIQ doorbell
 75:          1          0          0          0   ARMCTRL  75
 84:       6518          0          0          0   ARMCTRL  84  mmc0
 99:      65543      47405      39193      57753   ARMCTRL  99  arch_timer
497:          0          0          0          0  pinctrl-bcm2835  17  lirc_rpi
FIQ:              usb_fiq
IPI0:          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0  Timer broadcast interrupts
IPI2:      16388      33373      85486     101209  Rescheduling interrupts
IPI3:          1          4          6          5  Function call interrupts
IPI4:          2          1          2          6  Single function call interrupts
IPI5:          0          0          0          0  CPU stop interrupts
IPI6:          0          0          0          0  IRQ work interrupts
IPI7:          0          0          0          0  completion interrupts
Err:          0 

OpenELEC:~ # dmesg | grep -i lirc

[    5.898084] lirc_dev: IR Remote Control driver registered, major 248

[    5.925459] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.

[    6.822622] lirc_rpi: auto-detected active high receiver on GPIO pin 17

[    6.823177] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0

[    6.823195] lirc_rpi: driver registered!

[    7.268732] input: lircd as /devices/virtual/input/input3


OpenELEC:~ # lsmod | grep irc

lirc_rpi                5982  3

lirc_dev                7578  1 lirc_rpi

rc_core                14603  1 lirc_dev


mount -t debugfs debugfs /sys/kernel/debug
cat /sys/kernel/debug/gpio 

The output should be something like this (you should see two gpio pins allocated to the lirc_rpi driver):
GPIOs 0-53, bcm2708_gpio:
 gpio-16  (led0                ) out hi
 gpio-17  (lirc_rpi ir/out     ) in  lo
 gpio-18  (lirc_rpi ir/in      ) in  hi
Check dmesg after loading the module with the debug parameter.
modprobe lirc_rpi debug=1

lirc_dev: IR Remote Control driver registered, major 252 
lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.
lirc_rpi lirc_rpi.0: lirc_dev: driver lirc_rpi registered at minor = 0
lirc_rpi: driver registered!
lirc_rpi: is_right_chip bcm2708_gpio 0
lirc_rpi: to_irq 103
lirc_rpi: auto-detected active low receiver on GPIO pin 18
Run irw then check if the module succesfuly requested an irq.
cat /proc/interrupts
           CPU0       
  3:      88963   ARMCTRL  BCM2708 Timer Tick
 52:       3251   ARMCTRL  BCM2708 GPIO catchall handler
 65:          2   ARMCTRL  ARM Mailbox IRQ
 66:          1   ARMCTRL  VCHIQ doorbell
 75:   51434882   ARMCTRL  dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1
 77:        223   ARMCTRL  bcm2708_sdhci (dma)
 83:         24   ARMCTRL  uart-pl011
 84:       7123   ARMCTRL  mmc0
103:       3251      GPIO  lirc_rpi

[링크 : http://aron.ws/projects/lirc_rpi/] 


OpenELEC:~ # mode2 -d /dev/lirc0

mode2: could not open /dev/lirc0

mode2: default_init(): Device or resource busy


[링크 : http://aron.ws/projects/lirc_rpi/openelec_howto.html]



+2015.04.28


gpio -g write 16 1

dtoverlay=lirc-rpi,gpio_out_pin=16,gpio_in_pin=17,debug=on

dtoverlay=lirc-rpi,gpio_out_pin=25,gpio_in_pin=18

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


File:   lirc-rpi-overlay.dtb

Info:   Configures lirc-rpi (Linux Infrared Remote Control for Raspberry Pi)

        Consult the module documentation for more details.

Load:   dtoverlay=lirc-rpi,<param>=<val>,...

Params: gpio_out_pin             GPIO pin for output (default "17")


        gpio_in_pin              GPIO pin for input (default "18")


        gpio_in_pull             Pull up/down/off on the input pin

                                 (default "down")


        sense                    Override the IR receive auto-detection logic:

                                   "1" = force active high

                                   "0" = force active low

                                   "-1" = use auto-detection

                                 (default "-1")


        softcarrier              Turn the software carrier "on" or "off"

                                 (default "on")


        invert                   "on" = invert the output pin (default "off")


        debug                    "on" = enable additional debug messages

                                 (default "off")


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



+ 2015.04.28

config.txt

dtoverlay=lirc-rpi,gpio_in_pin=18,debug=on


OpenELEC:~ # dmesg | grep -i lirc

[    5.656942] lirc_dev: IR Remote Control driver registered, major 248

[    5.703156] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.

[    5.705297] lirc_rpi: to_irq 498

[    6.595845] lirc_rpi: auto-detected active high receiver on GPIO pin 18

[    6.596240] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0

[    6.596255] lirc_rpi: driver registered!

[    6.769256] input: lircd as /devices/virtual/input/input0

[    7.791546] lirc_rpi: Interrupt 498 obtained

[    7.791573] lirc_rpi: in init_timing_params, freq=38000 pulse=13157, space=13158


OpenELEC:~ #  modprobe lirc_rpi debug=1


OpenELEC:~ # cat /sys/kernel/debug/gpio

GPIOs 0-53, platform/3f200000.gpio, pinctrl-bcm2835:

 gpio-35  (led1                ) in  lo

 gpio-47  (led0                ) out lo


OpenELEC:~ # cat /proc/interrupts

            CPU0       CPU1       CPU2       CPU3

 16:          0          0          0          0   ARMCTRL  16  bcm2708_fb dma

 24:         42          0          0          0   ARMCTRL  24  DMA IRQ

 25:       1532          0          0          0   ARMCTRL  25  DMA IRQ

 32:      22278          0          0          0   ARMCTRL  32  dwc_otg, dwc_otg_pcd, dwc_otg_hcd:usb1

 49:          0          0          0          0   ARMCTRL  49  3f200000.gpio:bank0

 50:          0          0          0          0   ARMCTRL  50  3f200000.gpio:bank1

 65:         32          0          0          0   ARMCTRL  65  ARM Mailbox IRQ

 66:      46149          0          0          0   ARMCTRL  66  VCHIQ doorbell

 75:          1          0          0          0   ARMCTRL  75

 84:       5845          0          0          0   ARMCTRL  84  mmc0

 99:       8864       7960       6038       4639   ARMCTRL  99  arch_timer

498:          0          0          0          0  pinctrl-bcm2835  18  lirc_rpi

FIQ:              usb_fiq

IPI0:          0          0          0          0  CPU wakeup interrupts

IPI1:          0          0          0          0  Timer broadcast interrupts

IPI2:      14513      40888       8299       7798  Rescheduling interrupts

IPI3:          2          4          5          2  Function call interrupts

IPI4:          1          5          0          1  Single function call interrupts

IPI5:          0          0          0          0  CPU stop interrupts

IPI6:          1          0          0          0  IRQ work interrupts

IPI7:          0          0          0          0  completion interrupts

Err:          0



Posted by 구차니
프로그램 사용/ncurses2015. 4. 27. 17:44

쓸일이 생길지도 모르니 일단 조사..


[링크 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/article/ncurses_프로그래밍]

'프로그램 사용 > ncurses' 카테고리의 다른 글

ncurses 상자 및 색상 적용하기  (0) 2024.12.02
ncurses 예제  (0) 2024.11.30
ncurse example  (0) 2022.05.17
Posted by 구차니

focal length랑 focal distance 용어가 다른거 같은데..

기억이 안나네 -_-


아무튼.. 촛점을 기준으로 비례해서 센서/필름에서의 크기로 실제 크기를 재는 식으로 거리를 재는 듯?

순수하게 촛점거리를 이용해서(렌즈-센서 거리) 피사체 까지의 거리를 재진 못하려나..


[링크 : http://photo.stackexchange.com/questions/12434/how-do-i-calculate-the-distance-of-an-object-in-a-photo]

[링크 : http://www.dpreview.com/forums/thread/1750289]


[링크 : http://www.lensation.de/en/calculators.html]



[링크 : http://egloos.zum.com/lontide/v/4892216] 심도계산

'이론 관련 > 사진 광학 관련' 카테고리의 다른 글

SAD(Sum of Absolute Differences) 알고리즘  (0) 2015.05.06
TOF - Time of Flight  (0) 2015.04.30
rolling shutter  (0) 2014.08.13
OLPF / MTF  (0) 2013.03.21
UV / CPL / ND64 필터 테스트  (8) 2012.12.25
Posted by 구차니
Linux2015. 4. 27. 09:26

쓰레드와 프로세스의 context switch 개념에서의 차이점


프로세스는 code / data / heap / stack 모두 스위칭

쓰레드는 stack만 스위칭


[링크 : http://egloos.zum.com/sweeper/v/2815395]


[링크 : http://en.wikipedia.org/wiki/Context_switch]

[링크 : http://en.wikipedia.org/wiki/Thread_(computing)]

Posted by 구차니

회사에 누군가 하나라도 당해서

우연히(?) 파일서버를 네트워크 드라이브로 쓰고 있었다면?!?!

어우....


계속 시끌시끌 하지만 여전히 해결책이 없고

플래시 버전업 외에는 딱히 해결책이 없는데다

랜섬웨어 특징상 돈을 준다고 해도 풀어 줄지 안줄지 알수가 없기 때문에


몇번이고 울궈먹을수 있는 상황이라

회사가 당하면 정말 치명적일듯..



역설적으로 Adobe Flash는 이런 사건을 계기로 완전 배제 되지 않으려나 싶긴한데

국내에서는 그게 안되니 어떨려나..

회사 서버가 다 털려서(어짜피 클라이언트가 암호화 해버리는 거니 서버를 주기적으로 전체 백업하지 않는 이상...)

업무 불가능 해지면 그때야 손을 보게 되려나?...

Posted by 구차니
embeded/raspberry pi2015. 4. 24. 08:20

테스터가 없어서

회사 들고와서 전압을 체크 했는데

통전 시험 ok

전압 3.3v ok

전압 5.5v ok


머지 -ㅁ-?


---

device tree overlay 관련해서 lirc-rpi만 했는데

아래것들도 해줘야 하는건가 ...

# Uncomment this to enable the lirc-rpi module

#dtoverlay=lirc-rpi


# Uncomment this to override the defaults for the lirc-rpi module

#dtparam=gpio_out_pin=16

#dtparam=gpio_in_pin=17

#dtparam=gpio_in_pull=down


[링크 : https://www.raspberrypi.org/documentation/configuration/device-tree.md] 


dtoverlay=lirc-rpi

dtparam=gpio_out_pin=16

dtparam=gpio_in_pin=17

dtparam=gpio_in_pull=down

or appended to the overlay line like this:


dtoverlay=lirc-rpi:gpio_out_pin=16,gpio_in_pin=17,gpio_in_pull=down 


[링크 : https://www.raspberrypi.org/documentation/configuration/device-tree.md]



GPIO16/17은 먼데 설정을 해주지 -ㅁ-?


[링크 : http://elinux.org/RPi_BCM2835_GPIOs]



+

[링크 : http://alexba.in/blog/2013/01/06/setting-up-lirc-on-the-raspberrypi/]

[링크 : http://aron.ws/projects/lirc_rpi/]

Posted by 구차니
embeded/raspberry pi2015. 4. 23. 09:12


before


after


집에가서 해봐야지 머.. ㅠㅠ


IR 리시버 수신 방향이라던가

높이 문제라던가 여러가지가 발생할 것으로 예상... OTL

Posted by 구차니

지르는데 이유가 있나? 걍 지르는거지 머 ㅋㅋ

그나저나..


래곤 에이지 : 오리진

Peggle

bejeweled

simcity 2000

wing commander 3

는 오리진 무료 게임으로 풀은적이 있는건데?!


데드 스페이스 2는 이미 있고

C&C 전편은 예전에 아마존에서 할인할때 샀고

일단 이번 지름 목적은 윙커맨더 4 ㅋ





+



어?peggle은 예전거랑 다른건가?!


Posted by 구차니
embeded/raspberry pi2015. 4. 22. 09:53

플랫폼

- Raspberry pi 2 B+

- openelec / kodi helix 14.x

- 늘솜 GPIO 확장 키트 + ir receiver(TSOP38238)



GPIO IR receiver

Don't have a CEC TV or a smartphone remote? For less than a dollar/euro, you can add an IR receiver to your Raspberry Pi that works with most MCE and Apple remotes (and a few others). Most Kodi install options for the Pi should work with the GPIO IR out of the box, or by enabling a setting from within Kodi. Go to a local electronics store or search on ebay for "TSOP4838" and use some simple jumper wires (or solder the pins directly, if you wish). (We need a link to a good, up to date GPIO IR guide. Most of the links I found are outdated and contain instructions for additional configurations that are no longer required. If you find a good link/guide, please add it to the wiki.)


If you are using OpenELEC just add this to your config.txt file:

device_tree_overlay=lirc-rpi

[링크 : http://kodi.wiki/view/Raspberry_Pi] 


[링크 : http://wiki.openelec.tv/index.php/Guide_To_lirc_rpi_GPIO_Receiver]


[링크 : http://wiki.openelec.tv/index.php/Guide_to_add_your_own_remote]

[링크 : http://www.alessandrocolla.com/configuring-ir-remote-control-openelec-5-0/]


config.txt에 넣어 나서 부팅로그

OpenELEC:~ # dmesg | grep -i lirc

[    5.581824] lirc_dev: IR Remote Control driver registered, major 248

[    5.601775] lirc_rpi: module is from the staging directory, the quality is unknown, you have been warned.

[    6.495878] lirc_rpi: auto-detected active high receiver on GPIO pin 18

[    6.498306] lirc_rpi lirc_rpi: lirc_dev: driver lirc_rpi registered at minor = 0

[    6.498585] lirc_rpi: driver registered!

[    6.822791] input: lircd as /devices/virtual/input/input1 


OpenELEC:~ # ps -ef | grep -i lirc

  213 root       0:00 /usr/sbin/eventlircd -f --evmap=/etc/eventlircd.d --socket=/run/lirc/lircd --release=_UP

  386 root       3:28 /usr/lib/kodi/kodi.bin --standalone -fs --lircdev /run/lirc/lircd

  390 root       0:00 /usr/sbin/lircd --uinput --driver=default --device=/dev/lirc0 --output=/run/lirc/lircd-lirc0 --pidfile=/run/lirc/lircd-lirc0.pid /etc/lirc/lircd.conf.rpi

  530 root       0:00 grep -i lirc 



나머지는... 땜질 다시 하고 나서 ㅠㅠ



경로가 미묘하게 다른거 같은데.. 다른 설정도 있나..

아니면 땜질하다가 부품 태워먹었나.. ㅠㅠ

irw /var/run/lirc/lircd-lirc0

-> irw /run/lirc/lircd-lirc0



# ir-keytable -p LIRC

Couldn't find any node at /sys/class/rc/rc*.

# ir-keytable -p LIRC -d /sys/class/lirc/lirc0

Unable to query evdev protocol version: Inappropriate ioctl for device



Posted by 구차니