Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.98 KB

README.en.md

File metadata and controls

57 lines (42 loc) · 1.98 KB

oled-station

The station for displaying any kind of info on the screen via MQTT protocol. Inspired by https://github.com/nfriedly/nodemcu-weather-station.

At this moment the device can display time, weather (temperature humidity pressure and dark sky icon from http://forecast.io), text message, image. Any other type of information to display can be easy added, look at software part of this README.

Demo video

Hardware

The device itself

Parts inside

Parts 2

Software

Device connect to MQTT broker and subscribe to oled/events/+ When a message arrives module will run a handler according to the last part of a topic.

mqtt:on("message", function(conn, topic, data)
    local start = tmr.now()
    print(topic,node.heap())
            if  topic:match('weather$') then
                dolc('weather',data)
            elseif topic:match('message$') then
                dolc('message',data)
            elseif topic:match('image$') then
                dolc('image',data)
            elseif topic:match('gird$') then
                dolc('gird')
            elseif topic:match('test$') then
                dolc('test',data)
            elseif topic:match('setTime$') then
                dolc('settime',data)
            elseif topic:match('save$') then
                dolc('save',data)
            end

    data = nil
    topic =nil
         
    collectgarbage()
end)

Controlled with Node-RED flows