Skip to content

Commit

Permalink
Fixed tests by replacing rpi-cpu-temp with cpu-temp
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Mar 18, 2024
1 parent b09fccc commit 2e583e6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
],
"io": "../../config_templates/io/default_linux_serial.json",
"request": [
{ "type": "rpi-cpu-temp" }
{
"type": "cpu-temp",
"processors": 1
}
]
}
3 changes: 2 additions & 1 deletion config_templates/base/request_battery_voltage_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
],
"request": [
{
"type": "rpi-cpu-temp"
"type": "cpu-temp",
"processors": 1
},
{
"type": "battery-voltage-io",
Expand Down
3 changes: 2 additions & 1 deletion config_templates/base/request_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
],
"request": [
{
"type": "rpi-cpu-temp"
"type": "cpu-temp",
"processors": 1
},
{
"type": "w1-temperature",
Expand Down
31 changes: 0 additions & 31 deletions other/docs/raspberry_pi_cpu_temperature.md
Original file line number Diff line number Diff line change
@@ -1,32 +1 @@
NEW DOCUMENTATION HERE: https://solarthing.readthedocs.io/en/latest/config/rpi-cpu-temp.html

# Raspberry Pi CPU Temperature
For all the programs that upload to databases, they support the ability to add the Raspberry Pi's CPU temperature
as a packet. You just have to add this json to your `base.json`:
```json5
{
//...
"request": [
{ "type": "rpi-cpu-temp" }
]
}
```

Learn more about the `request` field [here](request_field.md).

This works by using the `vcgencmd measure_temp` that is only available on Raspberry Pis

You can see an example [here](../../config_templates/base/mate_template_with_rpi_cpu_temperature.json)

If you have any suggestions for statistics to add, feel free to request them!

### What to try when this doesn't work
If you have everything else in SolarThing working normally, but this isn't working, there are a few things you can try.

If you are using the systemd service, it should be configured to run as the user 'solarthing'. If SolarThing was
set up correctly, the user 'solarthing' should be a member of the group 'video'. You can make sure this is the case by
running `groups solarthing` and make sure 'video' appears. If it doesn't, the easiest thing to do is to run `/other/linux/create_user.sh`
which will make sure the 'solarthing' user is in the correct groups.

If that doesn't work, make sure you have everything spelled correctly. And if that still doesn't work,
drop by [our issues page](https://github.com/wildmountainfarms/solarthing/issues) and give us a section of your `logs/log_info.log` file and your `config/base.json`.
31 changes: 1 addition & 30 deletions other/docs/request_field.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,4 @@ The `request` field is an array of objects that *can* be present in configuratio
This is a common way to define what to upload to the database. In the `mate` and `rover` program case, it supplements
the data they already provide.


Here's an example of requesting the Raspberry Pi CPU Temperature
```json5
{
// ...
"request": [
{
"type": "rpi-cpu-temp"
}
]
}
```

You can also request data from a DS18B20 temperature sensor:
```json5
{
// ...
"request": [
{
"type": "rpi-cpu-temp"
},
{
"type": "w1-temperature",
"directory": "/sys/bus/w1/devices/28-000006470bec",
"data_id": 1
}
]
}
```
If you are interesting in learning more about the DS18B20 sensor, [click here](DS18B20_sensor_setup.md).
NEW DOCUMENTATION HERE: https://solarthing.readthedocs.io/en/latest/config/file/base-json/request/index.html

0 comments on commit 2e583e6

Please sign in to comment.