feat: update

This commit is contained in:
eric
2023-04-25 19:19:17 +08:00
parent e3312c6568
commit d62c4a8fc8
14 changed files with 147 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

View File

@@ -0,0 +1 @@

27
公众号/联系我.md Normal file
View 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
View File

@@ -0,0 +1 @@

118
草稿/EC20发短信.md Normal file
View 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`
![](https://hackrobot-1258475618.cos.ap-shenzhen-fsi.myqcloud.com/202304251728281.png)
> 为什么我不用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('请检查网络')
```
最后,别用`中国移动`,趁早携号转网吧