HackMD
  • Prime
    Prime  Full-text search on all paid plans
    Search anywhere and reach everything in a Workspace with Prime plan.
    Got it
      • Create new note
      • Create a note from template
    • Prime  Full-text search on all paid plans
      Prime  Full-text search on all paid plans
      Search anywhere and reach everything in a Workspace with Prime plan.
      Got it
      • Sharing Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • More (Comment, Invitee)
      • Publishing
        Everyone on the web can find and read all notes of this public team.
        After the note is published, everyone on the web can find and read this note.
        See all published notes on profile page.
      • Commenting Enable
        Disabled Forbidden Owners Signed-in users Everyone
      • Permission
        • Forbidden
        • Owners
        • Signed-in users
        • Everyone
      • Invitee
      • No invitee
      • Options
      • Versions and GitHub Sync
      • Transfer ownership
      • Delete this note
      • Template
      • Save as template
      • Insert from template
      • Export
      • Dropbox
      • Google Drive
      • Gist
      • Import
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
      • Download
      • Markdown
      • HTML
      • Raw HTML
    Menu Sharing Create Help
    Create Create new note Create a note from template
    Menu
    Options
    Versions and GitHub Sync Transfer ownership Delete this note
    Export
    Dropbox Google Drive Gist
    Import
    Dropbox Google Drive Gist Clipboard
    Download
    Markdown HTML Raw HTML
    Back
    Sharing
    Sharing Link copied
    /edit
    View mode
    • Edit mode
    • View mode
    • Book mode
    • Slide mode
    Edit mode View mode Book mode Slide mode
    Note Permission
    Read
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    Write
    Only me
    • Only me
    • Signed-in users
    • Everyone
    Only me Signed-in users Everyone
    More (Comment, Invitee)
    Publishing
    Everyone on the web can find and read all notes of this public team.
    After the note is published, everyone on the web can find and read this note.
    See all published notes on profile page.
    More (Comment, Invitee)
    Commenting Enable
    Disabled Forbidden Owners Signed-in users Everyone
    Permission
    Owners
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Invitee
    No invitee
       owned this note    owned this note      
    Published Linked with GitHub
    Like BookmarkBookmarked
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Internet of Tubs @ Bornhack19 ![](https://i.imgur.com/Kn70PJa.jpg) ## Background Once upon a time at a hacker festival, there was a hot tub. It was there because Jérémie Zimmermann [had urged hackers](https://www.youtube.com/watch?v=KNw9_7AUIZ0) to take better care of themselves and one another. This inspired the wellness-area at Bornhack. ## The challenge After giving the water a whirl, richard42graham remembered working on a ["shitty addon"](https://hackaday.com/2019/03/20/introducing-the-shitty-add-on-v1-69bis-standard/) the year before during soldering practice, and wanted to combine the temperature sensor from this addon with a WiFi-connected _ESP8266_ chip. This would turn the hot tub into a quirky collaborative festival-project. Owing to its wood-burning stove and open-air location, the water temperature in the tub would naturally fluctuate. And while cooling it down is a relatively quick feat, raising it takes time, making it difficult to hit the sweet spot of around 40C celcius. Keeping the temperature up with team-alerts and beckoning new patrons with the temperature became the objectives. ## The process A team of two hackers (Richard & Max) soldered a sensor to an ESP chip and wrote some quick firmware and a web front-end. The hot tub was now connected to the internet: with a plastic bag weighed down with a stone, with wires sticking out of it, dangling inside the hot tub. The ESP8266 ran a simple HTTP server with a `/data` endpoint serving out a JSON array with temperature points (measured every 20 seconds), so a 5 hour timeseries graph could be drawn. ![](https://i.imgur.com/Ea5NXwG.jpg) ![](https://i.imgur.com/wvo7lC5.jpg) It was probably not a good idea to let everybody query the ESP directly, especially after gaining popularity, so it was quickly decided that we would have to build something in front of it. MQTT seemed like an obvious way to publish the sensor data, so we hacked together a scraper extracting the latest measurement from the existing endpoint, with the aim to change the webinterface to do the same later. With the data made public in a reliable way, it was now possible to retrieve the temperature for the obligatory IRC and Twitter bots, which still had to be coded. This proved to be a challenge, given most IRC bot frameworks apparently were not actively maintained. After some pain and grief, we settled with Sopel. People could query the bot about the current temperature, and it would alert when the water was getting too cold (so more wood could be put in), or if the water was good to jump in. On top of that, the Ohmlights, some LED torches present all over the camp site gained a "Hot Tub Mode", streaming the current temperature in a marquee font. The campsite solder gave up around midnight, which left our fancy new inventions showing 0.0 degrees, so the unit had to be retreived; a good opportunity to improve the firmware. Next day, we fired up the Arduino IDE and the ESP8266 toolchain and had to fight a bit, because the Arduino IDE was packaged in a snap which didn't have permission to access the `/dev/ttyUSB0` serial device. We updated the firmware of the ESP so it would push to MQTT directly, rendering the scraper obsolete. As written above, we weren't quite happy about the rudimentary HTML temperature graph, so this needed to be improved as well. With the data already being exposed over MQTT, we could set up a Telegraf datalogger, which would subscribe to the MQTT broker and dump the temperature into InfluxDB, a time series database. Afterwards we could get shiny graphs thanks to Grafana, so people in the bar could easily read the temperature from a less crappy frontend, without having to leave their beer alone. ![](https://i.imgur.com/F4xg8zs.jpg) At the end of the festival, the tools and gadgets we had created worked quite well, and ideas for future updates were many. Some new ideas include showing how many people are in the hot tub (using lasers, mats, or heat-sensing cameras), as well as changing the temperature sensor to a waterproof one (to get rid of the plastic-bag waterproofing), and temperature-dependent text color on the Ohmlights. BOM: ESP8266 LM1117 (linear regulator 5v to 3v) DC-DC regulator (12 to 5V) Temperature sensor TMP112 DC-DC regulator 75WH battery team: richard42graham (esp + firmware) 0m-ax (esp + firmware) flokli (mqtt + irc bot + grafana + writeup) Pawel (twitter bot) eightdot (ohmlights) baskee (irc bot + writeup) IRC & Twitter Bot + Ohmlight script + ESP firmware + MQTT scraper: https://gitlab.com/flokli/bornhack-hottub Ohmlight design https://bitlair.nl/Projects/Ohm_led_strip_sleeves

    Import from clipboard

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lost their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template is not available.


    Upgrade

    All
    • All
    • Team
    No template found.

    Create custom template


    Upgrade

    Delete template

    Do you really want to delete this template?

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Tutorials

    Book Mode Tutorial

    Slide Mode Tutorial

    YAML Metadata

    Contacts

    Facebook

    Twitter

    Feedback

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions

    Versions and GitHub Sync

    Sign in to link this note to GitHub Learn more
    This note is not linked with GitHub Learn more
     
    Add badge Pull Push GitHub Link Settings
    Upgrade now

    Version named by    

    More Less
    • Edit
    • Delete

    Note content is identical to the latest version.
    Compare with
      Choose a version
      No search result
      Version not found

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub

        Please sign in to GitHub and install the HackMD app on your GitHub repo. Learn more

         Sign in to GitHub

        HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Available push count

        Upgrade

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Upgrade

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully