V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
ruoyu0088
V2EX  ›  Python

用 ESP8266+MicroPython 实现了空调的远程遥控

  •  
  •   ruoyu0088 · Oct 15, 2017 · 17421 views
    This topic created in 3115 days ago, the information mentioned may be changed or developed.

    16 元买的 ESP8266 的开发板,安装上 MicroPython。加上一个红外线 LED,一个电阻,一个温度传感器 DTH22。然后设置成 WebSocket 服务器,就可以用手机查看家里的温度,控制空调的开关了。

    遥控器的信号是使用 TSOP38238 解调,然后用 30 元的逻辑分析仪捕捉。

    https://github.com/ruoyu0088/esp8266_ir

    26 replies    2018-12-17 13:59:14 +08:00
    qiukun
        1
    qiukun  
       Oct 15, 2017
    jyf
        2
    jyf  
       Oct 15, 2017   ❤️ 1
    可以接上 mqtt
    chroming
        3
    chroming  
       Oct 15, 2017 via Android
    感谢分享
    brucewzp
        4
    brucewzp  
       Oct 15, 2017 via iPhone
    曾经我也迷恋过根据天气自动调节温度,直到有一天我发现窗户没关。。。
    zonghua
        5
    zonghua  
       Oct 15, 2017 via iPhone
    你用什么工具上传代码的?我试过 esploer 上传代码竟然会丢失换行符,丢失缩进
    ma6254
        6
    ma6254  
       Oct 15, 2017 via Android   ❤️ 1
    我自己是用 nodemcu 固件,上传代码用 nodemcu-uploader,编辑用 vscode
    zonghua
        7
    zonghua  
       Oct 15, 2017 via iPhone
    @ma6254 遥控编码怎么得来的呢,想过用红外接收管录制,但是没有红外接收管
    ruoyu0088
        8
    ruoyu0088  
    OP
       Oct 15, 2017   ❤️ 1
    我是用 https://github.com/micropython/webrepl 上传代码,遥控代码是直接用逻辑分析仪获取解调波形。
    facat
        9
    facat  
       Oct 15, 2017 via Android
    @ruoyu0088 请问用的是哪个逻辑分析仪?
    XIVN1987
        10
    XIVN1987  
       Oct 15, 2017
    建议换 ESP32,贵不了几块钱,,性能更高、内存更大,,可玩儿性更高
    ruoyu0088
        11
    ruoyu0088  
    OP
       Oct 15, 2017   ❤️ 1
    zonghua
        12
    zonghua  
       Oct 15, 2017

    @ma6254 https://github.com/adafruit/ampy 刚才看了视频()发现这个命令行工具更好用
    ruoyu0088
        13
    ruoyu0088  
    OP
       Oct 15, 2017   ❤️ 1
    @zonghua 这个工具使用串口通信,应该只能是在 main.py 程序结束,进入 REPL 时才能使用。而 webrepl 通过 websocket 通信上传文件,可以在主程序运行时上传下载文件。webrepl 也提供了命令行工具上传下载。
    1314258
        14
    1314258  
       Oct 15, 2017 via iPhone
    @brucewzp 把自动开关窗也做上
    mintist
        15
    mintist  
       Oct 15, 2017
    问下,如果在路由器内网,如何访问 ESP8266 的 WebSocket 服务器?
    ashong
        16
    ashong  
       Oct 15, 2017
    小米有个空调伴侣很好用, 就是贵点儿
    ruoyu0088
        17
    ruoyu0088  
    OP
       Oct 15, 2017   ❤️ 1
    @mintist 我的路由器可以设置端口映射,把 websocket 的端口,映射到内网的 esp8266 的 IP 上即可。
    zonghua
        18
    zonghua  
       Oct 15, 2017
    @ruoyu0088 我想实现国内某个物联网平台 MQTT 客户端的授权过程,结果一堆加密的库不兼容😂
    freehere
        19
    freehere  
       Oct 15, 2017
    赞,学习了
    brucewzp
        20
    brucewzp  
       Oct 15, 2017 via iPhone
    @1314258 关个窗帘可以搞,窗户的话成本就太大了
    dangyuluo
        21
    dangyuluo  
       Oct 15, 2017
    哈哈不错,最近正好有一个类似的项目,代码拿来学习了。
    but0n
        22
    but0n  
       Oct 15, 2017
    @zonghua 红外接收管可以用 VS838 https://github.com/but0n/IrDA-stm32
    alang
        23
    alang  
       Oct 16, 2017 via iPhone
    工科狗
    mintist
        24
    mintist  
       Oct 16, 2017
    @ruoyu0088 了解,谢谢
    smallgoogle
        25
    smallgoogle  
       Nov 27, 2018
    大佬。求个联系方式。我卡在 8266 红外这好久了。
    Livynwa
        26
    Livynwa  
       Dec 17, 2018
    能留个联系方式吗?最近有个设计跟你差不多,大佬看到回复我一下
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   919 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 57ms · UTC 22:33 · PVG 06:33 · LAX 15:33 · JFK 18:33
    ♥ Do have faith in what you're doing.