95ba524532de3607c5b6e3cfb56e63bf51685121
Board-dat/NWI/NWI1044-dat/NWI1044-dat.md
| ... | ... | @@ -8,6 +8,8 @@ |
| 8 | 8 | - [[nodemcu-dat]] |
| 9 | 9 | |
| 10 | 10 | |
| 11 | +- [[ESP-12F-dat]] - [[SDR1064-dat]] |
|
| 12 | + |
|
| 11 | 13 | ## Note |
| 12 | 14 | |
| 13 | 15 | - NO need to install driver for CH341 (replaced by CP2102) |
| ... | ... | @@ -25,6 +27,8 @@ ESPlorer |
| 25 | 27 |  |
| 26 | 28 | |
| 27 | 29 | |
| 30 | + |
|
| 31 | + |
|
| 28 | 32 | ## ref |
| 29 | 33 | |
| 30 | 34 | - Open source support: www.nodemcu.com |
Board-dat/SDR/SDR1064-dat/SDR1064-dat.md
| ... | ... | @@ -1,7 +1,10 @@ |
| 1 | 1 | |
| 2 | 2 | # SDR1064-dat |
| 3 | 3 | |
| 4 | -- [[motor-driver-dat]] - [[NWI1044-dat]] |
|
| 4 | +- [[motor-driver-dat]] - required board [[NWI1044-dat]] |
|
| 5 | + |
|
| 6 | +- [[rc-code-dat]] - [[code-dat]] - [[SDR1064-rover-code-dat]] |
|
| 7 | + |
|
| 5 | 8 | |
| 6 | 9 | ## Info |
| 7 | 10 |
Chip-cn-dat/AIT-dat/ESP-12F-DAT/ESP-12F-DAT.md
| ... | ... | @@ -28,16 +28,60 @@ |
| 28 | 28 | |
| 29 | 29 | ## Pin Definitions |
| 30 | 30 | |
| 31 | -| left | template | boot mode | func | right | template | boot mode | func | |
|
| 32 | -| ---- | -------- | ------------ | ---- | ----- | -------- | --------- | ------------ | |
|
| 33 | -| RST | | ext.u, w/cap | | TXD | | | | |
|
| 34 | -| ADC | | | | RXD | | | | |
|
| 35 | -| EN | | ext.u | | IO5 | | | I2C | |
|
| 36 | -| IO16 | | | | IO4 | | | I2C | |
|
| 37 | -| IO14 | | | SCK | IO0 | | ext.u | boot | |
|
| 38 | -| IO12 | | | MI | IO2 | | ext.u | on-board LED | |
|
| 39 | -| IO13 | | | MO | IO15 | | ext.d | SS | |
|
| 40 | -| VCC | | | | GND | | | | |
|
| 31 | +- [[ESP8266-HDK-dat]] |
|
| 32 | + |
|
| 33 | + |
|
| 34 | +chip table |
|
| 35 | + |
|
| 36 | +| pin | name | sytem | usage | custom | custom2 | |
|
| 37 | +| --- | --------- | --------------- | ------ | ------- | ------- | |
|
| 38 | +| 1 | VDDA | power. | | | | |
|
| 39 | +| 2 | LNA | [[Antenna-dat]] | | | | |
|
| 40 | +| 3 | VDD3P3 | power. | | | | |
|
| 41 | +| 4 | VDD3P3 | power. | | | | |
|
| 42 | +| 5 | VDD_RTC | x | | | | |
|
| 43 | +| 6 | TOUT | [[ADC-dat]] | | | | |
|
| 44 | +| 7 | CHIP_EN | | | | | |
|
| 45 | +| 8 | XPD_DCDC | | IO16 | | | |
|
| 46 | +| 9 | MTMS | | IO14 | | | |
|
| 47 | +| 10 | MTDI | | IO12 | | | |
|
| 48 | +| 11 | VDDPST | power. | | | | |
|
| 49 | +| 12 | MTCK | | IO13 | | | |
|
| 50 | +| 13 | MTDO | boot - L | IO15 | | | |
|
| 51 | +| 14 | GPIO2 | boot - H | IO2 | | | |
|
| 52 | +| 15 | GPIO0 | boot - H | IO0 | mod.led | | |
|
| 53 | +| 16 | GPIO4 | | IO4 | | | |
|
| 54 | +| 17 | VDDPST | power. | | | | |
|
| 55 | +| 18 | SD_DATA_2 | flash | x-IO9 | | | |
|
| 56 | +| 19 | SD_DATA_3 | flash | x-IO10 | | | |
|
| 57 | +| 20 | SD_CMD | flash | x-IO11 | | | |
|
| 58 | +| 21 | SD_CLK | flash | x-IO6 | | | |
|
| 59 | +| 22 | SD_DATA_0 | flash | x-IO7 | | | |
|
| 60 | +| 23 | SD_DATA_1 | flash | x-IO8 | | | |
|
| 61 | +| 24 | GPIO5 | | IO5 | | | |
|
| 62 | +| 25 | U0RXD | | UART | | | |
|
| 63 | +| 26 | U0TXD | | UART | | | |
|
| 64 | +| 27 | XTAL_OUT | x | | | | |
|
| 65 | +| 28 | XTAL_IN | x | | | | |
|
| 66 | +| 29 | VDDD | power. | | | | |
|
| 67 | +| 30 | VDDA | power. | | | | |
|
| 68 | +| 31 | RES12K | x | | | | |
|
| 69 | +| 32 | EXT_RSTB | [[reset-dat]] | | | | |
|
| 70 | +| pad | GND | power. | | | | |
|
| 71 | + |
|
| 72 | + |
|
| 73 | + |
|
| 74 | + |
|
| 75 | +| custom | left | boot mode | func | right | boot mode | func | custom | |
|
| 76 | +| ------ | ---- | ------------ | ---- | ----- | --------- | ------------ | ------ | |
|
| 77 | +| | RST | ext.u, w/cap | | TXD | | | | |
|
| 78 | +| | ADC | | | RXD | | | | |
|
| 79 | +| | EN | ext.u | | IO5 | | | (I2C) | |
|
| 80 | +| | IO16 | | | IO4 | | | (I2C) | |
|
| 81 | +| | IO14 | | SCK | IO0 | ext.u | boot | | |
|
| 82 | +| | IO12 | | MI | IO2 | ext.u | on-board LED | | |
|
| 83 | +| | IO13 | | MO | IO15 | ext.d | SS | | |
|
| 84 | +| | 3V3 | | | GND | | | | |
|
| 41 | 85 | |
| 42 | 86 | - [[NWI1083-dat]] |
| 43 | 87 |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/ESP8266-DAT.md
| ... | ... | @@ -16,14 +16,6 @@ hardware and software - [[ESP8266-HDK-dat]] - [[ESP8266-SDK-dat]] |
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | |
| 19 | -## mini development boards |
|
| 20 | - |
|
| 21 | -- [[NWI1050-dat]] - [[NWI1053-dat]] - [[NWI1130-dat]] - [[NWI1083-dat]] |
|
| 22 | - |
|
| 23 | -- module system based on [[BTB-dat]] - [[12P-BTB-dat]] == [[NWI1230-dat]] |
|
| 24 | - |
|
| 25 | - |
|
| 26 | - |
|
| 27 | 19 | |
| 28 | 20 | ## peripherals |
| 29 | 21 | |
| ... | ... | @@ -35,7 +27,7 @@ hardware and software - [[ESP8266-HDK-dat]] - [[ESP8266-SDK-dat]] |
| 35 | 27 | |
| 36 | 28 | |
| 37 | 29 | |
| 38 | - |
|
| 30 | +debug - [[ESP8266-debug-log-dat]] - [[ESP8266-error-log-dat]] - [[ESP8266-boot-log-dat]] |
|
| 39 | 31 | |
| 40 | 32 | |
| 41 | 33 | ## ref |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/ESP8266-HDK-dat/ESP8266-HDK-dat.md
| ... | ... | @@ -3,6 +3,8 @@ |
| 3 | 3 | |
| 4 | 4 | - [[ESP8266-SDK-dat]] |
| 5 | 5 | |
| 6 | +- [[ESP8266-board-dat]] - [[serial-dat]] - [[CH9102-dat]] |
|
| 7 | + |
|
| 6 | 8 | ## chip info |
| 7 | 9 | |
| 8 | 10 | - DS [[0a-esp8266ex_datasheet_en.pdf]] |
| ... | ... | @@ -126,41 +128,41 @@ The ESP8266EX schematics include seven aspects: |
| 126 | 128 | |
| 127 | 129 | - [[nodemcu-dat]] |
| 128 | 130 | |
| 129 | -| pin | name | sytem | usage | custom | custom2 | |
|
| 130 | -| --- | --------- | --------------- | ------ | ------ | ------- | |
|
| 131 | -| 1 | VDDA | power. | | | | |
|
| 132 | -| 2 | LNA | [[Antenna-dat]] | | | | |
|
| 133 | -| 3 | VDD3P3 | power. | | | | |
|
| 134 | -| 4 | VDD3P3 | power. | | | | |
|
| 135 | -| 5 | VDD_RTC | x | | | | |
|
| 136 | -| 6 | TOUT | [[ADC-dat]] | | | | |
|
| 137 | -| 7 | CHIP_EN | | | | | |
|
| 138 | -| 8 | XPD_DCDC | | IO16 | | | |
|
| 139 | -| 9 | MTMS | | IO14 | | | |
|
| 140 | -| 10 | MTDI | | IO12 | | | |
|
| 141 | -| 11 | VDDPST | power. | | | | |
|
| 142 | -| 12 | MTCK | | IO13 | | | |
|
| 143 | -| 13 | MTDO | boot - L | IO15 | | | |
|
| 144 | -| 14 | GPIO2 | boot - H | IO2 | | | |
|
| 145 | -| 15 | GPIO0 | boot - H | IO0 | | | |
|
| 146 | -| 16 | GPIO4 | | IO4 | | | |
|
| 147 | -| 17 | VDDPST | power. | | | | |
|
| 148 | -| 18 | SD_DATA_2 | flash | x-IO9 | | | |
|
| 149 | -| 19 | SD_DATA_3 | flash | x-IO10 | | | |
|
| 150 | -| 20 | SD_CMD | flash | x-IO11 | | | |
|
| 151 | -| 21 | SD_CLK | flash | x-IO6 | | | |
|
| 152 | -| 22 | SD_DATA_0 | flash | x-IO7 | | | |
|
| 153 | -| 23 | SD_DATA_1 | flash | x-IO8 | | | |
|
| 154 | -| 24 | GPIO5 | | IO5 | | | |
|
| 155 | -| 25 | U0RXD | | UART | | | |
|
| 156 | -| 26 | U0TXD | | UART | | | |
|
| 157 | -| 27 | XTAL_OUT | x | | | | |
|
| 158 | -| 28 | XTAL_IN | x | | | | |
|
| 159 | -| 29 | VDDD | power. | | | | |
|
| 160 | -| 30 | VDDA | power. | | | | |
|
| 161 | -| 31 | RES12K | x | | | | |
|
| 162 | -| 32 | EXT_RSTB | [[reset-dat]] | | | | |
|
| 163 | -| pad | GND | power. | | | | |
|
| 131 | +| pin | name | sytem | usage | custom | custom2 | |
|
| 132 | +| --- | --------- | --------------- | ------ | ------- | ------- | |
|
| 133 | +| 1 | VDDA | power. | | | | |
|
| 134 | +| 2 | LNA | [[Antenna-dat]] | | | | |
|
| 135 | +| 3 | VDD3P3 | power. | | | | |
|
| 136 | +| 4 | VDD3P3 | power. | | | | |
|
| 137 | +| 5 | VDD_RTC | x | | | | |
|
| 138 | +| 6 | TOUT | [[ADC-dat]] | | | | |
|
| 139 | +| 7 | CHIP_EN | | | | | |
|
| 140 | +| 8 | XPD_DCDC | | IO16 | | | |
|
| 141 | +| 9 | MTMS | | IO14 | | | |
|
| 142 | +| 10 | MTDI | | IO12 | | | |
|
| 143 | +| 11 | VDDPST | power. | | | | |
|
| 144 | +| 12 | MTCK | | IO13 | | | |
|
| 145 | +| 13 | MTDO | boot - L | IO15 | | | |
|
| 146 | +| 14 | GPIO2 | boot - H | IO2 | | | |
|
| 147 | +| 15 | GPIO0 | boot - H | IO0 | mod.led | | |
|
| 148 | +| 16 | GPIO4 | | IO4 | | | |
|
| 149 | +| 17 | VDDPST | power. | | | | |
|
| 150 | +| 18 | SD_DATA_2 | flash | x-IO9 | | | |
|
| 151 | +| 19 | SD_DATA_3 | flash | x-IO10 | | | |
|
| 152 | +| 20 | SD_CMD | flash | x-IO11 | | | |
|
| 153 | +| 21 | SD_CLK | flash | x-IO6 | | | |
|
| 154 | +| 22 | SD_DATA_0 | flash | x-IO7 | | | |
|
| 155 | +| 23 | SD_DATA_1 | flash | x-IO8 | | | |
|
| 156 | +| 24 | GPIO5 | | IO5 | | | |
|
| 157 | +| 25 | U0RXD | | UART | | | |
|
| 158 | +| 26 | U0TXD | | UART | | | |
|
| 159 | +| 27 | XTAL_OUT | x | | | | |
|
| 160 | +| 28 | XTAL_IN | x | | | | |
|
| 161 | +| 29 | VDDD | power. | | | | |
|
| 162 | +| 30 | VDDA | power. | | | | |
|
| 163 | +| 31 | RES12K | x | | | | |
|
| 164 | +| 32 | EXT_RSTB | [[reset-dat]] | | | | |
|
| 165 | +| pad | GND | power. | | | | |
|
| 164 | 166 | |
| 165 | 167 | |
| 166 | 168 | - XPD_DCDC - Deep-sleep wakeup (need to be connected to EXT_RSTB); |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/ESP8266-board-dat/ESP8266-board-dat.md
| ... | ... | @@ -20,6 +20,17 @@ |
| 20 | 20 | - [[NWI1203-dat]] == [ESP8266-DevKitC Mini DEV. Board, ESP8266-DevKitC-02D-F](https://www.electrodragon.com/product/esp8266-devkitc-mini-development-board-esp8266-devkitc-02d-f/) |
| 21 | 21 | |
| 22 | 22 | |
| 23 | + |
|
| 24 | + |
|
| 25 | +## mini development boards |
|
| 26 | + |
|
| 27 | +- [[NWI1050-dat]] - [[NWI1053-dat]] - [[NWI1130-dat]] - [[NWI1083-dat]] |
|
| 28 | + |
|
| 29 | +- module system based on [[BTB-dat]] - [[12P-BTB-dat]] == [[NWI1230-dat]] |
|
| 30 | + |
|
| 31 | + |
|
| 32 | + |
|
| 33 | + |
|
| 23 | 34 | ## APP Board |
| 24 | 35 | |
| 25 | 36 | - [[esp-relay-board-dat]] - [[NWI1072-dat]] - [[NWI1124-dat]] |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/ESP8266-debug-log-dat.md
| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | - |
|
| 2 | -# ESP8266-debug-log-dat.md |
|
| 3 | - |
|
| 4 | -- [[ESP8266-boot-log-dat]] |
|
| 5 | - |
|
| 6 | - |
|
| 7 | -stack error exception |
|
| 8 | --> test with basic code |
|
| 9 | --> error still on boot |
|
| 10 | - |
|
| 11 | -- check wiring and soldering |
|
| 12 | -- power supply error |
|
| ... | ... | \ No newline at end of file |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/esp8266-debug-dat/ESP8266-boot-log-dat/2025-06-11-18-18-29.png
| ... | ... | Binary files /dev/null and b/Chip-cn-dat/Espressif-dat/ESP8266-DAT/esp8266-debug-dat/ESP8266-boot-log-dat/2025-06-11-18-18-29.png differ |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/esp8266-debug-dat/ESP8266-boot-log-dat/ESP8266-boot-log-dat.md
| ... | ... | @@ -0,0 +1,141 @@ |
| 1 | +
|
|
| 2 | +# ESP8266-boot-log-dat
|
|
| 3 | +
|
|
| 4 | +## normal flash boot log
|
|
| 5 | +
|
|
| 6 | +Baud rate **74880** is what the ESP8266 bootloader uses. The apps on top of the Espressif SDK (e.g. Arduino sketch) talk at 115200 if not specified otherwise.
|
|
| 7 | +
|
|
| 8 | +**the normal reset boot ** == CORRECT
|
|
| 9 | +
|
|
| 10 | + ets Jan 8 2013,rst cause:2, boot mode:(3,6)
|
|
| 11 | +
|
|
| 12 | + load 0x40100000, len 28740, room 16
|
|
| 13 | + tail 4
|
|
| 14 | + chksum 0xef
|
|
| 15 | + load 0x33333333, len 858993459, room 4
|
|
| 16 | +
|
|
| 17 | +boot mode:(3,6) → GPIO0 is LOW (indicating flash mode, not normal run mode). This means the ESP8266 is still in flashing mode, and won't run user code.
|
|
| 18 | +
|
|
| 19 | +
|
|
| 20 | +## the prog mode boot
|
|
| 21 | +
|
|
| 22 | +flash boot mode
|
|
| 23 | +
|
|
| 24 | + ets Jan 8 2013,rst cause:2, boot mode:(1,6)
|
|
| 25 | +
|
|
| 26 | + ets Jan 8 2013,rst cause:2, boot mode:(1,7)
|
|
| 27 | +
|
|
| 28 | +
|
|
| 29 | +
|
|
| 30 | +
|
|
| 31 | +download mode
|
|
| 32 | +
|
|
| 33 | + ets Jan 8 2013,rst cause:2, boot mode:(1,6)
|
|
| 34 | +
|
|
| 35 | + or
|
|
| 36 | +
|
|
| 37 | + rl\0l湠|\0宭鄚?l?b|巶?抮抌?b岒nn瀕nn溾?bpp寧lrlrl
|
|
| 38 | +
|
|
| 39 | +
|
|
| 40 | +
|
|
| 41 | +## module default boot log
|
|
| 42 | +
|
|
| 43 | + ets Jan 8 2013,rst cause:2, boot mode:(3,6)
|
|
| 44 | +
|
|
| 45 | + load 0x40100000, len 1856, room 16
|
|
| 46 | + tail 0
|
|
| 47 | + chksum 0x63
|
|
| 48 | + load 0x3ffe8000, len 776, room 8
|
|
| 49 | + tail 0
|
|
| 50 | + chksum 0x02
|
|
| 51 | + load 0x3ffe8310, len 552, room 8
|
|
| 52 | + tail 0
|
|
| 53 | + chksum 0x79
|
|
| 54 | + csum 0x79
|
|
| 55 | +
|
|
| 56 | + 2nd boot version : 1.5
|
|
| 57 | + SPI Speed : 40MHz
|
|
| 58 | + SPI Mode : DIO
|
|
| 59 | + SPI Flash Size & Map: 32Mbit(512KB+512KB)
|
|
| 60 | + jump to run user1 @ 1000
|
|
| 61 | +
|
|
| 62 | +## AIT firmware bootload mode
|
|
| 63 | +
|
|
| 64 | +
|
|
| 65 | + rl\0l湠|\0宭鄚?l?b|巶?抮抌?b岒nn瀕nn溾?bp寧lrlrlp騨??lbn鈢ll帋b岒nn頫0l寧l`?nnl`nr帓抧忪l`p騨?r寽溾?bn鈢鞄帋b岒nn頫0l`?nnl`nr帓抧宭`p騨?r寽溾囔lbn鈢l巖?b岒nn頫0l`?nnl`nr帓抧騦l`r拻n騦l`rl寣n湆騨n瀸炩宺nnn?l宐rrl\0?抣?拻??巐ll~rl\0?抣lln溾\0?悓~抈\0?抣寪n鄮n鞉n~寣ll鄝b鞂llpb?br倢靗`nl巔岇l`bl`l拻n瀗寬鈔l瀨bll`rl屸?俷鞉r傭n|?ll鞄l屸r抣宭?l`屸r抣靗?l`屸r抣帪\0?ll`rl巶rl尀鈱bl宐r|巄p`靗靊lr宭b祢n顎nn?宭騪l?l寧???巐?l€n黒0尀鈱bl鞄p尀鈱bl宐prlrl
|
|
| 66 | + Ai-Thinker Technology Co. Ltd.
|
|
| 67 | +
|
|
| 68 | + ready
|
|
| 69 | +
|
|
| 70 | +or in 74880 baud rate output
|
|
| 71 | +
|
|
| 72 | + 2nd boot version : 1.5
|
|
| 73 | + SPI Speed : 40MHz
|
|
| 74 | + SPI Mode : DIO
|
|
| 75 | + SPI Flash Size & Map: 32Mbit(512KB+512KB)
|
|
| 76 | +
|
|
| 77 | + jump to run user1 @ 1000
|
|
| 78 | +
|
|
| 79 | + rf[112] : 03
|
|
| 80 | + rf[113] : 00
|
|
| 81 | + rf[114] : 01
|
|
| 82 | +
|
|
| 83 | + SDK ver: 1.5.4(baaeaebb) compiled @ May 17 2016 19:23:54
|
|
| 84 | + phy ver: 972, pp ver: 10.1
|
|
| 85 | +
|
|
| 86 | + mode : softAP(46:17:93:0a:04:4d)
|
|
| 87 | + add if1
|
|
| 88 | + dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
|
|
| 89 | + bcn 100
|
|
| 90 | + @奪-nP隡T'悟w??+?j?!PKT\ )礍U5)nZP権?ERK吷X )d? 5Y
|
|
| 91 | + 鳯ZP楯?RK呏eE@蔜@蛓P
|
|
| 92 | + LZPJJ?E J?
|
|
| 93 | + ?p-蒠5折^P媕)\07???)i@H?Q\0!m)\07
|
|
| 94 | + %CCMi
|
|
| 95 | + )刏s衠?[篮??藦€5n劳??\0黵f[112] : 03
|
|
| 96 | + rf[113] : 00
|
|
| 97 | + rf[114] : 01
|
|
| 98 | +
|
|
| 99 | + SDK ver: 1.5.4(baaeaebb) compiled @ May 17 2016 19:23:54
|
|
| 100 | + phy ver: 972, pp ver: 10.1
|
|
| 101 | +
|
|
| 102 | + ^谡€钍耸顯)嚸
|
|
| 103 | + )蛨?
|
|
| 104 | +
|
|
| 105 | +## custom flash firmware
|
|
| 106 | +
|
|
| 107 | +for [[esp-relay-board-dat]]
|
|
| 108 | +
|
|
| 109 | + rl\0l湠|\0宭鄚?l?b|巶?抮抌?b岒nn瀕nn溾?bp寧lrlrlp騨??l寽bn鈢l?巄岒nn頫0l寧l`?nnl`nr帓抧b?lr拻nb?l?l寽?l宭`鼈n?
|
|
| 110 | + mounting FS...
|
|
| 111 | + mounted file system
|
|
| 112 | + read your my_device ID ESP_574524 from json
|
|
| 113 | + *WM: Adding parameter
|
|
| 114 | + *WM: server
|
|
| 115 | + *WM: Adding parameter
|
|
| 116 | + *WM: port
|
|
| 117 | + *WM: Adding parameter
|
|
| 118 | + *WM: user
|
|
| 119 | + *WM: Adding parameter
|
|
| 120 | + *WM: pass
|
|
| 121 | + *WM: Adding parameter
|
|
| 122 | + *WM: my_device
|
|
| 123 | + *WM:
|
|
| 124 | + *WM: AutoConnect
|
|
| 125 | + *WM: Connecting as wifi client...
|
|
| 126 | + *WM: Using last saved values, should be faster
|
|
| 127 | + *WM: Connection result:
|
|
| 128 | + *WM: 0
|
|
| 129 | + *WM: SET AP STA
|
|
| 130 | + *WM:
|
|
| 131 | + *WM: Configuring access point...
|
|
| 132 | + *WM: ESP_Relay_Board
|
|
| 133 | + *WM: AP IP address:
|
|
| 134 | + *WM: 192.168.4.1
|
|
| 135 | + *WM: HTTP server started
|
|
| 136 | +
|
|
| 137 | +
|
|
| 138 | +
|
|
| 139 | +## ref
|
|
| 140 | +
|
|
| 141 | +- [[ESP8266-SDK-dat]] |
|
| ... | ... | \ No newline at end of file |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/esp8266-debug-dat/ESP8266-error-log-dat/ESP8266-error-log-dat.md
| ... | ... | @@ -0,0 +1,61 @@ |
| 1 | + |
|
| 2 | +# ESP8266-error-log-dat |
|
| 3 | + |
|
| 4 | + |
|
| 5 | + |
|
| 6 | + |
|
| 7 | +## slow down the baud rate to 57600 |
|
| 8 | + |
|
| 9 | + |
|
| 10 | +an issue from [[NWI1044-dat]] - [[CH9102-dat]] |
|
| 11 | + |
|
| 12 | + A fatal esptool.py error occurred: Invalid head of packet (0x49) |
|
| 13 | + Chip is ESP8266EX |
|
| 14 | + Features: WiFi |
|
| 15 | + Crystal is 26MHz |
|
| 16 | + MAC: f4:cf:a2:d9:74:3a |
|
| 17 | + Uploading stub... |
|
| 18 | + Running stub... |
|
| 19 | + |
|
| 20 | +solved |
|
| 21 | + |
|
| 22 | + Serial port COM18 |
|
| 23 | + Connecting.... |
|
| 24 | + Chip is ESP8266EX |
|
| 25 | + Features: WiFi |
|
| 26 | + Crystal is 26MHz |
|
| 27 | + MAC: f4:cf:a2:d9:74:3a |
|
| 28 | + Uploading stub... |
|
| 29 | + Running stub... |
|
| 30 | + Stub running... |
|
| 31 | + Configuring flash size... |
|
| 32 | + Auto-detected Flash size: 4MB |
|
| 33 | + Erasing flash (this may take a while)... |
|
| 34 | + Chip erase completed successfully in 7.4s |
|
| 35 | + Flash params set to 0x0240 |
|
| 36 | + Compressed 307328 bytes to 223573... |
|
| 37 | + Writing at 0x00000000... (7 %) |
|
| 38 | + Writing at 0x00004000... (14 %) |
|
| 39 | + Writing at 0x00008000... (21 %) |
|
| 40 | + Writing at 0x0000c000... (28 %) |
|
| 41 | + Writing at 0x00010000... (35 %) |
|
| 42 | + Writing at 0x00014000... (42 %) |
|
| 43 | + Writing at 0x00018000... (50 %) |
|
| 44 | + Writing at 0x0001c000... (57 %) |
|
| 45 | + Writing at 0x00020000... (64 %) |
|
| 46 | + Writing at 0x00024000... (71 %) |
|
| 47 | + Writing at 0x00028000... (78 %) |
|
| 48 | + Writing at 0x0002c000... (85 %) |
|
| 49 | + Writing at 0x00030000... (92 %) |
|
| 50 | + Writing at 0x00034000... (100 %) |
|
| 51 | + Wrote 307328 bytes (223573 compressed) at 0x00000000 in 38.9 seconds (effective 63.3 kbit/s)... |
|
| 52 | + Hash of data verified. |
|
| 53 | + |
|
| 54 | + Leaving... |
|
| 55 | + Hard resetting via RTS pin... |
|
| 56 | + |
|
| 57 | + |
|
| 58 | + |
|
| 59 | +## ref |
|
| 60 | + |
|
| 61 | +- [[esp8266-dat]] |
|
| ... | ... | \ No newline at end of file |
Chip-cn-dat/Espressif-dat/ESP8266-DAT/esp8266-debug-dat/esp8266-debug-dat.md
| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | + |
|
| 2 | +# ESP8266-debug-dat.md |
|
| 3 | + |
|
| 4 | +- [[ESP8266-boot-log-dat]] - [[esp8266-error-log-dat]] |
|
| 5 | + |
|
| 6 | + |
|
| 7 | +## stack error exception |
|
| 8 | + |
|
| 9 | +- -> test with basic code |
|
| 10 | +- -> error still on boot |
|
| 11 | + |
|
| 12 | +- check wiring and soldering |
|
| 13 | +- power supply error |
|
| 14 | + |
|
| 15 | + |
|
| 16 | + |
|
| 17 | + |
|
| 18 | +## ref |
|
| 19 | + |
|
| 20 | +- [[ESP8266-dat]] |
|
| ... | ... | \ No newline at end of file |
Chip-cn-dat/Espressif-dat/Espressif-dat.md
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | -- [[ESP8266-dat]] |
|
| 17 | +- [[ESP8266-dat]] - [[ESP8266-HDK-dat]] - [[ESP8266-SDK-dat]] |
|
| 18 | 18 | |
| 19 | 19 | - [[ESP8684-dat]] - [[ESP8684-DEVKITC-dat]] |
| 20 | 20 |
Chip-cn-dat/WCH-dat/CH9102-dat/CH9102-dat.md
| ... | ... | @@ -14,6 +14,12 @@ |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | |
| 17 | + |
|
| 18 | + |
|
| 19 | + |
|
| 20 | + |
|
| 21 | + |
|
| 22 | + |
|
| 17 | 23 | ## ref |
| 18 | 24 | |
| 19 | 25 | - [[wch-dat]] - [[serial-dat]] |
| ... | ... | \ No newline at end of file |
SDK-dat/ESP-SDK-dat/ESP8266-SDK-dat/ESP8266-SDK-dat.md
| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | |
| 2 | 2 | # ESP8266-SDK-dat |
| 3 | 3 | |
| 4 | -- [[esp-idf-dat]] - [[ESP-dat]] - [[esp-sdk-dat]] |
|
| 4 | +- [[esp-idf-dat]] - [[ESP-dat]] - [[esp-sdk-dat]] - [[esptool-dat]] |
|
| 5 | 5 | |
| 6 | 6 | - [[ESP8266-HDK-dat]] |
| 7 | 7 | |
| ... | ... | @@ -9,6 +9,10 @@ |
| 9 | 9 | |
| 10 | 10 | - [[display-SDK-dat]] |
| 11 | 11 | |
| 12 | +- [[nodemcu-dat]] |
|
| 13 | + |
|
| 14 | +- [[serial-dat]] |
|
| 15 | + |
|
| 12 | 16 | Bootloader / ROM output 74880 Default ESP8266 boot messages (after reset). |
| 13 | 17 | |
| 14 | 18 | AT firmware |
SDK-dat/ESP-SDK-dat/ESP8266-SDK-dat/ESP8266-boot-log-dat/2025-06-11-18-18-29.png
| ... | ... | Binary files a/SDK-dat/ESP-SDK-dat/ESP8266-SDK-dat/ESP8266-boot-log-dat/2025-06-11-18-18-29.png and /dev/null differ |
SDK-dat/ESP-SDK-dat/ESP8266-SDK-dat/ESP8266-boot-log-dat/ESP8266-boot-log-dat.md
| ... | ... | @@ -1,141 +0,0 @@ |
| 1 | -
|
|
| 2 | -# ESP8266-boot-log-dat
|
|
| 3 | -
|
|
| 4 | -## normal flash boot log
|
|
| 5 | -
|
|
| 6 | -Baud rate **74880** is what the ESP8266 bootloader uses. The apps on top of the Espressif SDK (e.g. Arduino sketch) talk at 115200 if not specified otherwise.
|
|
| 7 | -
|
|
| 8 | -**the normal reset boot ** == CORRECT
|
|
| 9 | -
|
|
| 10 | - ets Jan 8 2013,rst cause:2, boot mode:(3,6)
|
|
| 11 | -
|
|
| 12 | - load 0x40100000, len 28740, room 16
|
|
| 13 | - tail 4
|
|
| 14 | - chksum 0xef
|
|
| 15 | - load 0x33333333, len 858993459, room 4
|
|
| 16 | -
|
|
| 17 | -boot mode:(3,6) → GPIO0 is LOW (indicating flash mode, not normal run mode). This means the ESP8266 is still in flashing mode, and won't run user code.
|
|
| 18 | -
|
|
| 19 | -
|
|
| 20 | -## the prog mode boot
|
|
| 21 | -
|
|
| 22 | -flash boot mode
|
|
| 23 | -
|
|
| 24 | - ets Jan 8 2013,rst cause:2, boot mode:(1,6)
|
|
| 25 | -
|
|
| 26 | - ets Jan 8 2013,rst cause:2, boot mode:(1,7)
|
|
| 27 | -
|
|
| 28 | -
|
|
| 29 | -
|
|
| 30 | -
|
|
| 31 | -download mode
|
|
| 32 | -
|
|
| 33 | - ets Jan 8 2013,rst cause:2, boot mode:(1,6)
|
|
| 34 | -
|
|
| 35 | - or
|
|
| 36 | -
|
|
| 37 | - rl\0l湠|\0宭鄚?l?b|巶?抮抌?b岒nn瀕nn溾?bpp寧lrlrl
|
|
| 38 | -
|
|
| 39 | -
|
|
| 40 | -
|
|
| 41 | -## module default boot log
|
|
| 42 | -
|
|
| 43 | - ets Jan 8 2013,rst cause:2, boot mode:(3,6)
|
|
| 44 | -
|
|
| 45 | - load 0x40100000, len 1856, room 16
|
|
| 46 | - tail 0
|
|
| 47 | - chksum 0x63
|
|
| 48 | - load 0x3ffe8000, len 776, room 8
|
|
| 49 | - tail 0
|
|
| 50 | - chksum 0x02
|
|
| 51 | - load 0x3ffe8310, len 552, room 8
|
|
| 52 | - tail 0
|
|
| 53 | - chksum 0x79
|
|
| 54 | - csum 0x79
|
|
| 55 | -
|
|
| 56 | - 2nd boot version : 1.5
|
|
| 57 | - SPI Speed : 40MHz
|
|
| 58 | - SPI Mode : DIO
|
|
| 59 | - SPI Flash Size & Map: 32Mbit(512KB+512KB)
|
|
| 60 | - jump to run user1 @ 1000
|
|
| 61 | -
|
|
| 62 | -## AIT firmware bootload mode
|
|
| 63 | -
|
|
| 64 | -
|
|
| 65 | - rl\0l湠|\0宭鄚?l?b|巶?抮抌?b岒nn瀕nn溾?bp寧lrlrlp騨??lbn鈢ll帋b岒nn頫0l寧l`?nnl`nr帓抧忪l`p騨?r寽溾?bn鈢鞄帋b岒nn頫0l`?nnl`nr帓抧宭`p騨?r寽溾囔lbn鈢l巖?b岒nn頫0l`?nnl`nr帓抧騦l`r拻n騦l`rl寣n湆騨n瀸炩宺nnn?l宐rrl\0?抣?拻??巐ll~rl\0?抣lln溾\0?悓~抈\0?抣寪n鄮n鞉n~寣ll鄝b鞂llpb?br倢靗`nl巔岇l`bl`l拻n瀗寬鈔l瀨bll`rl屸?俷鞉r傭n|?ll鞄l屸r抣宭?l`屸r抣靗?l`屸r抣帪\0?ll`rl巶rl尀鈱bl宐r|巄p`靗靊lr宭b祢n顎nn?宭騪l?l寧???巐?l€n黒0尀鈱bl鞄p尀鈱bl宐prlrl
|
|
| 66 | - Ai-Thinker Technology Co. Ltd.
|
|
| 67 | -
|
|
| 68 | - ready
|
|
| 69 | -
|
|
| 70 | -or in 74880 baud rate output
|
|
| 71 | -
|
|
| 72 | - 2nd boot version : 1.5
|
|
| 73 | - SPI Speed : 40MHz
|
|
| 74 | - SPI Mode : DIO
|
|
| 75 | - SPI Flash Size & Map: 32Mbit(512KB+512KB)
|
|
| 76 | -
|
|
| 77 | - jump to run user1 @ 1000
|
|
| 78 | -
|
|
| 79 | - rf[112] : 03
|
|
| 80 | - rf[113] : 00
|
|
| 81 | - rf[114] : 01
|
|
| 82 | -
|
|
| 83 | - SDK ver: 1.5.4(baaeaebb) compiled @ May 17 2016 19:23:54
|
|
| 84 | - phy ver: 972, pp ver: 10.1
|
|
| 85 | -
|
|
| 86 | - mode : softAP(46:17:93:0a:04:4d)
|
|
| 87 | - add if1
|
|
| 88 | - dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
|
|
| 89 | - bcn 100
|
|
| 90 | - @奪-nP隡T'悟w??+?j?!PKT\ )礍U5)nZP権?ERK吷X )d? 5Y
|
|
| 91 | - 鳯ZP楯?RK呏eE@蔜@蛓P
|
|
| 92 | - LZPJJ?E J?
|
|
| 93 | - ?p-蒠5折^P媕)\07???)i@H?Q\0!m)\07
|
|
| 94 | - %CCMi
|
|
| 95 | - )刏s衠?[篮??藦€5n劳??\0黵f[112] : 03
|
|
| 96 | - rf[113] : 00
|
|
| 97 | - rf[114] : 01
|
|
| 98 | -
|
|
| 99 | - SDK ver: 1.5.4(baaeaebb) compiled @ May 17 2016 19:23:54
|
|
| 100 | - phy ver: 972, pp ver: 10.1
|
|
| 101 | -
|
|
| 102 | - ^谡€钍耸顯)嚸
|
|
| 103 | - )蛨?
|
|
| 104 | -
|
|
| 105 | -## custom flash firmware
|
|
| 106 | -
|
|
| 107 | -for [[esp-relay-board-dat]]
|
|
| 108 | -
|
|
| 109 | - rl\0l湠|\0宭鄚?l?b|巶?抮抌?b岒nn瀕nn溾?bp寧lrlrlp騨??l寽bn鈢l?巄岒nn頫0l寧l`?nnl`nr帓抧b?lr拻nb?l?l寽?l宭`鼈n?
|
|
| 110 | - mounting FS...
|
|
| 111 | - mounted file system
|
|
| 112 | - read your my_device ID ESP_574524 from json
|
|
| 113 | - *WM: Adding parameter
|
|
| 114 | - *WM: server
|
|
| 115 | - *WM: Adding parameter
|
|
| 116 | - *WM: port
|
|
| 117 | - *WM: Adding parameter
|
|
| 118 | - *WM: user
|
|
| 119 | - *WM: Adding parameter
|
|
| 120 | - *WM: pass
|
|
| 121 | - *WM: Adding parameter
|
|
| 122 | - *WM: my_device
|
|
| 123 | - *WM:
|
|
| 124 | - *WM: AutoConnect
|
|
| 125 | - *WM: Connecting as wifi client...
|
|
| 126 | - *WM: Using last saved values, should be faster
|
|
| 127 | - *WM: Connection result:
|
|
| 128 | - *WM: 0
|
|
| 129 | - *WM: SET AP STA
|
|
| 130 | - *WM:
|
|
| 131 | - *WM: Configuring access point...
|
|
| 132 | - *WM: ESP_Relay_Board
|
|
| 133 | - *WM: AP IP address:
|
|
| 134 | - *WM: 192.168.4.1
|
|
| 135 | - *WM: HTTP server started
|
|
| 136 | -
|
|
| 137 | -
|
|
| 138 | -
|
|
| 139 | -## ref
|
|
| 140 | -
|
|
| 141 | -- [[ESP8266-SDK-dat]] |
|
| ... | ... | \ No newline at end of file |
SDK-dat/ESP-SDK-dat/esptool-dat/esptool-dat.md
| ... | ... | @@ -285,7 +285,11 @@ esptool.exe --baud 115200 --port COM66 --baud 921600 read_flash 0 2097152 output |
| 285 | 285 | |
| 286 | 286 | |
| 287 | 287 | |
| 288 | -### ESP8266 |
|
| 288 | +## ESP8266 |
|
| 289 | 289 | |
| 290 | 290 | C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3 -I C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.2/tools/upload.py --chip esp8266 --port COM162 --baud 921600 --before default_reset --after hard_reset write_flash 0x0 C:\Users\ADMINI~1\AppData\Local\Temp\arduino_build_397525/webserver-path-1.ino.bin |
| 291 | 291 | |
| 292 | + |
|
| 293 | + |
|
| 294 | + |
|
| 295 | +"C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\tools\python3\3.7.2-post1/python3" -I "C:\Users\Administrator\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.1.2/tools/upload.py" --chip esp8266 --port "COM18" --baud "115200" "" erase_flash --before default_reset --after hard_reset write_flash 0x0 "C:\Users\Administrator\AppData\Local\arduino\sketches\2D2D6E632091F2AB5E91938F7E8449F8/PWM-motor-esp-webserver-ap-1.ino.bin" |
SDK-dat/SDK-DAT.md
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | - [[STM32-dat]] |
| 7 | 7 | |
| 8 | -- [[ESP-SDK-dat]] - [[ESP-IDF-dat]] |
|
| 8 | +- [[ESP-SDK-dat]] - [[ESP-IDF-dat]] - [[ESP-dat]] |
|
| 9 | 9 | |
| 10 | 10 | - [[arduino-ide-dat]] - [[arduino-cli-dat]] |
| 11 | 11 |
Tech-dat/Interface-dat/Serial-dat/Serial-dat.md
| ... | ... | @@ -53,6 +53,8 @@ from the perspective of the cable to the perspective of the target |
| 53 | 53 | |
| 54 | 54 | [[DPR1153-dat]] |
| 55 | 55 | |
| 56 | + |
|
| 57 | + |
|
| 56 | 58 | ## Use case |
| 57 | 59 | |
| 58 | 60 |
Tech-dat/debug-dat/debug-dat.md
| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | |
| 2 | 2 | # debug-dat.md |
| 3 | 3 | |
| 4 | -- [[ESP8266-debug-log-dat]] - [[ESP8266-boot-log-dat]] |
|
| 4 | +- [[esp8266-debug-dat]] - [[ESP8266-boot-log-dat]] |
|
| 5 | 5 | |
| 6 | 6 | - [[FPC-dat]] |
| 7 | 7 |
board-3rd-dat/nodemcu-dat/nodemcu-dat.md
| ... | ... | @@ -77,4 +77,17 @@ |
| 77 | 77 | |
| 78 | 78 | - [[NWI1044-dat]] |
| 79 | 79 | |
| 80 | -- [[NWI1074-dat]] |
|
| ... | ... | \ No newline at end of file |
| 0 | +- [[NWI1074-dat]] |
|
| 1 | + |
|
| 2 | + |
|
| 3 | + |
|
| 4 | +## output |
|
| 5 | + |
|
| 6 | + NodeMCU custom build by frightanic.com |
|
| 7 | + branch: master |
|
| 8 | + commit: c8037568571edb5c568c2f8231e4f8ce0683b883 |
|
| 9 | + SSL: false |
|
| 10 | + modules: cjson,file,gpio,net,node,pwm,tmr,uart,wifi |
|
| 11 | + build built on: 2016-03-14 02:10 |
|
| 12 | + powered by Lua 5.1.4 on SDK 1.4.0 |
|
| 13 | + lua: cannot open init.lua |
|
| ... | ... | \ No newline at end of file |
code-dat/code-dat.md
| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | |
| 11 | 11 | - [[SDR1064-rover-code-dat]] |
| 12 | 12 | |
| 13 | - |
|
| 13 | +- [[esp8266-HDK-dat]] |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | ## repo |
code-dat/motor-driver-code-dat/PWM-motor-esp-webserver-ap-1.ino
| ... | ... | @@ -2,13 +2,16 @@ |
| 2 | 2 | #include <ESP8266WebServer.h> |
| 3 | 3 | |
| 4 | 4 | // ===== WiFi 配置 ===== |
| 5 | -const char* ssid = "YOUR_SSID"; |
|
| 6 | -const char* password = "YOUR_PASSWORD"; |
|
| 5 | +const char* ssid = "motor_control"; |
|
| 6 | +const char* password = "electrodragon"; |
|
| 7 | 7 | |
| 8 | 8 | // ===== GPIO 定义 ===== |
| 9 | -const int PWM_PIN = D1; // PWM 控制速度 IO5 |
|
| 10 | -const int DIR_PIN1 = D2; // 方向引脚1 IO4 |
|
| 11 | -const int DIR_PIN2 = D3; // 方向引脚2 IO0 |
|
| 9 | +const int PWM1_PIN = 5; // PWM 控制速度 IO5 |
|
| 10 | +const int PWM2_PIN = 4; // PWM 控制速度 IO4 |
|
| 11 | + |
|
| 12 | +const int DIR_PIN1 = 2; // 方向引脚1 IO2 |
|
| 13 | +const int DIR_PIN2 = 0; // 方向引脚2 IO0 |
|
| 14 | + |
|
| 12 | 15 | |
| 13 | 16 | // ===== Web Server ===== |
| 14 | 17 | ESP8266WebServer server(80); |
| ... | ... | @@ -39,7 +42,8 @@ void handleRoot() { |
| 39 | 42 | void handleControl() { |
| 40 | 43 | if (server.hasArg("speed")) { |
| 41 | 44 | int speed = server.arg("speed").toInt(); // PWM 值 0-1023 |
| 42 | - analogWrite(PWM_PIN, speed); |
|
| 45 | + analogWrite(PWM1_PIN, speed); |
|
| 46 | + analogWrite(PWM2_PIN, speed); |
|
| 43 | 47 | } |
| 44 | 48 | |
| 45 | 49 | if (server.hasArg("dir")) { |
| ... | ... | @@ -61,31 +65,53 @@ void handleControl() { |
| 61 | 65 | void setup() { |
| 62 | 66 | Serial.begin(115200); |
| 63 | 67 | |
| 64 | - pinMode(PWM_PIN, OUTPUT); |
|
| 68 | + pinMode(PWM1_PIN, OUTPUT); |
|
| 69 | + pinMode(PWM2_PIN, OUTPUT); |
|
| 65 | 70 | pinMode(DIR_PIN1, OUTPUT); |
| 66 | 71 | pinMode(DIR_PIN2, OUTPUT); |
| 67 | 72 | |
| 68 | 73 | // 默认停止 |
| 69 | - analogWrite(PWM_PIN, 0); |
|
| 74 | + analogWrite(PWM1_PIN, 0); |
|
| 75 | + analogWrite(PWM2_PIN, 0); |
|
| 70 | 76 | digitalWrite(DIR_PIN1, LOW); |
| 71 | 77 | digitalWrite(DIR_PIN2, LOW); |
| 72 | 78 | |
| 73 | 79 | // 启动为 WiFi AP 模式,使用固定 IP |
| 80 | + Serial.println("Starting WiFi AP..."); |
|
| 81 | + |
|
| 82 | + // Disconnect from any previous WiFi |
|
| 83 | + WiFi.disconnect(); |
|
| 74 | 84 | WiFi.mode(WIFI_AP); |
| 75 | - // 固定 AP 地址(根据需要修改) |
|
| 85 | + delay(100); |
|
| 86 | + |
|
| 87 | + // 启动软 AP:使用 ssid 和 password(注意:WPA2 密码至少 8 字符) |
|
| 88 | + bool apStarted = WiFi.softAP(ssid, password); |
|
| 89 | + if (!apStarted) { |
|
| 90 | + Serial.println("AP start failed! Retrying..."); |
|
| 91 | + delay(1000); |
|
| 92 | + WiFi.softAP(ssid, password); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + delay(1000); // Give more time for AP to start |
|
| 96 | + |
|
| 97 | + // 固定 AP 地址(根据需要修改)- Must be called AFTER softAP() |
|
| 76 | 98 | IPAddress apIP(192, 168, 50, 1); |
| 77 | 99 | IPAddress apGateway(192, 168, 50, 1); |
| 78 | 100 | IPAddress apSubnet(255, 255, 255, 0); |
| 79 | 101 | if (!WiFi.softAPConfig(apIP, apGateway, apSubnet)) { |
| 80 | 102 | Serial.println("softAPConfig failed"); |
| 81 | 103 | } |
| 82 | - |
|
| 83 | - // 启动软 AP:使用 ssid 和 password(注意:WPA2 密码至少 8 字符) |
|
| 84 | - WiFi.softAP(ssid, password); |
|
| 104 | + |
|
| 85 | 105 | delay(500); |
| 86 | 106 | Serial.println(""); |
| 87 | - Serial.print("AP started, IP: "); |
|
| 107 | + Serial.println("=========================="); |
|
| 108 | + Serial.print("AP SSID: "); |
|
| 109 | + Serial.println(ssid); |
|
| 110 | + Serial.print("AP Password: "); |
|
| 111 | + Serial.println(password); |
|
| 112 | + Serial.print("AP IP: "); |
|
| 88 | 113 | Serial.println(WiFi.softAPIP()); |
| 114 | + Serial.println("=========================="); |
|
| 89 | 115 | |
| 90 | 116 | // Web 服务 |
| 91 | 117 | server.on("/", handleRoot); |
code-dat/motor-driver-code-dat/PWM-motor-esp-webserver-ap-2.ino
| ... | ... | @@ -0,0 +1,124 @@ |
| 1 | +#include <ESP8266WiFi.h> |
|
| 2 | +#include <ESP8266WebServer.h> |
|
| 3 | + |
|
| 4 | +// ===== WiFi 配置 ===== |
|
| 5 | +const char* ssid = "motor_control"; |
|
| 6 | +const char* password = "electrodragon"; |
|
| 7 | + |
|
| 8 | +// ===== GPIO 定义 ===== |
|
| 9 | +const int PWM1_PIN = 5; // PWM 控制速度 IO5 |
|
| 10 | +const int PWM2_PIN = 4; // PWM 控制速度 IO4 |
|
| 11 | + |
|
| 12 | +const int DIR_PIN1 = 2; // 方向引脚1 IO2 |
|
| 13 | +const int DIR_PIN2 = 0; // 方向引脚2 IO0 |
|
| 14 | + |
|
| 15 | + |
|
| 16 | +// ===== Web Server ===== |
|
| 17 | +ESP8266WebServer server(80); |
|
| 18 | + |
|
| 19 | +// ===== HTML Web 控制界面 ===== |
|
| 20 | +const char html_page[] PROGMEM = R"rawliteral( |
|
| 21 | +<!DOCTYPE html><html> |
|
| 22 | +<head><title>ESP8266 Motor Control</title></head> |
|
| 23 | +<body> |
|
| 24 | +<h2>Motor Control</h2> |
|
| 25 | +<form action="/control"> |
|
| 26 | +Speed: <input type="range" name="speed" min="0" max="1023"><br> |
|
| 27 | +Direction: |
|
| 28 | +<select name="dir"> |
|
| 29 | + <option value="fw">Forward</option> |
|
| 30 | + <option value="rv">Reverse</option> |
|
| 31 | +</select><br> |
|
| 32 | +<input type="submit" value="Apply"> |
|
| 33 | +</form> |
|
| 34 | +</body></html> |
|
| 35 | +)rawliteral"; |
|
| 36 | + |
|
| 37 | +// ===== 处理 Web 请求 ===== |
|
| 38 | +void handleRoot() { |
|
| 39 | + server.send(200, "text/html", html_page); |
|
| 40 | +} |
|
| 41 | + |
|
| 42 | +void handleControl() { |
|
| 43 | + if (server.hasArg("speed")) { |
|
| 44 | + int speed = server.arg("speed").toInt(); // PWM 值 0-1023 |
|
| 45 | + analogWrite(PWM1_PIN, speed); |
|
| 46 | + analogWrite(PWM2_PIN, speed); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + if (server.hasArg("dir")) { |
|
| 50 | + String d = server.arg("dir"); |
|
| 51 | + if (d == "fw") { |
|
| 52 | + digitalWrite(DIR_PIN1, HIGH); |
|
| 53 | + digitalWrite(DIR_PIN2, LOW); |
|
| 54 | + } else { |
|
| 55 | + digitalWrite(DIR_PIN1, LOW); |
|
| 56 | + digitalWrite(DIR_PIN2, HIGH); |
|
| 57 | + } |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + server.sendHeader("Location", "/"); |
|
| 61 | + server.send(302, "text/plain", ""); |
|
| 62 | +} |
|
| 63 | + |
|
| 64 | +// ===== 初始化 ===== |
|
| 65 | +void setup() { |
|
| 66 | + Serial.begin(115200); |
|
| 67 | + |
|
| 68 | + pinMode(PWM1_PIN, OUTPUT); |
|
| 69 | + pinMode(PWM2_PIN, OUTPUT); |
|
| 70 | + pinMode(DIR_PIN1, OUTPUT); |
|
| 71 | + pinMode(DIR_PIN2, OUTPUT); |
|
| 72 | + |
|
| 73 | + // 默认停止 |
|
| 74 | + analogWrite(PWM1_PIN, 0); |
|
| 75 | + analogWrite(PWM2_PIN, 0); |
|
| 76 | + digitalWrite(DIR_PIN1, LOW); |
|
| 77 | + digitalWrite(DIR_PIN2, LOW); |
|
| 78 | + |
|
| 79 | + // 启动为 WiFi AP 模式,使用固定 IP |
|
| 80 | + Serial.println("Starting WiFi AP..."); |
|
| 81 | + |
|
| 82 | + // Disconnect from any previous WiFi |
|
| 83 | + WiFi.disconnect(); |
|
| 84 | + WiFi.mode(WIFI_AP); |
|
| 85 | + delay(100); |
|
| 86 | + |
|
| 87 | + // 启动软 AP:使用 ssid 和 password(注意:WPA2 密码至少 8 字符) |
|
| 88 | + bool apStarted = WiFi.softAP(ssid, password); |
|
| 89 | + if (!apStarted) { |
|
| 90 | + Serial.println("AP start failed! Retrying..."); |
|
| 91 | + delay(1000); |
|
| 92 | + WiFi.softAP(ssid, password); |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + delay(1000); // Give more time for AP to start |
|
| 96 | + |
|
| 97 | + // 固定 AP 地址(根据需要修改)- Must be called AFTER softAP() |
|
| 98 | + IPAddress apIP(192, 168, 50, 1); |
|
| 99 | + IPAddress apGateway(192, 168, 50, 1); |
|
| 100 | + IPAddress apSubnet(255, 255, 255, 0); |
|
| 101 | + if (!WiFi.softAPConfig(apIP, apGateway, apSubnet)) { |
|
| 102 | + Serial.println("softAPConfig failed"); |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + delay(500); |
|
| 106 | + Serial.println(""); |
|
| 107 | + Serial.println("=========================="); |
|
| 108 | + Serial.print("AP SSID: "); |
|
| 109 | + Serial.println(ssid); |
|
| 110 | + Serial.print("AP Password: "); |
|
| 111 | + Serial.println(password); |
|
| 112 | + Serial.print("AP IP: "); |
|
| 113 | + Serial.println(WiFi.softAPIP()); |
|
| 114 | + Serial.println("=========================="); |
|
| 115 | + |
|
| 116 | + // Web 服务 |
|
| 117 | + server.on("/", handleRoot); |
|
| 118 | + server.on("/control", handleControl); |
|
| 119 | + server.begin(); |
|
| 120 | +} |
|
| 121 | + |
|
| 122 | +void loop() { |
|
| 123 | + server.handleClient(); |
|
| 124 | +} |
|
| ... | ... | \ No newline at end of file |
code-dat/motor-driver-code-dat/PWM-motor-esp-webserver-sta-1.ino
| ... | ... | @@ -8,9 +8,9 @@ const char* ssid = "YOUR_SSID"; |
| 8 | 8 | const char* password = "YOUR_PASSWORD"; |
| 9 | 9 | |
| 10 | 10 | // ===== GPIO 定义 ===== |
| 11 | -const int PWM_PIN = D1; // PWM 控制速度 IO5 |
|
| 12 | -const int DIR_PIN1 = D2; // 方向引脚1 IO4 |
|
| 13 | -const int DIR_PIN2 = D3; // 方向引脚2 IO0 |
|
| 11 | +const int PWM_PIN = 5; // PWM 控制速度 IO5 |
|
| 12 | +const int DIR_PIN1 = 4; // 方向引脚1 IO4 |
|
| 13 | +const int DIR_PIN2 = 0; // 方向引脚2 IO0 |
|
| 14 | 14 | |
| 15 | 15 | // ===== Web Server ===== |
| 16 | 16 | ESP8266WebServer server(80); |