DEV Community

maxzuraw
maxzuraw

Posted on

Cold bedroom notifier

Overview

Simple temperature monitoring station, build out of spring boot and react native.

100 feet view:

cbn overview

Submission Category:

Choose Your Own Adventure

Link to Code

backend-server: https://github.com/maxzuraw/cbn-server-atlas-hackaton.git

mobile-app: https://github.com/maxzuraw/cbn-mobile-atlas-hackaton.git

Additional Resources / Info

Easiest way to test:

Starting backend
  1. clone backend-server repo
  2. run ./startservice.sh script
  3. open browser: http://localhost:8080
  4. login with admin:admin
  5. add new sensor in "Sensors" section as follows:

Adding new sensor

Starting mobile client
  1. Open: https://expo.dev/@l0cke/cbn-mobile
  2. Install app inside Expo Go wrapper
  3. Open "Settings" tab:

Empty settings

Add settings with "+" button, like:

new settings to localserver

Select "Connect" to server:

Connect to server

From command line on laptop, where sever is running send some "simulated" temperatures with curl:

curl --location --request POST 'http://localhost:8080/api/temperature' \
--header 'Authorization: Basic c2Vuc29yOnNlbnNvcg==' \
--header 'Content-Type: application/json' \
--header 'Cookie: JSESSIONID=6FA8E64A552CDB55F455652A8C4BEEA3' \
--data-raw '{
"sensor":"bedroom",
"value": 20.44
}'

You should see on "Temperature" tab incoming message, something like this:

Incoming measurements

Hope you will like this small temperature monitoring station.

Additionally in server repo, there is a folder esp8266 where are some samples of arduino code to apply to your arduino ESP8266 board connected to DallasTemperature sensor, which can be used to send real measurements to you server. It's currently used also at my home since 1 week - new kid was fully downloaded on 18.12, and I had to write some small app to monitor temperature in her bedroom, which will eventually alarm, when kid's bedroom is getting too cold or overheated (that's why it's called "cold bedroom notifier"). And that's the use case which was important to me. I bet you can find couple of other use cases as well.

Best wishes to All of You in the New Year!
Max

Top comments (0)