Skip to content

Commit 4585748

Browse files
committed
Update readme and postinst to make sure bluetooth is enabled
1 parent 8527a02 commit 4585748

File tree

4 files changed

+28
-38
lines changed

4 files changed

+28
-38
lines changed

DEBIAN/postinst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ rm -f /etc/nginx/sites-enabled/default
33
ln -s /etc/nginx/sites-available/solarpi.conf /etc/nginx/sites-enabled/solarpi
44
service nginx reload
55

6+
# Enable bluetooth
7+
systemctl enable bluetooth
8+
rfkill unblock bluetooth
9+
610
# Enable solarpi services
711
systemctl daemon-reload
812
systemctl enable solarpi-monitor.service

readme.md

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Solarpi is a simple python app to do datalogging of the junctec battery monitor and helios solar chargers via bluetooth.
44

5-
It's made for a raspberry pi zero 2w but should will work on any debian based system.
5+
It's made for a raspberry pi should will work on any debian based system.
66

77
![solarpi-web](docs/solarpi-screenshot.png)
88

@@ -19,47 +19,39 @@ The `solarpi-web` service provides a simple web application to view the data in
1919

2020
## Install
2121

22-
Copy the solarpi folder/python module to /opt/solar-pi.
22+
Download the latest release and run:
2323

24-
Install the following python dependencies with apt:
25-
26-
```
27-
python3-bleak
28-
python3-aiohttp
29-
python3-aiosqlite
30-
python3-jinja2
24+
```bash
25+
sudo apt install ./solarpi-v1.0.0.deb
3126
```
3227

28+
## Usage
3329

34-
### Setup solarpi service
30+
Go to the ip or hostname of the pi in your browser and you should see the web page.
3531

36-
Install the service
37-
```
38-
cp solarpi*.service /etc/systemd/system/
39-
systemctl daemon-reload
40-
systemctl enable solarpi-monitor.service
41-
systemctl enable solarpi-web.service
42-
systemctl start solarpi-monitor.service
43-
systemctl start solarpi-web.service
44-
```
32+
If you see a 502 Bad gateway page make sure the solarpi-web service is up and running.
4533

46-
### Setup nginx proxy
4734

48-
This is done so the app does not need to be running as root.
35+
### Logs
4936

50-
```
51-
apt install nginx
52-
rm /etc/nginx/sites-enabled/default
53-
cp solarpi.site /etc/nginx/sites-enabled/solarpi
54-
service nginx restart
55-
```
37+
Check logs using `journalctl -f -u solarpi-web.service` and `journalctl -f -u solarpi-monitor.service`.
5638

57-
## Usage
39+
### Restart/stop/start
5840

59-
Go to the ip or hostname of the pi in your browser and you should see the web page.
41+
You can stop, start, or restart the service(s) using.
42+
43+
`sudo system solarpi-web restsart`
44+
45+
### DB backup/restore
46+
47+
The database is located at `/opt/solar-pi/solarpi.db`. You can simply copy this
48+
file to back it up and replace it (stop the services first) to restore a backup.
6049

61-
If you see a 502 Bad gateway page make sure the solarpi-web service is up and running.
6250

63-
Check logs using `journalctl -f solarpi-web.service` and `journalctl -f solarpi-monitor.service`.
51+
## Troubleshooting
6452

53+
It appears the raspberry pi has bad RF coexistence with when using BT and wifi.
6554

55+
I had lots of connectivity issues with a raspberry pi zero 2 w. After switching
56+
to a raspberry pi 3 and using ethernet instead of wifi the bluetooth connectivity
57+
problems have gone away and bluetooth updates much more rapidly.

solarpi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "1.0.0"
1+
version = "1.0.1"

solarpi/monitor.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,6 @@ def on_battery_monitor_data(
326326
BATTERY_MONITOR_DATA_CHARACTERISTIC_UUID, on_battery_monitor_data
327327
)
328328

329-
last_sent = time()
330-
await BATTERY_MONITOR.write_gatt_char(
331-
BATTERY_MONITOR_CONF_CHARACTERISTIC_UUID,
332-
BATTERY_MONITOR_REFRESH,
333-
)
334-
335329
# Periodically poll to make sure it's not just sitting with no data coming in
336330
# DO NOT SEND immeidately or it screws up the connection
337331
last_sent = time()

0 commit comments

Comments
 (0)