-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocal-search.xml
More file actions
364 lines (177 loc) · 207 KB
/
local-search.xml
File metadata and controls
364 lines (177 loc) · 207 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?xml version="1.0" encoding="utf-8"?>
<search>
<entry>
<title>刷机指南</title>
<link href="/2022/01/21/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E5%88%B7%E6%9C%BA%E6%8C%87%E5%8D%97/"/>
<url>/2022/01/21/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E5%88%B7%E6%9C%BA%E6%8C%87%E5%8D%97/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E8%B5%84%E6%96%99%E5%87%86%E5%A4%87">1. 资料准备</a></li><li><a href="#2-%E6%AD%A5%E9%AA%A4">2. 步骤</a><ul><li><a href="#21-%E6%89%8B%E6%9C%BA%E8%A7%A3%E9%94%81%E8%A7%A3bootloader%E9%94%81">2.1. 手机解锁(解bootloader锁)</a></li><li><a href="#22-%E5%88%B7%E5%85%A5%E7%AC%AC%E4%B8%89%E6%96%B9rec">2.2. 刷入第三方rec</a></li><li><a href="#23-%E5%9C%A8%E8%AE%BE%E5%A4%87%E4%B8%BAtwrp%E7%95%8C%E9%9D%A2%E4%B8%8B%E5%88%B7%E6%9C%BA">2.3. 在设备为twrp界面下刷机</a></li></ul></li><li><a href="#3-%E6%89%8B%E6%9C%BA%E5%BC%80%E5%A7%8B%E4%BD%BF%E7%94%A8">3. 手机开始使用</a></li><li><a href="#4-%E5%85%B6%E4%BB%96%E5%8F%82%E8%80%83">4. 其他参考</a></li></ul><!-- /TOC --><h1 id="1-资料准备"><a href="#1-资料准备" class="headerlink" title="1. 资料准备"></a>1. 资料准备</h1><ol><li><p> <a href="https://adbdownload.info/">ADB Driver</a>,<a href="https://www.baidu.com/s?wd=adb%20driver%20download">百度的搜索:adb driver download</a>。驱动,让电脑能识别adb设备。</p></li><li><p> <a href="https://developer.android.com/studio/releases/platform-tools">ADB platform tools</a>,<a href="https://cn.bing.com/search?q=ADB+platform+tools">必应的搜索:adb platform tools</a>。命令行工具,下载之后解压,把文件夹存到合适的位置,然后把路径添加到环境变量,确保在cmd中输入<code>adb</code>能得到正确的反应。</p></li></ol><img src="/2022/01/21/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E5%88%B7%E6%9C%BA%E6%8C%87%E5%8D%97/刷机指南_2022-01-21-13-22-15.png" width="70%"><img src="/2022/01/21/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E5%88%B7%E6%9C%BA%E6%8C%87%E5%8D%97/刷机指南_2022-01-21-13-23-12.png" width="70%"><ol start="3"><li><p> 第三方rec,<a href="https://twrp.me/Devices/">TWRP官网设备列表</a>,接下来以我的<code>红米4高配版(Markw)</code>举例:<a href="https://download.mokeedev.com/?device=markw">魔趣ROM设备页的TWRP链接</a>,<a href="https://forum.xda-developers.com/t/recovery-unofficial-markw-twrp-3-4-0-1.4030421/">XDA论坛对应设备的TWRP REC</a>,以及<a href="https://github.com/redispade/device_xiaomi_markw_twrp/releases/tag/twrp-3.4.0-1-markw">附带的github下载页</a>。这是最直接的下载方式,还有一些开发者制作了一键刷入脚本,汉化的,都可以。</p></li><li><p> 第三方ROM,<a href="https://download.mokeedev.com/">魔趣Mokee</a>,<a href="https://lineageos.org/">Lineage os</a>,<a href="https://wiki.pixelexperience.org/devices/">Pixel Experience</a>,等等。MIUI和Flyme开放给其他厂商机型下载的页面可能挂了,建议还是在<a href="https://forum.xda-developers.com/">XDA</a>找。</p></li><li><p> 权限管理工具,<a href="https://magiskcn.com/">Magisk中文网</a>,<a href="https://github.com/topjohnwu/Magisk">Magisk的Github</a>。</p></li><li><p> <a href="https://opengapps.org/">Open Gapp Project</a>,手头上的安卓手机基本都是ARM64,<a href="https://marasati.com/2019/06/10/gapps.html">The Open GApps 各版本详细介绍</a>,或搜索<a href="https://cn.bing.com/search?q=open+gapp%E7%89%88%E6%9C%AC%E5%8C%BA%E5%88%AB">open gapp版本区别</a>,选择nano即可(micro还多出Gmail)</p></li></ol><h1 id="2-步骤"><a href="#2-步骤" class="headerlink" title="2. 步骤"></a>2. 步骤</h1><h2 id="2-1-手机解锁(解bootloader锁)"><a href="#2-1-手机解锁(解bootloader锁)" class="headerlink" title="2.1. 手机解锁(解bootloader锁)"></a>2.1. 手机解锁(解bootloader锁)</h2><p><a href="https://www.miui.com/unlock/index.html">小米设备申请解锁网页和工具下载</a></p><p>首次解锁,设备先绑定小米账号(手机登录账号,打开开发者模式->设备解锁状态按提示操作),然后电脑上下载好上述工具,登录小米账号(小米账号要有设备解锁资格),按提示操作。(手机进入fastboot状态,驱动也装好)</p><p>近年各大手机厂商设备解锁功能收紧,不知道这些设备解锁操作有无新的阻碍。反正我的红米4很早之前解锁过又上锁了,但是重新解锁完全没有阻碍。不知道近年来的新设备如何。</p><h2 id="2-2-刷入第三方rec"><a href="#2-2-刷入第三方rec" class="headerlink" title="2.2. 刷入第三方rec"></a>2.2. 刷入第三方rec</h2><ol><li><p> 手机进入fastboot:关机,按住减音量键和开机键即可。</p></li><li><p> 在cmd确定可以运行adb,驱动正常。</p></li><li><p>连接adb设备,刷入rec</p> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">fastboot devices <span class="hljs-comment">#确定能识别到设备</span><br>fastboot flash recovery c:/.../twrp.img <span class="hljs-comment">#路径看实际情况,等待进度完成</span><br>fastboot boot c:/.../twrp.img <span class="hljs-comment">#路径看实际情况,等待进度完成,手机就会重启进入twrp界面</span><br><span class="hljs-comment"># 不太确定刷完第三方rec之后还能不能直接进入原系统,我的好像会卡米,所以还是刷完第三方rec之后就刷机</span><br></code></pre></td></tr></table></figure><h2 id="2-3-在设备为twrp界面下刷机"><a href="#2-3-在设备为twrp界面下刷机" class="headerlink" title="2.3. 在设备为twrp界面下刷机"></a>2.3. 在设备为twrp界面下刷机</h2></li></ol><p>如果此前手机内存里面还没有下载好ROM(仅fastboot刷入rec不会清除手机内存的文件),有几种方法:手机USB连接OTG设备,在twrp下把ROM复制到本机;进入twrp模式下可以通过连接数据线,使用adb命令,把文件发送到手机内存:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">adb push C:\...\MK10.0-markw.zip sdcard <span class="hljs-comment">#发送到根目录,本地文件的路径在属性里面复制即可</span><br>adb push C:\...\MK10.0-markw.zip /storage/emulated/0/DCIM <span class="hljs-comment">#发送到相册目录</span><br>adb push C:\...\MK10.0-markw.zip /storage/emulated/0/Files <span class="hljs-comment">#发送到其他目录,要先确保这个目录存在,数据线连接时,不显示复制的进度</span><br></code></pre></td></tr></table></figure><p>有ROM情况下,最好同时再准备好open gapp和magisk:</p><ol><li><p> 双清(恢复出厂设置,清除Data、Cache,清除软件啥的,不会清除自己另外的文件),选择Wipe->划过进度条。</p></li><li><p> 返回主页,选择安装,找到自己的ROM,滑动以安装。</p></li><li><p> 紧接着刷入open gapp</p></li><li><p> 安装完之后格式化data分区(所有文件就清掉了),Wipe->格式化data,按提示输入yes</p></li><li><p> 刷入了open gapp之后进入系统,联网之后设备验证会很久(网络原因),可以之后再联网。</p></li><li><p> 接着刷入magisk?,也可以之后连接电脑之后使用adb刷,或者之后再卡刷(就不需要双清或者更多的清除了)。</p></li><li><p> 进入系统之后还想进入rec:打开开发者模式->高级重启选项打开,然后手机重启时有重起至rec的选项。</p></li></ol><h1 id="3-手机开始使用"><a href="#3-手机开始使用" class="headerlink" title="3. 手机开始使用"></a>3. 手机开始使用</h1><ol><li><p> 类原生系统,第一次开机时不要插入SIM卡。</p></li><li><p>软件洁癖,使用adb命令在手机电脑之间传文件</p> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">adb connect 192.168.X.X<br>adb pull /storage/emulated/0/Download/XXX C:\Users\LUCK\Desktop<br>adb push C:\...\MK10.0-markw.zip /storage/emulated/0/Files<br><span class="hljs-comment">#网络ADB调试有时会显示进度</span><br></code></pre></td></tr></table></figure></li><li><p> 必备软件:<a href="https://github.com/2dust/v2rayNG/releases">V2rayNG</a>,<a href="https://www.videolan.org/vlc/download-android.html">VLC Player</a>,<a href="https://www.52pojie.cn/thread-1299678-1-1.html">ADM</a>,</p></li></ol><h1 id="4-其他参考"><a href="#4-其他参考" class="headerlink" title="4. 其他参考"></a>4. 其他参考</h1><p><a href="https://cloud.tencent.com/developer/news/473261">手机刷机双清、三清、四清等详细介绍</a></p><p><a href="https://www.bilibili.com/read/cv12472212">小米8解锁BootLoader,进入TWRP流程</a></p><p><a href="https://mp.weixin.qq.com/s/Ufj8fkANXYcEI_V0tFGZ0Q">安卓手机刷机教程;解锁BL;刷入REC;获取ROOT权限;更换系统;刷机玩机资源教程攻略</a></p>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>ESP32开发笔记</title>
<link href="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/"/>
<url>/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-guide">1. Guide</a></li><li><a href="#2-esp-idf%E7%9B%B8%E5%85%B3%E8%B5%84%E6%BA%90%E4%B8%8B%E8%BD%BD">2. ESP IDF相关资源下载</a></li><li><a href="#3-__esp32-platformio%E4%BD%BF%E7%94%A8__">3. <strong>ESP32 PlatformIO使用</strong></a></li><li><a href="#4-esp32-micropython">4. ESP32 Micropython</a><ul><li><a href="#41-%E7%83%A7%E5%86%99micropython">4.1. 烧写micropython</a></li><li><a href="#42-micropython%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83">4.2. micropython开发环境</a></li><li><a href="#43-python%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%B7%AF%E5%BE%84%E9%97%AE%E9%A2%98">4.3. python环境变量路径问题</a></li></ul></li><li><a href="#5-esp32%E5%9C%A8espressif-iot-development-framework%E6%A8%A1%E6%9D%BF%E4%B8%8B%E7%9A%84%E5%B7%A5%E7%A8%8B">5. ESP32在Espressif IoT Development Framework模板下的工程</a><ul><li><a href="#51-rtos%E7%9A%84%E5%8A%9F%E8%83%BD">5.1. RTOS的功能</a></li><li><a href="#52-%E4%BD%9C%E4%B8%BAconsole%E7%9A%84%E5%8A%9F%E8%83%BD">5.2. 作为console的功能</a></li></ul></li><li><a href="#6-esp32%E4%BB%A5arduino%E4%B8%BA%E6%A8%A1%E6%9D%BF%E5%9F%BA%E4%BA%8Efreertos%E7%9A%84%E5%BC%80%E5%8F%91">6. ESP32以Arduino为模板,基于freeRTOS的开发</a><ul><li><a href="#61-%E4%BC%98%E7%82%B9%E5%B0%B1%E6%98%AF%E9%85%8D%E5%90%88platform-io%E6%9C%89%E5%A4%A7%E9%87%8F%E6%A0%87%E5%87%86%E7%9A%84%E5%BA%93%E5%8F%AF%E5%8F%82%E8%80%83">6.1. 优点就是配合platform IO有大量标准的库可参考</a></li><li><a href="#62-%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9">6.2. 注意事项</a></li></ul></li><li><a href="#7-esp32%E7%A1%AC%E4%BB%B6%E5%BC%80%E5%8F%91">7. ESP32硬件开发</a><ul><li><a href="#71-gpio-matrix%E8%BF%98%E6%B2%A1%E7%9C%9F%E6%AD%A3%E4%BD%BF%E7%94%A8">7.1. GPIO Matrix(还没真正使用)</a></li><li><a href="#72-%E5%85%B3%E4%BA%8Eesp32espi%E5%92%8Cst7735%E7%A1%AC%E4%BB%B6%E8%AE%BE%E8%AE%A1">7.2. 关于ESP32<code>eSPI</code>和<code>ST7735</code>硬件设计</a></li><li><a href="#73-esp32-cam%E8%AE%BE%E8%AE%A1">7.3. ESP32 CAM设计</a><ul><li><a href="#731-%E6%8E%A8%E8%8D%90%E8%AE%BE%E8%AE%A1">7.3.1. 推荐设计</a></li><li><a href="#732-%E5%85%B6%E4%BB%96">7.3.2. 其他</a></li></ul></li></ul></li><li><a href="#8-bug%E8%AE%B0%E5%BD%95">8. Bug记录</a></li><li><a href="#9-code-reference">9. Code Reference</a><ul><li><a href="#91-freertos-task">9.1. FreeRTOS Task</a></li><li><a href="#92-freertos-software-timer">9.2. FreeRTOS Software Timer</a></li><li><a href="#93-freertos-semaphore">9.3. FreeRTOS Semaphore</a></li><li><a href="#94-arduino--freertos">9.4. Arduino + FreeRTOS</a></li></ul></li></ul><!-- /TOC --><h1 id="1-Guide"><a href="#1-Guide" class="headerlink" title="1. Guide"></a>1. Guide</h1><p><a href="https://www.espressif.com/zh-hans">乐鑫官网</a></p><p><a href="https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/">乐鑫官网 快速入门指南</a></p><p><a href="https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/resources.html">乐鑫官网 PlatformIO的指引</a></p><p><a href="https://docs.platformio.org/en/latest/platforms/espressif32.html">PlatformIO官网里关于ESP32的文档</a></p><p><a href="https://github.com/espressif/vscode-esp-idf-extension"><del>ESP-IDF VS Code Extension</del></a></p><p><a href="https://blog.csdn.net/Mark_md/article/details/113517263"><del>ESP32开发 0.windows Vscode开发环境搭建</del></a></p><h1 id="2-ESP-IDF相关资源下载"><a href="#2-ESP-IDF相关资源下载" class="headerlink" title="2. ESP IDF相关资源下载"></a>2. ESP IDF相关资源下载</h1><ol><li><p>先决条件:</p><p> <a href="https://code.visualstudio.com/#alt-downloads">VSCODE</a>,下载<code>System Installer</code>,登录github账号同步。</p><p> <a href="https://git-scm.com/downloads">Git</a></p><p> <a href="https://www.python.org/downloads/">Python</a>,要用<code>esp idf</code>只能使用3.8的版本。3.8.7可正常使用,更高的未验证。</p></li><li><p><a href="https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/windows-setup.html#esp-idf">乐鑫官网 快速入门指南 ESP-IDF 工具安装器</a><br>下载离线安装包。</p> <img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/嵌入式控制网站整理_2021-08-17-22-20-03.png" width="100%"> <img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/嵌入式控制网站整理_2021-08-17-22-20-18.png" width="100%"><p> 注意不需要使用更低版本的<code>esp-idf-tools-setup</code>单独处理。<code>esp-idf-tools-setup-2.10</code>安装之后就能直接使用。</p> <img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/嵌入式控制网站整理_2021-08-17-22-27-40.png" width="70%"></li><li><p>完毕之后安装vscode插件</p> <img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/嵌入式控制网站整理_2021-08-17-22-28-35.png" width="70%"> <img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/嵌入式控制网站整理_2021-08-17-22-28-44.png" width="70%"> <img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/嵌入式控制网站整理_2021-08-17-22-28-59.png" width="70%"></li></ol><ol start="4"><li> 插件配置的最后是下载python虚拟环境,不需要挂梯子,最好把梯子关掉。</li></ol><h1 id="3-ESP32-PlatformIO使用"><a href="#3-ESP32-PlatformIO使用" class="headerlink" title="3. ESP32 PlatformIO使用"></a>3. <strong>ESP32 PlatformIO使用</strong></h1><p>开发ESP32使用PlatformIO最方便,而且编译速度比<code>ESP-IDE</code>快很多。</p><ol><li><p>提前安装:<code>python</code>,并且更新pip和安装<code>platformio</code>,这个package是为了烧录程序。</p> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">python -m pip install --upgrade pip<br>pip install platformio<br></code></pre></td></tr></table></figure></li><li><p> 安装vscode,然后安装<code>platformio</code>插件。创建新工程即可。特别简单。第一次使用时比较慢,因为要下载的东西比较多,大概一个多G左右。</p></li><li><p>工程里面的<code>platformio.ini</code>可以管理调试的配置。普通的esp32选择<code>board = esp32dev</code></p> <figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs ini"><span class="hljs-section">[env:esp32dev]</span><br><span class="hljs-attr">platform</span> = espressif32<br><span class="hljs-attr">framework</span> = espidf<br><span class="hljs-attr">board</span> = esp32dev<br><span class="hljs-attr">monitor_speed</span> = <span class="hljs-number">115200</span><br></code></pre></td></tr></table></figure></li><li><p>一些例子一方面可以看</p><p> <a href="https://github.com/espressif/esp-idf">github:espressif/esp-idf</a>,下载里面的examples,或者<br> <a href="https://www.espressif.com/zh-hans/support/download/sdks-demos">ESP-IDF官网,下载压缩包,解压得到examples</a></p></li><li><p>工程移植和学习的方式:</p><p> 创建一个模板工程,要多线程就用<code>Espressif IOT Development Framework</code>,如果有依赖<code>arduino</code>的库就用<code>arduino</code>的模板。</p><p> 然后把<code>example</code>里面的需要参考的工程的主函数复制或者移植部分过去。platformIO创建的工程没有路径问题。工程内需要的其他文件也可以按需要复制过去。有文件夹的则整个复制过去,并且查看<code>CMakeLists.txt</code>添加需要的文件名。</p></li></ol><h1 id="4-ESP32-Micropython"><a href="#4-ESP32-Micropython" class="headerlink" title="4. ESP32 Micropython"></a>4. ESP32 Micropython</h1><p><a href="https://docs.micropython.org/en/latest/esp32/quickref.html">Micropython : Quick reference for the ESP32</a></p><h2 id="4-1-烧写micropython"><a href="#4-1-烧写micropython" class="headerlink" title="4.1. 烧写micropython"></a>4.1. 烧写micropython</h2><p><a href="https://www.cnblogs.com/schaepher/p/14503380.html">ESP32 开发板刷入 MicroPython 很好的教程</a></p><p><a href="https://micropython.org/download/">Micropython固件下载</a></p><blockquote><p> 如果买的开发板是基于 ESP32-WROVER 模组,则选择 GENERIC-SPIRAM,否则选 GENERIC。</p></blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><code class="hljs bash">python -m pip install --upgrade pip<br>pip install esptool<br>esptool.py chip_id<br><span class="hljs-comment"># 输入之后可以看到设备在COM几</span><br>esptool.py --chip esp32 --port COM3 erase_flash <br><span class="hljs-comment"># 清除 ESP32 开发板的 flash 芯片已有的内容</span><br><span class="hljs-comment"># 这一步是为了确保 MicroPython 刷入 flash 时的成功率。</span><br>esptool.py --chip esp32 --port COM3 --baud 460800 write_flash -z 0x1000 C:\Users\LUCK\Downloads\esp32-20210623-v1.16.bin<br><span class="hljs-comment"># COM要对,波特率是烧写的波特率,不改变后续python系统正常运行的波特率,后面的路径是本地文件的路径</span><br></code></pre></td></tr></table></figure><p>之后在串口里面验证。发送<code>help()</code>,注意发送的时候要发送换行符,换行符是<code>\r\n(CRLF)</code>。</p><h2 id="4-2-micropython开发环境"><a href="#4-2-micropython开发环境" class="headerlink" title="4.2. micropython开发环境"></a>4.2. micropython开发环境</h2><p><a href="https://www.bilibili.com/read/cv7262936/">在vscode里基于Pymakr插件进行esp32的micropython开发</a></p><ol><li><p> <a href="https://nodejs.org/en/download/">Node.js Download</a>,下载LTS版本,安装时最后一个勾要打上。</p></li><li><p> 安装vscode里面的<code>Pymakr</code>插件上传.py文件,注意<code>Pymakr</code>插件里面的描述,对于vscode的版本有要求。我现在(20210819)是<code>Pymakr v1.1.12</code>,要求vscode版本是1.56.x(使用的是1.56.2)</p></li><li><p> <a href="https://code.visualstudio.com/docs/supporting/faq#_previous-release-versions">vscode历史版本下载</a>,<br><code>https://update.code.visualstudio.com/{version}/win32-x64/stable</code>,把version改成<code>1.56.2</code>之类的即可。<br><a href="https://code.visualstudio.com/updates/v1_59">版本列表看这里</a></p></li></ol><p>相关的bug:</p><ol><li><p>从1.59.0退回1.56.2版本的vscode之后,新建文件和打开插件的时候会有下面的错误</p><blockquote><p>(this.configurationService.getValue(…) || []).filter is not a function</p></blockquote><p> <a href="https://stackoverflow.com/questions/67587398/vs-code-error-this-configurationservice-getvalue-filter-is-not-a-f">解决方法</a></p><p> 在设置中须将<code>workbench.editorAssociations</code>标志修复为:</p> <figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs json">"workbench.editorAssociations": [<br> {<br> <span class="hljs-attr">"viewType"</span>: <span class="hljs-string">"jupyter-notebook"</span>,<br> <span class="hljs-attr">"filenamePattern"</span>: <span class="hljs-string">"*.ipynb"</span><br> }<br> ],<br></code></pre></td></tr></table></figure><p> 以前是:</p> <figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs json"><br>"workbench.editorAssociations": {<br> "*.ipynb": "jupyter-notebook"<br>}<br></code></pre></td></tr></table></figure></li><li><p> 使用RT-Thread插件未成功。</p></li></ol><h2 id="4-3-python环境变量路径问题"><a href="#4-3-python环境变量路径问题" class="headerlink" title="4.3. python环境变量路径问题"></a>4.3. python环境变量路径问题</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">python -m pip install --upgrade pip<br></code></pre></td></tr></table></figure><p>执行这个更新pip的操作之后如果有Warning的话,应该是提示pip的路径不在环境变量里面,看提示的路径是什么,然后把它添加到环境变量路径,就不会warning了。</p><p>通过pip下载了其他库之后,比如在命令行:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">pip install esptool<br>esptool.py chip_id<br></code></pre></td></tr></table></figure><p>然后提示<code>esptool.py 不是内部或外部命令</code>,这是因为第三方安装的库的路径也没有添加到环境变量。其路径一般和上面pip提示的路径属于同一个文件夹。路径参考如下。随python版本不同而不同。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">C:\Users\LUCK\AppData\Roaming\Python\Python38\Scripts <br>C:\Users\LUCK\AppData\Roaming\Python\Python38\site-packages <br></code></pre></td></tr></table></figure><h1 id="5-ESP32在Espressif-IoT-Development-Framework模板下的工程"><a href="#5-ESP32在Espressif-IoT-Development-Framework模板下的工程" class="headerlink" title="5. ESP32在Espressif IoT Development Framework模板下的工程"></a>5. ESP32在Espressif IoT Development Framework模板下的工程</h1><h2 id="5-1-RTOS的功能"><a href="#5-1-RTOS的功能" class="headerlink" title="5.1. RTOS的功能"></a>5.1. RTOS的功能</h2><p>新建了一个需要使用freeRTOS的工程,但是编译无法通过。搜索了一下[undefined reference to `uxTaskGetSystemState’](<a href="https://www.esp32.com/viewtopic.php?t=3674">https://www.esp32.com/viewtopic.php?t=3674</a>)</p><blockquote><p> 此功能需要 configUSE_TRACE_FACILITY=1。您必须在 menuconfig 中检查此选项:</p></blockquote><blockquote><p> menuconfig->Component config->FreeRTOS->Enable FreeRTOS trace facility</p></blockquote><p>但是在<code>PlatformIO</code>里面使用<code>Run Menuconfig</code>,然而vscode的cmd无法使用方向键。只能在命令行:</p><blockquote><p> cd 到所在工程的路径,然后执行下面的命令</p></blockquote><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">C:\Users\LUCK\.platformio\penv\Scripts\platformio.exe run --target menuconfig<br></code></pre></td></tr></table></figure><p>就能使用方向键完成上面的配置了。</p><h2 id="5-2-作为console的功能"><a href="#5-2-作为console的功能" class="headerlink" title="5.2. 作为console的功能"></a>5.2. 作为console的功能</h2><p>注意使用另外的串口工具,相关配置选择正确。发送的时候换行符选择为<code>\n</code>,不是<code>\r\n</code>。</p><h1 id="6-ESP32以Arduino为模板,基于freeRTOS的开发"><a href="#6-ESP32以Arduino为模板,基于freeRTOS的开发" class="headerlink" title="6. ESP32以Arduino为模板,基于freeRTOS的开发"></a>6. ESP32以Arduino为模板,基于freeRTOS的开发</h1><h2 id="6-1-优点就是配合platform-IO有大量标准的库可参考"><a href="#6-1-优点就是配合platform-IO有大量标准的库可参考" class="headerlink" title="6.1. 优点就是配合platform IO有大量标准的库可参考"></a>6.1. 优点就是配合platform IO有大量标准的库可参考</h2><h2 id="6-2-注意事项"><a href="#6-2-注意事项" class="headerlink" title="6.2. 注意事项"></a>6.2. 注意事项</h2><ol><li><p>线程任务创建的时候栈大小一定要足够。<code>4096</code>基本ok,但是<code>128</code>就太小了。</p><blockquote><p> 造成信号量和线程不能同时使用、信号量和软件定时器不能同时使用、还有各种系统崩溃基本都是这个原因。</p></blockquote></li><li><p>启用RTOS之后不需要任务调度器,并且loop里面不要放任何东西!loop里面的是会循环运行的,但是不在freeRTOS的管理中,所以会意外的打断正在运行的任务。</p><blockquote><p> 导致了OLED显示屏显示异常的问题(字符位置不对、显示不完全),这并不是IMU和OLED优先级的问题。</p></blockquote></li><li><p> 外设的初始化可以放在线程的for里面,不需要一定放在setup里面。setup里面就先初始化一个串口,然后是GPIO,然后是信号量,然后是定时器,最后是任务。</p></li></ol><h1 id="7-ESP32硬件开发"><a href="#7-ESP32硬件开发" class="headerlink" title="7. ESP32硬件开发"></a>7. ESP32硬件开发</h1><h2 id="7-1-GPIO-Matrix(还没真正使用)"><a href="#7-1-GPIO-Matrix(还没真正使用)" class="headerlink" title="7.1. GPIO Matrix(还没真正使用)"></a>7.1. GPIO Matrix(还没真正使用)</h2><p>一个外设的功能可以映射到任意的GPIO,但是需要高速运行的时候</p><blockquote><p> 如果SPI采用GPIO矩阵,则最大频率会限制在26.6MHz,如果采用IOMUX,最高频率会限制在80MHz;</p></blockquote><blockquote><p> HSPI和VSPI并不是网友们认为的high-speed SPI 和Very High-speed SPI,这是SPI和HSPI、VSPI是一样的,只不过是换个名字用于区分,SPI相当于SPI0或SPI1,HSPI相当于SPI2,VSPI相当于SPI3。</p></blockquote><p>因此设计硬件设计时很友好。</p><h2 id="7-2-关于ESP32eSPI和ST7735硬件设计"><a href="#7-2-关于ESP32eSPI和ST7735硬件设计" class="headerlink" title="7.2. 关于ESP32eSPI和ST7735硬件设计"></a>7.2. 关于ESP32<code>eSPI</code>和<code>ST7735</code>硬件设计</h2><p>在<code>ST7735</code>库里面有<code>User_Setup.h</code>里面有如下参考配置。(<a href="https://item.taobao.com/item.htm?spm=a230r.1.14.16.57fa77b0syOr9L&id=565271827736&ns=1&abbucket=16#detail">ST7735淘宝店</a>)</p><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><code class="hljs C"><span class="hljs-comment">// For ESP32 Dev board (only tested with ILI9341 display)</span><br><span class="hljs-comment">// The hardware SPI can be mapped to any pins</span><br><br><span class="hljs-comment">//#define TFT_MISO 19</span><br><span class="hljs-comment">//#define TFT_MOSI 23</span><br><span class="hljs-comment">//#define TFT_SCLK 18</span><br><span class="hljs-comment">//#define TFT_CS 15 // Chip select control pin</span><br><span class="hljs-comment">//#define TFT_DC 2 // Data Command control pin</span><br><span class="hljs-comment">//#define TFT_RST 4 // Reset pin (could connect to RST pin)</span><br><span class="hljs-comment">//#define TFT_RST -1 // Set TFT_RST to -1 if display RESET is connected to ESP32 board RST</span><br></code></pre></td></tr></table></figure><p>一方面是引脚可映射到任意IO,另一方面,这些参考的引脚配置来自ESP32的硬件手册。</p><img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/ESP32开发笔记_2021-08-22-19-59-26.png" width="100%"><h2 id="7-3-ESP32-CAM设计"><a href="#7-3-ESP32-CAM设计" class="headerlink" title="7.3. ESP32 CAM设计"></a>7.3. ESP32 CAM设计</h2><img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/ESP32开发笔记_2021-08-23-21-56-15.png" width="70%"><table><thead><tr><th>管脚名称</th><th>管脚类型</th><th>管脚描述</th></tr></thead><tbody><tr><td>SIO_C</td><td>输入</td><td>SCCB总线的时钟线,可类比I2C的SCL</td></tr><tr><td>SIO_D</td><td>I/O</td><td>SCCB总线的数据线,可类比I2C的SDA</td></tr><tr><td>RESETB</td><td>输入</td><td>系统复位管脚,低电平有效</td></tr><tr><td>PWDN</td><td>输入</td><td>掉电/省电模式,高电平有效</td></tr><tr><td>HREF</td><td>输出</td><td>行同步信号</td></tr><tr><td>VSYNC</td><td>输出</td><td>帧同步信号</td></tr><tr><td>PCLK</td><td>输出</td><td>像素同步时钟输出信号</td></tr><tr><td>XCLK</td><td>输入</td><td>外部时钟输入端口,可接外部晶振</td></tr><tr><td>Y0…Y9</td><td>输出</td><td>像素数据输出端口</td></tr></tbody></table><img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/ESP32开发笔记_2021-08-23-21-56-37.png" width="70%"><p>下图的电路参考的是<code>Weact</code>的<code>STM32H7XX</code>开发板(<a href="https://github.com/WeActTC/MiniSTM32H7xx">github</a>或者<a href="https://gitee.com/WeAct-TC/MiniSTM32H7xx">gitee</a>),非常冗余和设计完善,但是后来发现这太过冗余了。</p><img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/ESP32开发笔记_2021-08-23-21-57-56.png" width="70%"><h3 id="7-3-1-推荐设计"><a href="#7-3-1-推荐设计" class="headerlink" title="7.3.1. 推荐设计"></a>7.3.1. 推荐设计</h3><p><a href="https://docs.ai-thinker.com/esp32-cam"><strong>安信可科技 ESP32-CAM摄像头开发板</strong></a></p><img src="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/ESP32开发笔记_2021-08-23-22-14-41.png" width="100%"><p>量产并且大量应用的,然而引脚和<code>platformIO</code>的推荐不一样,D0~D7这种数据引脚有几个交错和不同,其他的仅<code>XCLK(MCLK)</code>不同,<code>PWDN</code>和<code>RESET</code>的连接方式参考安信可的即可。看来引脚设计确实非常灵活。。。没什么好顾虑的,那种和时钟相关的高速的不动它就行。</p><p>ov2640相关的文档在上面的<a href="https://docs.ai-thinker.com/esp32-cam"><strong>安信可科技 ESP32-CAM摄像头开发板</strong></a><br>文末即可下载。需要其他相关资源从weact STM32H7xx Core Board 的<a href="https://github.com/WeActTC/MiniSTM32H7xx">github</a>或者<a href="https://gitee.com/WeAct-TC/MiniSTM32H7xx">gitee</a>下载</p><h3 id="7-3-2-其他"><a href="#7-3-2-其他" class="headerlink" title="7.3.2. 其他"></a>7.3.2. 其他</h3><p><a href="https://github.com/1zlab/1ZLAB_ESP32_Wifi_Camera">1ZLAB_ESP32_Wifi_Camera</a>,设计精美,有原理图。</p><p><a href="https://github.com/m5stack/esp32-cam-demo">m5stack/esp32-cam-demo</a></p><h1 id="8-Bug记录"><a href="#8-Bug记录" class="headerlink" title="8. Bug记录"></a>8. Bug记录</h1><p><a href="https://www.cnblogs.com/gtsup/p/9559770.html">关于启动模式的问题</a>,<br><a href="https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection">ESP32启动模式和时序官方文档</a>,<br>本来怀疑新焊接的一块ESP32是不是需要通过特殊的方法才能烧录程序,答案是不需要,因为本身芯片EN引脚配置的阻容就能实现正确的上电时序了。只有焊接问题会导致无法烧录程序。</p><p>另外,CP2102不需要连接ESP32也应该要被电脑正常识别。</p><h1 id="9-Code-Reference"><a href="#9-Code-Reference" class="headerlink" title="9. Code Reference"></a>9. Code Reference</h1><h2 id="9-1-FreeRTOS-Task"><a href="#9-1-FreeRTOS-Task" class="headerlink" title="9.1. FreeRTOS Task"></a>9.1. FreeRTOS Task</h2><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><code class="hljs CPP"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">vUserTaskCode</span><span class="hljs-params">(<span class="hljs-keyword">void</span> *pvParameters)</span></span><br><span class="hljs-function"></span>{<br> <span class="hljs-keyword">for</span> (;;)<br> {<br> <span class="hljs-comment">// code</span><br> }<br>}<br><br><span class="hljs-comment">// in setup</span><br><span class="hljs-keyword">static</span> <span class="hljs-keyword">uint8_t</span> ucParameterToPassUserTask;<br>TaskHandle_t xUserTaskHandle = <span class="hljs-literal">NULL</span>;<br><span class="hljs-comment">// 线程函数名,任务名(无用),栈大小,创建时要使用的一个变量,优先级(tskIDLE_PRIORITY是默认,为0),任务的handle</span><br>xTaskCreate(vUserTaskCode, <span class="hljs-string">"TASK1"</span>, <span class="hljs-number">4096</span>, &ucParameterToPassUserTask, <span class="hljs-number">0</span>, &xUserTaskHandle);<br></code></pre></td></tr></table></figure><h2 id="9-2-FreeRTOS-Software-Timer"><a href="#9-2-FreeRTOS-Software-Timer" class="headerlink" title="9.2. FreeRTOS Software Timer"></a>9.2. FreeRTOS Software Timer</h2><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br></pre></td><td class="code"><pre><code class="hljs CPP"><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">vUserTimerCallback</span><span class="hljs-params">(TimerHandle_t pxTimer)</span></span><br><span class="hljs-function"></span>{<br> <span class="hljs-comment">// code</span><br>}<br><br><span class="hljs-comment">// in setup</span><br><span class="hljs-comment">// 软件定时器xTimerCreate,先创建定时器然后再创建task</span><br>TimerHandle_t xUserTimer = <span class="hljs-literal">NULL</span>;<br>xUserTimer = xTimerCreate(<span class="hljs-string">"UserTimer"</span>, <span class="hljs-comment">// Just a text name, not used by the kernel.</span><br> (<span class="hljs-number">3000</span> / portTICK_PERIOD_MS), <span class="hljs-comment">// The timer period in ticks.</span><br> pdTRUE, <span class="hljs-comment">// pdFalse means a one-shot timer. pdTRUE means an auto-reload timer</span><br> <span class="hljs-number">0</span>, <span class="hljs-comment">// The id is not used by the callback so can take any value.</span><br> vUserTimerCallback); <span class="hljs-comment">// The callback function that switches the LCD back-light off.</span><br><span class="hljs-keyword">if</span> (xUserTimer == <span class="hljs-literal">NULL</span>)<br> Serial.println(<span class="hljs-string">"The UserTimer was not created..."</span>);<br><span class="hljs-keyword">else</span><br>{<br> <span class="hljs-keyword">if</span> (xTimerStart(xUserTimer, <span class="hljs-number">0</span>) != pdPASS) <span class="hljs-comment">// This line of code also start the timer. Or use xTimerStart( xUserTimer, 0 );</span><br> Serial.println(<span class="hljs-string">"The UserTimer could not be set into the Active state...."</span>);<br>}<br></code></pre></td></tr></table></figure><h2 id="9-3-FreeRTOS-Semaphore"><a href="#9-3-FreeRTOS-Semaphore" class="headerlink" title="9.3. FreeRTOS Semaphore"></a>9.3. FreeRTOS Semaphore</h2><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><code class="hljs CPP">SemaphoreHandle_t xUserSemaphore = <span class="hljs-literal">NULL</span>;<br><br><span class="hljs-comment">// in setup</span><br>xUserSemaphore = xSemaphoreCreateBinary();<br><span class="hljs-comment">// xUserSemaphore = xSemaphoreCreateMutex();</span><br><span class="hljs-comment">// xUserSemaphore = xSemaphoreCreateCounting(100, 0);</span><br><span class="hljs-keyword">if</span>( xUserSemaphore != <span class="hljs-literal">NULL</span> )<br>{<br> Serial.println(<span class="hljs-string">"xUserSemaphore create ok..."</span>);<span class="hljs-comment">// The semaphore was created successfully. The semaphore can now be used.</span><br>}<br><br><span class="hljs-comment">// usage</span><br><span class="hljs-comment">// static BaseType_t pxUserSemaphoreWoken = pdFALSE;</span><br>BaseType_t UserSemaphoreSend;<br>UserSemaphoreSend = xSemaphoreGive( xUserSemaphore);<br><span class="hljs-keyword">if</span>(UserSemaphoreSend == pdPASS)Serial.println(<span class="hljs-string">"xUserSemaphore send ok..."</span>);<br><span class="hljs-keyword">else</span> Serial.println(<span class="hljs-string">"xUserSemaphore send wrong..."</span>);<br><br>xSemaphoreTake( xUserSemaphore, portMAX_DELAY );<br></code></pre></td></tr></table></figure><h2 id="9-4-Arduino-FreeRTOS"><a href="#9-4-Arduino-FreeRTOS" class="headerlink" title="9.4. Arduino + FreeRTOS"></a>9.4. Arduino + FreeRTOS</h2><figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br></pre></td><td class="code"><pre><code class="hljs CPP"><span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string"><Arduino.h></span></span><br><br><span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> LED_PIN 27</span><br><span class="hljs-keyword">bool</span> led_state = <span class="hljs-literal">true</span>;<br><br><span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> STACK_SIZE 500</span><br>StackType_t xStack[STACK_SIZE];<br>StaticTask_t xTaskBuffer;<br><br><span class="hljs-keyword">static</span> StaticTimer_t xTimerBuffer;<br>UBaseType_t uxVariableToIncrement = <span class="hljs-number">0</span>;<br><br>SemaphoreHandle_t xSemaphore = <span class="hljs-literal">NULL</span>;<br><br><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">vFunc1TimerCallback</span><span class="hljs-params">(TimerHandle_t pxTimer)</span></span><br><span class="hljs-function"></span>{<br> Serial.println(<span class="hljs-string">"vFunc1TimerCallback running...\n"</span>);<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">vTaskCode1</span><span class="hljs-params">(<span class="hljs-keyword">void</span> *pvParameters)</span></span><br><span class="hljs-function"></span>{<br> <span class="hljs-keyword">for</span> (;;)<br> {<br> <span class="hljs-comment">// led_state = !led_state;</span><br> <span class="hljs-comment">// digitalWrite(LED_PIN, led_state);</span><br> <span class="hljs-comment">// Serial.println("vTaskCode1 running...");</span><br> <span class="hljs-comment">// vTaskDelay(1000 / portTICK_PERIOD_MS);</span><br><br> xSemaphoreTake( xSemaphore, portMAX_DELAY );<br> led_state = !led_state;<br> digitalWrite(LED_PIN, led_state);<br> Serial.println(<span class="hljs-string">"vTaskCode1 receive Semaphore running...\n"</span>);<br> <span class="hljs-comment">// vTaskDelay(1000 / portTICK_PERIOD_MS);</span><br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">vTaskCode2</span><span class="hljs-params">(<span class="hljs-keyword">void</span> *pvParameters)</span></span><br><span class="hljs-function"></span>{<br> <span class="hljs-keyword">for</span> (;;)<br> {<br> Serial.println(<span class="hljs-string">"vTaskCode2 running...\n"</span>);<br> vTaskDelay(<span class="hljs-number">1000</span> / portTICK_PERIOD_MS);<br><br> <span class="hljs-comment">// static BaseType_t pxTaskWoken = pdFALSE;</span><br> <span class="hljs-comment">// BaseType_t send;</span><br> <span class="hljs-comment">// send = xSemaphoreGive( xSemaphore);</span><br> <span class="hljs-comment">// if(send == pdPASS)Serial.println("xSemaphore send ok...");</span><br> <span class="hljs-comment">// else Serial.println("xSemaphore send wrong...");</span><br> }<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">setup</span><span class="hljs-params">()</span> </span>{<br> pinMode(LED_PIN, OUTPUT);<br> Serial.begin(<span class="hljs-number">115200</span>);<br> Serial.println(<span class="hljs-string">"Initializing System..."</span>);<br><br> xSemaphore = xSemaphoreCreateBinary();<br> <span class="hljs-comment">// xSemaphore = xSemaphoreCreateMutex();</span><br> <span class="hljs-comment">// xSemaphore = xSemaphoreCreateCounting(100, 0);</span><br> <span class="hljs-keyword">if</span>( xSemaphore != <span class="hljs-literal">NULL</span> )<br> {<br> Serial.println(<span class="hljs-string">"xSemaphore create ok..."</span>);<span class="hljs-comment">// The semaphore was created successfully. The semaphore can now be used.</span><br> }<br><br> <span class="hljs-comment">// // 软件定时器xTimerCreate,先创建定时器然后再创建task</span><br> TimerHandle_t xFunc1Timer = <span class="hljs-literal">NULL</span>;<br> xFunc1Timer = xTimerCreate(<span class="hljs-string">"Func1Timer"</span>, <span class="hljs-comment">// Just a text name, not used by the kernel.</span><br> (<span class="hljs-number">3000</span> / portTICK_PERIOD_MS), <span class="hljs-comment">// The timer period in ticks.</span><br> pdTRUE, <span class="hljs-comment">// pdFalse means a one-shot timer. pdTRUE means an auto-reload timer</span><br> <span class="hljs-number">0</span>, <span class="hljs-comment">// The id is not used by the callback so can take any value.</span><br> vFunc1TimerCallback); <span class="hljs-comment">// The callback function that switches the LCD back-light off.</span><br> <span class="hljs-keyword">if</span> (xFunc1Timer == <span class="hljs-literal">NULL</span>)<br> Serial.println(<span class="hljs-string">"The timer was not created..."</span>);<br> <span class="hljs-keyword">else</span><br> {<br> <span class="hljs-keyword">if</span> (xTimerStart(xFunc1Timer, <span class="hljs-number">0</span>) != pdPASS) <span class="hljs-comment">// This line of code also start the timer. Or use xTimerStart( xFuncxTimer, 0 );</span><br> Serial.println(<span class="hljs-string">"The timer could not be set into the Active state...."</span>);<br> }<br><br> <span class="hljs-keyword">static</span> <span class="hljs-keyword">uint8_t</span> ucParameterToPass1;<br> TaskHandle_t xTask1Handle = <span class="hljs-literal">NULL</span>;<br> <span class="hljs-comment">// 线程函数名,任务名(无用),栈大小,创建时要使用的一个变量,优先级(tskIDLE_PRIORITY是默认,为0),任务的handle</span><br> xTaskCreate(vTaskCode1, <span class="hljs-string">"TASK1"</span>, <span class="hljs-number">4096</span>, &ucParameterToPass1, <span class="hljs-number">0</span>, &xTask1Handle);<br><br> <span class="hljs-keyword">static</span> <span class="hljs-keyword">uint8_t</span> ucParameterToPass2;<br> TaskHandle_t xTask2Handle = <span class="hljs-literal">NULL</span>;<br> <span class="hljs-comment">// 线程函数名,任务名(无用),栈大小,创建时要使用的一个变量,优先级(tskIDLE_PRIORITY是默认,为0),任务的handle</span><br> xTaskCreate(vTaskCode2, <span class="hljs-string">"TASK2"</span>, <span class="hljs-number">4096</span>, &ucParameterToPass2, <span class="hljs-number">0</span>, &xTask2Handle);<br>}<br><br><span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">loop</span><span class="hljs-params">()</span> </span>{<br> Serial.println(<span class="hljs-string">"Runing..."</span>);<br> vTaskDelay(<span class="hljs-number">1500</span> / portTICK_PERIOD_MS);<br><br> <span class="hljs-keyword">static</span> BaseType_t pxTaskWoken = pdFALSE;<br> BaseType_t send;<br> send = xSemaphoreGive( xSemaphore);<br> <span class="hljs-keyword">if</span>(send == pdPASS)Serial.println(<span class="hljs-string">"xSemaphore send ok..."</span>);<br> <span class="hljs-keyword">else</span> Serial.println(<span class="hljs-string">"xSemaphore send wrong..."</span>);<br>}<br><br></code></pre></td></tr></table></figure>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>电脑安装与配置</title>
<link href="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/"/>
<url>/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E7%AC%94%E8%AE%B0%E6%9C%ACwin10%E4%B8%8Eubuntu%E5%8F%8C%E7%B3%BB%E7%BB%9F">1. 笔记本win10与ubuntu双系统</a><ul><li><a href="#11-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B">1.1. 安装过程</a></li><li><a href="#12-%E5%B8%B8%E7%94%A8%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9">1.2. 常用注意事项</a></li><li><a href="#13-%E5%8F%8C%E7%A1%AC%E7%9B%98%E7%9A%84%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9">1.3. 双硬盘的注意事项</a></li></ul></li><li><a href="#2-win-to-go--ubuntu-to-go%E5%8F%8C%E7%B3%BB%E7%BB%9F">2. win to go + ubuntu to go双系统</a><ul><li><a href="#21-%E8%B5%84%E6%BA%90%E5%87%86%E5%A4%87">2.1. 资源准备</a></li><li><a href="#22-%E6%AD%A5%E9%AA%A4">2.2. 步骤</a></li><li><a href="#23-%E5%85%B6%E4%BB%96%E5%92%8C%E8%B8%A9%E5%9D%91">2.3. 其他和踩坑</a></li><li><a href="#24-%E5%9C%A8%E5%AD%A6%E6%A0%A1%E7%9A%84w730t%E5%B7%A5%E4%BD%9C%E7%AB%99">2.4. 在学校的W730t工作站</a><ul><li><a href="#241-%E5%A6%82%E6%9E%9C%E9%81%87%E5%88%B0%E6%8F%92%E5%85%A5wtg%E4%B9%8B%E5%90%8E%E5%BC%80%E6%9C%BA%E4%B8%8D%E6%96%AD%E9%87%8D%E5%90%AF%E8%80%8C%E4%B8%94%E4%B8%80%E7%9B%B4%E9%BB%91%E5%B1%8F%E7%9A%84%E9%97%AE%E9%A2%98">2.4.1. 如果遇到插入WTG之后开机不断重启而且一直黑屏的问题:</a></li></ul></li></ul></li><li><a href="#3-ubuntu%E4%BD%BF%E7%94%A8tips">3. ubuntu使用tips</a></li><li><a href="#4-windows%E8%BD%AF%E4%BB%B6%E9%85%8D%E7%BD%AE">4. windows软件配置</a></li><li><a href="#5-%E6%96%87%E4%BB%B6%E7%BB%84%E7%BB%87%E6%96%B9%E5%BC%8F">5. 文件组织方式</a><ul><li><a href="#51-files">5.1. Files</a></li><li><a href="#52-c-disk">5.2. C disk</a></li><li><a href="#53-filesync">5.3. FileSync</a></li><li><a href="#54-%E5%85%B6%E4%BB%96">5.4. 其他</a></li></ul></li></ul><!-- /TOC --><h1 id="1-笔记本win10与ubuntu双系统"><a href="#1-笔记本win10与ubuntu双系统" class="headerlink" title="1. 笔记本win10与ubuntu双系统"></a>1. 笔记本win10与ubuntu双系统</h1><p><a href="https://www.cnblogs.com/masbay/p/10745170.html">参考教程:windows10安装ubuntu双系统教程(绝对史上最详细)</a></p><h2 id="1-1-安装过程"><a href="#1-1-安装过程" class="headerlink" title="1.1. 安装过程"></a>1.1. 安装过程</h2><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-29-38.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-30-32.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-30-54.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-31-28.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-31-57.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-32-27.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-37-22.png" width="70%"><img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-38-10.png" width="70%"><h2 id="1-2-常用注意事项"><a href="#1-2-常用注意事项" class="headerlink" title="1.2. 常用注意事项"></a>1.2. 常用注意事项</h2><ol><li><p> 关闭windows快速启动。</p></li><li><p> 关闭BIOS安全启动,允许USB启动,调节BIOS启动顺序等。</p></li><li><p> 制作ubuntu安装盘,可使用软碟通工具(Ultra ISO)。</p></li><li><p> 进入Ubuntu安装界面,最关键是要选择<code>其他选项</code></p></li><li><p> 手动划分分区的时候,<code>UEFI</code>必须为<code>主分区</code>,其他尽量选择作为<code>主分区</code>而不是<code>逻辑分区</code>,<code>Swap</code>只能作为逻辑分区。</p></li><li><p> 空间分配参考:<code>Swap</code>:8192,<code>/</code>和<code>/home</code>对半分,各40G左右。</p></li></ol><h2 id="1-3-双硬盘的注意事项"><a href="#1-3-双硬盘的注意事项" class="headerlink" title="1.3. 双硬盘的注意事项"></a>1.3. 双硬盘的注意事项</h2><ol><li><p> 主硬盘压缩一下,新建立一个UEFI分区,然后在需要安装Ubuntu的硬盘压缩出未分配空间。</p></li><li><p>在<code>安装启动引导器的设备</code>里面要选择自己新建的那个UEFI分区对应的卷号,如下图。</p> <img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-37-22.png" width="70%"></li></ol><h1 id="2-win-to-go-ubuntu-to-go双系统"><a href="#2-win-to-go-ubuntu-to-go双系统" class="headerlink" title="2. win to go + ubuntu to go双系统"></a>2. win to go + ubuntu to go双系统</h1><h2 id="2-1-资源准备"><a href="#2-1-资源准备" class="headerlink" title="2.1. 资源准备"></a>2.1. 资源准备</h2><p><code>企业版windows镜像</code>,搜索最新的,使用磁力或者迅雷下载。</p><p><a href="https://ubuntu.com/download/desktop">Ubuntu LTS</a>,同样使用ultra ISO制作ubuntu安装盘。</p><p><a href="https://bbs.luobotou.org/thread-761-1-1.html">Windows To Go 辅助工具|WTG辅助工具 v5.5.9</a>,<br><a href="https://bbs.luobotou.org/thread-6098-1-1.html">WTG辅助工具高级选项说明</a>,<br>使用本工具把Windows镜像写入移动硬盘。</p><p>也有其他的方式,比如旧版一些的windows就有直接制作WTG的工具,或者其他第三方工具。</p><h2 id="2-2-步骤"><a href="#2-2-步骤" class="headerlink" title="2.2. 步骤"></a>2.2. 步骤</h2><ol><li><p> 先启动安装好的WTG,进入磁盘管理,压缩卷,腾出给ubuntu的磁盘空间。</p></li><li><p> 插着WTG和ubuntu安装盘,重启,进入Ubuntu安装盘,然后进行同样的安装过程。</p></li><li><p>注意,在手动分空间的时候,分区尽量为主分区。而且不需要另外多划分一个UEFI了,在<code>安装启动引导器的设备</code>里面要选择的是硬盘本身,不需要指定任何一个UEFI分区对应的卷号,如下图。否则可能开机之后只能进入其中某一个系统。</p> <img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-22-35-22.png" width="60%"></li></ol><h2 id="2-3-其他和踩坑"><a href="#2-3-其他和踩坑" class="headerlink" title="2.3. 其他和踩坑"></a>2.3. 其他和踩坑</h2><ol><li><p> <a href="https://blog.csdn.net/qiancaobaicheng/article/details/90486439">Ubuntu安装过程中分区时出现空闲空间不可用的情况</a></p></li><li><p> <a href="https://bbs.luobotou.org/thread-45312-1-1.html">实现磁盘无默认盘符(让系统默认不要给分区分配盘符)</a></p></li><li><p> 我用windows自带工具制作的WTG再安装ubuntu,怎么样也无法进入Ubuntu的引导,也就是无法在开机的时候选择进入的系统。使用上述的<code>Windows To Go 辅助工具|</code>的流程才是正常的。</p></li><li><p> 如果引导出现问题,把WTG插入另一个开着机的电脑就可以直接对UEFI分区进行文件操作。要对本机的UEFI分区进行文件操作,可使用<code>DiskGenius</code>,编辑则使用<code>BootICE</code>,正常安装不需要涉及这两。</p></li></ol><h2 id="2-4-在学校的W730t工作站"><a href="#2-4-在学校的W730t工作站" class="headerlink" title="2.4. 在学校的W730t工作站"></a>2.4. 在学校的W730t工作站</h2><h3 id="2-4-1-如果遇到插入WTG之后开机不断重启而且一直黑屏的问题:"><a href="#2-4-1-如果遇到插入WTG之后开机不断重启而且一直黑屏的问题:" class="headerlink" title="2.4.1. 如果遇到插入WTG之后开机不断重启而且一直黑屏的问题:"></a>2.4.1. 如果遇到插入WTG之后开机不断重启而且一直黑屏的问题:</h3><ol><li><p> 开机了,键盘有效之后先随便按一个键,表示取消重新启动。</p></li><li><p>方向键向下选择一档(表示接着启动),或者向下选择两档(表示以后永远接着启动),然后按回车。</p> <img src="/2021/08/08/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%94%B5%E8%84%91%E5%AE%89%E8%A3%85%E4%B8%8E%E9%85%8D%E7%BD%AE/电脑安装与配置_2021-08-08-23-07-58.png" width="70%"></li><li><p> 于是就进入了ubuntu双系统的引导界面。直接按回车进入当前的系统(默认为ubuntu,可以在<code>grub</code>更改为默认windows),按两下方向键再按回车可以进入另一个系统。</p></li><li><p> 硬盘在读盘,但是一直黑屏的话,多等待一下,10min左右应该就安装好相关的东西能亮屏了。</p></li><li><p> 如果已经实现了永远接着启动,那么在重启之后,键盘灯亮起的时候,方向键按两下,(但是在W730t工作站上还是进不了ubuntu)</p></li></ol><h1 id="3-ubuntu使用tips"><a href="#3-ubuntu使用tips" class="headerlink" title="3. ubuntu使用tips"></a>3. ubuntu使用tips</h1><p><a href="https://blog.csdn.net/ewqapple/article/details/88799473">ubuntu更改启动顺序</a></p><p><a href="https://www.jianshu.com/p/cf445a2c55e8">解决Ubuntu 18.04+Windows双系统时间不同步的问题</a></p><h1 id="4-windows软件配置"><a href="#4-windows软件配置" class="headerlink" title="4. windows软件配置"></a>4. windows软件配置</h1><ol><li><p> 开机,等待驱动与必要更新的安装,完毕之后重启。</p></li><li><p>安装<code>火绒</code>,代替<code>Windows Defender</code>,然后才能使用<code>KMS</code>顺利激活Windows。</p><p> <a href="https://github.com/zbezj/HEU_KMS_Activator">HEU_KMS_Activator</a>,github上面还有<a href="https://github.com/search?q=KMS">很多</a></p></li><li><p>常用环境同步</p><p> windows换用微软账号登陆,登上oneDrive,并且等待设置同步。</p><p> 网站上登陆<a href="https://www.office.com/">Office</a>,下载安装工具。(如果要使用旧版就到<a href="https://msdn.itellyou.cn/">MSDN</a>下载)</p><p> 下载<a href="https://www.google.cn/chrome/index.html">chrome</a>,获取外网访问环境<a href="https://github.com/Fndroid/clash_for_windows_pkg/releases/tag/0.17.0">clash_for_windows_pkg</a>,登陆谷歌账号,书签同步,就基本上可以无缝使用新电脑了。</p></li><li><p>必备软件</p><p> <a href="https://sspai.com/post/52521">QTTabBar少数派的介绍</a>,<a href="http://qttabbar.wikidot.com/">它的官网</a></p><p> <a href="https://www.7-zip.org/">7z</a></p><p> <a href="http://www.idman.ys168.com/">IDM</a>,这个网址还包含一些其他软件。在<code>下载</code>-><code>选项</code>-><code>文件类型</code>中去掉<code>PDF</code>,于是就能直接在chrome浏览pdf了。</p><p> <a href="https://cajviewer.cnki.net/download.html">CAJ浏览器</a>,下载7.2即可。</p><p> <a href="https://calibre-ebook.com/download">Calibre,看电子书相关</a></p><p> <a href="https://github.com/Chuyu-Team/Dism-Multi-language/releases">Dism-Multi-language</a></p></li><li><p>常用的大型生产力软件</p><p> <a href="http://www.zhanshaoyi.com/15504.html">MATLAB 2020b安装教程,我爱分享网</a></p><p> <a href="https://cn.bing.com/search?q=solidworks+2018+sp5%E6%95%99%E7%A8%8B&qs=n&form=QBRE&sp=-1&pq=solidworks+2018+sp5%E6%95%99%E7%A8%8B&sc=0-21&sk=&cvid=ABFB0BFF75AB42369438CE234A39D46F">Solidworks 2018 sp5</a>,windows11安装solidworks2018要使用SW2020的激活方式,<a href="http://www.ee123.net/post/88.html">参考:windows11安装激活solidworks2018教程,有激活工具下载</a>,<a href="https://zhuanlan.zhihu.com/p/357370405">补充参考:知乎-SolidWorks2020详细步骤安装教程</a></p><p> <a href="https://www.mr-wu.cn/altium-designer-ad-21-free-download/">Altium Designer AD 21 吴川斌</a>,<a href="http://www.zhanshaoyi.com/15892.html">Altium Designer AD 21 我爱分享网</a>,其他相关配置看:</p> <a href="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/EDA%E8%BD%AF%E4%BB%B6%E8%B5%84%E6%BA%90%E6%95%B4%E7%90%86/" title="EDA软件资源整理">EDA软件资源整理</a> <a href="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/" title="嵌入式控制网站整理">嵌入式控制网站整理</a></li><li><p>常用的生产力环境</p><p> <a href="https://code.visualstudio.com/#alt-downloads">VSCODE</a>,下载<code>System Installer</code>,登录github账号同步。</p><p> <a href="https://git-scm.com/downloads">Git</a></p><p> <a href="https://www.python.org/downloads/">Python</a></p><p> <a href="https://sourceforge.net/projects/mingw-w64/files/">mingw下载</a>,下载<code>x86_64-posix-seh</code>即可,应该是第二个。然后配置环境变量,在Path环境变量里面添加一条,指向MinGW的bin文件夹。在命令窗口中输入下面的命令验证安装是否成功:<br> <code>gcc -v</code></p><p> <a href="https://cmake.org/download/">cmake下载</a>,下载<code>.msi</code>后缀的,直接安装即可。</p></li><li><p>其他开发配置</p><p> <a href="https://zhuanlan.zhihu.com/p/355146595">vscode 用cmake傻瓜式搭建C++编译调试环境</a></p><p> 如果一个工程里面有多个文件,就看:<a href="https://zhuanlan.zhihu.com/p/267803605">Cmake 语法与实战入门</a></p><p> <a href="https://www.bilibili.com/read/cv6308000/">配置CLion用于STM32开发【优雅の嵌入式开发】</a> </p></li></ol><h1 id="5-文件组织方式"><a href="#5-文件组织方式" class="headerlink" title="5. 文件组织方式"></a>5. 文件组织方式</h1><h2 id="5-1-Files"><a href="#5-1-Files" class="headerlink" title="5.1. Files"></a>5.1. Files</h2><ol><li><p>Archive</p><p> 202009_XXX内容,完全结束再归档,否则放在Working</p></li><li><p>ArchihveProject</p><p> 2020_XXX内容,之后的项目进行和归档都按如下方式:</p><ol><li> <code>1_Simulation</code></li><li> <code>2_Hardware</code>,主要是PCB</li><li> <code>3_Software</code>,各类软件,嵌入式,代码等</li><li> <code>4_Mechanical</code></li><li> <code>5_Docs</code>,进行过程的文档,进度管理、总结、报告等</li><li> <code>6_Reference</code>,参考文献,Github资料</li></ol></li><li><p>HITSZ</p><p> 2020大二下,2020大三上,之后按课程分。实验课单独。</p></li><li><p>MobilePhone</p><ol><li> <code>DCIM</code>,Camera的挑选出<code>风景</code>照和<code>活动</code>照归档,剩下的经常用<code>Photoczip</code>压缩。Screenshots,ScreenRecorder,Creative保持。</li><li> <code>Movies</code>,QQ和微信的经常导出保存,不然最后看不来。</li><li> <code>Pictures</code>,同上</li><li> <code>QQ or Wechat</code>,聊天过程产生的文件也要及时归档</li></ol></li><li><p>Software</p><p> 仅工作使用的PC有,存放要用的软件,如Dism++,everything,SpaceSniffer等(这些免安装或者绿色破解的)</p></li><li><p>SoftwareDaily</p><p> 用于备份上述软件的压缩包或安装文件</p></li><li><p>SoftwareProfessional</p><p> 大型生产力</p></li><li><p>WorkRef</p><ol><li> 系统学习某个知识的论文,如<code>ADRC</code>,数学建模</li><li> 开发参考手册,如STM32相关的参考手册</li><li> 电子书</li><li> 其他资源,如办公、美化,有趣的网上开源文件文档</li></ol></li></ol><h2 id="5-2-C-disk"><a href="#5-2-C-disk" class="headerlink" title="5.2. C disk"></a>5.2. C disk</h2><ol><li><p>Prog</p><ol><li> 安装自己下载压缩包再添加PATH的软件,如<code>mingw64</code>,<code>openocd</code>,<code>gcc-arm-none-eabi</code></li><li> 安装一些在安装时自己尝试安装到C盘根目录的软件,如<code>Keil</code></li></ol></li><li><p>ProgData</p><ol><li> 软件要求的,本来使用用户文档文件夹但是能够更改的,如AltiumDesigner的临时文档,Ansys的临时文档,STM32CubeMX的固件库。</li><li> ProgData/Arm</li><li> QQ,微信等能够改动的</li></ol></li></ol><h2 id="5-3-FileSync"><a href="#5-3-FileSync" class="headerlink" title="5.3. FileSync"></a>5.3. FileSync</h2><ol><li><p> OneDrive</p></li><li><p> 坚果云</p></li></ol><h2 id="5-4-其他"><a href="#5-4-其他" class="headerlink" title="5.4. 其他"></a>5.4. 其他</h2><ol><li><p>Media</p><p> 指剪辑视频的PR工程之类的东西。</p></li><li><p> Movies</p></li><li><p> Music</p></li><li><p> Pictures</p></li><li><p>临时</p><p> 临时备份一下电脑Working(未完成的项目,博客),云盘(坚果云),用户文档(主要指用户的图片、文档),其他东西归档完毕之后可以直接复制到上述的目录,框架是统一标准化的。</p></li></ol>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>网站资源收集</title>
<link href="/2021/07/12/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%BD%91%E7%AB%99%E8%B5%84%E6%BA%90%E6%94%B6%E9%9B%86/"/>
<url>/2021/07/12/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E7%BD%91%E7%AB%99%E8%B5%84%E6%BA%90%E6%94%B6%E9%9B%86/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E8%B5%84%E6%BA%90%E7%BD%91%E7%AB%99">1. 资源网站</a><ul><li><a href="#11-%E8%A7%86%E9%A2%91%E7%B1%BB">1.1. 视频类</a></li><li><a href="#12-ppt%E6%A8%A1%E6%9D%BF%E7%B1%BB">1.2. PPT模板类</a></li><li><a href="#13-%E9%9D%99%E6%80%81%E5%9B%BE%E7%89%87">1.3. 静态图片</a></li><li><a href="#14-%E5%8A%A8%E6%80%81%E5%9B%BE">1.4. 动态图</a></li><li><a href="#15-%E5%A3%81%E7%BA%B8">1.5. 壁纸</a></li><li><a href="#16-%E5%9B%BE%E6%A0%87%E7%B1%BB">1.6. 图标类</a></li><li><a href="#17-psd%E6%A8%A1%E6%9D%BF">1.7. PSD模板</a></li><li><a href="#18-%E9%9F%B3%E9%A2%91%E7%B1%BB">1.8. 音频类</a></li><li><a href="#19-%E5%AD%97%E4%BD%93%E7%B1%BB">1.9. 字体类</a></li><li><a href="#110-%E9%85%8D%E8%89%B2">1.10. 配色</a></li></ul></li><li><a href="#2-%E7%9C%8B%E4%B9%A6">2. 看书</a></li><li><a href="#3-%E5%BC%80%E5%8F%91%E5%AD%A6%E4%B9%A0%E7%9B%B8%E5%85%B3">3. 开发学习相关</a><ul><li><a href="#31-%E8%BD%AF%E4%BB%B6">3.1. 软件</a></li><li><a href="#32-%E5%BA%93%E6%A1%86%E6%9E%B6">3.2. 库、框架</a></li><li><a href="#33-%E9%A1%B9%E7%9B%AE">3.3. 项目</a></li></ul></li><li><a href="#4-%E5%85%B6%E4%BB%96%E8%BD%AF%E4%BB%B6">4. 其他软件</a></li><li><a href="#5-%E7%AE%97%E6%B3%95-%E6%8A%80%E6%9C%AF-%E5%AD%A6%E4%B9%A0">5. 算法 技术 学习</a></li></ul><!-- /TOC --><h1 id="1-资源网站"><a href="#1-资源网站" class="headerlink" title="1. 资源网站"></a>1. 资源网站</h1><p><a href="https://www.bilibili.com/video/BV1Nf4y1a7DT">来源</a></p><h2 id="1-1-视频类"><a href="#1-1-视频类" class="headerlink" title="1.1. 视频类"></a>1.1. 视频类</h2><ol><li> 预告片世界:<a href="https://www.yugaopian.cn/">https://www.yugaopian.cn/</a></li><li> 33台词:<a href="http://33.agilestudio.cn/">http://33.agilestudio.cn/</a></li><li> MixKit:<a href="https://mixkit.co/free-stock-video/">https://mixkit.co/free-stock-video/</a> </li><li> Pexel:<a href="https://www.pexels.com/zh-cn/video/">https://www.pexels.com/zh-cn/video/</a></li><li> Videezy:<a href="https://www.videezy.com/">https://www.videezy.com/</a> </li><li> VJShi:<a href="https://www.vjshi.com/">https://www.vjshi.com/</a> </li></ol><h2 id="1-2-PPT模板类"><a href="#1-2-PPT模板类" class="headerlink" title="1.2. PPT模板类"></a>1.2. PPT模板类</h2><ol><li> 51PPT模板:<a href="http://www.51pptmoban.com/">http://www.51pptmoban.com/</a> </li><li> 优品PPT:<a href="https://www.ypppt.com/">https://www.ypppt.com/</a> </li><li> 第一PPT:<a href="http://www.1ppt.com/">http://www.1ppt.com/</a> </li><li> 叮当设计:<a href="https://www.dingdangsheji.com/">https://www.dingdangsheji.com/</a> </li><li> PPT超级市场:<a href="http://ppt.sotary.com/web/wxapp/index.html">http://ppt.sotary.com/web/wxapp/index.html</a></li></ol><h2 id="1-3-静态图片"><a href="#1-3-静态图片" class="headerlink" title="1.3. 静态图片"></a>1.3. 静态图片</h2><ol><li> PH:<a href="https://pxhere.com/">https://pxhere.com/</a></li><li> CC0图片网:<a href="https://cc0.cn/">https://cc0.cn/</a></li><li> Foodiesfeed:<a href="https://www.foodiesfeed.com/">https://www.foodiesfeed.com/</a> </li><li> Unplash:<a href="https://unsplash.com/">https://unsplash.com/</a></li><li> Pixabay:<a href="https://pixabay.com/">https://pixabay.com/</a> </li></ol><h2 id="1-4-动态图"><a href="#1-4-动态图" class="headerlink" title="1.4. 动态图"></a>1.4. 动态图</h2><ol><li> Giphy:<a href="https://giphy.com/">https://giphy.com/</a> </li><li> GfyCat:<a href="https://gfycat.com/">https://gfycat.com/</a></li><li> Tenor:<a href="https://tenor.com/">https://tenor.com/</a></li><li> GIF ABYSS:<a href="https://gifs.alphacoders.com/">https://gifs.alphacoders.com/</a> </li><li> 动图宇宙:<a href="https://biaoqingsoso.com/">https://biaoqingsoso.com/</a> </li><li> Soogif:<a href="https://www.soogif.com/">https://www.soogif.com/</a> </li><li> 闪萌:<a href="http://www.weshineapp.com/">http://www.weshineapp.com/</a></li></ol><h2 id="1-5-壁纸"><a href="#1-5-壁纸" class="headerlink" title="1.5. 壁纸"></a>1.5. 壁纸</h2><ol><li> WallHaven:<a href="https://wallhaven.cc/">https://wallhaven.cc/</a></li><li> 10Wallpaper:<a href="https://www.10wallpaper.com/">https://www.10wallpaper.com/</a> </li><li> alphacoders:<a href="https://wall.alphacoders.com/?lang=Chinese">https://wall.alphacoders.com/?lang=Chinese</a> </li><li> 极简壁纸:<a href="https://bz.zzzmh.cn/index">https://bz.zzzmh.cn/index</a> </li><li> 3G壁纸:<a href="https://www.3gbizhi.com/">https://www.3gbizhi.com/</a> </li><li> 必应壁纸:<a href="https://bing.ioliu.cn/">https://bing.ioliu.cn/</a> </li></ol><h2 id="1-6-图标类"><a href="#1-6-图标类" class="headerlink" title="1.6. 图标类"></a>1.6. 图标类</h2><ol><li> 阿里巴巴矢量图库:<a href="https://www.iconfont.cn/">https://www.iconfont.cn/</a> </li><li> Ikonate:<a href="https://ikonate.com/">https://ikonate.com/</a> </li><li> iconstore:<a href="https://iconstore.co/">https://iconstore.co/</a> </li><li> icoon:<a href="https://icooon-mono.com/">https://icooon-mono.com/</a></li><li> iconfinder:<a href="https://www.iconfinder.com/">https://www.iconfinder.com/</a></li></ol><h2 id="1-7-PSD模板"><a href="#1-7-PSD模板" class="headerlink" title="1.7. PSD模板"></a>1.7. PSD模板</h2><ol><li> 素材中国:<a href="http://www.sccnn.com/">http://www.sccnn.com/</a> </li><li> 站长素材:<a href="https://sc.chinaz.com/psd/">https://sc.chinaz.com/psd/</a> </li><li> 365PSD:<a href="https://cn.365psd.com/free-psd">https://cn.365psd.com/free-psd</a> </li><li> freepik:<a href="https://www.freepik.com/psd">https://www.freepik.com/psd</a></li><li> freebiesbug: <a href="https://freebiesbug.com/">https://freebiesbug.com/</a> </li></ol><h2 id="1-8-音频类"><a href="#1-8-音频类" class="headerlink" title="1.8. 音频类"></a>1.8. 音频类</h2><ol><li> Mixkit:<a href="https://mixkit.co/free-stock-music/">https://mixkit.co/free-stock-music/</a> </li><li> 爱给网:<a href="https://www.aigei.com/">https://www.aigei.com/</a></li><li> 淘声网:<a href="https://www.tosound.com/">https://www.tosound.com/</a> </li><li> 耳聆:<a href="https://www.ear0.com/">https://www.ear0.com/</a></li></ol><h2 id="1-9-字体类"><a href="#1-9-字体类" class="headerlink" title="1.9. 字体类"></a>1.9. 字体类</h2><ol><li> 素材中国:<a href="http://www.sccnn.com/ziku/">http://www.sccnn.com/ziku/</a> </li><li> 100Font:<a href="https://www.100font.com/">https://www.100font.com/</a> </li><li> DaFont:<a href="https://www.dafont.com/">https://www.dafont.com/</a> </li><li> 自由字体:<a href="https://ziyouziti.com/">https://ziyouziti.com/</a> </li></ol><h2 id="1-10-配色"><a href="#1-10-配色" class="headerlink" title="1.10. 配色"></a>1.10. 配色</h2><ol><li> 中国色彩:<a href="http://zhongguose.com/">http://zhongguose.com/</a> </li><li> ColorHex:<a href="https://www.colorhexa.com/">https://www.colorhexa.com/</a> </li><li> 优色网配色专区:<a href="https://color.uisdc.com/">https://color.uisdc.com/</a> </li><li> ColorDrop:<a href="https://www.colordrop.io/">https://www.colordrop.io/</a></li><li> LOL Colors:<a href="https://www.webdesignrankings.com/resources/lolcolors/">https://www.webdesignrankings.com/resources/lolcolors/</a></li><li> colorHunt:<a href="https://colorhunt.co/">https://colorhunt.co/</a> </li><li> Adobe Color:<a href="https://color.adobe.com/zh/create/color-wheel">https://color.adobe.com/zh/create/color-wheel</a></li><li> uigradients:<a href="https://uigradients.com/#PiggyPink">https://uigradients.com/#PiggyPink</a> </li><li> webgradient:<a href="https://webgradients.com/">https://webgradients.com/</a></li></ol><h1 id="2-看书"><a href="#2-看书" class="headerlink" title="2. 看书"></a>2. 看书</h1><ol><li> Z—LIBRARY:<a href="https://zh.1lib.org/">https://zh.1lib.org/</a></li><li> Lorefree:<a href="https://ebook2.lorefree.com/">https://ebook2.lorefree.com/</a></li><li> 鸠摩搜书:<a href="https://www.jiumodiary.com/">https://www.jiumodiary.com/</a></li><li> ePUBee:<a href="http://www.obook.vip/books/">http://www.obook.vip/books/</a></li><li> IRead:<a href="http://www.iread.cf/">http://www.iread.cf/</a></li><li> 淘链客:<a href="http://www.toplinks.cc/s/">http://www.toplinks.cc/s/</a></li></ol><p>全国图书馆参考咨询联盟: <a href="http://www.ucdrs.superlib.net/">http://www.ucdrs.superlib.net/</a></p><h1 id="3-开发学习相关"><a href="#3-开发学习相关" class="headerlink" title="3. 开发学习相关"></a>3. 开发学习相关</h1><h2 id="3-1-软件"><a href="#3-1-软件" class="headerlink" title="3.1. 软件"></a>3.1. 软件</h2><p><a href="http://openocd.org/">OpenOCD(Open On-Chip Debugger)开源片上调试器</a>,<br><a href="https://zhuanlan.zhihu.com/p/41517198">跟我一起学OpenOCD(一)</a></p><p><a href="https://www.vofa.plus/">VOFA+ 插件驱动的高自由度上位机</a></p><h2 id="3-2-库、框架"><a href="#3-2-库、框架" class="headerlink" title="3.2. 库、框架"></a>3.2. 库、框架</h2><p><a href="http://wiki.ros.org/mavros">MAVROS – MAVLink extendable communication node for ROS with proxy for Ground Control Station.</a></p><p><a href="https://mqtt.org/">MQTT</a></p><p><a href="https://github.com/adafruit">Adafruit Industries ,开发CircuitPython的公司</a></p><p><a href="https://circuitpython.org/">CircuitPython :The easiest way to program microcontrollers,是从micropython演化而来的</a></p><p><a href="http://wiringpi.com/">Wiring Pi : GPIO Interface library for the Raspberry Pi</a></p><p><a href="https://zhuanlan.zhihu.com/p/388573380">Python 地图绘制神器 Folium</a></p><h2 id="3-3-项目"><a href="#3-3-项目" class="headerlink" title="3.3. 项目"></a>3.3. 项目</h2><p><a href="https://github.com/search?q=drawbot">drawbot,应该有写字机器人的项目??</a></p><p><a href="https://github.com/golaced/Oldx_fly_controller">OLDX-开源多旋翼开发平台项目</a>,同一个人的github还有四足机器人项目</p><h1 id="4-其他软件"><a href="#4-其他软件" class="headerlink" title="4. 其他软件"></a>4. 其他软件</h1><p><a href="https://lutris.net/">lutris : Play all your games on Linux</a></p><p><a href="https://www.nomachine.com/">NoMachine : Go from your desktop to any NoMachine-enabled computer</a></p><p><a href="https://www.grammarly.com/">Grammarly’s AI-powered writing assistant.</a></p><p><a href="https://www.youxiaohou.com/">油小猴 一个汇聚了各种黑科技的小站</a>,<a href="https://github.com/syhyz1990">百度云网页相关的油猴脚本</a></p><h1 id="5-算法-技术-学习"><a href="#5-算法-技术-学习" class="headerlink" title="5. 算法 技术 学习"></a>5. 算法 技术 学习</h1><p><a href="https://www.cnblogs.com/jins-note/p/10215511.html">KCF跟踪算法原理 入门详解</a></p><p><a href="http://blog.sina.com.cn/s/blog_4dbdf51b0100w0u0.html">电赛准备之运放的带宽及压摆率的含义</a></p><p><a href="http://www.elecfans.com/dianzichangshi/20171106575268.html">自举元件的选择</a></p><p><a href="https://zhuanlan.zhihu.com/p/353496202">电子硬件知识汇总</a></p><p><a href="https://zhuanlan.zhihu.com/p/387180224">整理了 34 个 Python 自动化办公库!</a></p><p><a href="https://zhuanlan.zhihu.com/p/387272899">GitHub 上最酷的 8 个简历模板</a></p><p><a href="https://shields.io/">shields.io生成用于插入在github的markdown文章的标签</a></p><p><a href="https://pan.baidu.com/share/link?shareid=1712127455&uk=2751828687&fid=3970607190">ARM-Cortex M3权威指南 中文版</a></p><p><a href="http://www.xknote.com/books/67chh.html#download">ARM Cortex-M3与Cortex-M4权威指南(第3版) 带书签目录完整版PDF</a></p>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>嵌入式控制网站整理</title>
<link href="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/"/>
<url>/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E8%BD%AF%E4%BB%B6%E4%B8%8B%E8%BD%BD%E7%BD%91%E5%9D%80">1. 软件下载网址</a><ul><li><a href="#11-keil-mdk-arm">1.1. Keil MDK-ARM</a></li><li><a href="#12-keil%E8%BD%AF%E4%BB%B6%E9%85%8D%E5%A5%97%E7%9A%84%E5%9B%BA%E4%BB%B6%E5%8C%85">1.2. Keil软件配套的固件包</a></li><li><a href="#13-stm32cubemx">1.3. STM32CUBEMX</a></li><li><a href="#14-java%E7%8E%AF%E5%A2%83">1.4. <del>Java环境</del></a></li><li><a href="#15-stm32cube%E7%9B%B8%E5%BA%94%E7%9A%84%E5%9B%BA%E4%BB%B6%E5%8C%85">1.5. STM32CUBE相应的固件包:</a></li><li><a href="#16-jlink%E7%9B%B8%E5%85%B3%E8%BD%AF%E4%BB%B6">1.6. Jlink相关软件</a></li><li><a href="#17-stlink%E7%9B%B8%E5%85%B3%E8%BD%AF%E4%BB%B6">1.7. STLink相关软件</a></li><li><a href="#18-arm-none-eabi-gcc">1.8. arm-none-eabi-gcc</a></li><li><a href="#19-mingw32-make">1.9. mingw32-make</a></li><li><a href="#110-openocd">1.10. OpenOCD</a><ul><li><a href="#1101-openocd%E7%9A%84%E4%B8%8B%E8%BD%BD%E5%AE%89%E8%A3%85">1.10.1. OpenOCD的下载安装</a></li><li><a href="#1102-openocd%E7%9A%84%E4%BD%BF%E7%94%A8">1.10.2. OpenOCD的使用</a></li></ul></li></ul></li><li><a href="#2-%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E4%B8%8B%E8%BD%BD%E7%9A%84%E7%BD%91%E5%9D%80">2. 官方文档下载的网址</a><ul><li><a href="#21-stm32%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3">2.1. STM32官方文档</a></li><li><a href="#22-hal_api">2.2. HAL_API</a></li><li><a href="#23-ti-mcu">2.3. TI MCU</a></li><li><a href="#24-ti-mcu-%E5%BC%95%E8%84%9A%E9%85%8D%E7%BD%AE">2.4. TI MCU 引脚配置</a></li></ul></li><li><a href="#3-esp32%E5%BC%80%E5%8F%91%E7%9B%B8%E5%85%B3">3. ESP32开发相关</a><ul><li><a href="#31-guide">3.1. Guide</a></li><li><a href="#32-%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE%E5%92%8C%E5%BC%80%E5%8F%91%E5%8F%82%E8%80%83">3.2. 环境配置和开发参考:</a></li><li><a href="#33-32-esp-idf%E7%9B%B8%E5%85%B3%E8%B5%84%E6%BA%90%E4%B8%8B%E8%BD%BD-%E5%8F%82%E8%80%83%E4%B8%8A%E8%BF%B0%E6%96%87%E7%AB%A0%E7%9A%84%E9%93%BE%E6%8E%A5">3.3. <del>3.2. ESP IDF相关资源下载</del> 参考上述文章的链接</a></li><li><a href="#34-__esp32-platformio%E4%BD%BF%E7%94%A8__">3.4. <strong>ESP32 PlatformIO使用</strong></a></li></ul></li><li><a href="#4-%E8%BD%AF%E4%BB%B6%E7%9A%84%E6%AD%A3%E7%A1%AE%E9%85%8D%E7%BD%AE">4. 软件的正确配置</a><ul><li><a href="#41-vscode%E6%AD%A3%E7%A1%AEinclude-path">4.1. VsCode正确#include path</a></li></ul></li></ul><!-- /TOC --><h1 id="1-软件下载网址"><a href="#1-软件下载网址" class="headerlink" title="1. 软件下载网址"></a>1. 软件下载网址</h1><h2 id="1-1-Keil-MDK-ARM"><a href="#1-1-Keil-MDK-ARM" class="headerlink" title="1.1. Keil MDK-ARM"></a>1.1. Keil MDK-ARM</h2><p>官网:<a href="https://www.keil.com/">https://www.keil.com/</a><br>下载网页:<a href="https://www.keil.com/demo/eval/arm.htm#/DOWNLOAD">https://www.keil.com/demo/eval/arm.htm#/DOWNLOAD</a><br>要获得下载链接需要填写邮箱信息之类的,信息随便填,但是邮箱填一个有效的就行。<br>安装教程:<a href="https://blog.csdn.net/qq_42748213/article/details/90485750">https://blog.csdn.net/qq_42748213/article/details/90485750</a></p><h2 id="1-2-Keil软件配套的固件包"><a href="#1-2-Keil软件配套的固件包" class="headerlink" title="1.2. Keil软件配套的固件包"></a>1.2. Keil软件配套的固件包</h2><p>理论上的官网链接:<br><a href="https://www.keil.com/dd2/Pack/">https://www.keil.com/dd2/Pack/</a><br>(实际上好像找不到下载链接)</p><p>另外,在Keil安装好之后,可以在pack installer找到需要的包来安装,但是网络非常非常慢,实际不可行。</p><p>推荐第三方下载链接:<br><a href="http://www.stmcu.org.cn/module/forum/thread-615019-1-1.html">http://www.stmcu.org.cn/module/forum/thread-615019-1-1.html</a><br>使用ctrl+f,搜索STM32F1,或者STM32F4,找最新的下载即可</p><p>操作教程:<br><a href="https://blog.csdn.net/weixin_38815998/article/details/81235345">https://blog.csdn.net/weixin_38815998/article/details/81235345</a></p><h2 id="1-3-STM32CUBEMX"><a href="#1-3-STM32CUBEMX" class="headerlink" title="1.3. STM32CUBEMX"></a>1.3. STM32CUBEMX</h2><p>官网:<a href="https://www.st.com/content/st_com/zh.html">https://www.st.com/content/st_com/zh.html</a><br>下载页:<a href="https://www.st.com/content/st_com/zh/stm32cube-ecosystem.html#stm32ce-associatedproducts">https://www.st.com/content/st_com/zh/stm32cube-ecosystem.html#stm32ce-associatedproducts</a></p><p>要获得下载链接需要填写邮箱信息之类的,信息随便填,但是邮箱填一个有效的就行,提交之后会发送下载链接到你的邮箱,24小时内有效,要浏览器启用cookie才可正常下载(不行的话可以多操作几次)。</p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-07-07-12-45-03.png" width="100%"><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-07-07-12-45-29.png" width="100%"><h2 id="1-4-Java环境"><a href="#1-4-Java环境" class="headerlink" title="1.4. Java环境"></a>1.4. <del>Java环境</del></h2><p><strong>注:windows11 + STM32CubeMX 6.4.0,没有另外下载JRE,可正常运行。以前一些旧版本的CubeMX才需要JRE。</strong></p><p>先下载java运行环境(java runtime environment JRE),再安装STM32CUBEMX</p><p>下载链接:<br><a href="https://www.java.com/zh_CN/download/">https://www.java.com/zh_CN/download/</a></p><p>注意当前最新版本的cube需要的Java环境不能高于251版<br>在甲骨文官网经过复杂的链接最终能转到JRE和JDK的历史版本下载:<br><a href="https://www.oracle.com/java/technologies/oracle-java-archive-downloads.html">https://www.oracle.com/java/technologies/oracle-java-archive-downloads.html</a></p><p>相关说明:<br><a href="https://tieba.baidu.com/p/5649655840">JRE安装环境</a><br><a href="https://blog.csdn.net/loongshawn/article/details/53159952">如何在官网下载java JDK或JRE的历史版本</a></p><h2 id="1-5-STM32CUBE相应的固件包:"><a href="#1-5-STM32CUBE相应的固件包:" class="headerlink" title="1.5. STM32CUBE相应的固件包:"></a>1.5. STM32CUBE相应的固件包:</h2><p>下载链接:<br><a href="https://www.st.com/zh/embedded-software/stm32cube-mcu-mpu-packages.html#products">https://www.st.com/zh/embedded-software/stm32cube-mcu-mpu-packages.html#products</a><br>需要使用哪个系列的芯片包下载就行。</p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-07-07-12-48-36.png" width="100%"><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-07-07-12-48-42.png" width="100%"><h2 id="1-6-Jlink相关软件"><a href="#1-6-Jlink相关软件" class="headerlink" title="1.6. Jlink相关软件"></a>1.6. Jlink相关软件</h2><p>我们淘宝能买到的Jlink基本上都是盗版,所以安装的Jlink驱动不能太高版本,不然使用仿真器会有异常。lsy2019下半年制作的下载器在Jlink6.54版本上驱动完全正常。</p><p>Jlink公司segger的官网:<br><a href="https://www.segger.com/downloads/jlink/">https://www.segger.com/downloads/jlink/</a></p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-07-07-12-49-33.png" width="100%"><p>接下来下载调试还会用上更现代化的<a href="https://www.segger.com/products/development-tools/ozone-j-link-debugger/">Ozone:The J-Link Debugger and Performance Analyzer</a>。</p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2022-02-06-21-16-35.png" width="100%"><h2 id="1-7-STLink相关软件"><a href="#1-7-STLink相关软件" class="headerlink" title="1.7. STLink相关软件"></a>1.7. STLink相关软件</h2><p><a href="https://www.st.com/zh/development-tools/stm32cubeprog.html">STM32CubeProgrammer</a>,可以通过多种方式下载程序到目标单片机,有STLink时可以观察各种寄存器。但是没有办法搜索全局变量等。待完善。</p><p>也可以搜索STLink对应的硬件,看它提供的相关软件。如<a href="https://www.st.com/zh/development-tools/stlink-v3set.html">STLink V3</a>。</p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2022-02-06-21-20-05.png" width="100%"><h2 id="1-8-arm-none-eabi-gcc"><a href="#1-8-arm-none-eabi-gcc" class="headerlink" title="1.8. arm-none-eabi-gcc"></a>1.8. arm-none-eabi-gcc</h2><p><a href="https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads">GNU Arm Embedded Toolchain Downloads</a>,这是ARM提供的交叉编译器。下载<code>.zip</code>解压到合适的位置,把其中的<code>bin</code>文件夹添加到环境变量。在CMD输入如下内容,能正确输出版本号即为正常。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">arm-none-eabi-gcc -v<br></code></pre></td></tr></table></figure><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2022-02-06-21-30-03.png" width="100%"><h2 id="1-9-mingw32-make"><a href="#1-9-mingw32-make" class="headerlink" title="1.9. mingw32-make"></a>1.9. mingw32-make</h2><p>要使用GCC编译工具编译STM32程序,先<a href="https://sourceforge.net/projects/mingw-w64/files/">安装mingw</a>,下载<code>x86_64-posix-seh</code>即可,应该是第二个。然后配置环境变量,在Path环境变量里面添加一条,指向MinGW的bin文件夹。在命令窗口中输入下面的命令验证安装是否成功:<code>gcc -v</code></p><p>在STM32CubeMX生成代码时选择<code>MakeFile类型</code>,然后在程序的根目录打开终端(或打开终端再切换到该目录,或在Code里面打开),输入</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">mingw32-make<br></code></pre></td></tr></table></figure><p>此时就会调用<code>../mingw64/bin/mingw32-make.exe</code>编译STM32程序。也可以把<code>mingw32-make.exe</code>复制一份,重命名为<code>make.exe</code>,以便输入更短的命令。</p><h2 id="1-10-OpenOCD"><a href="#1-10-OpenOCD" class="headerlink" title="1.10. OpenOCD"></a>1.10. OpenOCD</h2><h3 id="1-10-1-OpenOCD的下载安装"><a href="#1-10-1-OpenOCD的下载安装" class="headerlink" title="1.10.1. OpenOCD的下载安装"></a>1.10.1. OpenOCD的下载安装</h3><p><a href="https://openocd.org/">OpenOCD官网</a>,下载要从<a href="https://github.com/openocd-org/openocd/releases">OpenOCD Github的release下载</a>。但是这个下载只能下载到<code>source code</code>,预编译的版本从<a href="https://github.com/xpack-dev-tools/openocd-xpack/releases">openocd-xpack的Github release</a>下载。</p><p>下载完成后,解压到合适的位置,把其中的<code>bin</code>文件夹添加到环境变量。输入如下命令查看是否正常安装。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">openocd -v<br></code></pre></td></tr></table></figure><h3 id="1-10-2-OpenOCD的使用"><a href="#1-10-2-OpenOCD的使用" class="headerlink" title="1.10.2. OpenOCD的使用"></a>1.10.2. OpenOCD的使用</h3><p><a href="https://blog.csdn.net/Mculover666/article/details/117553014">参考CSDN:Windows上使用 OpenOCD 给 STM32 下载程序</a></p><ol><li> 连接到目标芯片</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">openocd -f <接口配置文件> -f <目标芯片配置文件><br><span class="hljs-comment"># 如下</span><br>openocd -f C:\Prog\openocd\scripts\interface\stlink.cfg -f C:\Prog\openocd\scripts\target\stm32f4x.cfg<br></code></pre></td></tr></table></figure><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2022-02-06-22-00-16.png" width="100%"><ol start="2"><li><p>下载程序</p><p> 成功连接到目标芯片后,需要使用<code>telnet</code>协议(这个协议不能使用windows自带的Open SSH)连接到 openOCD 终端,端口4444,这里使用<a href="https://www.52pojie.cn/thread-1121116-1-1.html">mobaxterm</a>。接下来的操作在mobaxterm的终端进行。</p></li><li><p> 常用的命令和添加到makefile中实现一键下载,继续参考原文章。可以优化MakeFile命令。但是还是不太方便调试。</p></li></ol><p>额外的参考:</p><p><a href="https://zhuanlan.zhihu.com/p/436807403">知乎:gdb+openocd+stlink调试MCU</a></p><p><a href="https://www.cnblogs.com/ImagineMiracle-wxn/p/Riscv-OpenOCD_And_JTAG.html">OpenOCD安装与使用(JTAG调试)</a></p><h1 id="2-官方文档下载的网址"><a href="#2-官方文档下载的网址" class="headerlink" title="2. 官方文档下载的网址"></a>2. 官方文档下载的网址</h1><h2 id="2-1-STM32官方文档"><a href="#2-1-STM32官方文档" class="headerlink" title="2.1. STM32官方文档"></a>2.1. STM32官方文档</h2><p>看寄存器的相关说明就看<code>参考手册一栏</code>,产品说明就看<code>数据手册</code>,应用看<code>用户手册</code></p><p><a href="https://www.stmcu.com.cn/">stmcu.com</a>,在<code>设计资源</code>里面,看到<code>译文</code>的是有中文的,文档比较新但是网速稍慢,可以注册一个账号。</p><p><a href="https://www.stmicroelectronics.com.cn/content/st_com/zh.html">stmicroelectronics.com</a>,选择<code>产品</code>-><code>微控制器</code>,然后浏览下载</p><p><a href="https://www.st.com/content/st_com/zh.html">st.com</a>,就是官网,下载和上面一样</p><p><a href="https://www.stmcu.org.cn/">stmcu.org</a>,整体上比较清楚,可以看到是否有中文版本,但是要注册与非网的账号。</p><h2 id="2-2-HAL-API"><a href="#2-2-HAL-API" class="headerlink" title="2.2. HAL_API"></a>2.2. HAL_API</h2><p><a href="https://www.stmicroelectronics.com.cn/content/st_com/zh/search.html#q=HAL%20API-t=resources-page=1">st.com->查找HAL API</a>,看来只有英文的文档。</p><h2 id="2-3-TI-MCU"><a href="#2-3-TI-MCU" class="headerlink" title="2.3. TI MCU"></a>2.3. TI MCU</h2><p><a href="https://www.ti.com.cn/product/cn/TM4C123GH6PM">TM4C123GH6PM</a><br>基于 Arm 的微控制器,ACFly Edu主控</p><p><a href="https://www.ti.com.cn/product/cn/TMS320F28335">TMS320F28335</a></p><p><a href="https://www.ti.com.cn/product/cn/MSP430F5529">MSP430F5529</a></p><h2 id="2-4-TI-MCU-引脚配置"><a href="#2-4-TI-MCU-引脚配置" class="headerlink" title="2.4. TI MCU 引脚配置"></a>2.4. TI MCU 引脚配置</h2><p>就选定一款芯片,翻到下面找它的设计资源,软件相关的即可。</p><p><a href="https://dev.ti.com/pinmux/app.html#/default">PinMux</a>,也可下载对应的软件(和网页版功能相同)。</p><p>也可以在<code>TM4C123GH6PM</code>下面的<code>设计与开发</code>-><code>设计工作和仿真</code>-> <code>Tiva™ C Series PinMux Utility</code>,同样可以图形化观察全部引脚。</p><h1 id="3-ESP32开发相关"><a href="#3-ESP32开发相关" class="headerlink" title="3. ESP32开发相关"></a>3. ESP32开发相关</h1><h2 id="3-1-Guide"><a href="#3-1-Guide" class="headerlink" title="3.1. Guide"></a>3.1. Guide</h2><p><a href="https://www.espressif.com/zh-hans">乐鑫官网</a></p><p><a href="https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/">乐鑫官网 快速入门指南</a></p><p><a href="https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/resources.html">乐鑫官网 PlatformIO的指引</a></p><p><a href="https://docs.platformio.org/en/latest/platforms/espressif32.html">PlatformIO官网里关于ESP32的文档</a></p><p><a href="https://github.com/espressif/vscode-esp-idf-extension"><del>ESP-IDF VS Code Extension</del></a></p><p><a href="https://blog.csdn.net/Mark_md/article/details/113517263"><del>ESP32开发 0.windows Vscode开发环境搭建</del></a></p><h2 id="3-2-环境配置和开发参考:"><a href="#3-2-环境配置和开发参考:" class="headerlink" title="3.2. 环境配置和开发参考:"></a>3.2. 环境配置和开发参考:</h2><a href="/2021/08/22/%E5%B5%8C%E5%85%A5%E5%BC%8F/ESP32%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0/" title="ESP32开发笔记">ESP32开发笔记</a><p>后续在上面的文章更新。</p><h2 id="3-3-3-2-ESP-IDF相关资源下载-参考上述文章的链接"><a href="#3-3-3-2-ESP-IDF相关资源下载-参考上述文章的链接" class="headerlink" title="3.3. 3.2. ESP IDF相关资源下载 参考上述文章的链接"></a>3.3. <del>3.2. ESP IDF相关资源下载</del> 参考上述文章的链接</h2><ol><li><p>先决条件:</p><p> <a href="https://code.visualstudio.com/#alt-downloads">VSCODE</a>,下载<code>System Installer</code>,登录github账号同步。</p><p> <a href="https://git-scm.com/downloads">Git</a></p><p> <a href="https://www.python.org/downloads/">Python</a>,要用<code>esp idf</code>只能使用3.8的版本。3.8.7可正常使用,更高的未验证。</p></li><li><p><a href="https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32/get-started/windows-setup.html#esp-idf">乐鑫官网 快速入门指南 ESP-IDF 工具安装器</a><br>下载离线安装包。</p> <img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-08-17-22-20-03.png" width="100%"> <img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-08-17-22-20-18.png" width="100%"><p> 注意不需要使用更低版本的<code>esp-idf-tools-setup</code>单独处理。<code>esp-idf-tools-setup-2.10</code>安装之后就能直接使用。</p> <img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-08-17-22-27-40.png" width="70%"></li><li><p>完毕之后安装vscode插件</p> <img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-08-17-22-28-35.png" width="70%"> <img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-08-17-22-28-44.png" width="70%"> <img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2021-08-17-22-28-59.png" width="70%"></li></ol><ol start="4"><li> 插件配置的最后是下载python虚拟环境,不需要挂梯子,最好把梯子关掉。</li></ol><h2 id="3-4-ESP32-PlatformIO使用"><a href="#3-4-ESP32-PlatformIO使用" class="headerlink" title="3.4. ESP32 PlatformIO使用"></a>3.4. <strong>ESP32 PlatformIO使用</strong></h2><p>开发ESP32使用PlatformIO最方便,而且编译速度比<code>ESP-IDE</code>快很多。</p><ol><li><p>提前安装:<code>python</code>,并且更新pip和安装<code>platformio</code>,这个package是为了烧录程序。</p> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">python -m pip install --upgrade pip<br>pip install platformio<br></code></pre></td></tr></table></figure></li><li><p> 安装vscode,然后安装<code>platformio</code>插件。创建新工程即可。特别简单。第一次使用时比较慢,因为要下载的东西比较多,大概一个多G左右。</p></li><li><p>工程里面的<code>platformio.ini</code>可以管理调试的配置。普通的esp32选择<code>board = esp32dev</code></p> <figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs ini"><span class="hljs-section">[env:esp32dev]</span><br><span class="hljs-attr">platform</span> = espressif32<br><span class="hljs-attr">framework</span> = espidf<br><span class="hljs-attr">board</span> = esp32dev<br><span class="hljs-attr">monitor_speed</span> = <span class="hljs-number">115200</span><br></code></pre></td></tr></table></figure></li><li><p>一些例子一方面可以看</p><p> <a href="https://github.com/espressif/esp-idf">github:espressif/esp-idf</a>,下载里面的examples,或者<br> <a href="https://www.espressif.com/zh-hans/support/download/sdks-demos">ESP-IDF官网,下载压缩包,解压得到examples</a></p></li><li><p>工程移植和学习的方式:</p><p> 创建一个模板工程,要多线程就用<code>Espressif IOT Development Framework</code>,如果有依赖<code>arduino</code>的库就用<code>arduino</code>的模板。</p><p> 然后把<code>example</code>里面的需要参考的工程的主函数复制或者移植部分过去。platformIO创建的工程没有路径问题。工程内需要的其他文件也可以按需要复制过去。有文件夹的则整个复制过去,并且查看<code>CMakeLists.txt</code>添加需要的文件名。</p></li></ol><h1 id="4-软件的正确配置"><a href="#4-软件的正确配置" class="headerlink" title="4. 软件的正确配置"></a>4. 软件的正确配置</h1><h2 id="4-1-VsCode正确-include-path"><a href="#4-1-VsCode正确-include-path" class="headerlink" title="4.1. VsCode正确#include path"></a>4.1. VsCode正确#include path</h2><p>一些Cube生成的头文件,函数,变量等会爆红,这是包含路径不正确的原因。在设置中搜索<code>include path</code>,找到<code>C/C++</code>的<code>System include path</code>,这是全局的(上面那个<code>Default: include path</code>是仅当没有本地的<code>.vscode</code>文件夹才生效的)。添加如下内容。之后嵌入式相关的函数就能正常跳转了。</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs awk"><span class="hljs-variable">${workspaceFolder}</span>/**<br><span class="hljs-variable">${workspaceFolder}</span><span class="hljs-regexp">/Drivers/</span>**<br></code></pre></td></tr></table></figure><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/%E5%B5%8C%E5%85%A5%E5%BC%8F%E6%8E%A7%E5%88%B6%E7%BD%91%E7%AB%99%E6%95%B4%E7%90%86/嵌入式控制网站整理_2022-02-07-14-59-55.png" width="100%"><p><strong>注:目前还会出现<code>stddef.h</code>找不到的情况,但是不影响使用。</strong></p>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>EDA软件资源整理</title>
<link href="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/EDA%E8%BD%AF%E4%BB%B6%E8%B5%84%E6%BA%90%E6%95%B4%E7%90%86/"/>
<url>/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/EDA%E8%BD%AF%E4%BB%B6%E8%B5%84%E6%BA%90%E6%95%B4%E7%90%86/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-ad%E5%AD%A6%E4%B9%A0%E6%95%99%E7%A8%8B">1. AD学习教程</a></li><li><a href="#2-adlib%E8%B5%84%E6%BA%90%E6%95%B4%E7%90%86">2. ADlib资源整理</a><ul><li><a href="#21-%E8%B5%84%E6%BA%90">2.1. 资源</a></li><li><a href="#22-github%E8%B5%84%E6%BA%90">2.2. Github资源</a></li><li><a href="#23-%E6%9B%B4%E6%96%B0%E6%88%91%E7%8E%B0%E5%9C%A8%E4%BD%BF%E7%94%A8%E7%9A%84">2.3. 更新,我现在使用的</a></li></ul></li></ul><!-- /TOC --><h1 id="1-AD学习教程"><a href="#1-AD学习教程" class="headerlink" title="1. AD学习教程"></a>1. AD学习教程</h1><p><a href="https://www.bilibili.com/video/BV1R4411a7xg">Altium Designer 20 AD19 AD18 全套零基础入门PCB Layout设计实战视频教程【志博教育】</a></p><p><a href="https://www.altium.com/cn/documentation/altium-designer/pcb-obj-roomroom-ad">Altium Designer Room</a></p><p><a href="https://www.google.com/search?q=altium20%20room%20%E7%A7%BB%E6%A4%8D%E5%88%B0%E6%96%B0%E7%94%B5%E8%B7%AF%E6%9D%BF">Google Altium20 room 移植到新电路板</a></p><h1 id="2-ADlib资源整理"><a href="#2-ADlib资源整理" class="headerlink" title="2. ADlib资源整理"></a>2. ADlib资源整理</h1><h2 id="2-1-资源"><a href="#2-1-资源" class="headerlink" title="2.1. 资源"></a>2.1. 资源</h2><p><a href="https://gitee.com/JLC_SMT/JLCSMT_LIB">嘉立创集成库</a></p><p><a href="https://www.3dcontentcentral.cn/">3D Content Central</a>,可以下载各种3D模型</p><p><a href="https://app.ultralibrarian.com/content/help/?altium_designer.htm">从TI官网下载封装库导入AD的方法</a></p><h2 id="2-2-Github资源"><a href="#2-2-Github资源" class="headerlink" title="2.2. Github资源"></a>2.2. Github资源</h2><p><a href="https://github.com/search?q=Altium+Designer+Library">search</a></p><p><a href="https://github.com/issus/altium-library">altium-library</a>这个很不错,连接开源服务器使用,库很多,但也不是都有。但是对电脑要求较高,会很卡。</p><p><a href="https://github.com/KitSprout/AltiumDesigner_PcbLibrary">AltiumDesigner_PcbLibrary</a></p><p><a href="https://github.com/Kevincoooool/AltiumDesigner_PcbLibrary_3D">AltiumDesigner_PcbLibrary_3D</a></p><h2 id="2-3-更新,我现在使用的"><a href="#2-3-更新,我现在使用的" class="headerlink" title="2.3. 更新,我现在使用的"></a>2.3. 更新,我现在使用的</h2><p>统一安装目录:<code>C:\Files\Software\ADlib</code>里面</p><p><a href="https://gitee.com/JLC_SMT/JLCSMT_LIB">嘉立创集成库</a></p><p><a href="https://github.com/KitSprout/AltiumDesigner_PcbLibrary">AltiumDesigner_PcbLibrary</a></p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/EDA%E8%BD%AF%E4%BB%B6%E8%B5%84%E6%BA%90%E6%95%B4%E7%90%86/EDA软件资源整理_2022-02-07-21-22-03.png" width="100%"><p><a href="https://componentsearchengine.com/library/altium">Component Search Engine</a>,<del>创建一个<code>AltiumLL</code>文件夹。</del> 只能存在用户的文档里面(默认),更改路径之后不知道它什么时候又会变回去了。出了问题参考下面:</p><p><a href="https://www.samacsys.com/altiumll-faq/">傻逼软件,文件目录一定要我安装在文档,更改一下都不行,现在只能通过脚本启动软件</a></p><p>AltiumLL的下载目录和上面的ADlib放在一起。AltiumLL自己的目录就还是在我的文档。之后在软件里面登录<code>DigiPCBA</code>,点开设置的<code>Account Management</code>,切换到中国服务器,登录自己的<code>DigiPCBA</code>账号就行。</p><img src="/2021/07/08/%E5%B5%8C%E5%85%A5%E5%BC%8F/EDA%E8%BD%AF%E4%BB%B6%E8%B5%84%E6%BA%90%E6%95%B4%E7%90%86/EDA软件资源整理_2022-02-07-21-24-30.png" width="100%">]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>git基本使用和代码规范</title>
<link href="/2021/07/06/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/git%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E5%92%8C%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83/"/>
<url>/2021/07/06/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/git%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E5%92%8C%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-git%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E">1. git使用说明</a><ul><li><a href="#11-%E4%B8%8B%E8%BD%BDgit%E5%9C%A8%E7%BB%88%E7%AB%AF%E9%85%8D%E7%BD%AEgit%E7%9A%84%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF">1.1. 下载git,在终端配置git的基本信息</a></li><li><a href="#12-%E7%94%9F%E6%88%90ssh%E5%85%AC%E9%92%A5%E8%BE%93%E5%85%A5%E5%91%BD%E4%BB%A4%E4%B8%80%E7%9B%B4%E5%9B%9E%E8%BD%A6%E5%8D%B3%E5%8F%AF">1.2. 生成ssh公钥,输入命令一直回车即可</a></li><li><a href="#13-%E6%9C%AC%E5%9C%B0%E6%96%B0%E5%BB%BA%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%E5%A4%B9%E5%9C%A8vscode%E5%88%9D%E5%A7%8B%E5%8C%96%E4%B8%80%E4%B8%8B%E6%96%87%E4%BB%B6%E5%A4%B9%E8%BF%9B%E8%A1%8Cgit-init%E7%9A%84%E6%93%8D%E4%BD%9C">1.3. 本地新建一个文件夹,在vscode初始化一下文件夹(进行<code>git init</code>的操作)</a><ul><li><a href="#131-pull">1.3.1. pull</a></li><li><a href="#132-%E6%B7%BB%E5%8A%A0%E8%BF%9C%E7%A8%8B%E4%BB%93%E5%BA%93">1.3.2. 添加远程仓库</a></li><li><a href="#133-%E6%8F%90%E4%BA%A4%E4%BB%A3%E7%A0%81">1.3.3. 提交代码</a></li><li><a href="#134-%E6%89%93tag">1.3.4. 打tag</a></li></ul></li><li><a href="#14-%E5%88%86%E6%94%AF%E7%9A%84%E4%BD%BF%E7%94%A8">1.4. 分支的使用</a><ul><li><a href="#141-%E5%88%9B%E5%BB%BA%E5%88%86%E6%94%AF">1.4.1. 创建分支</a></li><li><a href="#142-push%E6%93%8D%E4%BD%9C">1.4.2. push操作</a></li><li><a href="#143-pull%E6%93%8D%E4%BD%9C">1.4.3. pull操作</a></li></ul></li><li><a href="#15-%E5%8F%82%E8%80%83%E8%AF%B4%E6%98%8E">1.5. 参考说明</a></li></ul></li><li><a href="#2-%E5%8D%97%E5%B7%A5%E9%AA%81%E9%B9%B0%E7%94%B5%E6%8E%A7%E7%BB%84%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83%E8%AF%B4%E6%98%8E">2. 南工骁鹰电控组代码规范说明</a><ul><li><a href="#21-%E8%BD%AF%E4%BB%B6%E4%BD%BF%E7%94%A8%E8%A7%84%E8%8C%83">2.1. 软件使用规范</a></li><li><a href="#22-cube%E9%85%8D%E7%BD%AE">2.2. CUBE配置</a></li><li><a href="#23-%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83">2.3. 代码规范</a></li><li><a href="#24-git%E4%BD%BF%E7%94%A8%E8%A7%84%E8%8C%83">2.4. git使用规范</a><ul><li><a href="#241-%E6%9C%AC%E5%9C%B0%E6%96%87%E4%BB%B6%E9%83%A8%E5%88%86">2.4.1. 本地文件部分</a></li><li><a href="#242-git%E4%BB%93%E5%BA%93%E9%83%A8%E5%88%86">2.4.2. git仓库部分</a></li></ul></li><li><a href="#25-%E7%89%88%E6%9D%83%E5%A3%B0%E6%98%8E">2.5. 版权声明</a></li><li><a href="#26-%E6%9B%B4%E6%96%B0">2.6. 更新</a><ul><li><a href="#261-git%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%9A%84%E5%9C%B0%E5%9D%80">2.6.1. git服务器的地址:</a></li><li><a href="#262-%E9%81%87%E5%88%B0%E9%97%AE%E9%A2%98">2.6.2. 遇到问题:</a></li></ul></li></ul></li></ul><!-- /TOC --><h1 id="1-git使用说明"><a href="#1-git使用说明" class="headerlink" title="1. git使用说明"></a>1. git使用说明</h1><h2 id="1-1-下载git,在终端配置git的基本信息"><a href="#1-1-下载git,在终端配置git的基本信息" class="headerlink" title="1.1. 下载git,在终端配置git的基本信息"></a>1.1. 下载git,在终端配置git的基本信息</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">git config --global user.name <span class="hljs-string">"YOURNAME"</span><br>git config --global user.email <span class="hljs-string">"YOUR EMAIL"</span><br></code></pre></td></tr></table></figure><h2 id="1-2-生成ssh公钥,输入命令一直回车即可"><a href="#1-2-生成ssh公钥,输入命令一直回车即可" class="headerlink" title="1.2. 生成ssh公钥,输入命令一直回车即可"></a>1.2. 生成ssh公钥,输入命令一直回车即可</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ssh-keygen -o<br></code></pre></td></tr></table></figure><p>你的ssh公钥在<code>~/.ssh/id_rsa</code>,windows的注意看终端给的说明。<br>ssh公钥就可以添加到你的账户。</p><h2 id="1-3-本地新建一个文件夹,在vscode初始化一下文件夹(进行git-init的操作)"><a href="#1-3-本地新建一个文件夹,在vscode初始化一下文件夹(进行git-init的操作)" class="headerlink" title="1.3. 本地新建一个文件夹,在vscode初始化一下文件夹(进行git init的操作)"></a>1.3. 本地新建一个文件夹,在vscode初始化一下文件夹(进行<code>git init</code>的操作)</h2><h3 id="1-3-1-pull"><a href="#1-3-1-pull" class="headerlink" title="1.3.1. pull"></a>1.3.1. pull</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">git pull <远程主机名> <远程分支名>:<本地分支名><br>git pull <span class="hljs-string">"远程仓库的ssh地址"</span><br>git pull git@gitee.com:luckandii/deliver-y.git<br></code></pre></td></tr></table></figure><h3 id="1-3-2-添加远程仓库"><a href="#1-3-2-添加远程仓库" class="headerlink" title="1.3.2. 添加远程仓库"></a>1.3.2. 添加远程仓库</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">git remote add 远程仓库在本地的别名 远程仓库的ssh地址<br>git remote add origin git@gitee.com:luckandii/deliver-y.git<br></code></pre></td></tr></table></figure><h3 id="1-3-3-提交代码"><a href="#1-3-3-提交代码" class="headerlink" title="1.3.3. 提交代码"></a>1.3.3. 提交代码</h3><p>先commit,然后在vscode里面推送到指定的远程仓库即可。如果本地分支名与远程分支名相同,则可以省略冒号:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">git push <远程主机名> <本地分支名>:<远程分支名><br>git push <远程主机名> <本地分支名><br>git push -u origin master<br></code></pre></td></tr></table></figure><h3 id="1-3-4-打tag"><a href="#1-3-4-打tag" class="headerlink" title="1.3.4. 打tag"></a>1.3.4. 打tag</h3><p>先把所有代码提交更改,然后打tag</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git tag -a v1.0 <br></code></pre></td></tr></table></figure><p>添加代码描述,然后把编辑窗口关掉<br>以前是直接push master,现在push参数为tag的名称</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git push origin v1.0<br></code></pre></td></tr></table></figure><h2 id="1-4-分支的使用"><a href="#1-4-分支的使用" class="headerlink" title="1.4. 分支的使用"></a>1.4. 分支的使用</h2><h3 id="1-4-1-创建分支"><a href="#1-4-1-创建分支" class="headerlink" title="1.4.1. 创建分支"></a>1.4.1. 创建分支</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git checkout -b branchname<br></code></pre></td></tr></table></figure><p>相当于创建新分支并切换到新分支下</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">git branch branchname<br>git checkout branchname<br></code></pre></td></tr></table></figure><h3 id="1-4-2-push操作"><a href="#1-4-2-push操作" class="headerlink" title="1.4.2. push操作"></a>1.4.2. push操作</h3><p>与之前的提交代码完全一样,先commit,然后在vscode里面推送到指定的远程仓库即可。如果本地分支名与远程分支名相同,则可以省略冒号:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">git push <远程主机名> <本地分支名>:<远程分支名><span class="hljs-comment"># 建议</span><br>git push <远程主机名> <本地分支名><br>git push -u origin master<br></code></pre></td></tr></table></figure><p>提交好了之后远程主机就有了新的分支的代码和文件了。</p><h3 id="1-4-3-pull操作"><a href="#1-4-3-pull操作" class="headerlink" title="1.4.3. pull操作"></a>1.4.3. pull操作</h3><p>将远程指定分支 拉取到 本地指定分支上,如果当前没有对应的本地分支则回自动创建:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git pull origin <远程分支名>:<本地分支名><br></code></pre></td></tr></table></figure><p>将远程指定分支 拉取到 本地当前分支上:</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git pull origin <远程分支名><br></code></pre></td></tr></table></figure><p>将与本地当前分支同名的远程分支 拉取到 本地当前分支上(需先关联远程分支)</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">git pull<br></code></pre></td></tr></table></figure><p>将本地分支与远程同名分支相关联</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">git push --set-upstream origin <本地分支名><br>// 简写方式:<br>git push -u origin <本地分支名><br></code></pre></td></tr></table></figure><h2 id="1-5-参考说明"><a href="#1-5-参考说明" class="headerlink" title="1.5. 参考说明"></a>1.5. 参考说明</h2><p><a href="https://gitee.com/help/articles/4107">gitee给的关于git使用指导</a></p><p><a href="https://www.jianshu.com/p/e57a4a2cf077">简书的一篇教程</a></p><p><a href="https://www.runoob.com/git/git-tutorial.html">菜鸟网站上面的教程</a></p><p><a href="https://www.atlassian.com/git/tutorials/saving-changes/gitignore">gitignore tutorials and example</a> </p><p><a href="https://git-scm.com/docs/gitignore">gitignore official document</a> </p><h1 id="2-南工骁鹰电控组代码规范说明"><a href="#2-南工骁鹰电控组代码规范说明" class="headerlink" title="2. 南工骁鹰电控组代码规范说明"></a>2. 南工骁鹰电控组代码规范说明</h1><h2 id="2-1-软件使用规范"><a href="#2-1-软件使用规范" class="headerlink" title="2.1. 软件使用规范"></a>2.1. 软件使用规范</h2><ul><li><p> 本年度统一使用STM32CUBE版本为6.1.1,固件库版本为F4 V1.25.2,keil版本为MDK-ARM5.31,Jlink驱动版本为V654,请勿自行升级。</p></li><li><p> 请使用UTF-8编码打开和编辑代码,如果发现在keil中打开乱码请勿保存。</p></li></ul><h2 id="2-2-CUBE配置"><a href="#2-2-CUBE配置" class="headerlink" title="2.2. CUBE配置"></a>2.2. CUBE配置</h2><ul><li><p> 时钟树统一配置为(160MHZ:C板,168HZ:A板)(主要是关于CAN的配置)</p></li><li><p> 定时器分频后得到1Mhz</p></li><li><p> RCC,SYS相关</p></li></ul><h2 id="2-3-代码规范"><a href="#2-3-代码规范" class="headerlink" title="2.3. 代码规范"></a>2.3. 代码规范</h2><ul><li><p> 文件夹命名:<strong>大驼峰式命名法</strong>,英文单词首字母大写,单词间不加连接,如<code>Modules</code>,<code>Bsp</code>,<code>FirstName</code></p></li><li><p>文件命名:</p><ul><li><p> 文件名包含前缀</p></li><li><p> 全部小写,使用下划线连接</p></li><li><p> 示例:在<code>Bsp</code>文件夹下的<code>bsp_motor.c</code>,在<code>Gimbal</code>文件夹下的<code>gimbal_control.c</code></p></li></ul></li><li><p> 函数名:全部小写,下划线连接单词,函数名之前加上所属模块的前缀,如<code>chassis_param_init</code></p></li><li><p> 宏:全部大写,下划线连接单词,如<code>#define ROTATE_X_OFFSET 7</code></p></li><li><p> 变量:全部小写,下划线连接单词,局部变量加上下划线后缀<code>_</code></p></li><li><p>结构体:</p><ul><li><p> 定义类型时首字母大写,下划线连接,加上<code>_t</code>表示结构体,如<code>struct Chassis_t {XXX...};</code></p></li><li><p> 示例化时全部小写,与变量相同<code>struct Chassis_t chassis;</code></p></li></ul></li><li><p> 枚举类型:首字母大写,下划线连接,加上<code>_e</code>后缀,如<code>enum Work_state_e</code></p></li></ul><ul><li><p>注释:写在被解释的代码的上方,如:</p><pre><code> /* the radius of wheel(mm) */ #define RADIUS 76 // 麦克纳姆轮全向底盘初始化 mecanum_init();</code></pre></li><li><p> 缩进:除了CUBE生成的文件,在自己写代码的地方都使用<u>四个空格</u>的<code>Tab</code></p></li></ul><h2 id="2-4-git使用规范"><a href="#2-4-git使用规范" class="headerlink" title="2.4. git使用规范"></a>2.4. git使用规范</h2><h3 id="2-4-1-本地文件部分"><a href="#2-4-1-本地文件部分" class="headerlink" title="2.4.1. 本地文件部分"></a>2.4.1. 本地文件部分</h3><ul><li><p>在工程的根目录添加一个<code>.gitignore</code>文件(放在与<code>.ioc</code>文件同级),以忽略工程编译产生的大量与核心代码无关的文件,<code>.gitignore</code>文件的内容:</p><pre><code> /MDK-ARM/* !/**.uvprojx !/**.s /.vscode/</code></pre></li><li><p> 在工程的根目录添加一个<code>readme.md</code>或者<code>readme.txt</code>的文件,以日志的形式记录项目的开发进度,尚存的bug,待办等。</p></li><li><p> 取得阶段性进展的时候项目打包,打包之后的压缩文件加上版本号<code>VX.X</code>。</p></li></ul><h3 id="2-4-2-git仓库部分"><a href="#2-4-2-git仓库部分" class="headerlink" title="2.4.2. git仓库部分"></a>2.4.2. git仓库部分</h3><ul><li><p> 每一辆车的代码存在一个仓库,<code>master</code>分支是稳定分支,开发或者添加新功能请切换到另外的分支,比如<code>your_name_dev</code>的分支。</p></li><li><p> 一个新功能实现之后,合并到主分支;取得阶段性成果之后,给项目打<code>tag</code></p></li><li><p> 每个人创建一个仓库,用以添加其他的代码,探究性的开发新功能,开发过程的记录等等。</p></li></ul><h2 id="2-5-版权声明"><a href="#2-5-版权声明" class="headerlink" title="2.5. 版权声明"></a>2.5. 版权声明</h2><ul><li> 仓库所有代码只适用于Robomaster机器人</li><li> 仓库所有代码未经允许禁止私自转发、禁止私自使用</li><li> 仓库所有代码最终解释权归哈尔滨工业大学(深圳)南工骁鹰战队Critical HIT所有</li></ul><h2 id="2-6-更新"><a href="#2-6-更新" class="headerlink" title="2.6. 更新"></a>2.6. 更新</h2><h3 id="2-6-1-git服务器的地址:"><a href="#2-6-1-git服务器的地址:" class="headerlink" title="2.6.1. git服务器的地址:"></a>2.6.1. git服务器的地址:</h3><p>连接到RM701_LAN的wifi之后访问(与原来相同):<a href="http://192.168.2.177:3000/">http://192.168.2.177:3000/</a></p><p>连接到HITSZ或者704、宿舍的网络之后访问:<a href="http://10.249.16.68:3000/">http://10.249.16.68:3000/</a></p><p>只要连到校园网(除了UTSZ),都可以访问了。</p><h3 id="2-6-2-遇到问题:"><a href="#2-6-2-遇到问题:" class="headerlink" title="2.6.2. 遇到问题:"></a>2.6.2. 遇到问题:</h3><p>使用命令行方式进行pull和push,先pull再push,还有错误则考虑更新ssh公钥。</p><p>在701网络内进行推送:添加与要推送到的远程仓库为<code>git@192.168.2.177:XXX/XXX.git</code>,可以直接从网页复制</p><p>在701以外的校园网进行推送:添加与要推送到的远程仓库为<code>http://10.249.16.68:3000/XXX/XXXX.git</code>,即使用http方式而不是ssh方式</p><p>推送的时候会提示输入用户名和账户,用户名和密码是登陆git网站的用户名和密码,与下同:</p><img src="/2021/07/06/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/git%E5%9F%BA%E6%9C%AC%E4%BD%BF%E7%94%A8%E5%92%8C%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83/git基本使用和代码规范_2021-07-06-12-25-19.png" width="50%"><p>如果输错了,可以使用<code>git credential-manager uninstall</code>删除缓存的用户名和密码。</p>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>树莓派git服务器</title>
<link href="/2021/07/05/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BEgit%E6%9C%8D%E5%8A%A1%E5%99%A8/"/>
<url>/2021/07/05/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BEgit%E6%9C%8D%E5%8A%A1%E5%99%A8/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E5%B8%B8%E8%A7%84%E6%96%B9%E6%B3%95">1. 常规方法</a><ul><li><a href="#11-%E6%8D%A2%E9%98%BF%E9%87%8C%E6%BA%90">1.1. 换阿里源</a></li><li><a href="#12-%E6%A0%91%E8%8E%93%E6%B4%BE%E7%AB%AF%E9%85%8D%E7%BD%AEgit">1.2. 树莓派端配置git</a><ul><li><a href="#121-%E5%AE%8C%E6%95%B4%E6%93%8D%E4%BD%9C">1.2.1. 完整操作</a></li></ul></li><li><a href="#13-pc%E7%AB%AF%E7%9A%84%E9%85%8D%E7%BD%AE">1.3. PC端的配置</a><ul><li><a href="#131-%E5%AE%8C%E5%85%A8%E4%BD%BF%E7%94%A8git%E5%91%BD%E4%BB%A4%E7%9A%84%E6%96%B9%E5%BC%8F">1.3.1. 完全使用git命令的方式</a></li><li><a href="#132-%E4%BD%BF%E7%94%A8vscode%E7%9A%84%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2">1.3.2. 使用vscode的图形界面</a></li></ul></li><li><a href="#14-%E5%85%B6%E4%BB%96">1.4. 其他</a><ul><li><a href="#141-%E7%A6%81%E7%94%A8%E4%BC%91%E7%9C%A0">1.4.1. 禁用休眠</a></li></ul></li></ul></li><li><a href="#2-%E6%A0%91%E8%8E%93%E6%B4%BEgogs%E6%9C%8D%E5%8A%A1%E5%99%A8">2. 树莓派gogs服务器</a><ul><li><a href="#21-%E5%8F%82%E8%80%83%E7%BD%91%E5%9D%80">2.1. 参考网址</a></li><li><a href="#22-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B">2.2. 安装过程</a></li><li><a href="#23-%E7%94%A8%E6%88%B7%E7%AE%A1%E7%90%86">2.3. 用户管理</a></li><li><a href="#24-%E6%9C%AC%E5%9C%B0%E7%9A%84%E4%BD%BF%E7%94%A8">2.4. 本地的使用</a></li><li><a href="#25-ngnix%E4%BB%A3%E7%90%86">2.5. Ngnix代理</a><ul><li><a href="#251-%E5%AE%98%E6%96%B9%E6%8C%87%E5%AF%BC">2.5.1. 官方指导</a></li><li><a href="#252-%E4%B8%80%E4%BA%9B%E5%8F%82%E8%80%83">2.5.2. 一些参考</a></li></ul></li><li><a href="#26-%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F">2.6. 内网穿透</a></li><li><a href="#27-bugs">2.7. BUGS</a></li></ul></li></ul><!-- /TOC --><h1 id="1-常规方法"><a href="#1-常规方法" class="headerlink" title="1. 常规方法"></a>1. 常规方法</h1><h2 id="1-1-换阿里源"><a href="#1-1-换阿里源" class="headerlink" title="1.1. 换阿里源"></a>1.1. 换阿里源</h2><pre><code>sudo nano /etc/apt/sources.list#将原有内容用#注释掉deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpideb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi</code></pre><hr><pre><code>sudo nano /etc/apt/sources.list.d/raspi.list#将原有内容用#注释掉deb http://mirrors.aliyun.com/raspbian/raspbian/ buster maindeb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main</code></pre><hr><pre><code>sudo apt-get updatesudo apt-get upgrade</code></pre><hr><p>提示重复配置可以把 <code>/etc/apt/sources.list.d/raspi.list</code> 里面的源删掉,只留一个文件有源就可以,目前还没遇到什么问题。</p><hr><hr><h2 id="1-2-树莓派端配置git"><a href="#1-2-树莓派端配置git" class="headerlink" title="1.2. 树莓派端配置git"></a>1.2. 树莓派端配置git</h2><pre><code>sudo apt-get install git-core</code></pre><p>树莓派本身的系统应该是有git的,接下来添加git用户,需要sudo命令</p><p>添加用户:git,其中最后的 <code>/home/git</code> 指的是这个git用户组在文件目录的位置,最后的 <code>git</code> 是创建的用户的名字</p><pre><code>sudo adduser --system --shell /bin/bash --gecos 'git version control by pi' --group --home /home/git git</code></pre><p>设置密码</p><pre><code>sudo passwd git</code></pre><p>切换用户,注意接下来的操作都是“git”用户的操作,“git”用户对这些文件有控制权</p><pre><code>su git</code></pre><p>首先更改目录到要存储git的路径下</p><pre><code>cd /home/git</code></pre><p>为仓库创建一个文件夹,并移动进去,然后初始化并清空仓库</p><pre><code>mkdir test.gitcd test.gitgit --bare init</code></pre><hr><h3 id="1-2-1-完整操作"><a href="#1-2-1-完整操作" class="headerlink" title="1.2.1. 完整操作"></a>1.2.1. 完整操作</h3><pre><code>sudo adduser --system --shell /bin/bash --gecos 'git version control by pi' --group --home /home/git luckgitsudo passwd luckgitsu luckgitcd /home/gitmkdir git_learning.gitcd git_learning.gitgit --bare init</code></pre><hr><h2 id="1-3-PC端的配置"><a href="#1-3-PC端的配置" class="headerlink" title="1.3. PC端的配置"></a>1.3. PC端的配置</h2><h3 id="1-3-1-完全使用git命令的方式"><a href="#1-3-1-完全使用git命令的方式" class="headerlink" title="1.3.1. 完全使用git命令的方式"></a>1.3.1. 完全使用git命令的方式</h3><ul><li><p>添加新的远程主机</p><pre><code> # 示例:git remote add pi git@[your IP]:/home/git/test.git git remote add pi_git_learning luckgit@192.168.1.123:/home/git/git_learning.git</code></pre><p> <code>pi_git_learning</code> 是这个远程存储器显示在本PC的名字,只是方便区分我添加的不同的一些远程git存储,<code>@</code>之前的是我在树莓派上创建的用户的名称,<code>@</code>之后是树莓派的IP,即相当于以<code>luckgit</code>的用户名访问<code>192.168.1.123</code>的IP,<code>:</code>之后的是树莓派上为这个仓库创建的git文件夹</p></li><li><p>push代码</p><pre><code> git add . git commit -am "Initial" # 本次提交代码的说明 # 示例:git push pi master git push pi_git_learning master</code></pre><p> push之后的第一个参数是远程存储器在本地的名字,第二个参数是分支名称,push是要输入对应用户的密码的。</p><p> 因为没有配置ssh,所以只能通过命令行提交(而且每次都要输入密码,如果直接用vscode的“推送到”会报错“no permission”)</p></li><li><p>clone代码</p><pre><code> git clone luckgit@192.168.1.123:/home/git/git_learning.git</code></pre><p> 以<code>luckgit</code>访问<code>192.168.1.123</code>服务器下的<code>/home/git/git_learning.git</code>并clone,但是这样子存到本地,这个远程仓库的名称是默认的<code>origin</code></p></li><li><p>pull代码</p><p> <strong>先切换到对应仓库的目录下</strong>,然后</p><pre><code> git pull origin master</code></pre><p> 从远程仓库<code>origin</code>的<code>master</code>分支拉取,因为从网站上clone下的项目也默认为<code>origin</code>的名字,所以pull其他项目也是这条命令</p></li></ul><hr><h3 id="1-3-2-使用vscode的图形界面"><a href="#1-3-2-使用vscode的图形界面" class="headerlink" title="1.3.2. 使用vscode的图形界面"></a>1.3.2. 使用vscode的图形界面</h3><p>首先要配置树莓派上git服务的ssh</p><hr><hr><h2 id="1-4-其他"><a href="#1-4-其他" class="headerlink" title="1.4. 其他"></a>1.4. 其他</h2><h3 id="1-4-1-禁用休眠"><a href="#1-4-1-禁用休眠" class="headerlink" title="1.4.1. 禁用休眠"></a>1.4.1. 禁用休眠</h3><p><a href="https://www.cnblogs.com/xiaoqianbook/p/11945271.html">一个很好的博客</a></p><pre><code>sudo nano /etc/lightdm/lightdm.conf</code></pre><p>找到[Seat:*]这一项,在下面的‘#xserver-command=X’删除前面的注释符#,修改为以下</p><pre><code>xserver-command=X -s 0-dpms</code></pre><p>其中,-s 参数:设置屏幕保护不启动,0 数字零,-dpms 参数:关闭电源节能管理。</p><h1 id="2-树莓派gogs服务器"><a href="#2-树莓派gogs服务器" class="headerlink" title="2. 树莓派gogs服务器"></a>2. 树莓派gogs服务器</h1><h2 id="2-1-参考网址"><a href="#2-1-参考网址" class="headerlink" title="2.1. 参考网址"></a>2.1. 参考网址</h2><ul><li><p>官网参考</p><p> <a href="https://gogs.io/">官网</a><br> <a href="https://github.com/gogs/gogs">gogs github</a><br> <a href="https://github.com/gogs/gogs/blob/main/README_ZH.md">gogs github readme</a> </p></li><li><p>安装参考</p><p> <a href="https://gogs.io/docs/installation/install_from_binary">二进制安装</a><br> 官网的参考,言简意赅,树莓派就是使用二进制的安装方式<br> <a href="https://gogs.io/docs/installation/configuration_and_run">安装完成之后配置运行</a></p></li></ul><ul><li><p>其他教程</p><p> <a href="http://bbs.eeworld.com.cn/thread-504985-1-1.html">亲测可用</a><br> <a href="https://my.oschina.net/520wsl/blog/3155444">和上面内容相同</a><br> <a href="https://www.lxx1.com/4779">写得很丰富,但是实测总有问题</a></p></li></ul><h2 id="2-2-安装过程"><a href="#2-2-安装过程" class="headerlink" title="2.2. 安装过程"></a>2.2. 安装过程</h2><ul><li><p>准备工作</p><ol><li><p>树莓派新建一个用户,注意名字一定是git,不需要禁止用户登录</p> <figure class="highlight mipsasm"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs mipsasm">sudo <span class="hljs-keyword">adduser </span>git<br><span class="hljs-comment"># 有需要的话用下面的命令删除原有的用户</span><br>sudo userdel -r username<br></code></pre></td></tr></table></figure></li><li><p>下载gogs的安装包</p><p> <a href="https://gogs.io/docs/installation/install_from_binary">下载页</a>,翻到下面选择树莓派的版本<br> <a href="https://dl.gogs.io/0.11.91/gogs_0.11.91_raspi_armv7.zip">下载链接</a>,链接带版本号,应该是会更新的<br> 下载到电脑上,把文件名和路径改的简单一点<code>c:\gogs.zip</code>,然后通过pscp发到树莓派git用户的home上</p><pre><code> pscp -P 22 c:\文件完整路径 pi@IP地址:/home/git/</code></pre><p> 上面的操作只是下载比较快,不然也可以在树莓派上切换到<code>/home/git/</code>,注意下载链接自己在网址上找新的</p><pre><code> sudo wget https://dl.gogs.io/0.11.91/gogs_0.11.91_raspi_armv7.zip -O gogs.zip</code></pre><p> 如果文件保存的路径不是<code>/home/git/</code>,把它复制到目标路径</p><pre><code> sudo cp gogs.zip /home/git/</code></pre></li></ol></li><li><p>安装</p><ol><li><p>切换到<code>/home/git/</code>,解压gogs.zip</p><pre><code> cd /home/git sudo unzip gogs.zip # 还可以顺便删掉原压缩包 sudo rm gogs.zip</code></pre></li><li><p>使用命令 <code>cd</code> 进入到刚刚创建的目录</p><pre><code> cd gogs</code></pre></li><li><p>执行命令 <code>./gogs web</code></p></li><li><p>Gogs 默认会在端口 3000 启动 HTTP 服务,访问 /install 以进行初始配置(例如 <code>http://树莓派的IP地址:3000/install</code> )</p></li><li><p>安装的网页界面</p><ul><li><p> 数据库类型选SQLite3,可以免去复杂的配置</p></li><li><p> 应用名称,就是之后网页的名称</p></li><li><p> 仓库根目录,系统用户默认为git就没有问题,否则之后需要更改配置文件</p></li><li><p> 域名,URL输入树莓派确定的IP地址,不要选择localhost,否则之后通过ssh添加远程储存库的时候也显示为localhost,就添加不上</p></li><li><p> 一定要添加一个管理员</p></li><li><p> 立即安装,很快就完成</p></li></ul></li></ol></li><li><p>设置自启动</p><ol><li><p>把服务脚本复制到系统目录</p><pre><code> sudo cp /home/git/gogs/scripts/systemd/gogs.service /etc/systemd/system</code></pre><p> 如果复制失败的话,可以尝试把<code>/etc/systemd/system</code>下已有的<code>gogs.service</code>删除然后再操作</p></li><li><p>设置开机自启动gogs</p><pre><code> sudo systemctl enable gogs</code></pre></li><li><p>立即启动gogs</p><pre><code> sudo systemctl start gogs</code></pre></li><li><p>查看实时日志输出</p><pre><code> sudo systemctl status gogs</code></pre><p> 如果状态命令显示<code>Active:活动(运行中)</code>,则说明一切正常</p></li></ol></li><li><p>更改系统设置和配置</p><pre><code> sudo nano /home/git/gogs/custom/conf/app.ini</code></pre><p> 可以更改用,IP,域名,数据库类型,等等很多设置,改完之后再完整执行一次上面自启动的5点。</p></li></ul><h2 id="2-3-用户管理"><a href="#2-3-用户管理" class="headerlink" title="2.3. 用户管理"></a>2.3. 用户管理</h2><ul><li> 在网页非常直观,不写了。</li></ul><h2 id="2-4-本地的使用"><a href="#2-4-本地的使用" class="headerlink" title="2.4. 本地的使用"></a>2.4. 本地的使用</h2><ul><li><p>添加ssh公钥到用户,首先查看ssh公钥,打开<code>git bash</code></p><pre><code> cd ~/.ssh ls cat id_rsa.pub</code></pre></li><li><p> clone,push,pull的使用相同</p></li></ul><h2 id="2-5-Ngnix代理"><a href="#2-5-Ngnix代理" class="headerlink" title="2.5. Ngnix代理"></a>2.5. Ngnix代理</h2><h3 id="2-5-1-官方指导"><a href="#2-5-1-官方指导" class="headerlink" title="2.5.1. 官方指导"></a>2.5.1. 官方指导</h3><p><a href="https://gogs.io/docs/intro/faqs">官网说明</a></p><ul><li><p>如何使用 NGINX 的反向代理?<br> 在 <code>nginx.conf</code> 文件中,将下面的 <code>server</code> 部分增加至 <code>http</code> 分区内并重载配置:</p><pre><code> server { listen 80; server_name git.crystalnetwork.us; location / { proxy_pass http://localhost:3000; } }</code></pre></li><li><p>配置子路径<br> 如果您想要通过域名的子路径来访问 Gogs 实例,可以将 NGINX 的配置修改为以下形式(特别注意后缀 <code>/</code>):</p><pre><code> server { listen 80; server_name git.crystalnetwork.us; location /gogs/ { proxy_pass http://localhost:3000/; } }</code></pre><p> 然后在配置文件中设置<code>[server] EXTERNAL_URL = http://git.crystalnetwork.us/gogs/</code>。</p></li></ul><h3 id="2-5-2-一些参考"><a href="#2-5-2-一些参考" class="headerlink" title="2.5.2. 一些参考"></a>2.5.2. 一些参考</h3><p><a href="https://blog.mynook.info/post/host-your-own-git-server-using-gogs/">官方github给的第三方教程</a></p><p><a href="http://yangyingming.com/article/383/">感觉比较好的教程</a></p><p>搜索gogs ngnix</p><h2 id="2-6-内网穿透"><a href="#2-6-内网穿透" class="headerlink" title="2.6. 内网穿透"></a>2.6. 内网穿透</h2><p>看来使用frp的方式比较好</p><p><a href="https://github.com/fatedier/frp/blob/dev/README_zh.md">frp github</a></p><p><a href="https://gofrp.org/docs/">frp doc</a></p><p><a href="https://www.jianshu.com/p/a921e85280ed">参考教程</a></p><p><a href="http://ife.baidu.com/note/detail/id/1059">原来gitpage使用这么简单???</a></p><h2 id="2-7-BUGS"><a href="#2-7-BUGS" class="headerlink" title="2.7. BUGS"></a>2.7. BUGS</h2><ul><li> 树莓派联网不上的问题,路由器5G的模式改为<code>11 a/n mixed</code>,如果是<code>11 a/n/ac mixed</code>可能有问题(已经排除信道的问题)</li></ul>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>树莓派&python总结</title>
<link href="/2021/07/04/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BE&python%E6%80%BB%E7%BB%93/"/>
<url>/2021/07/04/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BE&python%E6%80%BB%E7%BB%93/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E5%9B%BE%E5%BD%A2%E7%95%8C%E9%9D%A2%E5%BC%80%E5%8F%91">1. 图形界面开发</a><ul><li><a href="#11-%E5%AE%98%E6%96%B9%E6%95%99%E6%9D%90">1.1. 官方教材</a></li><li><a href="#12-%E5%8F%82%E8%80%83">1.2. 参考</a></li><li><a href="#13-%E5%AE%9E%E4%BE%8B">1.3. 实例</a></li></ul></li><li><a href="#2-%E4%B8%B2%E5%8F%A3%E4%BD%BF%E7%94%A8">2. 串口使用</a><ul><li><a href="#21-%E5%BC%80%E5%90%AF%E4%B8%B2%E5%8F%A3%E5%8A%9F%E8%83%BD">2.1. 开启串口功能</a></li><li><a href="#22-%E5%88%A0%E9%99%A4%E4%B8%80%E4%BA%9B%E6%96%87%E4%BB%B6%E7%9A%84%E8%AF%AD%E5%8F%A5">2.2. 删除一些文件的语句</a></li><li><a href="#23-%E8%A7%82%E5%AF%9F%E6%98%AF%E5%90%A6%E6%AD%A3%E5%B8%B8%E6%8C%82%E8%BD%BD%E4%B8%B2%E5%8F%A3">2.3. 观察是否正常挂载串口</a></li><li><a href="#24-%E8%A6%81%E6%9B%B4%E6%94%B9%E4%B8%B2%E5%8F%A3%E6%98%A0%E5%B0%84%E5%85%B3%E7%B3%BB">2.4. 要更改串口映射关系</a><ul><li><a href="#241-sudo-raspi-config">2.4.1. sudo raspi-config</a></li><li><a href="#242-sudo-nano-bootconfigtxt">2.4.2. sudo nano /boot/config.txt</a></li><li><a href="#243-%E4%BD%BF%E7%94%A8-ls--l-devserial-%E6%9F%A5%E7%9C%8B%E6%98%A0%E5%B0%84">2.4.3. 使用 ls -l /dev/serial* 查看映射</a></li></ul></li><li><a href="#25-%E6%B5%8B%E8%AF%95%E5%AE%89%E8%A3%85%E6%98%AF%E5%90%A6%E6%88%90%E5%8A%9F">2.5. 测试安装是否成功</a></li><li><a href="#26-%E4%BD%BF%E7%94%A8%E4%B8%B2%E5%8F%A3%E5%B7%A5%E5%85%B7%E6%B5%8B%E8%AF%95%E6%98%AF%E5%90%A6%E6%AD%A3%E5%B8%B8%E8%AF%BB%E5%8F%96">2.6. 使用串口工具测试是否正常读取</a></li><li><a href="#27-%E5%9C%A8python%E9%87%8C%E9%9D%A2%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%A0%81%E8%AF%BB%E5%8F%96">2.7. 在python里面使用代码读取</a></li></ul></li><li><a href="#3-%E6%A0%91%E8%8E%93%E6%B4%BE%E5%AE%89%E8%A3%85pyqt5">3. 树莓派安装PYQT5</a><ul><li><a href="#31-%E5%AE%89%E8%A3%85%E8%BF%87%E7%A8%8B">3.1. 安装过程</a></li><li><a href="#32-%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9">3.2. 注意事项</a><ul><li><a href="#321-path%E9%97%AE%E9%A2%98">3.2.1. PATH问题</a></li><li><a href="#322-pyqt%E7%9A%84%E7%89%88%E6%9C%AC%E5%8F%B7">3.2.2. pyQt的版本号</a></li><li><a href="#323-%E5%AE%89%E8%A3%85pyqtgraph">3.2.3. 安装pyqtgraph</a></li><li><a href="#324-%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99">3.2.4. 参考资料</a></li></ul></li></ul></li></ul><!-- /TOC --><h1 id="1-图形界面开发"><a href="#1-图形界面开发" class="headerlink" title="1. 图形界面开发"></a>1. 图形界面开发</h1><h2 id="1-1-官方教材"><a href="#1-1-官方教材" class="headerlink" title="1.1. 官方教材"></a>1.1. 官方教材</h2><p><a href="https://gpiozero.readthedocs.io/en/stable/index.html">GPIO zero</a></p><p><a href="https://www.raspberrypi.org/documentation/">Raspberry Pi Documentation</a></p><p><a href="https://www.raspberrypi.org/documentation/usage/">usage guide</a></p><img src="/2021/07/04/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BE&python%E6%80%BB%E7%BB%93/树莓派&python总结_2021-05-03-18-43-22.png" width="100%"><h2 id="1-2-参考"><a href="#1-2-参考" class="headerlink" title="1.2. 参考"></a>1.2. 参考</h2><p><a href="https://zhuanlan.zhihu.com/p/55826891">Python-matplotlib绘图(示波器及动态函数模拟专题)</a></p><p><a href="https://blog.csdn.net/qq_25948717/article/details/82724686">Python–Matlibplot画图功能演示</a></p><h2 id="1-3-实例"><a href="#1-3-实例" class="headerlink" title="1.3. 实例"></a>1.3. 实例</h2><p><a href="https://zhuanlan.zhihu.com/p/44146707">QT在Python中制作精美的图形用户界面</a></p><p><a href="https://www.zhihu.com/question/48628182">如何用Python编写示波器界面</a></p><p><a href="https://blog.csdn.net/hqm178933/article/details/103349262">Python matplotlib 库实现一个简单从串口中读取数据并绘制的代码</a></p><hr><p>开始找到可靠资料</p><p><a href="https://www.zhihu.com/column/pyqt5">知乎:快速掌握pyqt5专栏</a></p><p><a href="https://zhuanlan.zhihu.com/p/75673557">知乎:快速掌握pyqt5目录</a></p><p>这里找到的CSDN教程更加有针对性</p><p><a href="https://blog.csdn.net/baidu_34045013/category_6348966.html">CSDN:pyqt5教程专栏</a></p><p><a href="https://blog.csdn.net/baidu_34045013/article/details/52141849">CSDN:pyqt的绘图</a></p><hr><p>文件共享</p><p><a href="https://blog.csdn.net/qq_43467588/article/details/109225890">win10与ios</a></p><p><a href="https://support.microsoft.com/zh-cn/windows/%E5%9C%A8-windows-10-%E4%B8%AD%E9%80%9A%E8%BF%87%E7%BD%91%E7%BB%9C%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6-b58704b2-f53a-4b82-7bc1-80f9994725bf">win10与ES文件浏览器</a></p><p><a href="https://www.baidu.com/s?ie=UTF-8&wd=ES%E6%96%87%E4%BB%B6%E6%B5%8F%E8%A7%88%E5%99%A8%E6%B7%BB%E5%8A%A0win10%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6">win10与ES文件浏览器</a></p><p>就是登陆的时候试试微软账户(<a href="mailto:XXX@outlook.com">XXX@outlook.com</a>)和PIN(LUCK)及其密码的组合。</p><h1 id="2-串口使用"><a href="#2-串口使用" class="headerlink" title="2. 串口使用"></a>2. 串口使用</h1><p><a href="https://blog.csdn.net/weixin_43944175/article/details/100152317">参考教程</a></p><h2 id="2-1-开启串口功能"><a href="#2-1-开启串口功能" class="headerlink" title="2.1. 开启串口功能"></a>2.1. 开启串口功能</h2><p>菜单–>首选项–>Raspberry Pi Configure 将Serial Port改为Enable,然后重启。</p><h2 id="2-2-删除一些文件的语句"><a href="#2-2-删除一些文件的语句" class="headerlink" title="2.2. 删除一些文件的语句"></a>2.2. 删除一些文件的语句</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo vim /boot/cmdline.txt<br></code></pre></td></tr></table></figure><p>将/boot目录下的cmdline.txt里面的 “console=ttyAMA0, 115200”这句话删掉。(内容可能有差异,将第一个console至第二个console前的内容删除。)</p><p><a href="https://shumeipai.nxez.com/2017/01/31/raspberry-serial-programming-python-example.html">树莓派实验室的指导</a><br>注释下述文件的一些内容。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo nano /etc/inittab<br></code></pre></td></tr></table></figure><h2 id="2-3-观察是否正常挂载串口"><a href="#2-3-观察是否正常挂载串口" class="headerlink" title="2.3. 观察是否正常挂载串口"></a>2.3. 观察是否正常挂载串口</h2><p>插拔一下,看看时间比较新的就是所需的端口</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">ls -l /dev/tty*<br></code></pre></td></tr></table></figure><h2 id="2-4-要更改串口映射关系"><a href="#2-4-要更改串口映射关系" class="headerlink" title="2.4. 要更改串口映射关系"></a>2.4. 要更改串口映射关系</h2><p><a href="https://blog.csdn.net/zz531987464/article/details/83188189">串口映射参考</a></p><p><a href="https://www.maixj.net/ict/raspberry-4b-serial-23733">修改树莓派4B串口映射</a></p><h3 id="2-4-1-sudo-raspi-config"><a href="#2-4-1-sudo-raspi-config" class="headerlink" title="2.4.1. sudo raspi-config"></a>2.4.1. sudo raspi-config</h3><p>Interfacing Options -> P6 Serial, 第一个选项(would you like a login shell to be accessible? over serial?)选择NO,第二个选项(would you like the serial port hardware to be enabled?)选择 YES</p><h3 id="2-4-2-sudo-nano-boot-config-txt"><a href="#2-4-2-sudo-nano-boot-config-txt" class="headerlink" title="2.4.2. sudo nano /boot/config.txt"></a>2.4.2. sudo nano /boot/config.txt</h3><p>添加一行<code>dtoverlay=miniuart-bt</code></p><h3 id="2-4-3-使用-ls-l-dev-serial-查看映射"><a href="#2-4-3-使用-ls-l-dev-serial-查看映射" class="headerlink" title="2.4.3. 使用 ls -l /dev/serial* 查看映射"></a>2.4.3. 使用 ls -l /dev/serial* 查看映射</h3><p>serial0映射到ttyAMA0才是可靠的</p><h2 id="2-5-测试安装是否成功"><a href="#2-5-测试安装是否成功" class="headerlink" title="2.5. 测试安装是否成功"></a>2.5. 测试安装是否成功</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo python<br><br>import serial<br>ser = serial.Serial(<span class="hljs-string">"/dev/ttyAMA0"</span>, 115200, timeout=0.5)<br>ser.isOpen()<br></code></pre></td></tr></table></figure><p>返回true就对了</p><h2 id="2-6-使用串口工具测试是否正常读取"><a href="#2-6-使用串口工具测试是否正常读取" class="headerlink" title="2.6. 使用串口工具测试是否正常读取"></a>2.6. 使用串口工具测试是否正常读取</h2><p><a href="https://blog.csdn.net/weixin_39371711/article/details/79432848">使用minicom</a><br>注意要用管理员身份打开</p><h2 id="2-7-在python里面使用代码读取"><a href="#2-7-在python里面使用代码读取" class="headerlink" title="2.7. 在python里面使用代码读取"></a>2.7. 在python里面使用代码读取</h2><p><strong>注意在thonny里面运行代码默认不是sudo的,右键thonny更改:属性-》桌面项-》命令,添加sudo</strong></p><h1 id="3-树莓派安装PYQT5"><a href="#3-树莓派安装PYQT5" class="headerlink" title="3. 树莓派安装PYQT5"></a>3. 树莓派安装PYQT5</h1><h2 id="3-1-安装过程"><a href="#3-1-安装过程" class="headerlink" title="3.1. 安装过程"></a>3.1. 安装过程</h2><ol><li> 如果原有的QT不满足版本要求,则卸载原有的QT;如果原有的QT在程序允许时无法导入<code>SIP</code>包,则也卸载原有QT重新安装</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 安装官方包的qt</span><br>sudo apt install python3-pyqt5<br><span class="hljs-comment"># 卸载原有qt</span><br>sudo apt remove python3-pyqt5<br><span class="hljs-comment"># 卸载之后再安装QT相关的包,卸载完全干净之后才不会报PATH错误</span><br><span class="hljs-comment"># 如果卸载不干净则</span><br>sudo apt autoremove<br></code></pre></td></tr></table></figure><ol start="2"><li> pip更新</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">python3 -m pip install --upgrade pip<br></code></pre></td></tr></table></figure><ol start="3"><li> 安装一些必要的包</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash">pip3 install sip<br>pip3 install PtQt5-sip<br>pip3 install setuptools<br>pip3 install Pyinstaller<br></code></pre></td></tr></table></figure><ol start="4"><li> 最重要的部分</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">pip3 install PyQt5-builder<br>sudo apt install qt5-default<br></code></pre></td></tr></table></figure><ol start="5"><li> 于是可以进行安装了</li></ol><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">pip3 install PyQt5<br><span class="hljs-comment"># 或者安装当前最新版本</span><br>pip3 install PyQt5==5.15.4<br></code></pre></td></tr></table></figure><p>通过<code>top</code>命令看到cc1plus占用了主要资源,就说明在编译QT5了,经过一段时间之后就安装上了。</p><h2 id="3-2-注意事项"><a href="#3-2-注意事项" class="headerlink" title="3.2. 注意事项"></a>3.2. 注意事项</h2><h3 id="3-2-1-PATH问题"><a href="#3-2-1-PATH问题" class="headerlink" title="3.2.1. PATH问题"></a>3.2.1. PATH问题</h3><p>正常安装的时候不会遇到PATH错误,如果有,解决方法是添加提示的PATH</p><p><a href="https://www.cnblogs.com/youyoui/p/10680329.html">教程</a></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash">sudo ~/.bashrc<br><span class="hljs-comment"># 在最后一行加上</span><br><span class="hljs-built_in">export</span> PATH=<span class="hljs-variable">$PATH</span>:/home/pi/.<span class="hljs-built_in">local</span>/bin <span class="hljs-comment">#根据需要</span><br></code></pre></td></tr></table></figure><ul><li> 生效时间:使用相同的用户打开新的终端时生效,或者手动<code>source ~/.bashrc</code>生效</li><li> 生效期限:永久有效</li><li> 生效范围:仅对当前用户有效</li><li> 如果有后续的环境变量加载文件覆盖了PATH定义,则可能不生效</li></ul><h3 id="3-2-2-pyQt的版本号"><a href="#3-2-2-pyQt的版本号" class="headerlink" title="3.2.2. pyQt的版本号"></a>3.2.2. pyQt的版本号</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><code class="hljs python"><span class="hljs-keyword">from</span> PyQt5.QtCore <span class="hljs-keyword">import</span> QT_VERSION_STR<br>print(QT_VERSION_STR) <span class="hljs-comment"># QT版本号</span><br><br><span class="hljs-keyword">from</span> PyQt5.Qt <span class="hljs-keyword">import</span> PYQT_VERSION_STR<br>print(PYQT_VERSION_STR) <span class="hljs-comment"># PYQT版本号</span><br><br><span class="hljs-keyword">from</span> sip <span class="hljs-keyword">import</span> SIP_VERSION_STR<br>print(SIP_VERSION_STR) <span class="hljs-comment"># SIP版本号</span><br></code></pre></td></tr></table></figure><h3 id="3-2-3-安装pyqtgraph"><a href="#3-2-3-安装pyqtgraph" class="headerlink" title="3.2.3. 安装pyqtgraph"></a>3.2.3. 安装pyqtgraph</h3><p>pyqtgraph对QT版本有要求,不满足要求时就安装旧版本安装pyqtgraph</p><figure class="highlight apache"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs apache"><span class="hljs-attribute">pip3</span> install pyqtgraph==<span class="hljs-number">0</span>.<span class="hljs-number">11</span>.<span class="hljs-number">1</span><br></code></pre></td></tr></table></figure><h3 id="3-2-4-参考资料"><a href="#3-2-4-参考资料" class="headerlink" title="3.2.4. 参考资料"></a>3.2.4. 参考资料</h3><p><a href="https://raspberrypi.stackexchange.com/questions/124278/raspberry-p-3b-pyqtgraph-import-error-sip">pyqtgraph Import error sip</a></p><p><a href="https://www.raspberrypi.org/forums/viewtopic.php?t=309014">Raspberry 4, PyQt5 has always an error</a></p><p><a href="https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html">Installing PyQt5</a></p><p><a href="https://pypi.org/project/PyQt5/#files">PyPI PyQt5</a></p><p>701git服务器的地址:<br>连接到RM701_LAN的wifi之后访问(与原来相同):<a href="http://192.168.2.177:3000/">http://192.168.2.177:3000/</a><br>连接到HITSZ或者704、宿舍的网络之后访问:<a href="http://10.249.16.68:3000/">http://10.249.16.68:3000/</a><br>只要连到校园网(除了UTSZ),都可以访问了。</p><script> if (location.href.indexOf("#reloaded") == -1) { location.href = location.href + "#reloaded"; location.reload(); }</script>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>RDclient远程连接</title>
<link href="/2021/04/29/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/RDclient%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5/"/>
<url>/2021/04/29/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/RDclient%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E5%AE%9E%E7%8E%B0%E5%B1%80%E5%9F%9F%E7%BD%91%E5%86%85%E8%AE%BF%E9%97%AE%E8%87%AA%E5%B7%B1%E7%9A%84%E7%94%B5%E8%84%91%E8%BF%9C%E7%A8%8B%E6%A1%8C%E9%9D%A2">1. 实现局域网内访问自己的电脑(远程桌面)</a><ul><li><a href="#11-%E5%BC%95%E5%AF%BC">1.1. 引导</a></li><li><a href="#12-win10%E5%AE%B6%E5%BA%AD%E7%89%88%E5%BC%80%E8%BF%9C%E7%A8%8B%E6%A1%8C%E9%9D%A2">1.2. win10家庭版开远程桌面</a></li><li><a href="#13-ipad%E7%AB%AFrd-client%E9%85%8D%E7%BD%AE">1.3. ipad端RD client配置</a></li></ul></li><li><a href="#2-%E8%BF%9C%E7%A8%8B%E5%BC%80%E6%9C%BA">2. 远程开机</a><ul><li><a href="#21-wake-on-lan">2.1. Wake On LAN</a></li><li><a href="#22-wake-on-wlan">2.2. Wake On WLAN</a></li></ul></li></ul><!-- /TOC --><h1 id="1-实现局域网内访问自己的电脑(远程桌面)"><a href="#1-实现局域网内访问自己的电脑(远程桌面)" class="headerlink" title="1. 实现局域网内访问自己的电脑(远程桌面)"></a>1. 实现局域网内访问自己的电脑(远程桌面)</h1><h2 id="1-1-引导"><a href="#1-1-引导" class="headerlink" title="1.1. 引导"></a>1.1. 引导</h2><p><a href="https://zhuanlan.zhihu.com/p/266109987">frp+远程桌面+RDclient</a></p><p><a href="https://zhuanlan.zhihu.com/p/266109987">frp+远程桌面+RDclient</a></p><h2 id="1-2-win10家庭版开远程桌面"><a href="#1-2-win10家庭版开远程桌面" class="headerlink" title="1.2. win10家庭版开远程桌面"></a>1.2. win10家庭版开远程桌面</h2><p><a href="https://github.com/stascorp/rdpwrap">github:rdpwrap</a></p><p><a href="https://github.com/stascorp/rdpwrap/releases">github:rdpwrap:releases</a></p><p><a href="https://github.com/stascorp/rdpwrap/issues/860">github:rdpwrap:issue</a></p><p><a href="https://github.com/LCW0NJUPT/rdpwrap-autoupdate">github:rdpwrap-autoupdate</a></p><ol><li><p> 我下载了“ RDPWrap-v1.6.2.zip ”,并将文件放在C:\ Program Files \ RDP Wrapper中</p></li><li><p> 然后我下载了“ autoupdate-v07.09.2019.zip ”,将内容放在C:\ Program Files \ RDP Wrapper中</p></li><li><p> 然后,我以管理员身份运行cmd并运行“ autoupdate.bat ”</p></li><li><p> RDPConf全绿即可</p></li></ol><h2 id="1-3-ipad端RD-client配置"><a href="#1-3-ipad端RD-client配置" class="headerlink" title="1.3. ipad端RD client配置"></a>1.3. ipad端RD client配置</h2><img src="/2021/04/29/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/RDclient%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5/RDclient远程连接_端口转发配置.png" width="100%"><img src="/2021/04/29/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/RDclient%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5/RDclient远程连接_同一局域网连接.png" width="50%"><img src="/2021/04/29/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/RDclient%E8%BF%9C%E7%A8%8B%E8%BF%9E%E6%8E%A5/RDclient远程连接_校园网内连接.png" width="50%"><h1 id="2-远程开机"><a href="#2-远程开机" class="headerlink" title="2. 远程开机"></a>2. 远程开机</h1><h2 id="2-1-Wake-On-LAN"><a href="#2-1-Wake-On-LAN" class="headerlink" title="2.1. Wake On LAN"></a>2.1. Wake On LAN</h2><p><a href="https://zhuanlan.zhihu.com/p/107387999?ivk_sa=1024320u">知乎参考教程</a></p><p>文末的参考链接非常齐全</p><ul><li><p> pc 进入 BIOS 模式,找到 wake on lan 选项,选择“ensable”或者其他开启选项。e570 的默认选项为“AC only”(只有充电时开启)。你也可以设置成“AC and Battery”(充电和使用电池都开启)。</p></li><li><p> pc 开机,进入“设备管理器”,点击“网络适配器”,双击工作中的网卡,点击“电源管理”,勾选“此设备唤醒计算机”,点击“高级”,点击“魔术封包唤醒”,选择“启用”。</p></li><li><p> 进入“防火墙”,点击右侧的“新建规则”,选择“端口”,选择“udp”,在“特定端口”一栏输入“9”。“配置文件”选择“公用”。确定即可。</p></li><li><p> 在其他设备唤醒主机</p></li></ul><h2 id="2-2-Wake-On-WLAN"><a href="#2-2-Wake-On-WLAN" class="headerlink" title="2.2. Wake On WLAN"></a>2.2. Wake On WLAN</h2><p><a href="https://www.binss.me/blog/wake-windows-10-laptop-by-WLAN/">关于Wake-on-WLAN的一些讨论</a></p><p>无线网卡的远程唤醒,资料太少,不知如何实现。暂时就让电脑不要关机好了。</p>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>树莓派基础使用</title>
<link href="/2021/02/21/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BE%E5%9F%BA%E7%A1%80%E4%BD%BF%E7%94%A8/"/>
<url>/2021/02/21/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/%E6%A0%91%E8%8E%93%E6%B4%BE%E5%9F%BA%E7%A1%80%E4%BD%BF%E7%94%A8/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-%E9%95%9C%E5%83%8F%E4%B8%8B%E8%BD%BD%E4%B8%8E%E7%83%A7%E5%86%99">1. 镜像下载与烧写</a></li><li><a href="#2-%E5%AE%98%E6%96%B9%E7%B3%BB%E7%BB%9F%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97">2. 官方系统使用指南</a><ul><li><a href="#21-%E5%AE%98%E6%96%B9%E9%95%9C%E5%83%8F%E4%BC%98%E7%82%B9">2.1. 官方镜像优点</a></li><li><a href="#22-%E7%83%A7%E5%86%99%E9%95%9C%E5%83%8F%E6%B7%BB%E5%8A%A0ssh%E7%A9%BA%E7%99%BD%E6%96%87%E4%BB%B6%E5%88%B0boot%E7%9B%98%E9%A2%84%E5%9F%8Bwifi">2.2. 烧写镜像,添加SSH空白文件到boot盘,预埋wifi</a></li><li><a href="#23-%E6%89%BE%E5%88%B0%E6%A0%91%E8%8E%93%E6%B4%BE%E7%9A%84wifi">2.3. 找到树莓派的WiFi</a></li><li><a href="#24-%E8%BF%9B%E5%85%A5%E7%B3%BB%E7%BB%9F%E5%9F%BA%E6%9C%AC%E9%85%8D%E7%BD%AE">2.4. 进入系统基本配置</a></li><li><a href="#25-%E5%85%B6%E4%BB%96%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97">2.5. 其他使用指南</a><ul><li><a href="#251-%E6%8D%A2%E9%98%BF%E9%87%8C%E6%BA%90">2.5.1. 换阿里源</a></li><li><a href="#252-%E5%8F%AF%E8%A7%86%E5%8C%96%E7%9A%84%E8%B5%84%E6%BA%90%E6%98%BE%E7%A4%BA%E5%99%A8neofetch">2.5.2. 可视化的资源显示器neofetch</a></li><li><a href="#253-%E5%AE%89%E8%A3%85%E4%B8%AD%E6%96%87%E8%BE%93%E5%85%A5%E6%B3%95">2.5.3. 安装中文输入法</a></li><li><a href="#254-%E7%A6%81%E7%94%A8%E4%BC%91%E7%9C%A0">2.5.4. 禁用休眠</a></li></ul></li></ul></li><li><a href="#3-%E5%85%B6%E4%BB%96%E5%8A%9F%E8%83%BD">3. 其他功能</a><ul><li><a href="#31-pscp%E5%B7%A5%E5%85%B7">3.1. pscp工具</a></li><li><a href="#32-samba%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6%E5%A4%B9%E6%A0%91%E8%8E%93%E6%B4%BE%E5%88%86%E4%BA%AB%E7%BB%99windows">3.2. samba共享文件夹,树莓派分享给windows</a></li><li><a href="#33-%E8%B5%84%E6%96%99%E6%B1%87%E6%80%BB">3.3. 资料汇总</a></li></ul></li></ul><!-- /TOC --><h1 id="1-镜像下载与烧写"><a href="#1-镜像下载与烧写" class="headerlink" title="1. 镜像下载与烧写"></a>1. 镜像下载与烧写</h1><p><a href="https://www.raspberrypi.org/downloads/">树莓派镜像烧写工具</a></p><p><a href="https://www.raspberrypi.org/downloads/raspberry-pi-os/">树莓派官方系统镜像</a><br>镜像比较大,最好把种子下载下来然后再用下载工具下载</p><p><a href="https://ubuntu.com/download/raspberry-pi">树莓派的ubuntu</a><br>注意用的是desktop版本还是server版本</p><h1 id="2-官方系统使用指南"><a href="#2-官方系统使用指南" class="headerlink" title="2. 官方系统使用指南"></a>2. 官方系统使用指南</h1><h2 id="2-1-官方镜像优点"><a href="#2-1-官方镜像优点" class="headerlink" title="2.1. 官方镜像优点"></a>2.1. 官方镜像优点</h2><p>内置SSH,VNC,Chrome(旧版),大量软件,桌面环境运行较流畅</p><p><a href="https://www.bilibili.com/video/BV1t64y1M7RA?t=150">一个很好的指导</a></p><h2 id="2-2-烧写镜像,添加SSH空白文件到boot盘,预埋wifi"><a href="#2-2-烧写镜像,添加SSH空白文件到boot盘,预埋wifi" class="headerlink" title="2.2. 烧写镜像,添加SSH空白文件到boot盘,预埋wifi"></a>2.2. 烧写镜像,添加SSH空白文件到boot盘,预埋wifi</h2><p>新建wpa_supplicant.conf,priority越大优先级越高,放入boot盘</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs conf">country=CN<br>ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev<br>update_config=1<br><br>network={<br> ssid="RM701_LAN"<br> psk="XXXXX"<br> key_mgmt=WPA-PSK<br> priority=2<br>}<br><br>network={<br> ssid="HomeAssistant"<br> psk="XXX"<br> key_mgmt=WPA-PSK<br> priority=1<br>}<br></code></pre></td></tr></table></figure><p>有屏幕和键盘的可以不用预埋wifi,有网线的可以连接到电脑,开机之后通过ssh设置WiFi。</p><h2 id="2-3-找到树莓派的WiFi"><a href="#2-3-找到树莓派的WiFi" class="headerlink" title="2.3. 找到树莓派的WiFi"></a>2.3. 找到树莓派的WiFi</h2><ol><li><p>网线连接到电脑,使用再cmd使用命令</p><p> arp -a</p></li></ol><p>有线的端口的就是树莓派的,一般是192.168.137.1之类的</p><p><a href="https://shumeipai.nxez.com/2013/10/15/raspberry-pi-and-a-network-cable-directly-connected-laptop.html">树莓派+一根网线直连笔记本电脑</a></p><ol start="2"><li><p>没有网线,进入路由器的管理界面</p><pre><code> 192.168.1.1 //tp-link的管理界面 192.168.31.1 //红米路由器 //具体看自己的路由器情况和所在网络的网段</code></pre></li><li><p> 其他工具,如安卓手机上面的fing,或者安卓手机使用终端模拟器执行<code>ip neigh</code>命令,与电脑的<code>arp - a</code>效果相同。树莓派连到手机热点的时候这样查看ip最方便。</p></li></ol><h2 id="2-4-进入系统基本配置"><a href="#2-4-进入系统基本配置" class="headerlink" title="2.4. 进入系统基本配置"></a>2.4. 进入系统基本配置</h2><blockquote><p>有屏幕:更改屏幕设置(大黑边问题)</p></blockquote><blockquote><p>没有屏幕:ssh连接,默认pi,raspberry</p></blockquote><blockquote><p>进入raspi-config,命令是</p></blockquote><pre><code>sudo raspi-config</code></pre><blockquote><p>设置VNC开启<br>在第五点5 interfacing options —> VNC</p></blockquote><p><a href="https://blog.csdn.net/qq_42612147/article/details/100073650">vnc viewer 显示 cannot currently show the desktop 的解决方法</a></p><blockquote><p>进入图像化界面进行初始化配置,设置地区语言,登陆密码之类的。</p></blockquote><blockquote><p>设置静态IP,在已经开启vnc的情况下可以连接vnc进行配置,注意经常设备不是固定使用的情况下不要设置静态ip,因为不同网络环境下网段会变。</p></blockquote><pre><code>sudo nano /etc/dhcpcd.conf# 添加以下内容interfac wlan0static ip_address=192.168.X.Xstatic routers=192.168.X.X</code></pre><h2 id="2-5-其他使用指南"><a href="#2-5-其他使用指南" class="headerlink" title="2.5. 其他使用指南"></a>2.5. 其他使用指南</h2><h3 id="2-5-1-换阿里源"><a href="#2-5-1-换阿里源" class="headerlink" title="2.5.1. 换阿里源"></a>2.5.1. 换阿里源</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 第一个文件</span><br>sudo nano /etc/apt/sources.list<br><span class="hljs-comment"># 将原有内容用#注释掉</span><br>deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi<br>deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi<br><br><span class="hljs-comment"># 第二个文件</span><br>sudo nano /etc/apt/sources.list.d/raspi.list<br><span class="hljs-comment"># 将原有内容用#注释掉</span><br>deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main<br>deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main<br><br><span class="hljs-comment"># 执行更新</span><br>sudo apt-get update<br>sudo apt-get upgrade<br></code></pre></td></tr></table></figure><p>提示重复配置可以把 <code>/etc/apt/sources.list.d/raspi.list</code> 里面的源删掉,只留一个文件有源就可以。</p><h3 id="2-5-2-可视化的资源显示器neofetch"><a href="#2-5-2-可视化的资源显示器neofetch" class="headerlink" title="2.5.2. 可视化的资源显示器neofetch"></a>2.5.2. 可视化的资源显示器neofetch</h3><p>在换完源,执行完更新的情况下执行</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-comment"># 安装neotetch</span><br>sudo aptitude install neofetch<br><span class="hljs-comment"># 配置neotetch,需要显示的东西取消注释即可</span><br>sudo nano .config/neofetch/config.conf<br></code></pre></td></tr></table></figure><h3 id="2-5-3-安装中文输入法"><a href="#2-5-3-安装中文输入法" class="headerlink" title="2.5.3. 安装中文输入法"></a>2.5.3. 安装中文输入法</h3><p><a href="https://shumeipai.nxez.com/2016/03/13/how-to-make-raspberry-pi-display-chinese.html">树莓派实验室关于安装中文输入法</a></p><p><a href="https://www.jianshu.com/p/84cb45bbef63">显示中文和安装中文输入法</a></p><pre><code># 字库sudo apt-get install ttf-wqy-zenhei#输入法sudo apt-get install scim-pinyin#配置sudo raspi-config</code></pre><p>localisation Options –> change Locale ,一直按方向下键,按空格选择 zh_CN GB2312 , zh_CN.GB18030 GB18030 , zh_CN.GBK GBK , zh_CN.UTF-8 UTF-8 四个选项,左边出现*号即为选中,按回车确认。</p><p>确认后,选择zh_CN.UTF-8,回车确认</p><h3 id="2-5-4-禁用休眠"><a href="#2-5-4-禁用休眠" class="headerlink" title="2.5.4. 禁用休眠"></a>2.5.4. 禁用休眠</h3><p><a href="https://www.cnblogs.com/xiaoqianbook/p/11945271.html">一个很好的博客</a></p><pre><code>sudo nano /etc/lightdm/lightdm.conf</code></pre><p>找到[Seat:*]这一项,在下面的‘#xserver-command=X’删除前面的注释符#,修改为以下</p><pre><code>xserver-command=X -s 0-dpms</code></pre><p>其中,-s 参数:设置屏幕保护不启动,0 数字零,-dpms 参数:关闭电源节能管理。</p><h1 id="3-其他功能"><a href="#3-其他功能" class="headerlink" title="3. 其他功能"></a>3. 其他功能</h1><h2 id="3-1-pscp工具"><a href="#3-1-pscp工具" class="headerlink" title="3.1. pscp工具"></a>3.1. pscp工具</h2><p>windows发送文件到树莓派上面,注意斜杠和反斜杠</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">pscp -P 22 c:\文件完整路径 pi@IP地址:/home/git/<br></code></pre></td></tr></table></figure><h2 id="3-2-samba共享文件夹,树莓派分享给windows"><a href="#3-2-samba共享文件夹,树莓派分享给windows" class="headerlink" title="3.2. samba共享文件夹,树莓派分享给windows"></a>3.2. samba共享文件夹,树莓派分享给windows</h2><p>搜索关键词<code>局域网内Windows和linux系统如何共享文件</code>,<code>SAMBA共享文件</code></p><p>安装samba 和 samba-common-bin</p><figure class="highlight routeros"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs routeros">sudo apt-<span class="hljs-builtin-name">get</span> update<br>sudo apt-<span class="hljs-builtin-name">get</span> install samba samba-common-bin<br></code></pre></td></tr></table></figure><p>配置samba服务 :</p><figure class="highlight awk"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs awk">sudo nano <span class="hljs-regexp">/etc/</span>samba/smb.conf<br></code></pre></td></tr></table></figure><p>跳到最后一行,加入如下语句:</p><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><code class="hljs conf">[MyNAS]<br> # 说明信息<br> comment = NAS Storage<br> # 可以访问的用户<br> valid users = pi,root<br> # 共享文件的路径,raspberry pi 会自动将连接到其上的外接存储设备挂载到/media/pi/目录下。注意这个目录要存在才可访问<br> path = /media/pi/<br> # 可被其他人看到资源名称(非内容)<br> browseable = yes<br> # 可写<br> writable = yes<br> readonly = no<br> # 新建文件的权限为 664<br> create mask = 0664<br> # 新建目录的权限为 775<br> directory mask = 0775<br></code></pre></td></tr></table></figure><p>samba用户权限配置,如果失败,先把<code>sudo apt-get remove samba </code>,然后再考虑<code>sudo apt-get autoremove</code>,再重装一遍</p><figure class="highlight livecodeserver"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs livecodeserver">sudo sambapasswd -<span class="hljs-keyword">a</span> <span class="hljs-literal">pi</span><br><span class="hljs-comment"># 提示找不到命令则试试</span><br>sudo smbpasswd -<span class="hljs-keyword">a</span> <span class="hljs-literal">pi</span><br></code></pre></td></tr></table></figure><p>输入新设置samba密码,为了安全性尽量不要和已经存在的pi密码重复。</p><p>重启服务: <code>sudo /etc/init.d/smbd restart</code></p><p>设置开机自启动,编辑<code>sudo nano /etc/rc.local</code>,在exit0前加上<code>sudo /etc/init.d/smbd restart</code></p><p>有的网上的比较老的教程是<code>sudo /etc/init.d/samba restart</code>,就不适用了。</p><p>在windows打开“计算机”——>在网络位置””空白处右键“添加一个网络位置”,按向导做即可。</p><h2 id="3-3-资料汇总"><a href="#3-3-资料汇总" class="headerlink" title="3.3. 资料汇总"></a>3.3. 资料汇总</h2><p><a href="https://github.com/xinxingli/Raspberry-Pi">一个树莓派学习资料汇总的网页</a></p>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title>hexo配置与使用</title>
<link href="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/"/>
<url>/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><!-- TOC --><ul><li><a href="#1-hexo%E7%9A%84%E9%85%8D%E7%BD%AE%E5%92%8C%E4%BD%BF%E7%94%A8">1. hexo的配置和使用</a><ul><li><a href="#11-%E5%8F%82%E8%80%83%E9%93%BE%E6%8E%A5">1.1. 参考链接</a></li><li><a href="#12-%E6%8F%92%E5%85%A5%E5%9B%BE%E7%89%87">1.2. 插入图片:</a><ul><li><a href="#121-%E7%BD%91%E7%BB%9C%E6%95%99%E7%A8%8B">1.2.1. 网络教程</a></li><li><a href="#122-%E5%AE%89%E8%A3%85%E6%8F%92%E4%BB%B6">1.2.2. 安装插件</a></li><li><a href="#123-%E6%94%B9%E8%AE%BE%E7%BD%AE">1.2.3. 改设置</a></li><li><a href="#124-%E4%BB%A3%E7%A0%81%E6%9B%BF%E6%8D%A2">1.2.4. 代码替换</a></li><li><a href="#125-%E5%BC%95%E7%94%A8%E6%96%B9%E5%BC%8F">1.2.5. 引用方式</a></li><li><a href="#126-%E7%A1%AE%E5%AE%9A%E7%9A%84%E8%A7%84%E8%8C%83%E7%9A%84%E5%9B%BE%E7%89%87%E5%BC%95%E7%94%A8%E6%96%B9%E6%B3%95">1.2.6. 确定的规范的图片引用方法:</a></li></ul></li><li><a href="#13-%E5%8A%A0%E5%AF%86%E6%96%87%E6%A1%A3">1.3. 加密文档</a></li><li><a href="#14-%E9%93%BE%E6%8E%A5%E7%AB%99%E5%86%85%E6%96%87%E7%AB%A0">1.4 链接站内文章</a></li><li><a href="#15-%E6%96%87%E7%AB%A0%E7%AE%A1%E7%90%86">1.5 文章管理</a></li></ul></li><li><a href="#2-%E6%9C%80%E5%B8%B8%E7%94%A8%E7%9A%84%E5%91%BD%E4%BB%A4">2. 最常用的命令</a></li></ul><!-- /TOC --><h1 id="1-hexo的配置和使用"><a href="#1-hexo的配置和使用" class="headerlink" title="1. hexo的配置和使用"></a>1. hexo的配置和使用</h1><h2 id="1-1-参考链接"><a href="#1-1-参考链接" class="headerlink" title="1.1. 参考链接"></a>1.1. 参考链接</h2><p><a href="https://hexo.io/">hexo官方网站</a></p><p><a href="https://www.bilibili.com/video/BV1cW411A7Jx?p=1">B站的不错的视频教程</a></p><p><a href="http://theme-next.iissnan.com/">next主题的中文文档</a></p><p><a href="https://github.com/theme-next/hexo-theme-next">next主题的Github</a></p><p><a href="https://gitee.com/help/articles/4136#article-header0">Gitee Pages的指导</a></p><p><a href="https://github.com/litten/hexo-theme-yilia">Yilia主题的Github及说明</a></p><p><a href="https://shen-yu.gitee.io/2019/ayer/">Ayer主题的使用说明</a></p><p><a href="https://github.com/fluid-dev/hexo-theme-fluid"><strong>Fluid主题,最终使用的主题</strong></a></p><p><a href="https://hexo.fluid-dev.com/docs/"><strong>Fluid主题的用户文档</strong></a></p><p><a href="https://hexo.io/themes/">hexo官网给出的模板</a></p><h2 id="1-2-插入图片:"><a href="#1-2-插入图片:" class="headerlink" title="1.2. 插入图片:"></a>1.2. 插入图片:</h2><a id="more"></a><h3 id="1-2-1-网络教程"><a href="#1-2-1-网络教程" class="headerlink" title="1.2.1. 网络教程"></a>1.2.1. 网络教程</h3><p><a href="https://www.jianshu.com/p/f72aaad7b852">hexo插入图片,简书上的教材</a></p><h3 id="1-2-2-安装插件"><a href="#1-2-2-安装插件" class="headerlink" title="1.2.2. 安装插件"></a>1.2.2. 安装插件</h3><pre><code><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs bash">npm install hexo-asset-image --save<br></code></pre></td></tr></table></figure></code></pre><h3 id="1-2-3-改设置"><a href="#1-2-3-改设置" class="headerlink" title="1.2.3. 改设置"></a>1.2.3. 改设置</h3><p>打开hexo的配置文件<code>_config.yml</code>,找到<code>post_asset_folder</code>,把这个选项从false改成true</p><h3 id="1-2-4-代码替换"><a href="#1-2-4-代码替换" class="headerlink" title="1.2.4. 代码替换"></a>1.2.4. 代码替换</h3><p><code>/node_modules/hexo-asset-image/index.js</code>的代码替换为:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br></pre></td><td class="code"><pre><code class="hljs js"><span class="hljs-meta">'use strict'</span>;<br><span class="hljs-keyword">var</span> cheerio = <span class="hljs-built_in">require</span>(<span class="hljs-string">'cheerio'</span>);<br><br><span class="hljs-comment">// http://stackoverflow.com/questions/14480345/how-to-get-the-nth-occurrence-in-a-string</span><br><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">getPosition</span>(<span class="hljs-params">str, m, i</span>) </span>{<br><span class="hljs-keyword">return</span> str.split(m, i).join(m).length;<br>}<br><br><span class="hljs-keyword">var</span> version = <span class="hljs-built_in">String</span>(hexo.version).split(<span class="hljs-string">'.'</span>);<br>hexo.extend.filter.register(<span class="hljs-string">'after_post_render'</span>, <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">data</span>)</span>{<br><span class="hljs-keyword">var</span> config = hexo.config;<br><span class="hljs-keyword">if</span>(config.post_asset_folder){<br> <span class="hljs-keyword">var</span> link = data.permalink;<br> <span class="hljs-keyword">if</span>(version.length > <span class="hljs-number">0</span> && <span class="hljs-built_in">Number</span>(version[<span class="hljs-number">0</span>]) == <span class="hljs-number">3</span>)<br> <span class="hljs-keyword">var</span> beginPos = getPosition(link, <span class="hljs-string">'/'</span>, <span class="hljs-number">1</span>) + <span class="hljs-number">1</span>;<br> <span class="hljs-keyword">else</span><br> <span class="hljs-keyword">var</span> beginPos = getPosition(link, <span class="hljs-string">'/'</span>, <span class="hljs-number">3</span>) + <span class="hljs-number">1</span>;<br> <span class="hljs-comment">// In hexo 3.1.1, the permalink of "about" page is like ".../about/index.html".</span><br> <span class="hljs-keyword">var</span> endPos = link.lastIndexOf(<span class="hljs-string">'/'</span>) + <span class="hljs-number">1</span>;<br> link = link.substring(beginPos, endPos);<br><br> <span class="hljs-keyword">var</span> toprocess = [<span class="hljs-string">'excerpt'</span>, <span class="hljs-string">'more'</span>, <span class="hljs-string">'content'</span>];<br> <span class="hljs-keyword">for</span>(<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i < toprocess.length; i++){<br> <span class="hljs-keyword">var</span> key = toprocess[i];<br><br> <span class="hljs-keyword">var</span> $ = cheerio.load(data[key], {<br> ignoreWhitespace: <span class="hljs-literal">false</span>,<br> xmlMode: <span class="hljs-literal">false</span>,<br> lowerCaseTags: <span class="hljs-literal">false</span>,<br> decodeEntities: <span class="hljs-literal">false</span><br> });<br><br> $(<span class="hljs-string">'img'</span>).each(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{<br> <span class="hljs-keyword">if</span> ($(<span class="hljs-built_in">this</span>).attr(<span class="hljs-string">'src'</span>)){<br> <span class="hljs-comment">// For windows style path, we replace '\' to '/'.</span><br> <span class="hljs-keyword">var</span> src = $(<span class="hljs-built_in">this</span>).attr(<span class="hljs-string">'src'</span>).replace(<span class="hljs-string">'\\'</span>, <span class="hljs-string">'/'</span>);<br> <span class="hljs-keyword">if</span>(!<span class="hljs-regexp">/http[s]*.*|\/\/.*/</span>.test(src) &&<br> !<span class="hljs-regexp">/^\s*\//</span>.test(src)) {<br> <span class="hljs-comment">// For "about" page, the first part of "src" can't be removed.</span><br> <span class="hljs-comment">// In addition, to support multi-level local directory.</span><br> <span class="hljs-keyword">var</span> linkArray = link.split(<span class="hljs-string">'/'</span>).filter(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">elem</span>)</span>{<br> <span class="hljs-keyword">return</span> elem != <span class="hljs-string">''</span>;<br> });<br> <span class="hljs-keyword">var</span> srcArray = src.split(<span class="hljs-string">'/'</span>).filter(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">elem</span>)</span>{<br> <span class="hljs-keyword">return</span> elem != <span class="hljs-string">''</span> && elem != <span class="hljs-string">'.'</span>;<br> });<br> <span class="hljs-keyword">if</span>(srcArray.length > <span class="hljs-number">1</span>)<br> srcArray.shift();<br> src = srcArray.join(<span class="hljs-string">'/'</span>);<br> $(<span class="hljs-built_in">this</span>).attr(<span class="hljs-string">'src'</span>, config.root + link + src);<br> <span class="hljs-built_in">console</span>.info&&<span class="hljs-built_in">console</span>.info(<span class="hljs-string">"update link as:-->"</span>+config.root + link + src);<br> }<br> }<span class="hljs-keyword">else</span>{<br> <span class="hljs-built_in">console</span>.info&&<span class="hljs-built_in">console</span>.info(<span class="hljs-string">"no src attr, skipped..."</span>);<br> <span class="hljs-built_in">console</span>.info&&<span class="hljs-built_in">console</span>.info($(<span class="hljs-built_in">this</span>));<br> }<br> });<br> data[key] = $.html();<br> }<br>}<br>});<br></code></pre></td></tr></table></figure><h3 id="1-2-5-引用方式"><a href="#1-2-5-引用方式" class="headerlink" title="1.2.5. 引用方式"></a>1.2.5. 引用方式</h3><p>创建新文章时,顺便创建相同名字的文件夹,也就是文章资源文件夹,如在一个文件目录下,博客名为<code>A.md</code>,相应的存在一个<code>A</code>文件夹存放图片<code>image.jpg</code>,引用时:</p><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs md">,这样就能正确显示在网页上,但是markdown预览不正常。<br>,这样markdown预览正确,但是显示在网页上不正常。<br></code></pre></td></tr></table></figure><p>就统一使用<code></code>的方式命名,之后再编辑器里面ctrl+f查找 <code>-图片](</code> 统一替换或者加入文件夹的名称即可</p><p><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo%E4%B8%BB%E9%A1%B5.png" alt="hexo主页图片"></p><p><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo%E4%B8%BB%E9%A1%B51.png" alt="hexo主页图片1"></p><h3 id="1-2-6-确定的规范的图片引用方法:"><a href="#1-2-6-确定的规范的图片引用方法:" class="headerlink" title="1.2.6. 确定的规范的图片引用方法:"></a>1.2.6. 确定的规范的图片引用方法:</h3><p>使用<a href="https://marketplace.visualstudio.com/items?itemName=mushan.vscode-paste-image&ssr=false#overview">PasteImage</a><br>插件,配置如下:</p><figure class="highlight"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><code class="hljs json">"pasteImage.basePath": "${currentFileDir}", // 引用图片文件的路径<br>"pasteImage.namePrefix": "${currentFileNameWithoutExt}_", // 图片文件名的前缀为文章名<br>"pasteImage.forceUnixStyleSeparator": true,<br>"pasteImage.insertPattern": "<img src="${imageFilePath}" width="100%">" // 插入图片的方式,这里使用html样式,方便调节大小<br>"pasteImage.path": "${currentFileDir}/${currentFileNameWithoutExt}", // 图片文件保存的地方,保存在同文章名的文件夹<br>"pasteImage.prefix": "" // 引用图片时的前缀<br></code></pre></td></tr></table></figure><!--  --><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo_introduction_base%20path.png" width="40%"><!--  --><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo_introduction_本地图片文件命名.png" width="50%"><!--  --><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo_introduction_path.png" width="40%"><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo_introduction_path.png" width="50%"><img src="/2021/01/17/%E6%97%A5%E5%B8%B8%E5%AD%A6%E4%B9%A0/hexo_introduction/hexo_introduction_insert%20pattern.png" width="50%"><p>使用html格式插入,部署之前就不需要更改路径,特别方便。</p><p>注意html格式插入的图片是紧密结合的。</p><h2 id="1-3-加密文档"><a href="#1-3-加密文档" class="headerlink" title="1.3. 加密文档"></a>1.3. 加密文档</h2><p>使用<a href="https://github.com/D0n9X1n/hexo-blog-encrypt#about-callback">hexo-blog-encrypt</a></p><p>已知的问题:导致目录显示不正确,<a href="https://github.com/fluid-dev/hexo-theme-fluid/issues/339">Fluid主题里面的issue</a>,我的暂时还没有解决。</p><p><a href="https://yuyuforest.com/2018/10/18/encrypt-toc/">可以学习一下的解决方式</a></p><p>使用了加密功能后,全站的代码一键复制功能失效。</p><h2 id="1-4-链接站内文章"><a href="#1-4-链接站内文章" class="headerlink" title="1.4 链接站内文章"></a>1.4 链接站内文章</h2><p><a href="https://github.com/iissnan/hexo-theme-next/issues/978">链接站内文章</a></p><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs md">{% post<span class="hljs-emphasis">_link 文章名 '展示的字符' %}</span><br></code></pre></td></tr></table></figure><h2 id="1-5-文章管理"><a href="#1-5-文章管理" class="headerlink" title="1.5 文章管理"></a>1.5 文章管理</h2><p><a href="https://zhuanlan.zhihu.com/p/156915260">说到关于post,draft,page</a></p><p><a href="https://hexo.io/zh-cn/docs/configuration#%E5%8C%85%E6%8B%AC%E6%88%96%E4%B8%8D%E5%8C%85%E6%8B%AC%E7%9B%AE%E5%BD%95%E5%92%8C%E6%96%87%E4%BB%B6">包括或者不包括目录、文件</a></p><h1 id="2-最常用的命令"><a href="#2-最常用的命令" class="headerlink" title="2. 最常用的命令"></a>2. 最常用的命令</h1><p>生成:</p><pre><code>hexo g</code></pre><p>本地预览:在浏览器输入<code>localhost:5000</code></p><pre><code>hexo server -p 5000</code></pre><p>部署</p><pre><code>hexo d</code></pre><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs html"><span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">align</span>=<span class="hljs-string">"left"</span>></span><br><span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">https://XXXX.png</span> /></span><br><span class="hljs-tag"></<span class="hljs-name">div</span>></span><br><br><span class="hljs-tag"><<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"XXXX.png"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"100%"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"100%"</span>></span><br></code></pre></td></tr></table></figure><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><code class="hljs md">---<br>title: 文章标题<br>date: 2021-01-17 16:00:00<br>toc: true<br>tags: <br><span class="hljs-code"> # ['技术']</span><br><span class="hljs-code">categories: </span><br><span class="hljs-code"> - 学习</span><br><span class="hljs-code">hide: false</span><br><span class="hljs-code"></span><br><span class="hljs-code">excerpt: 这是摘要</span><br><span class="hljs-code">index_img: /img/example.jpg # 文章在首页的封面图,路径是博客根目录/source/img/里面的图片</span><br><span class="hljs-code">banner_img: /img/post_banner.jpg # 文章页顶部大图</span><br><span class="hljs-code"></span><br><span class="hljs-code">abstract: 加密内容在解密前的摘要.</span><br><span class="hljs-code">password: hello</span><br><span class="hljs-code">---</span><br></code></pre></td></tr></table></figure>]]></content>
<categories>
<category>学习</category>
</categories>
<tags>
<tag>技术</tag>
</tags>
</entry>
<entry>
<title></title>
<link href="/"/>
<url>/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><h1 id="This-is-me"><a href="#This-is-me" class="headerlink" title="This is me"></a>This is me</h1>]]></content>
</entry>
<entry>
<title>about</title>
<link href="/"/>
<url>/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script><p>这里写关于页的正文,支持 Markdown, HTML</p><h1 id="要补充的"><a href="#要补充的" class="headerlink" title="要补充的"></a>要补充的</h1><h1 id="自己的项目"><a href="#自己的项目" class="headerlink" title="自己的项目"></a>自己的项目</h1><h1 id="当前的工作方向"><a href="#当前的工作方向" class="headerlink" title="当前的工作方向"></a>当前的工作方向</h1><h1 id="BASIC-INFORMATION"><a href="#BASIC-INFORMATION" class="headerlink" title="BASIC INFORMATION"></a>BASIC INFORMATION</h1><h2 id="Contact"><a href="#Contact" class="headerlink" title="Contact"></a>Contact</h2><h2 id="Overview-of-Me"><a href="#Overview-of-Me" class="headerlink" title="Overview of Me"></a>Overview of Me</h2><h2 id="About-This-Page"><a href="#About-This-Page" class="headerlink" title="About This Page"></a>About This Page</h2><h1 id="EDUCATION"><a href="#EDUCATION" class="headerlink" title="EDUCATION"></a>EDUCATION</h1><h2 id="Harbin-Institute-of-Technology-Shenzhen"><a href="#Harbin-Institute-of-Technology-Shenzhen" class="headerlink" title="Harbin Institute of Technology, Shenzhen"></a>Harbin Institute of Technology, Shenzhen</h2><h2 id="Guangdong-Experimental-High-School"><a href="#Guangdong-Experimental-High-School" class="headerlink" title="Guangdong Experimental High School"></a>Guangdong Experimental High School</h2><h1 id="AWARDS"><a href="#AWARDS" class="headerlink" title="AWARDS"></a>AWARDS</h1><h2 id="2021"><a href="#2021" class="headerlink" title="2021"></a>2021</h2><h2 id="2020"><a href="#2020" class="headerlink" title="2020"></a>2020</h2><h2 id="2019"><a href="#2019" class="headerlink" title="2019"></a>2019</h2><h2 id="2018"><a href="#2018" class="headerlink" title="2018"></a>2018</h2><h1 id="SKILLS"><a href="#SKILLS" class="headerlink" title="SKILLS"></a>SKILLS</h1><h2 id="Software"><a href="#Software" class="headerlink" title="Software"></a>Software</h2><h2 id="Coding-Languages"><a href="#Coding-Languages" class="headerlink" title="Coding Languages"></a>Coding Languages</h2><h2 id="Language-Levels"><a href="#Language-Levels" class="headerlink" title="Language Levels"></a>Language Levels</h2><h2 id="OTHERS"><a href="#OTHERS" class="headerlink" title="OTHERS"></a>OTHERS</h2><h2 id="Sports"><a href="#Sports" class="headerlink" title="Sports"></a>Sports</h2><h2 id="Arts"><a href="#Arts" class="headerlink" title="Arts"></a>Arts</h2><h2 id="Entertainments"><a href="#Entertainments" class="headerlink" title="Entertainments"></a>Entertainments</h2>]]></content>
</entry>
<entry>
<title>categories</title>
<link href="/"/>
<url>/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script>]]></content>
</entry>
<entry>
<title>friends</title>
<link href="/"/>
<url>/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script>]]></content>
</entry>
<entry>
<title>tags</title>
<link href="/"/>
<url>/</url>
<content type="html"><![CDATA[<link rel="stylesheet" class="aplayer-secondary-style-marker" href="\assets\css\APlayer.min.css"><script src="\assets\js\APlayer.min.js" class="aplayer-secondary-script-marker"></script><script class="meting-secondary-script-marker" src="\assets\js\Meting.min.js"></script>]]></content>
</entry>
</search>