esp32

Intro ๊ธฐ๋ณธ ์ •๋ณด Espressif Systems ์ œ์กฐ, 2016๋…„ ์ถœ์‹œ Wi-Fi์™€ ๋ธ”๋ฃจํˆฌ์Šค ๋ฌด์„  ํ†ต์‹  ๊ธฐ๋Šฅ์„ ํƒ‘์žฌํ•œ ์ €์ „๋ ฅ ๋งˆ์ดํฌ๋กœ์ปจํŠธ๋กค๋Ÿฌ ๊ฐ•๋ ฅํ•œ ํผํฌ๋จผ์Šค, ๊ณ ์„ฑ๋Šฅ ์–ดํ”Œ๋ฆฌ์ผ€์ด์…˜ ์ฒ˜๋ฆฌ esp8266์˜ ์—…๊ทธ๋ ˆ์ด๋“œ ๋ฒ„์ „ ์ŠคํŽ™ CPU - Xtensaยฎ single-/dual-core 32-bit LX6 microprocessor(s) ๋™์ž‘์ „์•• - 2.7V~3.6V WIFI - 802.11b/g/n (2.4 GHz) ๋ธ”๋ฃจํˆฌ์Šค - v4.2 BR/EDR ๋ฐ Bluetooth LE IO(pinout) - 34 RAM - 448KB SRAM - 520KB ์™ธ์žฅํ”Œ๋ž˜์‰ฌ - 512KB(์ตœ์†Œ์‚ฌ์–‘),OTA(on the air)์ตœ์†Œ์‚ฌ์–‘(1MB)~16MB๊นŒ์ง€ ์ง€์› ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ์ค€๋น„๋ฌผ esp32 ๊ฐœ๋ฐœ ์ปจํŠธ๋กค๋Ÿฌ (์ธํ„ฐ๋„ท์—์„œ ๊ตฌ๋งค) nodemcu firmware - ์ง์ ‘ buildํ•˜๊ฑฐ๋‚˜ ๋ฐฐํฌ๋œ ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด ๋ฐ›๋Š”๋‹ค. firmware upload tool - esptool, NodeMCU-PyFlasher Esplorer - Java๋กœ ๋งŒ๋“  GUI ๊ฐœ๋ฐœ ํˆด (์˜คํ”ˆ์†Œ์Šค, ์—ฌ๋Ÿฌ OS์— ๋…๋ฆฝ ์‹คํ–‰) ๊ฐœ๋ฐœ๋ฐฉ๋ฒ•์€ ์•„๋‘์ด๋…ธIDE๋ฅผ ํ†ตํ•œ ๊ฐœ๋ฐœ(C์–ธ์–ด)๊ณผ nodemcu + Esplorer๋ฅผ ํ†ตํ•œ ๊ฐœ๋ฐœ(Lua์–ธ์–ด)์ด ์žˆ๋‹ค. ...

2023-12-13 ยท (updated 2023-12-16) ยท 834 words

esp8266

Intro ๊ธฐ๋ณธ ์ •๋ณด Espressif Systems ์ œ์กฐ, 2014 ์ถœ์‹œ Wi-Fi ๋ฌด์„  ํ†ต์‹  ๊ธฐ๋Šฅ์„ ํƒ‘์žฌํ•œ ์ €์ „๋ ฅ ๋งˆ์ดํฌ๋กœ์ปจํŠธ๋กค๋Ÿฌ ์ €๋ ดํ•œ ๊ฐ€๊ฒฉ, IoT๊ตฌํ˜„์„ ์œ„ํ•œ ์ตœ์ ์˜ ์ปจํŠธ๋กค๋Ÿฌ ์ŠคํŽ™ CPU - Tensilica Xtensaยฎ L106(Diamond Standard 106Micro) @80/160MHz (32-bit RISC) ๋™์ž‘์ „์•• - 2.7V~3.6V WIFI - 802.11 b/g/n(HT20) ํ”„๋กœํ† ์ฝœ IO(pinout) - 17 RAM - 160KB(iRAM64KB,dRAM96KB) SRAM - 1KB ์™ธ์žฅํ”Œ๋ž˜์‰ฌ - 512KB(์ตœ์†Œ์‚ฌ์–‘),OTA(on the air)์ตœ์†Œ์‚ฌ์–‘(1MB)~16MB๊นŒ์ง€ ์ง€์› ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ์ค€๋น„๋ฌผ esp8266 ๊ฐœ๋ฐœ ์ปจํŠธ๋กค๋Ÿฌ (์ธํ„ฐ๋„ท์—์„œ ๊ตฌ๋งค) nodemcu firmware - ์ง์ ‘ buildํ•˜๊ฑฐ๋‚˜ ๋งŒ๋“ค์–ด์ง„ ์ด๋ฏธ์ง€๋ฅผ ๋‹ค์šด ๋ฐ›๋Š”๋‹ค. firmware upload tool - esptool, NodeMCU-PyFlasher Esplorer - Java๋กœ ๋งŒ๋“  GUI ๊ฐœ๋ฐœ ํˆด (์˜คํ”ˆ์†Œ์Šค, ์—ฌ๋Ÿฌ OS์— ๋…๋ฆฝ ์‹คํ–‰) esp8266 ๊ฐœ๋ฐœ๋ณด๋“œ ๋น„๊ต - https://frightanic.com/iot/comparison-of-esp8266-nodemcu-development-boards/ ๊ฐœ๋ฐœ๋ฐฉ๋ฒ•์€ ์•„๋‘์ด๋…ธIDE๋ฅผ ํ†ตํ•œ ๊ฐœ๋ฐœ(C์–ธ์–ด)๊ณผ nodemcu + Esplorer๋ฅผ ํ†ตํ•œ ๊ฐœ๋ฐœ(Lua์–ธ์–ด)์ด ์žˆ๋‹ค. ์ „์ž๋Š” ์ธํ„ฐ๋„ท์— ๋งŽ์€ ์ž๋ฃŒ์™€ ์˜ˆ์ œ๊ฐ€ ์žˆ์œผ๋ฏ€๋กœ ์ด๋ฅผ ์ฐธ์กฐํ•œ๋‹ค. ์—ฌ๊ธฐ์—์„œ๋Š” nodemcu(Lua base Firmware) + Esplorer(GUI Dev Tool)์— ์ง‘์ค‘ํ•œ๋‹ค. STEP01. ํ•˜๋“œ์›จ์–ด ์ค€๋น„: nodemcu esp8266 dev kit usb serial driver install - CP210x_Universal_Windows_Driver https://www.silabs.com/developers/usb-to-uart-bridge-vcp-drivers ์žฅ์น˜ ์—ฐ๊ฒฐ ํ™•์ธ Windows - ์žฅ์น˜๊ด€๋ฆฌ์ž > usb com serial port ํ™•์ธ Linux - lsusb ...

2023-12-13 ยท (updated 2023-12-19) ยท 404 words

NodeMCU

Intro a low-cost open source IoT platform arduino์™€ ๋‹ฌ๋ฆฌ ์™€์ดํŒŒ์ด ๋ฐ ๋ธ”๋ฃจํˆฌ์Šค ๋ชจ๋“ˆ ํƒ‘์žฌ ์‚ฌ๋ฌผ์ธํ„ฐ๋„ท(IoT)์šฉ MCU ์žฅ์น˜๋ฅผ ๊ฐœ๋ฐœํ•˜๋Š”๋ฐ ์ ํ•ฉ ์ข…๋ฅ˜ esp8266 esp32 esp8266-vs-esp32 - ๋น„๊ต ๊ฐœ๋ฐœํ™˜๊ฒฝ ์•„๋‘์ด๋…ธ IDE (Linux, Windows, Mac) Esplorer (Linux, Windows, Mac - Java) TOOLS esptool - esp firmware upload, read tool ETC fritzing์„ ์ด์šฉํ•˜์—ฌ ํ”„๋กœ์ ํŠธ๋ฅผ ์„ค๊ณ„ํ•˜๊ณ  ํšŒ๋กœ๋„๋ฅผ ๊ทธ๋ฆด ์ˆ˜ ์žˆ๋‹ค. REFERENCE ์ฃผ์˜ - www.nodemcu.com์˜ example์€ ์˜ค๋ž˜๋˜์—ˆ์œผ๋ฏ€๋กœ ์•„๋ž˜ docs๋ฅผ ์ฐธ๊ณ ํ•œ๋‹ค. esp์นฉ ์ œ์กฐ์‚ฌ - https://www.espressif.com/ nodemcu home - http://www.nodemcu.com docs esp8266 - https://nodemcu.readthedocs.io/en docs esp32 - https://nodemcu.readthedocs.io/en/dev-esp32/ faqs - https://nodemcu.readthedocs.io/en/dev-esp32/lua-developer-faq/

2023-12-13 ยท (updated 2023-12-17) ยท 82 words

Arduino - ์•„๋‘์ด๋…ธ

Intro ์‚ฌ์šฉํ•˜๊ธฐ ์‰ฌ์šด ํ•˜๋“œ์›จ์–ด์™€ ์†Œํ”„ํŠธ์›จ์–ด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ ์˜คํ”ˆ์†Œ์Šค ์ „์ž ํ”Œ๋žซํผ ์ดํƒˆ๋ฆฌ์•„ ๋งˆ์‹œ๋ชจ ๋ฐ˜์ง€(Massimo Banzi,๋Œ€ํ•™๊ต์ˆ˜)๊ฐ€ ๊ฐœ๋ฐœ ๋ฐ ๊ณต๊ฐœ ๋น„์ „๊ณต์ž๋ฅผ ์œ„ํ•œ ๊ฐœ๋ฐœ ๋ณด๋“œ ํ•˜๋“œ์›จ์–ด ์ข…๋ฅ˜ $ arduino-cli board listall Board Name FQBN Adafruit Circuit Playground arduino:avr:circuitplay32u4cat Arduino BT arduino:avr:bt Arduino Duemilanove or Diecimila arduino:avr:diecimila Arduino Esplora arduino:avr:esplora Arduino Ethernet arduino:avr:ethernet Arduino Fio arduino:avr:fio Arduino Gemma arduino:avr:gemma Arduino Industrial 101 arduino:avr:chiwawa Arduino Leonardo arduino:avr:leonardo Arduino Leonardo ETH arduino:avr:leonardoeth Arduino Mega ADK arduino:avr:megaADK Arduino Mega or Mega 2560 arduino:avr:mega Arduino Micro arduino:avr:micro Arduino Mini arduino:avr:mini Arduino NG or older arduino:avr:atmegang Arduino Nano arduino:avr:nano Arduino Pro or Pro Mini arduino:avr:pro Arduino Robot Control arduino:avr:robotControl Arduino Robot Motor arduino:avr:robotMotor Arduino Uno arduino:avr:uno Arduino Uno Mini arduino:avr:unomini Arduino Uno WiFi arduino:avr:unowifi Arduino Yรบn arduino:avr:yun Arduino Yรบn Mini arduino:avr:yunmini LilyPad Arduino arduino:avr:lilypad LilyPad Arduino USB arduino:avr:LilyPadUSB Linino One arduino:avr:one ์†Œํ”„ํŠธ์›จ์–ด ์„ค์น˜ arduino-ide - ์•„๋‘์ด๋…ธ ํ™ˆํŽ˜์ด์ง€์— OS๋ณ„๋กœ ๋‹ค์šด๋กœ๋“œ ๋ฐ ์„ค์น˜ ๊ฐ€๋Šฅ arduino cli - Command Line Interface (Linux, Win์šฉ) REFERENCE ์•„๋‘์ด๋…ธ - https://www.arduino.cc

2023-10-30 ยท (updated 2023-10-31) ยท 154 words

Arduino-cli - ์•„๋‘์ด๋…ธ ๋ช…๋ น๋ผ์ธ ์‚ฌ์šฉ

Intro arduino-cli๋Š” ์•„๋‘์ด๋…ธ IDE์˜ ๋ช…๋ น๋ผ์ธ ํˆด์ด๋‹ค. (์†Œํ”„ํŠธ์›จ์–ด ํˆด) Shell Script๋กœ ์—ฌ๋Ÿฌ ๋ฒˆ๊ฑฐ๋กœ์šด ์ž‘์—…์„ ์ž๋™ํ™” ํ•  ์ˆ˜ ์žˆ๋‹ค. nvim ์ด๋‚˜ vim์—์„œ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ๋Š” ํ™˜๊ฒฝ์— ์ ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค. nvim์„ ์ค‘์‹ฌ์œผ๋กœ ์ฝ”๋“œ ์ž‘์„ฑ, ์ปดํŒŒ์ผ, ๋””๋ฒ„๊น…์„ ๋ชจ๋‘ ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋‹ค. ์„ค์น˜ ๋ฐ ์‚ฌ์šฉํ™˜๊ฒฝ: windows, windows-wsl2-alpine, linux-ubuntu Intall: Windows reference: https://dumblebots.com/2020/08/02/arduino-cli-getting-started-windows/ ์œˆ๋„์šฐ์ฆˆ์šฉ arduino-cli.exe๋ฅผ ๋‹ค์šด๋ฐ›์•„ ์„ค์น˜, dos-shell ๋˜๋Š” powershell์—์„œ ๊ฒฝ๋กœ ์ถ”๊ฐ€ํ•˜๊ณ  ์‚ฌ์šฉ ์ด๋ฅผ ์œˆ๋„์šฐ์ฆˆ wsl2 ๊ธฐ๋ฐ˜์˜ ๋ฆฌ๋ˆ…์Šค์—์„œ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ /mnt/c/<์ดํ•˜๊ฒฝ๋กœ>๋กœ ์ ‘๊ทผ ๊ฐ€๋Šฅํ•˜๋‹ค. PATH์— ์ถ”๊ฐ€. Install: Linux ์ผ๋ฐ˜์‚ฌ์šฉ์ž์˜ ๊ฒฝ์šฐ ~/bin์— ์„ค์น˜: PATH์— ์ถ”๊ฐ€ curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh Install: windows-wsl2-alpine reference: https://github.com/dorssel/usbipd-win/wiki/WSL-support ์•„๋‘์ด๋…ธ ์žฅ์น˜๋ฅผ USB์— ์—ฐ๊ฒฐํ•œ๋‹ค. wsl2-alpine - gcompat, usbip, hwdata ์„ค์น˜ gcompat์€ ardunino-cli๋กœ ์ปดํŒŒ์ผํ•  ๋•Œ ld-linux-x86-64.so.2 ์‚ฌ์šฉํ•˜๋Š”๋ฐ alpine์€ musl ๊ธฐ๋ฐ˜์ด๋ฏ€๋กœ ํ˜ธํ™˜ ์ง€์› ํŒจํ‚ค์ง€๋ฅผ ์„ค์น˜ํ•ด์•ผ ํ•œ๋‹ค. usbip๋Š” usbipd์˜ ํด๋ผ์ด์–ธํŠธ ํŒจํ‚ค์ง€ hwdata๋Š” USB๋“ฑ์˜ ์žฅ์น˜ํŒŒ์ผ ardunino-cli ์‚ฌ์šฉ์ž ์„ค์น˜์‹œ์— USB์žฅ์น˜ ์†Œ์œ ๊ถŒ ๋ฌธ์ œ๊ฐ€ ์žˆ๋‹ค. ์žฅ์น˜ ์†Œ์œ ๊ถŒ์„ ํ•ด๋‹น ์‚ฌ์šฉ์ž๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค. windows - usbipd-win ์„ค์น˜ ๋ฐ ์„ค์ • usbipd๋Š” ์œˆ๋„์šฐ์ฆˆ์—์„œ wsl2 ๋“ฑ์— USB ์žฅ์น˜๋ฅผ ๊ณต์œ ํ•ด์ฃผ๋Š” ๋ฐ๋ชฌ ํ”„๋กœ๊ทธ๋žจ ๋ฐ˜๋“œ์‹œ ๊ด€๋ฆฌ์ž ๊ถŒํ•œ์œผ๋กœ ์‹คํ–‰ํ•ด ์ฃผ์–ด์•ผํ•œ๋‹ค. ์•„๋‘์ด๋…ธ ์žฅ์น˜๋ฅผ wsl2์— ๋ถ™์—ฌ ์ฃผ์—ˆ์„ ๊ฒฝ์šฐ ์œˆ๋„์šฐ์—์„œ๋Š” ์‚ฌ์šฉํ•  ์ˆ˜ ์—†๋‹ค. ์ด ๋ฐ๋ชฌ์€ usbip ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์„ ํ†ตํ•ด USB์žฅ์น˜(์—ฌ๊ธฐ์—์„œ๋Š” ์•„๋‘์ด๋…ธ)๋ฅผ ๊ณต์œ  # WSL2-Alpine Linux: Pre-Package Install doas apk update doas apk add gcompat linux-tools-usbip hwdata # Windows-Powershell # ๊ด€๋ฆฌ์ž๊ถŒํ•œ์œผ๋กœ ์‹คํ–‰, ์œˆ๋„์šฐ์ฆˆ ์žฌ๋ถ€ํŒ…์‹œ ๋‹ค์‹œ ์„ค์ •ํ•ด์ฃผ์–ด์•ผ ํ•œ๋‹ค. # ์—ฐ๊ฒฐ์‹œ ์ž๋™ attach ๋ฐฉ๋ฒ•์„ ๋ชจ์ƒ‰ํ•  ํ•„์š”๊ฐ€ ์žˆ๋‹ค. # usbipd๋ฅผ ์„ค์น˜ํ•˜๊ณ  wsl list๋ฅผ ํ†ตํ•ด ์•„๋‘์ด๋…ธ์˜ busid๋ฅผ ํ™•์ธํ•˜๊ณ  ์ด๋ฅผ ์—ฐ๊ฒฐํ•˜๊ณ  ํ™•์ธ. winget usbipd usbipd wsl list usbipd wsl attach --busid=2-2 usbipd wsl list # WSL2-Alpine Linux: arduino-cli Install # usb ์ง€์›์—ฌ๋ถ€ ํ™•์ธ # ardunino-cli ์„ค์น˜ ๋ฐ ํŒจ์Šค ์„ค์ • # ์žฅ์น˜ ์†Œ์œ ๊ถŒ ํ˜„ ์‚ฌ์šฉ์ž๋กœ ๋ณ€๊ฒฝ lsusb curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh export PATH=$PATH:$HOME/bin arduino-cli board list doas chown -R <user_id>:<user_id> /dev/ttyACM0 arduino-cli --help Install: debian, ubuntu lsusb curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh export PATH=$PATH:$HOME/bin arduino-cli board list sudo chown -R <user_id>:<user_id> /dev/ttyACM0 arduino-cli --help ์‹œ์ž‘ํ•˜๊ธฐ reference: https://arduino.github.io/arduino-cli/0.35/getting-started/ ์•„๋ž˜๋Š” Ardunino UNO์˜ ๊ฒฝ์šฐ # ๋„์›€๋ง arduino-cli help arduino-cli help core # ์„ค์ • ํŒŒ์ผ ์ดˆ๊ธฐํ™” (~/.arduino15/arduino-cli.yaml) arduino-cli config init # ์žฅ์น˜์™€ ์—ฐ๊ฒฐํ•˜๊ธฐ (Arduino UNO) arduino-cli board list arduino-cli core update-index arduino-cli core install arduino:avr arduino-cli board listall mkr # list์˜ ๋ณด๋“œ๊ฐ€ Unknown์œผ๋กœ ๋‚˜์˜ฌ ๊ฒฝ์šฐ arduino-cli board list # ์†Œ์Šค ์ž‘์„ฑ (๋™์ผํ•œ ์Šค์ผ€์น˜ ์ด๋ฆ„์˜ ํด๋”์™€ ํŒŒ์ผ์ด ํ•„์š”) # ๋‹ค๋ฅธ ๋ฐฉ๋ฒ•: arduino-cli sketch new myfirst && vim myfirst/myfirst.ino mkdir myfirst cat<<EOF > myfirst/myfirst.ino void setup() { pinMode(LED_BUILTIN, OUTPUT); } void loop() { digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); delay(1000); } # ์ปดํŒŒ์ผ๊ณผ ์—…๋กœ๋“œํ•˜๊ธฐ (upload์‹œ ์ž๋™ ์ปดํŒŒ์ผ) # ์žฅ์น˜๋ช… ํ™•์ธ: ardunino-cli board list # ์ปดํŒŒ์ผ(-b) arduino-cli compile --fqbn arduino:avr:uno myfirst # ์—…๋กœ๋“œ (-u) arduino-cli upload -p /dev/ttyACM0 --fqbn arduino:avr:uno myfirst # ์ปดํŒŒ์ผ(-b) & ์—…๋กœ๋“œ(-u) arduino-cli compile -p /dev/ttyACM0 -u arduino:avr:uno myfirst REFERENCE ardunino-cli ์„ค์น˜ ๋ฐ ์‹œ์ž‘ - https://arduino.github.io/arduino-cli/0.35/getting-started/ ์œˆ๋„์šฐ์ฆˆ ์„ค์น˜ ๋ฐ ์•ˆ๋‚ด - https://dumblebots.com/2020/08/02/arduino-cli-getting-started-windows/ wsl2์—์„œ usb์žฅ์น˜ ์—ฐ๊ฒฐ - https://github.com/dorssel/usbipd-win ardunino-cli linux install - https://m.blog.naver.com/roboholic84/221815428642

2023-10-30 ยท (updated 2023-10-31) ยท 437 words