Giter VIP home page Giter VIP logo

hakaru's Introduction

hakaru

Stream the sensor data

sequenceDiagram
    participant ESP32 as ESP32
    participant Client as MQTT Client
    participant TouchSensor as Touch Sensor

    ESP32->>+Client: Start streaming data
    Client->>ESP32: Send message to sleep
    ESP32->>+ESP32: Enter deep sleep mode
    TouchSensor->>ESP32: Touch GPIO 4
    ESP32-->>-ESP32: Wake up from deep sleep
    ESP32->>+ESP32: Start booting
Loading

Set up WiFi

  1. Connect to the ESP32's WiFi AP
  2. Open http://192.168.1.1
  3. Select the SSID and enter the password of the WiFi network

Then the ESP32 will connect to the WiFi network and start streaming data.
The WiFi configuration will be saved in the flash memory.

Check if the ESP32 is connected to the WiFi network

ping opencmm.local

Install Mosquitto MQTT Broker

ref. https://www.vultr.com/docs/install-mosquitto-mqtt-broker-on-ubuntu-20-04-server/

/etc/mosquitto/conf.d/default.conf

listener 1883 0.0.0.0
allow_anonymous false
password_file /etc/mosquitto/passwd

Receive data

mosquitto_sub -t 'sensor/data' -v -h 192.168.10.104 -u opencmm -P opencmm

Send command to ESP32

Update configuration

mosquitto_pub -t 'sensor/control' -h 192.168.10.104 -u opencmm -P opencmm -m '{"command": "config", "interval": 1000, "threshold": 100 }'

Go to sleep

mosquitto_pub -t 'sensor/control' -h 192.168.10.104 -u opencmm -P opencmm -m '{"command": "deepSleep" }'

Reset WiFi

mosquitto_pub -t 'sensor/control' -h 192.168.10.104 -u opencmm -P opencmm -m '{"command": "resetWifi" }'

hakaru's People

Contributors

yuichiroaoki avatar

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.