기본 콘텐츠로 건너뛰기

라벨이 raspberryPi인 게시물 표시

Rasbperry Pi Zero W 에 Docker 설치함. (/w raspbian)

w3c 컨퍼 갔다왔더니 docker를 다시 잘 써보고 싶어졌다. 귀염둥이 Raspberry Pi Zero W를 꺼내서 ssh 접속하고 docker-ce를 설치해본다. $ echo "deb [arch=armhf] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list deb [arch=armhf] https://download.docker.com/linux/debian jessie stable $ sudo apt update && sudo apt install docker-ce -y --force-yes Get:1 https://download.docker.com jessie InRelease [20.2 kB]                                  Hit http://mirrordirector.raspbian.org jessie InRelease                                        Ign https://download.docker.com jessie InRelease                          Hit https://download.docker.com jessie/stable armhf Packages Hit http://archive.raspberrypi.org jessie InRel...

raspberryPi zero 에서 USB 네트웍 연결이 안될 때.

집에선 안되고 밖에선 잘되는 알 수 없는 USB 네트웍 연결 raspberryPi Zero가 연결 안된 상태에서 ping 을 했을 때 $ ping raspberrypi.local PING raspberrypi.local (218.38.137.28): 56 data bytes 64 bytes from 2xx.xx.xxx.xx: icmp_seq=0 ttl=53 time=3.452 ms 64 bytes from 2xx.xx.xxx.xx: icmp_seq=1 ttl=53 time=2.664 ms 64 bytes from 2xx.xx.xxx.xx: icmp_seq=2 ttl=53 time=3.632 ms 64 bytes from 2xx.xx.xxx.xx: icmp_seq=3 ttl=53 time=5.183 ms 64 bytes from 2xx.xx.xxx.xx: icmp_seq=4 ttl=53 time=3.374 ms 64 bytes from 2xx.xx.xxx.xx: icmp_seq=5 ttl=53 time=3.516 ms ^C 이렇게 다른 놈이 잡고 있어서다. 다른 네트웍(가령 테더링)으로 연결 후 ssh pi@raspberrypi.local 로 접근(기본 암호는 raspberry) 후 잘되면 sudo vi /etc/hostname 하여 기존 raspberrypi 를 적절한 것으로 변경하고 raspberryPi Zero를 재부팅 후 ssh pi@<변경한 hostname>.local ( <>는 입력하지 않음) 으로 접속한다.

[tip] pico-8의 GPIO 기능

http://www.lexaloffle.com/pico-8.php?page=manual  를 읽다보니 재밌는 부분이 있다. 그건 바로 pico-8이 GPIO(General Purpose Input Output)를 지원한다는 점인데 CHIP/Pocket CHIP 뿐만 아니라 Raspberry Pi에도 대응하고 심지어 HTML으로 export했을 때도 된다는 사실. pico-8에는 가상의 메모리 맵이 있고 PEEK/POKE 명령으로 해당 주소를 읽고 쓸 수 있다. 메모리 맵은 아래와 같은데 0x0    gfx 0x1000 gfx2/map2 (shared) 0x2000 map 0x3000 gfx_props 0x3100 song 0x3200 sfx 0x4300 user data 0x5e00 persistent cart data (256 bytes) 0x5f00 draw state 0x5f40 hardware state 0x5f80 gpio pins (128 bytes) 0x6000 screen (8k) 이 0x5f80영역이 GPIO랑 붙는다. PEEK(0x5f80), POKE(0x5f81, 0xff)와 같이 접근 가능하다. CHIP류에선 0~7번 핀을 0x5f80~0x5f87까지 (PocketCHIP은 0,1 생략) RaspberryPi류에선 0x5f80~0x58f8f까지 사용할 수 있다. WiringPi Pin 번호에 주의하자 여튼 GPIO를 사용할 땐 pico8을 반드시 sudo 로 구동하여야 원활하게 사용할 수 있는 점을 명심하자. 재미있는 점은 HTML을 export 했을 때 pgio8_gpio 란 글로벌 변수로 GPIO를 시뮬레이션 할 수 있다. var pico8_gpio = Array(128); 이와 같이 미리 선언하고 PEEK, POKE하면 외부에서 pico-8 모듈로 읽고 쓰기가 가능해서 매우 유용하니 꼭 기억해두자.