Coder Social home page Coder Social logo

wolfg1969 / nodemcu-weather-station Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 2.0 1.5 MB

基于 NodeMCU 实现的室内气象站,可显示室内温度、湿度、气压和室外温度、湿度、天气状况。

License: MIT License

Lua 100.00%
nodemcu lua iot domoticz weather temprature humidity barometer home-automation-system sensor bme280 dht esp8266

nodemcu-weather-station's Introduction

基于 NodeMCU 实现的室内气象站

可显示室内温度、湿度、气压和室外温度、湿度、天气状况。

prototype

domoticz

硬件

  • ESP8266
  • 128x64 i2c OLED (optional)
  • BMP280 Temp/Pressure sensor
  • DHTxx Temp/Humidity sensor
  • or BME280 Temp/Humidity/Pressure sensor

花费约 70 元左右

NodeMCU 固件定制

  • dev 分支 commit: 4095c26
  • 需要的模块:
    • bme280
    • crypto
    • dht
    • gpio
    • http
    • i2c
    • sjson
    • tmr
    • u8g
    • wifi
  • 字体
#define U8G_FONT_TABLE                          \
    U8G_FONT_TABLE_ENTRY(font_6x10)             \
    U8G_FONT_TABLE_ENTRY(font_helvR24)          \
    U8G_FONT_TABLE_ENTRY(font_9x18r)
#undef U8G_FONT_TABLE_ENTRY

参数配置

将 config.lua.txt 复制成 config.lua 并根据实际环境修改参数值

  OLED_ADDR = 0x3c,
  
  SDA_PIN = 1, -- SDA Pin, D1
  SCL_PIN = 2, -- SCL Pin, D2
  DHT_PIN = 3, -- DHT Pin, D3
  
  ALTITUDE = 72, -- 海拔高度
  
  WIFI_SSID = "<WIFI_SSID>",
  WIFI_PASSWD = "<WIFI_PASSWD>",
  
  DOMOTICZ_USER = "<DOMOTICZ_USER>",
  DOMOTICZ_PASSWD = "<DOMOTICZ_PASSWD>",
  DOMOTICZ_API_URL = "<DOMOTICZ_API_URL>",
  DOMOTICZ_INDOOR_DEVICE_ID = "<DOMOTICZ_INDOOR_DEVICE_ID>",
  DOMOTICZ_OUTDOOR_DEVICE_ID = "<DOMOTICZ_OUTDOOR_DEVICE_ID>"

Domoticz 集成

  • 室内传感器,接收 NodeMCU 上报的数据
    • 添加硬件,类型为 Dummy
    • 创建类型为 Temp + Humidity + Baro 的虚拟设备
    • 将此设备的 id 做为气象站的 DOMOTICZ_INDOOR_DEVICE_ID 参数值
  • 室外传感器,从和风天气接口获取外部气象数据 实况天气-now 接口
    • 添加类型为 HTTP/HTTPS poller 的硬件
    • 创建类型为 Temp + Humidity + Baro 的虚拟设备
      • 将此设备的 id 做为气象站的 DOMOTICZ_OUTDOOR_DEVICE_ID 参数值
    • 将 domoticz_server 目录下的 heweather-now-parser.lua 放到 Domoticz 服务器主目录下的 scripts/lua_parsers 目录中

nodemcu-weather-station's People

Contributors

wolfg1969 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gavin-mu laikee99

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.