本機の ESP32-DevKitC-32E と PC をUSBケーブルで接続しておきます。VS Code を立ち上げて PlatformIO IDE から本機のプロジェクトを ESP32を使って学習リモコンを作る(7) ソフトウェア 本機のプロジェクト に従ってファームウェアとファイルシステムイメージを書込んでおきます。
* 実行するタスク: C:\Users\tatsu\.platformio\penv\Scripts\platformio.exe device monitor –environment esp32dev
— Terminal on COM5 | 115200 8-N-1
— Available filters and text transformations: debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at https://bit.ly/pio-monitor-filters
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13192
load:0x40080400,len:3028
entry 0x400805e4
START src/main.cpp from Oct 17 2026
Using library version 4.7.1
Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, FAST, Whynter, Lego Power Functions, Bosewave, MagiQuest, OpenLASIR, Universal Pulse Distance Width, Hash at pin 15
12000 us is the (minimum) gap, after which the start of a new IR packet is assumed
20
Because of the verbose output (>200 ms at 115200 baud), repeats are not dumped correctly!
If you receive protocol NEC, Samsung or LG, run also ReceiveDemo to check if your actual protocol is eventually NEC2 or SamsungLG, which is determined by the repeats
Connecting to Wi-Fi .
WiFi connected.
*IP address: 192.168.xx.xx
「取込」ボタンが押されました。
**************************************************************
receive_IR_process started
**************************************************************
Protocol=NEC Address=0x4BBA, Command=0x3, Raw-Data=0xFC034BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
Send with: IrSender.sendNEC(0x4BBA, 0x3, );
Raw result in internal ticks (50 us) – with leading gap
rawIRTimings[68]:
-65535
+180,-89
+12,-10 +12,-33 +12,-10 +12,-33
+12,-33 +11,-33 +12,-11 +11,-33
+12,-33 +12,-33 +11,-11 +12,-33
+11,-11 +12,-11 +11,-33 +12,-11
+11,-33 +12,-33 +12,-10 +12,-11
+12,-10 +12,-10 +12,-11 +12,-10
+12,-11 +11,-11 +12,-33 +11,-34
+11,-34 +11,-33 +11,-34 +11,-34
+11
Duration=1376 ticks
Raw result in microseconds – with leading gap
rawIRTimings[68]:
-3276750
+9000,-4450
+ 600,- 500 + 600,-1650 + 600,- 500 + 600,-1650
+ 600,-1650 + 550,-1650 + 600,- 550 + 550,-1650
+ 600,-1650 + 600,-1650 + 550,- 550 + 600,-1650
+ 550,- 550 + 600,- 550 + 550,-1650 + 600,- 550
+ 550,-1650 + 600,-1650 + 600,- 500 + 600,- 550
+ 600,- 500 + 600,- 500 + 600,- 550 + 600,- 500
+ 600,- 550 + 550,- 550 + 600,-1650 + 550,-1700
+ 550,-1700 + 550,-1650 + 550,-1700 + 550,-1700
+ 550
Duration=68800us
Result as internal 8bit ticks (50 us) array – compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {180,89, 12,10, 12,33, 12,10, 12,33, 12,33, 11,33, 12,11, 11,33, 12,33, 12,33, 11,11, 12,33, 11,11, 12,11, 11,33, 12,11, 11,33, 12,33, 12,10, 12,11, 12,10, 12,10, 12,11, 12,10, 12,11, 11,11, 12,33, 11,34, 11,34, 11,33, 11,34, 11,34, 11}; // Protocol=NEC Address=0x4BBA, Command=0x3, Raw-Data=0xFC034BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
Result as microseconds array – compensated with MARK_EXCESS_MICROS=20
uint16_t rawIRTimings[67] = {8980,4470, 580,520, 580,1670, 580,520, 580,1670, 580,1670, 530,1670, 580,570, 530,1670, 580,1670, 580,1670, 530,570, 580,1670, 530,570, 580,570, 530,1670, 580,570, 530,1670, 580,1670, 580,520, 580,570, 580,520, 580,520, 580,570, 580,520, 580,570, 530,570, 580,1670, 530,1720, 530,1720, 530,1670, 530,1720, 530,1720, 530}; // Protocol=NEC Address=0x4BBA, Command=0x3, Raw-Data=0xFC034BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
uint16_t address = 0x4BBA;
uint16_t command = 0x3;
uint64_t rawIRTimings = 0xFC034BBA;
Pronto Hex as string without repeat sequence
char prontoData[] = “0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 003F 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 003F 0016 0014 0018 0014 0016 003F 0018 0014 0016 003F 0018 003F 0018 0012 0018 0014 0018 0012 0018 0012 0018 0014 0018 0012 0018 0014 0016 0014 0018 003F 0016 0041 0016 0041 0016 003F 0016 0041 0016 0041 0016 06C3 “;
writeStr.length = 360
**************************************************************
receive_IR_process finishd
**************************************************************
「登録」ボタンが押されました。
**************************************************************
store_Flash started
**************************************************************
wrfile = /bt_4/bt_4_2.txt
writeStr= 0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 003F 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 003F 0016 0014 0018 0014 0016 003F 0018 0014 0016 003F 0018 003F 0018 0012 0018 0014 0018 0012 0018 0012 0018 0014 0018 0012 0018 0014 0016 0014 0018 003F 0016 0041 0016 0041 0016 003F 0016 0041 0016 0041 0016 06C3
**************************************************************
store_Flash finished
**************************************************************
**************************************************************
store_Flash started
**************************************************************
wrfile = /bt_4/num_reg.txt
writeStr= 2
**************************************************************
store_Flash finished
**************************************************************
学習モード操作から送信モード操作まで一連の操作を行った場合にターミナルに出力される内容を順を追って記録しました。ファームウェアの関数ごとに必要な情報をターミナルに出力するようにコードを記述しているので動作確認やデバグに有効だと思います。
* 実行するタスク: C:\Users\tatsu\.platformio\penv\Scripts\platformio.exe device monitor –environment esp32dev
— Terminal on COM5 | 115200 8-N-1
— Available filters and text transformations: debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at https://bit.ly/pio-monitor-filters
— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13192
load:0x40080400,len:3028
entry 0x400805e4
START src/main.cpp from Oct 17 2026
Using library version 4.7.1
Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, FAST, Whynter, Lego Power Functions, Bosewave, MagiQuest, OpenLASIR, Universal Pulse Distance Width, Hash at pin 15
12000 us is the (minimum) gap, after which the start of a new IR packet is assumed
20
Because of the verbose output (>200 ms at 115200 baud), repeats are not dumped correctly!
If you receive protocol NEC, Samsung or LG, run also ReceiveDemo to check if your actual protocol is eventually NEC2 or SamsungLG, which is determined by the repeats
Connecting to Wi-Fi .
WiFi connected.
*IP address: 192.168.12.5
モード切換ボタンが押されました。
「取込」ボタンが押されました。
**************************************************************
receive_IR_process started
**************************************************************
Protocol=NEC Address=0x4BBA, Command=0x4C, Raw-Data=0xB34C4BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
Send with: IrSender.sendNEC(0x4BBA, 0x4C, );
Raw result in internal ticks (50 us) – with leading gap
rawIRTimings[68]:
-65535
+180,-89
+12,-10 +12,-33 +12,-10 +12,-33
+12,-32 +12,-33 +12,-10 +12,-33
+12,-33 +12,-33 +11,-11 +12,-33
+12,-10 +12,-11 +11,-33 +12,-11
+11,-11 +11,-11 +12,-33 +12,-33
+11,-11 +12,-10 +12,-33 +12,-10
+12,-33 +12,-33 +11,-12 +11,-11
+11,-34 +11,-33 +11,-12 +11,-33
+12
Duration=1376 ticks
Raw result in microseconds – with leading gap
rawIRTimings[68]:
-3276750
+9000,-4450
+ 600,- 500 + 600,-1650 + 600,- 500 + 600,-1650
+ 600,-1600 + 600,-1650 + 600,- 500 + 600,-1650
+ 600,-1650 + 600,-1650 + 550,- 550 + 600,-1650
+ 600,- 500 + 600,- 550 + 550,-1650 + 600,- 550
+ 550,- 550 + 550,- 550 + 600,-1650 + 600,-1650
+ 550,- 550 + 600,- 500 + 600,-1650 + 600,- 500
+ 600,-1650 + 600,-1650 + 550,- 600 + 550,- 550
+ 550,-1700 + 550,-1650 + 550,- 600 + 550,-1650
+ 600
Duration=68800us
Result as internal 8bit ticks (50 us) array – compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {180,89, 12,10, 12,33, 12,10, 12,33, 12,32, 12,33, 12,10, 12,33, 12,33, 12,33, 11,11, 12,33, 12,10, 12,11, 11,33, 12,11, 11,11, 11,11, 12,33, 12,33, 11,11, 12,10, 12,33, 12,10, 12,33, 12,33, 11,12, 11,11, 11,34, 11,33, 11,12, 11,33, 12}; // Protocol=NEC Address=0x4BBA, Command=0x4C, Raw-Data=0xB34C4BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
Result as microseconds array – compensated with MARK_EXCESS_MICROS=20
uint16_t rawIRTimings[67] = {8980,4470, 580,520, 580,1670, 580,520, 580,1670, 580,1620, 580,1670, 580,520, 580,1670, 580,1670, 580,1670, 530,570, 580,1670, 580,520, 580,570, 530,1670, 580,570, 530,570, 530,570, 580,1670, 580,1670, 530,570, 580,520, 580,1670, 580,520, 580,1670, 580,1670, 530,620, 530,570, 530,1720, 530,1670, 530,620, 530,1670, 580}; // Protocol=NEC Address=0x4BBA, Command=0x4C, Raw-Data=0xB34C4BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
uint16_t address = 0x4BBA;
uint16_t command = 0x4C;
uint64_t rawIRTimings = 0xB34C4BBA;
Pronto Hex as string without repeat sequence
char prontoData[] = “0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003D 0018 003F 0018 0012 0018 003F 0018 003F 0018 003F 0016 0014 0018 003F 0018 0012 0018 0014 0016 003F 0018 0014 0016 0014 0016 0014 0018 003F 0018 003F 0016 0014 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 0016 0016 0014 0016 0041 0016 003F 0016 0016 0016 003F 0018 06C3 “;
writeStr.length = 360
**************************************************************
receive_IR_process finishd
**************************************************************
「登録」ボタンが押されました。
**************************************************************
store_Flash started
**************************************************************
wrfile = /bt_4/bt_4_1.txt
writeStr= 0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003D 0018 003F 0018 0012 0018 003F 0018 003F 0018 003F 0016 0014 0018 003F 0018 0012 0018 0014 0016 003F 0018 0014 0016 0014 0016 0014 0018 003F 0018 003F 0016 0014 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 0016 0016 0014 0016 0041 0016 003F 0016 0016 0016 003F 0018 06C3
**************************************************************
store_Flash finished
**************************************************************
**************************************************************
store_Flash started
**************************************************************
wrfile = /bt_4/num_reg.txt
writeStr= 1
**************************************************************
store_Flash finished
**************************************************************
「取込」ボタンが押されました。
**************************************************************
receive_IR_process started
**************************************************************
Protocol=NEC Address=0x4BBA, Command=0x3, Raw-Data=0xFC034BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
Send with: IrSender.sendNEC(0x4BBA, 0x3, );
Raw result in internal ticks (50 us) – with leading gap
rawIRTimings[68]:
-65535
+180,-89
+12,-10 +12,-33 +12,-10 +12,-33
+12,-33 +11,-33 +12,-11 +11,-33
+12,-33 +12,-33 +11,-11 +12,-33
+11,-11 +12,-11 +11,-33 +12,-11
+11,-33 +12,-33 +12,-10 +12,-11
+12,-10 +12,-10 +12,-11 +12,-10
+12,-11 +11,-11 +12,-33 +11,-34
+11,-34 +11,-33 +11,-34 +11,-34
+11
Duration=1376 ticks
Raw result in microseconds – with leading gap
rawIRTimings[68]:
-3276750
+9000,-4450
+ 600,- 500 + 600,-1650 + 600,- 500 + 600,-1650
+ 600,-1650 + 550,-1650 + 600,- 550 + 550,-1650
+ 600,-1650 + 600,-1650 + 550,- 550 + 600,-1650
+ 550,- 550 + 600,- 550 + 550,-1650 + 600,- 550
+ 550,-1650 + 600,-1650 + 600,- 500 + 600,- 550
+ 600,- 500 + 600,- 500 + 600,- 550 + 600,- 500
+ 600,- 550 + 550,- 550 + 600,-1650 + 550,-1700
+ 550,-1700 + 550,-1650 + 550,-1700 + 550,-1700
+ 550
Duration=68800us
Result as internal 8bit ticks (50 us) array – compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {180,89, 12,10, 12,33, 12,10, 12,33, 12,33, 11,33, 12,11, 11,33, 12,33, 12,33, 11,11, 12,33, 11,11, 12,11, 11,33, 12,11, 11,33, 12,33, 12,10, 12,11, 12,10, 12,10, 12,11, 12,10, 12,11, 11,11, 12,33, 11,34, 11,34, 11,33, 11,34, 11,34, 11}; // Protocol=NEC Address=0x4BBA, Command=0x3, Raw-Data=0xFC034BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
Result as microseconds array – compensated with MARK_EXCESS_MICROS=20
uint16_t rawIRTimings[67] = {8980,4470, 580,520, 580,1670, 580,520, 580,1670, 580,1670, 530,1670, 580,570, 530,1670, 580,1670, 580,1670, 530,570, 580,1670, 530,570, 580,570, 530,1670, 580,570, 530,1670, 580,1670, 580,520, 580,570, 580,520, 580,520, 580,570, 580,520, 580,570, 530,570, 580,1670, 530,1720, 530,1720, 530,1670, 530,1720, 530,1720, 530}; // Protocol=NEC Address=0x4BBA, Command=0x3, Raw-Data=0xFC034BBA, 32 bits, LSB first, Gap=3276750us, Duration=68800us
uint16_t address = 0x4BBA;
uint16_t command = 0x3;
uint64_t rawIRTimings = 0xFC034BBA;
Pronto Hex as string without repeat sequence
char prontoData[] = “0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 003F 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 003F 0016 0014 0018 0014 0016 003F 0018 0014 0016 003F 0018 003F 0018 0012 0018 0014 0018 0012 0018 0012 0018 0014 0018 0012 0018 0014 0016 0014 0018 003F 0016 0041 0016 0041 0016 003F 0016 0041 0016 0041 0016 06C3 “;
writeStr.length = 360
**************************************************************
receive_IR_process finishd
**************************************************************
「登録」ボタンが押されました。
**************************************************************
store_Flash started
**************************************************************
wrfile = /bt_4/bt_4_2.txt
writeStr= 0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 003F 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 003F 0016 0014 0018 0014 0016 003F 0018 0014 0016 003F 0018 003F 0018 0012 0018 0014 0018 0012 0018 0012 0018 0014 0018 0012 0018 0014 0016 0014 0018 003F 0016 0041 0016 0041 0016 003F 0016 0041 0016 0041 0016 06C3
**************************************************************
store_Flash finished
**************************************************************
**************************************************************
store_Flash started
**************************************************************
wrfile = /bt_4/num_reg.txt
writeStr= 2
**************************************************************
store_Flash finished
**************************************************************
「終了」ボタンが押されました。
モード切換ボタンが押されました。
**************************************************************
restore_Flash started
**************************************************************
readStr =
2
readStr.length = 3
**************************************************************
restore_Flash finished
**************************************************************
**************************************************************
restore_Flash started
**************************************************************
readStr =
0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003D 0018 003F 0018 0012 0018 003F 0018 003F 0018 003F 0016 0014 0018 003F 0018 0012 0018 0014 0016 003F 0018 0014 0016 0014 0016 0014 0018 003F 0018 003F 0016 0014 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 0016 0016 0014 0016 0041 0016 003F 0016 0016 0016 003F 0018 06C3
readStr.length = 361
**************************************************************
restore_Flash finished
**************************************************************
**************************************************************
send_IR_process started
**************************************************************
readStr.c_str() =
0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003D 0018 003F 0018 0012 0018 003F 0018 003F 0018 003F 0016 0014 0018 003F 0018 0012 0018 0014 0016 003F 0018 0014 0016 0014 0016 0014 0018 003F 0018 003F 0016 0014 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 0016 0016 0014 0016 0041 0016 003F 0016 0016 0016 003F 0018 06C3
send trun on at 225040
**************************************************************
send_IR_process finished
**************************************************************
**************************************************************
restore_Flash started
**************************************************************
readStr =
0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 003F 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 003F 0016 0014 0018 0014 0016 003F 0018 0014 0016 003F 0018 003F 0018 0012 0018 0014 0018 0012 0018 0012 0018 0014 0018 0012 0018 0014 0016 0014 0018 003F 0016 0041 0016 0041 0016 003F 0016 0041 0016 0041 0016 06C3
readStr.length = 361
**************************************************************
restore_Flash finished
**************************************************************
**************************************************************
send_IR_process started
**************************************************************
readStr.c_str() =
0000 006D 0022 0000 015B 00AA 0018 0012 0018 003F 0018 0012 0018 003F 0018 003F 0016 003F 0018 0014 0016 003F 0018 003F 0018 003F 0016 0014 0018 003F 0016 0014 0018 0014 0016 003F 0018 0014 0016 003F 0018 003F 0018 0012 0018 0014 0018 0012 0018 0012 0018 0014 0018 0012 0018 0014 0016 0014 0018 003F 0016 0041 0016 0041 0016 003F 0016 0041 0016 0041 0016 06C3
send trun on at 225422
**************************************************************
send_IR_process finished
**************************************************************
コメント