본문 바로가기

RaspberryPi

(55)
Raspberry Pi PicoW - Bluetooth 설정 테스트 (BT Keyboard) Raspverry Pi Pico W의 무선 기능은 Infineon CYW43439를 사용한다. 이 장치에는 802.11n Wi-Fi와 Bluetooth 5.2를 모두 제공하는 2.4GHz 무선 장치가 포함되어 있으며 Bluetooth Classic 및 BLE(Bluetooth Low Energy) 기능을 지원한다. 기존에는 Bluetooth가 아닌 Wi-Fi만 지원했는데 이제 BLE를 지원 한다고 한다. C SDK 버전 1.5.1 과 최신 MicroPython 에서 Pico W가 Bluetooth 및 Bluetooth LE 장치를 사용할수 있다. 특히 ACL/SCO를 일시적으로 제외하고 BLE Central 및 Peripheral 역할과 함께 Bluetooth Classic을 지원한다고 한다. 우선 Pi..
Raspberry Pi PicoW - LittleFS를 사용한 웹서버 기존에 테스트 했던 웹서버는 저장소가 없이 소스코드 내에서 웹페이지의 정보를 전송 했는데 복잡한 웹페이지나 이미지가 많이 들어가는 웹페이지는 다루기가 어렵다. 그래서 파일 시스템(LittleFS)에 웹페이지 관련 파일들을 저장 해 두고 처리하면 상당히 편리 하다. 특히 웹페이지를 자주 바꾸어서 테스트 해야 하는 테스트에서는 파일시스템 내용만 바꾸면 되기 때문에 정말 빠르고 편리하게 개발 할 수 있다. ESP32 SPIFFS 웹서버 예제를 참고 해서 Pi Pico에서 제공하는 LittleFS로 웹서버를 구현하는 코드를 작성해 보자 #include #include #include #include #define _FS LittleFS #ifndef STASSID #define STASSID "****" #de..
Raspberry Pi PicoW - Ajax 를 이용한 실시간 웹 전압 디스플레이 ESP32-S2 웹서버 테스트 - Ajax 를 이용한 실시간 데이터 수신 테스트 코드를 이용하여 실시간 웹 디스플레이 테스트를 해보자. 코드는 거의 동일하게 구동된다. Pi Pico 확장 테스트 보드에는 ADC를 테스트 할 수 있는 가변저항(VR8)이 RP2040의 A0(GP26)에 할당되어 있다. 가변저항을 돌리면 전압변화가 생기고 이 전압을 웹페이지에 출력하는 코드를 작성해 보자. #include #include #include #ifndef STASSID #define STASSID "****" #define STAPSK "****" #endif const char* ssid = STASSID; const char* password = STAPSK; WebServer server(80); // HT..
Raspberry Pi PicoW - Simple WebServer Test Raspberry Pi PicoW 는 WiFi 기능을 제공한다. WiFi 모듈을 이용해서 간단한 웹서버 테스트를 진행해 보자. ESP32의 경우 편리한 WebServer 라이브러리를 제공하는데 Pi PicoW도 거의 유사한 라이브러리를 제공한다. ESP32 Simple WebServer 테스트 코드를 이용해서 웹서버 구동 코드를 작성하자. #include #include #include #include #ifndef STASSID #define STASSID "****" #define STAPSK "****" #endif const char* ssid = STASSID; const char* password = STAPSK; WebServer server(80); const int Led1Pin = 9;..
Raspberry Pi Pico W - RP2040 C++ SDK 환경에서 iperf 를 이용한 WiFi Throughput 테스트 Arduino IDE 개발환경에서 WiFi전송률 테스트 결과 10Mbps 정도가 측정이 되는데 좀더 속도를 높이기 위해 RP2040 C/C++ SDK 개발환경을 이용하여 iperf 를 이용한 WiFi Throughput 테스트를 진행 해 보자 #include "pico/cyw43_arch.h" #include "pico/stdlib.h" #include "lwip/netif.h" #include "lwip/ip4_addr.h" #include "lwip/apps/lwiperf.h" #ifndef USE_LED #define USE_LED 1 #endif #if CLIENT_TEST && !defined(IPERF_SERVER_IP) #error IPERF_SERVER_IP not defined #endi..
RaspberryPi Pico W - ThingSpeak 연동 테스트 RaspberryPi Pico W 를 이용해서 Cloud에 연동해서 데이터 전송 테스트를 해 보자. Cloud 는 다양한 서비스 업체가 있지만 간단하게 사용할 수 있는 ThingSpeak를 사용 하였다. https://thingspeak.com/ IoT Analytics - ThingSpeak Internet of Things Weather Station This project shows how to build an Arduino-based weather station that sends data to ThingSpeak. Once the data is collected, MATLAB is used to view trends of the data, plot histograms of the data, ca..
Raspberry Pi Pico W - Arduino IDE에서 Iperf로 WiFi Throughput 측정 테스트 Raspberry Pi Pico W의 WiFi 전송율을 테스트 해 보자. ESP32의 WiFi 전송율 테스트에 사용한 코드를 수정하여 테스트 하였다. #include const char* ssid = STASSID; const char* password = STAPSK; int port = 5001; WiFiServer server(port); void setup() { Serial.begin(115200); WiFi.mode(WIFI_STA); WiFi.setHostname("PicoW2"); Serial.printf("Connecting to '%s' with '%s'\n", ssid, password); WiFi.begin(ssid, password); while (WiFi.status() != W..
RaspberryPi Pico W 개발환경 설정 - Arduino IDE 사용 Raspberry Pi Pico W 보드는 기존에 제작 했던 Raspberry Pi Pico 확장 테스트 보드를 이용하여 테스트 하였다. Arduino 는 최신 버전을 다운 받는것이 좋다. Arduino IDE 2.0 RC 를 설치 하였다. https://www.arduino.cc/en/software Software Open-source electronic prototyping platform enabling users to create interactive electronic objects. www.arduino.cc Preferences 에서 RP2040 Arduino Board Manager URL을 설정 한다. https://github.com/earlephilhower/arduino-pico/..

반응형