Skip to content

Commit

Permalink
Better tracer documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
retrodaredevil committed Jul 2, 2021
1 parent d544315 commit 242336b
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 5 deletions.
22 changes: 22 additions & 0 deletions other/docs/custom_directories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Custom directories
Sometimes you should create custom directories so that you can more accurately name
the folder for the SolarThing instance you are running.

And sometimes, you may need an additional "request" directory.

The only reason you should be reading this is if you already have a SolarThing instance running, and you want
to create another instance of SolarThing to run.

It's good to note that technically you don't need to create another directory because the run.sh file is the same in
all the directories except for graphql, but I do recommend creating a custom directory if you need to.

```shell
cd /opt/solarthing/program
./create_custom.sh custom_coolname
```
But replace `coolname` with the name that you want. Note that you MUST prefix the name with `custom`. If you don't
there may be conflicts when updating SolarThing, which you don't want.

You can also install that program using `sudo /opt/solarthing/other/systemd/install.sh custom_coolname`.

That's it! You're done!
6 changes: 6 additions & 0 deletions other/docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ You can stop the service like this: `sudo systemctl stop solarthing-<program typ

Now SolarThing should be set up and running!

To see if SolarThing crashed, run: `systemctl status solarthing-<program type>`. If you need to view the log files,
informational logs are by default in `/opt/solarthing/program/<program type>/logs/log_info.log`. If you want to view
that log file live, you can run `tail -f /opt/solarthing/program/<program type>/logs/log_info.log`.

If any documentation is lacking (many parts are), feel free to open an issue at https://github.com/wildmountainfarms/solarthing/issues

---

---
Expand Down
6 changes: 3 additions & 3 deletions other/docs/quickstart_rover.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ Once everything is installed, you're ready to edit the configs. You will `cd` to
```
cd /opt/solarthing/program/request
```
If you are already using the request directory, click [here](./custom_directories.md).

Copy some template config files ([default_linux_serial](../../config_templates/io/default_linux_serial.json) and [rover_template](../../config_templates/base/rover_request_template.json) or [rover_setup_template](../../config_templates/base/rover_setup_template.json))
Copy some template config files ([default_linux_serial](../../config_templates/io/default_linux_serial.json) and [rover_template](../../config_templates/base/rover_request_template.json))
```
# sudo should not be required unless permissions were not set up correctly (add yourself to the solarthing group)
cp ../../config_templates/io/default_linux_serial.json config/
cp ../../config_templates/base/rover_request_template.json config/base.json
# or do this if you want to run the setup program: (You probably don't unless you want to test something)
cp ../../config_templates/base/rover_setup_template.json config/base.json
```

Now edit `config/base.json`
* Most rovers have a default modbus address of 1, hence the `"1"` present in the template configuration. However,
this is not always the case for newer Rover models, especially if a BT module has been plugged into them. You will
likely have to use the `rover-setup` program to scan
* rover-setup will be deprecated soon, and there will need to be a new feature for this
* Make sure you change the `"io"` property to correctly point to the io JSON file you want to use. Remember paths
are relative to `program/request`, so `config/io.json` would point to `program/request/config/io.json`.

Expand Down
43 changes: 43 additions & 0 deletions other/docs/quickstart_tracer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Quick Start EPEver Tracer
* If you haven't already, [click here](quickstart.md) to view how to clone this repo and install the service.
* Compatible with EPEver tracer models.
* Prerequisites: You have an RS485 to USB cable that works with your tracer

---

Unlike other serial adapters, the RS485 adapter on the Raspberry Pi doesn't work out of the box. To get it to work,
you need to install an additional driver on your Raspberry Pi. A few years down the line, you shouldn't have to do this,
but now (2021), you do. The awesome project [epsolar-tracer](https://github.com/kasbert/epsolar-tracer) project is
responsible for this driver. I made a script that piggybacks off of the installation instructions. You can run it by:
```shell
sudo apt-get update # not necessary if you've updated recently
sudo apt-get install dkms # May already be installed
sudo /opt/solarthing/other/linux/install_updated_serial_driver.sh
```

Once that is done running, you should reboot. After the reboot with the USB serial adapter plugged in, run
```shell
ls /dev/tty*
```
You should notice that there is a file/device called `ttyXRUSB0`. If there is, the driver installation worked, and you can continue!

Once everything is installed, you're ready to edit the configs. You will `cd` to the `program/request` directory.
```
cd /opt/solarthing/program/request
```
If you are already using the request directory, click [here](./custom_directories.md).

Copy some template config files ([default_linux_serial](../../config_templates/io/default_linux_serial.json) and [tracer_request_template](../../config_templates/base/tracer_request_template.json))
```
# sudo should not be required unless permissions were not set up correctly (add yourself to the solarthing group)
cp ../../config_templates/io/xr_serial_io.json config/
cp ../../config_templates/base/tracer_request_template.json config/base.json
```

Now edit `config/base.json`
* Most tracers have a default modbus address of 1, hence the `"1"` present in the template configuration.
* Make sure you change the `"io"` property to correctly point to the io JSON file you want to use. Remember paths
are relative to `program/request`, so `config/io.json` would point to `program/request/config/io.json`.

### I'm ready to use this for real!
Once your configuration is how you want it, you can go back to the [quickstart](quickstart.md#configuration-continued) to enable and start the service.
4 changes: 4 additions & 0 deletions other/docs/rover_dummy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Rover Dummy
This is work in progress. Basic idea is that you will use a different IO config that points to a config like:
[this template config](../../config_templates/io/dummy_rover_io.json). The file in that config should point to
a file [like this](../../program/rover/test/dummy_rover.json).
2 changes: 2 additions & 0 deletions other/docs/rover_setup_info.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Rover setup program
This has some more information on how to use the `rover-setup` program.

Note: This will be deprecated soon in favor of documentation I have not yet written.

How to get started: [Rover Quickstart](quickstart_rover.md)

### What is this for?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Tracer quickstart
Work in progress
## Tracer Notes
Just some notes to help me understand the tracer better. These notes aren't for anyone else.


I found my serial on `/dev/ttyACM0` using an RPi4

Expand Down

0 comments on commit 242336b

Please sign in to comment.