feat: update
BIN
images/060c748a1a82bbf002fc7e3c899d3920ac4d576b.png
Normal file
|
After Width: | Height: | Size: 632 KiB |
BIN
images/12930fa337eaf778a475840c34b9c43473d8489a.png
Normal file
|
After Width: | Height: | Size: 1.2 MiB |
BIN
images/1e5c7b5a0f0916f0a11ed434fbdeb689751416b8.jpeg
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
images/5b2457c3fa53a7ea4d642a1d35c3ff45caef28aa.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
BIN
images/7ff9c0779ea4b8b03217b0fa493310b0bfb9212c.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
images/8fdb77c6c6237fa88719a8b9891a65bc17f9af4c.png
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
images/a70b8fd1af5bfe023463bcde9a327e5d4dccb229.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
images/d08fd530eecba4d7abb0f30cb3b8b5dbd528479c.jpeg
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
images/df8f067cc06fd98b8c7469d30198397e81d32bd8.png
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
images/fa38a0bb67e9875c86fdeefa1ff1ec774c996cad.png
Normal file
|
After Width: | Height: | Size: 256 KiB |
1
公众号/添加微信.md
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
27
公众号/联系我.md
Normal file
@@ -0,0 +1,27 @@
|
||||
## 添加好友
|
||||
|
||||
> 微信机器人-bot模式
|
||||
|
||||
**长按文末底部二维码,识别添加好友**
|
||||
|
||||
微信号,接入了微信机器人: `微信对话开放平台` [^1] 以及`ChatGPT`[^2]
|
||||
|
||||
请注意:
|
||||
|
||||
- 微信机器人,24小时*运行在`安卓开发板`上
|
||||
|
||||
- 白天一般不看消息,`晚上偶尔`一律人工集中处理
|
||||
|
||||
---[1] Introducing ChatGPT: https://openai.com/blog/chatgpt
|
||||
|
||||
## 加群
|
||||
|
||||
> 自动邀请加入微信群
|
||||
|
||||
给`微信个人号` 发送关键词: 加群
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304222331835.png" title="" alt="" width="217">
|
||||
|
||||
[^1]: 微信对话开放平台: https://chatbot.weixin.qq.com/
|
||||
|
||||
[^2]: [Introducing ChatGPT](https://openai.com/blog/chatgpt)
|
||||
1
草稿/4g模块.md
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
118
草稿/EC20发短信.md
Normal file
@@ -0,0 +1,118 @@
|
||||
## EC20模块收发短信
|
||||
|
||||
> 使用4g模块,而不是GSM模块
|
||||
|
||||
通信运营商允许申请`副卡`,共享主卡的自费套餐,比如电话/短信/流量
|
||||
|
||||
通常副卡要收费10元/月,没有其他费用
|
||||
|
||||
但是能拥有一个全新的手机号,用作工作(区分生活)或者注册验证网站也挺好的
|
||||
|
||||
这个时候往往会遇到问题:比如出门只带一个手机,,或者出省旅游/出国也需要接发短信
|
||||
|
||||
托管sim卡,正常`收发短信`,就是一个小需求
|
||||
|
||||
另外,通过底层的AT指令,还可以实现`闪信`,也就是`0级短信`,也成`flash sms`
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251726778.jpeg" title="" alt="" width="229">
|
||||
|
||||
本篇文章用到的设备
|
||||
|
||||
- orange pi 3 lts,价格约250
|
||||
|
||||
- EC20 usb模块 价格约180 (+吸盘天线)
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251727812.png" title="" alt="" width="248">
|
||||
|
||||
实现的功能
|
||||
|
||||
- 短信:文本短信/静默短信/闪信
|
||||
|
||||
- 打电话/tts语音生成
|
||||
|
||||
- 4g流量网络
|
||||
|
||||
- gps定位
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251727855.png" title="" alt="" width="315">
|
||||
|
||||
---
|
||||
|
||||
## 串口调试
|
||||
|
||||
> 串口通信,AT指令
|
||||
|
||||
windows上下载`串口调试助手`, 回复关键词 `串口`可以获取
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251727862.png" title="" alt="" width="231">
|
||||
|
||||
另外发送短信,有`text和pdu模式`,需要对文字和手机号进行编码,可以使用转换工具
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251728200.png" title="" alt="" width="265">
|
||||
|
||||
通信模块的AT指令,基本相同,会有细微的差别,可参考相关手册
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251728491.png" title="" alt="" width="281">
|
||||
|
||||
---
|
||||
|
||||
## python调试串口
|
||||
|
||||
> 使用pyserial设置AT指令
|
||||
|
||||
```python
|
||||
import serial
|
||||
modem = serial.Serial(port='COM8', baudrate=9600)
|
||||
modem.write(("AT"+"\r\n").encode())
|
||||
```
|
||||
|
||||
注意在windows系统上,设备端口是`COM8`,在linux上的设备一般是`/dev/ttyUSB`
|
||||
|
||||

|
||||
|
||||
> 为什么我不用gammu
|
||||
|
||||
gammu是针对通信模块的框架,安装后,可以自动接受短信,守护进程
|
||||
|
||||
也可以发短信
|
||||
|
||||
并且有前端网页,后端数据集成
|
||||
|
||||
但是,对于配置类的约束,个人更倾向于python控制AT指令,封装成api
|
||||
|
||||
更好的实现业务逻辑,和改造
|
||||
|
||||
---
|
||||
|
||||
## 使用telegram bot进行转发
|
||||
|
||||
> 设置tg机器人,使用get请求即可
|
||||
|
||||
在telegram
|
||||
|
||||
- 申请一个bot机器人,获取token
|
||||
|
||||
- 创建群组,然后获取群组的chatid
|
||||
|
||||
就可以实现转发message消息
|
||||
|
||||
<img src="https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251728792.jpeg" title="" alt="" width="292">
|
||||
|
||||
参考代码
|
||||
|
||||
```python
|
||||
import requests
|
||||
# bot发消息到tg群组
|
||||
def sendTg(message):
|
||||
baseUrl="https://api.telegram.org/bot"
|
||||
toekn="558659722:AA32A3v8gK23q7R7_nsr8V58Iu-_Z6B232SCw"
|
||||
chat_id="-861532r23527609"
|
||||
text=message
|
||||
url=f'{baseUrl}{toekn}/sendMessage?chat_id={chat_id}&text={text}'
|
||||
try:
|
||||
r = requests.get(url)
|
||||
except:
|
||||
print('请检查网络')
|
||||
```
|
||||
|
||||
最后,别用`中国移动`,趁早携号转网吧
|
||||