Light up your hookah with a Raspberry and a neopixel ring!
Get your RaspberryPi, connect the neopixel LED ring and the BMP180 pressure sensor to it, configure it, upload and start BubLight .jar
file and you are ready to go!
You can then connect to a BubLight web UI, where you can configure colors and light modes and see a nice graph showing realtime pressure!
This hobby project is still a WORK IN PROGRESS. However, it had some successful demos :).
Hardware parts (the LED ring and the pressure sensor) are simulated in the simulated mode.
Steps:
-
Clone and build BubLight repository. Go to the directory where you want to clone BubLight and execute:
git clone https://github.com/Pyro2266/bublight.git cd bublight mvn clean install -P build-web
-
Go to the backend target directory:
cd bublight-backend/target
-
Start
.jar
file in a simulated mode with command:java -jar bublight-backend-0.0.2-SNAPSHOT.jar --bublight.simulatedPressure=true --bublight.simulatedLed=true
. -
WebUI and REST endpoints are now available on
localhost
at port8080
. -
Go to the WebUI (
localhost:8080
) and click things or play with Postman collection from thedocs
directory. Additionally, Swagger UI is available on URLhttp://localhost:8080/swagger-ui/index.html
. -
Enjoy! But keep in mind that everything is still under development and all the risk is on you :).
-
Feel free to leave feedback, create a PR, or an issue if something is not working.
Components used in demo:
- Raspberry Zero W 1.1
- GY-68 (BMP180)
- Adafruit Neopixel Ring (16x LED)
-
Download and install Raspberry Pi Imager
-
Choose Raspberry Pi OS LITE and write it to the SD card (I'm using
Raspbian GNU/Linux 10 (buster)
). -
To automatically connect to your Wi-Fi network (original guide here) go to the SD card (
boot
partition) and create filewpa_supplicant.conf
in the root directory. -
Open
wpa_supplicant.conf
file and write there configuration of your Wi-Fi (includingcountry
):country=SK ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="MyWiFiNetwork" psk="aVeryStrongPassword" key_mgmt=WPA-PSK }
-
(Optional) It is possible to include multiple networks. For example I'm using Wi-Fi network I have at home and hotspot from my phone. Just include another
network
block under the first one:network={ ssid="MyWiFiNetwork1" psk="aVeryStrongPassword" key_mgmt=WPA-PSK } network={ ssid="MyWiFiNetwork2" psk="aVeryStrongPassword" key_mgmt=WPA-PSK }
-
Enable SSH by creating empty file called
ssh
(without and file extension) in the SD card (the same place as Wi-Fi was configured). -
Insert SD card into your Raspberry, power it up, wait a few seconds. Now find the IP address of your Raspberry in the network (I'm using android app called Fing).
-
With the address obtained in previous step you can connect via SSH to the Raspberry. Default credentials are username:
pi
and password:raspberry
. Examplessh
command:ssh pi@192.168.1.123
. -
With the SSH connectiou up update and install following tools:
i2c-tools
,wiringpi
,swig
,java 8
(unfortunatelyjava 11
does not work with Raspberry Zero):sudo apt-get update sudo apt-get install i2c-tools wiringpi swig openjdk-8-jre
-
Check if
java 8
is installed:java -version
. You should seeopenjdk version "1.8.0_212"
. -
To enable
I2C
(original guide) and setup locale:- Execute command
sudo raspi-config
. - Go to
Interface Options
. - Go to
I2C
and enable it. - Go into
Localisation Options
and setup locale.
- Execute command
-
Check if
I2C
is ready with command:sudo i2cdetect -y 1
. It should return:0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- 77
-
Check if locale are correct with command:
locale
. -
Create
~/bublight
directory with command:mkdir ~/bublight
. We will copy the application here. -
Clone and build BubLight repository on your local computer (preferably in another console while keeping the SSH connection to the RPi open). Go to the directory where you want to clone BubLight and execute:
git clone https://github.com/Pyro2266/bublight.git cd bublight mvn clean install -P build-web
-
Copy executable
jar
file (frombublight-backend/target
directory) and application properties (frombublight-backend/src/main/resources
directory) to the Raspberry (into the~/bublight
directory). Don't forget to update your IP address.
scp bublight-backend/target/bublight-backend-0.0.2-SNAPSHOT.jar pi@IP_OF_YOUR_RPI:~/bublight
scp bublight-backend/src/main/resources/application.properties pi@IP_OF_YOUR_RPI:~/bublight
-
Go back to the SSH session to Raspberry and go to the
bublight
directory we created before:cd ~/bublight
. -
Check application properties if everything is set up correctly (if simulated mode is turned off and number of LEDs is correct):
nano application.properties
. -
Start BubLight with command:
sudo java -jar bublight-backend-0.0.2-SNAPSHOT.jar
. It takes a minute or two to start the application. -
WebUI and REST endpoints are now available at port
8080
. -
Go to the WebUI (
IP_OF_YOUR_RPI:8080
) and click things or play with Postman collection from thedocs
directory. Additionally, Swagger UI is available on URLhttp://IP_OF_YOUR_RPI:8080/swagger-ui/index.html
. -
Enjoy! But keep in mind that everything is still under development and all the risk is on you :).
-
Feel free to leave feedback, create a PR, or an issue if something is not working.
To give an idea how does it look now (keep in mind that it's still under development).