Giter Site home page Giter Site logo

boris1993 / sms_forwarder_air780_esp32 Goto Github PK

View Code? Open in Web Editor NEW
154.0 4.0 35.0 10.95 MB

使用合宙ESP32和Air780E构建的短信转发器

License: MIT License

Lua 100.00%
air780e esp32 esp32c3 esp32s3 lua luat luatos sms-forward sms-forwarder sms-forwarding

sms_forwarder_air780_esp32's Introduction

Air780E短信转发

利用ESP32驱动Air780E实现短信转发,兼容合宙ESP32S3和ESP32C3。

⚠ 仅支持联通、移动网络,不支持电信网络 ⚠

功能

  • 自动转发收到的短信,短信内容支持多种语言(其实就是ASCII和UCS-2字符集),目前已测试过英文、中文、日语、俄语字符
  • 支持多个推送平台,目前接入:

使用方法

硬件组装

  • 短接POW键上方的焊盘实现通电即开机

  • 按照下图方向为Air780e和ESP32焊上排针和排座。注意合宙不送排座,需要自己买。
Air780E ESP32S3
  • 按图示方向插入SIM卡

  • 按图示方向将Air780E和ESP32组合

为Air780e刷入AT固件

USB连接Air780e,选择 Luatools/resource/618_lua_lod/版本号 目录下的AT固件,将其烧录到Air780e。

修改脚本,刷入ESP32

  • 修改config.lua
    • 修改config.board_type为正确的型号,可选值见注释
    • 修改config.wifi,填入无线网络的SSID和密码
    • 修改config.notification_channel,将要启用的通知通道的enabled配置置为true,并填写推送平台相关配置
  • 烧录脚本
    • firmware目录中对应的固件烧入开发板
    • 将所有lua脚本下载至开发板
    • 将开发板上电开机,等待初始化完成后,即可转发短信到配置的通知通道

LED灯状态含义

  • ESP32
    • C3的D4或S3的LED A为初始化状态灯,闪烁代表正在初始化,常亮代表初始化完成,准备转发短信
    • C3的D5或S3的LED B为工作状态灯,平时长灭,收到新短信后高频闪烁,转发完成后熄灭
ESP32C3 ESP32S3
  • Air780
    • POW灯为电源指示灯,通电后常亮。注意,这个LED不代表开机状态,只要板子有电这个灯就会亮
    • NET灯为网络状态指示灯,长亮短灭代表正在初始化蜂窝网络,短亮长灭代表网络注册成功,可以接收短信

Firmware目录下的文件说明

  • LuatOS-SoC_V1004_ESP32C3_classic.soc对应ESP32C3 经典款
  • LuatOS-SoC_V1004_ESP32C3_lite.soc对应ESP32C3 简约款
  • LuatOS-SoC_V1004_ESP32S3.soc对应ESP32S3

固件均通过合宙云编译精简掉了不需要的功能,以保证内存空间充足。LuaTools自动下载的固件不能用,系统启动之后内存就不够用了,发不出去HTTP请求。

目前固件包含gpiouartpwmwdtcryptortcnetworksntptlswlanpmcjsonntpshelldbg

致谢

本项目参考低成本短信转发器而来,尤其是PDU相关代码,没有chenxuuu的这份项目和50元内自制短信转发器(Air780E+ESP32C3)这篇文章,我不会这么快就完成开发。

赞助

支付宝 微信 Bitcoin
3H8yBE359vkbpvC4nSP5xwafWThUh4JvGB

sms_forwarder_air780_esp32's People

Contributors

boris1993 avatar mmdjiji avatar nipgeihou avatar sth0409 avatar wongjg avatar wzxjohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sms_forwarder_air780_esp32's Issues

建议将项目中的 Server酱 链接换成推荐链接

您好,我是 Server酱的作者 Easy 。注意到您的项目中对接或提及了 Server酱,非常感谢对我们的支持。

这里有一个小建议。Server酱最近推出了「推荐返现计划」,您可以在项目中Server酱的官网链接后边加上推荐参数,这样在用户从这里进入Server酱并订阅会员后,您的项目将获得2元/单的佣金。

只需要用微信登录fx.ftqq.com ,然后开通计划就可以获得您的推荐链接,佣金会实时地转入开通账号的微信零钱中。

希望这个计划能让您的开源项目更好。


Hello, I am Easy, the author of ServerChan. I noticed that your project has integrated or mentioned ServerChan, and I am very grateful for that.

I have a small suggestion. ServerChan has recently launched a "Referral Cashback Program". You can add a referral parameter to the link to ServerChan's official website in your project. This way, when users enter ServerChan through your link and subscribe to a membership, your project will earn a commission of 2 RMB per subscription.

You just need to log in to fx.ftqq.com with WeChat, activate the program, and you will get your referral link. The commission will be instantly transferred to the WeChat Wallet of the account that activated the program.

Even though the earnings might not be substantial, I hope this program can provide some additional support for your open-source project.

某些时候air780读到sim需要几秒时间,过早AT命令会错误的提示:未检测到SIM卡

首先感谢作者的奉献精神!

代码整体是正常能实现并且好用的,但是我有其中一张卡,一直报“未检测到SIM卡”

问题原因:后来经过排查发现air780启动后几秒内AT命令会返回未插卡,但是几秒后就会检测到,但是目前代码中,开机会立即检测,导致报错后程序就停止了(是某些SIM卡的问题。我别的卡都正常,就一张会这样)

解决办法:
我目前是在“初始化Air780”第一行加了几秒延时,就避免了这个错误

也可以在检测sim中加入判断死循环更加稳妥,反正没检测到卡后面也不需要继续了

Air780E日志报错

下方是一直刷屏的日志,不知道是怎么回事。貌似Air780E只要一开机就出现这些日志。

[2023-10-14 19:51:29.269] @i.���@0H��I ��@@DP�bHMA�cHF��d�$6$6D�D �$G$dd�a����!��A�A MA�"@� �� M
[2023-10-14 19:51:29.269] #@+ � 5H<5�db�$�H}@� �H d� �A>:�� @=���Hl yO��� �@�d��J� 66�$,R� �"@䠌&dT`
[2023-10-14 19:51:29.269] R ��$"� �!D

[2023-10-14 19:51:29.269] N�Dp@F0 4 E�2 " � m%@TLp�$� Qd�@X @Hk�@H}@�@,2`,1 ��� @2�H �$N��
[2023-10-14 19:51:29.269] ��d�}
[2023-10-14 19:51:29.269] ERR

[2023-10-14 19:51:29.411] �xDC#�D�T�""�!�i�L�@� �@h�}m``hm"hhm"""hhm"h@@"@m"@m"HH@@h
[2023-10-14 19:51:29.411] ERR

[2023-10-14 19:51:29.534] @��a"(�I��Ā�a5� x 0e�p
#$X$XH$IYY$X$HHI$Y�
[2023-10-14 19:51:29.534] ERR

[2023-10-14 19:51:29.657] �WD#�D��p�@}�4H ty��"@ |Ʉy���@ xɄy�2�E�
l�l ee%�D$,l̄�А��
[2023-10-14 19:51:29.657] ERR

[2023-10-14 19:51:29.782] � �`(
^"k�y!@�t:1]Ok 6"�
�d6d<�

l�,?,>L
L"
,�,6l�Hk"<@k)Hnk@(H HI@�

[2023-10-14 19:51:29.782] ERR

[2023-10-14 19:51:29.908] �v
[2023-10-14 19:51:29.908] �6&� ɛk�� f`"o��ox�����"H"hhho"``�Z
[2023-10-14 19:51:29.908] ERR

[2023-10-14 19:51:30.035] y!��'<P�B��HF��
G�HO�@���x���D�$D�$"���$Mx����x���D�a

[2023-10-14 19:51:30.035] ERR

[2023-10-14 19:51:30.158] ��6��6 8�9�@i���"H��@��`I"@k"@"kpHpppp�
[2023-10-14 19:51:30.158] ERR

[2023-10-14 19:51:30.286] !I��!p`0H&I*�&@1Ak@$kDfG�x��,,,,
ix�
x���m��$x���m��
[2023-10-14 19:51:30.286] ERR

[2023-10-14 19:51:30.567] ȅ�D��D=����)�"@�@y�!�@"HM�@@
�npe�&e�&p%�Fpd�f�f@k"�p�p�
������ 7�H hL S�De� =�����1 ��� � Q@@e"�� ��=d�D3�� _�,vWH}@� Q [H2" ]�� _@�Ud�ID�@�U@��$M_D'a�$����_�� %@ 4}&!J�$�D@&�� �MD1l e �A��$�D�& D�"@�� X�$l� $ �{&�DKw�� ��B [2023-10-14 19:51:30.567] iedu���H`%�2 D$2 k�2m��dg
[2023-10-14 19:51:30.567] ERR

[2023-10-14 19:51:30.660] ��0$@l̐E�M�`�S"0 bpf O��h�$ ���, �@@@k@H�H��@@@@k@(k@ k@�
[2023-10-14 19:51:30.660] ERR

[2023-10-14 19:51:30.784] �2m��� �6 ��ȴ����"@ii@y@h @&HE�@�`@"��H"���lk���dx����d�ix�I�����L�"�b�"BB"B
[2023-10-14 19:51:30.784] ERR

[2023-10-14 19:51:30.908] d�j"@@
[2023-10-14 19:51:30.908] �
���`H�DD$$DD�d䄄䄄䄦g�����b�cd��o����Ј
[2023-10-14 19:51:30.908] ERR

[2023-10-14 19:51:31.048] @�N60 ��d��#�(x K"�-�
LLL$Lx��lDl�lix���dDDLLLK"@#K"hh"hK""`"H
[2023-10-14 19:51:31.048] ERR

[2023-10-14 19:51:31.174] , k��h"�1,0$@(
r�8 "Ȉk1�kH�GG#k GGk#IH"X"XX"�
[2023-10-14 19:51:31.174] ERR

[2023-10-14 19:51:31.298] �L6 0�K��h!y�i"h���kh)& @/ @?@/@�@�@
@�@�@�@6 @&@?@�
[2023-10-14 19:51:31.298] ERR

[2023-10-14 19:51:31.423] ���H�Lj@pȈ��I��kH@1
k@AdH@kH 2D"�dkHdk�+m%�k�
} $k@ �L$Dk@ :"��kH "D&d@@k@@"�
[2023-10-14 19:51:31.423] ERR

[2023-10-14 19:51:31.546] B�qy{8vib@�Y�loIk`D�&��&%I1�d�1�

[2023-10-14 19:51:31.546] $
1&l1 ,I1�E�%EIfII�IIIIII�.O.
[2023-10-14 19:51:31.546] ERR

[2023-10-14 19:51:31.909] 1

~M��,�k�"HL0LHx��```� � @ k 0�@ kh+$@ h=@ @ k+ @ � @ k@@*kh@h@`@@@@@@hh� �T�`� B@ O���`2�
�d$M
� 6`p�$! ��
� v@{� 2� DP! �,�!H}@�� ` ` H ` �AM
Z��� Y�=�@&���Hl
P1�-#A���3 b�@���)J$�`��4� (R�`�"@@ �@ (�
�D�D& e��D$A�3D��M �X �dp@F@ 4 �� $" �� m%`r`C�� �&amp;@`�DH @$"i$Hu@�`%@� H�$ ����D �D#P ` �@d��
[2023-10-14 19:51:31.909] ERR

[2023-10-14 19:51:32.050] D(���"H ԰0İO�Ȱ��
*m�"H#p&@��DmȁbHm�@@"B"�b��bB"Bb¢¢f��f�&F&�fFƦ憦B"Bb�bB"�B"¢¢&H�
[2023-10-14 19:51:32.050] ERR

[2023-10-14 19:51:32.174] dӲ0$@}s���""�9,Ymā$�!m
lx�,h�@
@l@l@�@�$@d@`HHH@"&&HH@�
[2023-10-14 19:51:32.174] ERR

[2023-10-14 19:51:32.298] ���,��KQ"H԰O0 aā�
�My�``�!hK"�!x,MM x�
M �Mx��$0x�,M"�!��!��!��a�k��@"
[2023-10-14 19:51:32.298] ERR

[2023-10-14 19:51:32.423] `@�"��X3x���1�k@1k@�& �ϝH&�kHHɩ@&#h�
[2023-10-14 19:51:32.423] ERR

[2023-10-14 19:51:32.549] ඉ�q8Ј��3�ɜ~rk3�Irok3�Iz�k@m�1k@��/H I#, Xe/X@@@fk"@@�
[2023-10-14 19:51:32.549] ERR

[2023-10-14 19:51:32.674] $<��D �D@0��*�" @i@l [2023-10-14 19:51:32.674] ( I��dx�l�Il� x�L�Lk(�d� [2023-10-14 19:51:32.674] �i��K�O�O�K��:A
[2023-10-14 19:51:32.674] ERR

[2023-10-14 19:51:32.799] 8`�i"oH�@0@�ӉD1kH%opl.l.p
N'&pef&pņpp�"*�bb�bB"�b�¢ʪ

[2023-10-14 19:51:32.799] ERR

[2023-10-14 19:51:32.924] �
[2023-10-14 19:51:32.924] 0Æ8��I
M��h���Թ@�h@��,x��,M��)�
[2023-10-14 19:51:32.924] Gh�
G h� ,G/k 4�III&XX&��
[2023-10-14 19:51:32.924] ERR

[2023-10-14 19:51:33.172] H9�Y11ߜ&i���hۚ��Ɋ�o�``"h��� mx�x�����"�� ���x�x�
�,������͍��h�{ )H h����� @�! d �% a�� �( �� $2� 2}rr� : $ �1``� < d�$�H6P �� 5d�,1{7�b@g��$t}&� �a�1@ D���4@�6 @�@ @& �7 f�� 9$�@���&H� Da�D`� D d��C� � �@@ �@`�@0b�"�$200A>��}��k�@hɈ`
[2023-10-14 19:51:33.172] `�`�`�0<�20�2D$H$dH�@��`�D10�
[2023-10-14 19:51:33.172] ERR

[2023-10-14 19:51:33.315] '
$Xb�A�6 �@���#Ȉ@2�ϯh
ɀ60ߣ0�� �,��� 4@dk@���@@@HkHmk@@@"@@"@mk���
[2023-10-14 19:51:33.315] ERR

[2023-10-14 19:51:33.438] �k ��7M :p��H�"�`@@"H"H""@
[2023-10-14 19:51:33.438] ERR

[2023-10-14 19:51:33.562] �D@�p��(h�"@�@�`@o��@1�k�"I�
[2023-10-14 19:51:33.562] ERR

[2023-10-14 19:51:33.794] Ј &��X@'y��k�k@#.I"�kH#.I*�# @�1�@�Iik�$ik%@@ k@���@
[2023-10-14 19:51:33.794] ERR

[2023-10-14 19:51:33.917] �+�08mABā�L�@��mgA1kH�I�kH�(�,k@m,k�)?Dk 8.dk@dmk 0��k��lk� ?"?@k@lk@@ H�
[2023-10-14 19:51:33.917] ERR

[2023-10-14 19:51:34.181] &4 0� 1@yy� H�"(L x��l�dm(��Lx(L"��L�ex�H"H@M"@��`0�( ֖}* 1@h�$� %HZ!m�i�?6و�._H � �����
[2023-10-14 19:51:34.181] ERR

[2023-10-14 19:51:34.435] p@0� " S�@�*H�lx0 �dF @b'@`Xd�$�$k�x� �L @@o"@@o"@"@H"HH"o"� 18� IB �`�h`!��10 [2023-10-14 19:51:34.435] }@�v �@ #z$! w$�H}@
��䐃 �$� @�@�=$ D$2dD Ĉ$$,�@d}گd%���o�%�$��&���$& ��D@ �@& �7 b�� f@Y�D1D�����&\A�&d��M X��^�@�� $$:pR � $�@'@v@$�p$ DH��$� �D� `

@�� &
� @@�`` D˚h�$E �0l 1n")
[2023-10-14 19:51:34.435] 01n3���EB � E񇖘ޘLY�%!8 61��b1�l1��l1@ @���[ (�)�%H�����h+�AH"�@d�p�$�
$d$"*Hdr��2D�
[2023-10-14 19:51:34.435] �D@j
+
�Lh'�8Āl(�%�
[2023-10-14 19:51:34.435] N��@D6@ ��
0d@
@m@$�
*$)H�`
TE @m(�%d}`�"` `\L@HL# h,$%@2@H, h�2��@� �&� &1`{dpHr�X
[2023-10-14 19:51:34.435] ERR

[2023-10-14 19:51:34.550] O(@"A���<$���YöK @Ӏ�mh@ <��`k�HP%Ҵ$HkHiI$$HkI"iʪ�"(����+FƦ"(e����A�bB

[2023-10-14 19:51:34.550] ERR

[2023-10-14 19:51:34.681] �
�o0d@(ĚPq���
�,��+&����,<ٞ,(Kx"���



�,�
[2023-10-14 19:51:34.681] k��HH�Y�YY�HH�X�$II�$
[2023-10-14 19:51:34.681] ERR

[2023-10-14 19:51:34.805] ii�H1 ��$���ρ����H�$y�$x�i�#φ H&HH&X�
[2023-10-14 19:51:34.805] ERR

[2023-10-14 19:51:34.931] @�t����q�fa��Թ@e���@
�%���d�d
�dD�d$�lx�_�L�L�Li�x(�n�L�l�d`I�("�h:h�
[2023-10-14 19:51:34.931] ERR

[2023-10-14 19:51:35.069] b7 P�@�7��q7x0h�l@�@D���H�ll

Eńń"@o"@"@"@"O"HHO"H@� b
[2023-10-14 19:51:35.069] ERR

添加gotify自建推送服务支持

使用gotify的http api发送消息推送

notification_helper.lua添加

local function gotify(sender_number, content)
    if not config.notification_channel.gotify.enabled then
        return
    end
    if utils.is_empty(config.notification_channel.gotify.host) then
        log.warn("notification_helper", "gotify host 未填写,跳过调用gotify")
        return
    end
    log.info("notification_helper", "正在发送gotify通知")
    local request_body = {
        title = sender_number,
        priority = config.notification_channel.gotify.priority,
        message = content
    }
    local schema = "http"
    if config.notification_channel.gotify.ssl then
        schema = "https"
    end
    local code, headers, response_body = http.request(
        "POST",
        schema .. "://" .. config.notification_channel.gotify.host .. ":" .. config.notification_channel.gotify.port .. "/message?token=" .. config.notification_channel.gotify.app_token,
        { ["Content-Type"] = "application/json" },
        json.encode(request_body)
    ).wait()
    if code ~= 200 then
        log.warn("notification_helper", "gotify发送消息失败,HTTP状态码:" .. code .. ",响应内容:" .. (response_body or ""))
    end
    log.info("notification_helper", "gotify通知发送完成")
end

local notification_channels = {
    bark = bark,
    luatos_notification = luatos_notification,
    server_chan = server_chan,
    ding_talk_bot = ding_talk_bot,
    pushplus = pushplus,
    telegram_bot = telegram_bot,
    feishu_bot = feishu_bot,
    wecom_bot = wecom_bot,
    gotify = gotify,
}

config.lua添加

config.notification_channel = {
// ...
gotify = {
        enabled = false,
        ssl = false,
        app_token = "",
        host = "",
        port = 80,
        priority = 5
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.