PiStation

PiStation

16 devlogs
42h 8m
•  Ship certified
Created by darrkenn

A weather station hosted on a raspberry Pi 3B+, using Flask,Chart.js and Tailwind. Weather is retrieved from a ESP32 over HTTP and stored in a sqlite database.

Timeline

Ship 1

1 payout of shell 606.0 shells

darrkenn

about 1 month ago

darrkenn Covers 16 devlogs and 42h 8m

PiStation DEVLOG #15

Added most extreme values from the past day

Update attachment

PiStation DEVLOG #14

Added downloading a CSV file that respects the filters. Also updated the current weather div with rain and pressure.

Update attachment
Youssef Youssef about 1 month ago
nice

PiStation DEVLOG #13

Added a card layout for mobile views as the table was too horizontally wide. Filtering works(basically same code as the table filter script).

The card layout looks better than the table, might make the desktop view use cards instead of a table.

Update attachment
darrkenn darrkenn about 1 month ago
Yeah it would work directly on an esp32 with an external mini sd card reader and the implementation of the sqlite3 library into the code!
Youssef Youssef about 2 months ago
nice, will it work directly from an esp32 ? like the esp32 cam who have an sd card we’re we can store on it

PiStation DEVLOG #12

Improved the layout of the site on screens smaller than 16:9. Updated the official pistation.xyz with all previous changes.

Update attachment

PiStation DEVLOG #11

Added pressure and rainfall charts. Pressure chart was easy, however the rainfall chart was hard to figure out what would be best. Went with a bar chart with max value of 1 and a min value of zero(Zero is no rain, One is rain).

Update attachment

PiStation DEVLOG #10

Setup pressure sensor and rain sensor on the esp32. Ive also reset the database in order to accept these new values. The JSON is perfect, it works on the browser and curl.... HOWEVER! python just doesn't like the JSON. This is most likely bad code I've written.

Update attachment
darrkenn darrkenn about 2 months ago
Whoops my pin was set wrong in the code

PiStation DEVLOG #9

Setup the esp32 code. It is a simple HTTP server that gets temp values on request and sends it back as a JSON. For power saving I made it go to deepsleep for 9 minutes.

Update attachment

PiStation DEVLOG #8

Added favicon to the pages. Unfortunately I just realized that the raspberry Pi doesn't have a built in ADC, so im going to have to use my Temu esp32 as a http server.

Update attachment

PiStation DEVLOG #7

Added a humidity chart and improve the looks of both charts.
Currently implementing function to download table as CSV

Update attachment

PiStation DEVLOG #6

I improved the look of the past readings page(however doesn't look 100% great on mobile yet). Decided to add chart.js to the project in order to better visualize the changes in weather.

Update attachment

PiStation DEVLOG #6

Improved past readings page. The readings can now be filtered based on select value (Ignore design its just for debugging)

Update attachment

PiStation DEVLOG #5

  • Got a cheap domain for £1 on porkbun.
  • Setup nginx on the raspberry pi.
  • Setup gunicorn for better performance/handling
  • Setup cloudflare tunnel for better protection and because i dont have a static ip.

Website Link:
https://pistation.xyz/

Update attachment

PiStation DEVLOG #4

Created a page that allows the viewing of all past readings of weather. Creates a dictionary which is then turned into a table.

Update attachment

PiStation DEVLOG #3

Setup the project on the raspberry pi using a rsync script that automatically updates files when changed on my pc. Fixed the databaseAdd.py script to now get data from the sensor and add it to the database. Now going to improve how the homepage looks because its quite bland.

Update attachment

PiStation DEVLOG #2

I setup the flask project with tailwind v4(Definitely didn't spend 1 hour wondering why the classes weren't being added until i finally added --watch to the command). Ive decided to get the sensor data every 10 minutes, by running a separate python file that appends data to a SQLite database.
On the client side whenever the user first opens the page it calls a function that gets the latest added temperature/humidity from the SQLite database.

Also the DHT11 sensor got too hot and fried itself🤦.

Update attachment

PiStation DEVLOG #1

I had problems with the AdafruitCircuitPythonDHT library in my code as it would try and use the Jetson.GPIO to get data from the pin. I fixed this by adding
(from adafruitblinka.microcontroller.genericlinux.rpigpiopin import Pin) to the (except ImportError) when it trys to import the pin.
The code now successfully gets the temperature/humidity and i can now work on the flask side of things.

Update attachment