ESP8266-DS18S20

From Hackerspace ACKspace
Revision as of 10:10, 22 September 2015 by Xopr (talk | contribs) (made code block collapsible)
Jump to: navigation, search
Project: ESP8266-DS18S20
Featured:
State Completed
Members xopr
GitHub No GitHub project defined. Add your project here.
Description Creating a wireless SpaceAPI-like sensor
Picture
No project picture! Fill in form Picture or Upload a jpeg here


This code is deprecated and had been replaced by the new SpaceAPI's space state

Also, the code is somewhat ugly, but it worked..

the PCB that powers the ESP8266

synopsis

This sketch provides a webserver-like interface and provides a json file (somewhat compatible with SpaceAPI).

The json will provide the DS18S20 temperature sensor's address and temperature in °C, and will look like:

{
  "sensors":{
    "ext_temp_count":2,
    "temperature":[
      {
        "ext_index":0,
        "value":-127.0,
        "unit":"°C",
        "ext_address":"00112233445566"
      },
      {
        "ext_index":0,
        "value":85.0,
        "unit":"°C",
        "ext_address":"99AABBCCDDEEFF"
      }
    ]
  }
}

Note: the ext_temp_count and ext_index fields are only visible in debug mode (GPIO0 pulled to ground)

code

ESP8266-DS18S20.ino

Click here to view the source code