https://github.com/palmstudio/precision_scale-raspberry_pi
Monitor data from a precision scale
https://github.com/palmstudio/precision_scale-raspberry_pi
Last synced: 2 months ago
JSON representation
Monitor data from a precision scale
- Host: GitHub
- URL: https://github.com/palmstudio/precision_scale-raspberry_pi
- Owner: PalmStudio
- Created: 2021-07-12T08:47:55.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-13T04:14:29.000Z (4 months ago)
- Last Synced: 2025-02-13T05:22:38.190Z (4 months ago)
- Language: Julia
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Interfacing a precision scale with a Raspberry Pi or a computer
[](https://doi.org/10.5281/zenodo.14862494)
The following code helps you interfacing a Raspberry Pi (or any computer really) with a precision scale and log the measurement values into a file.
## Use the script
### Log in
---
If you're using a regular computer (not a Raspberry), go to the [next step directly](#clone-or-download).
---
If you're using a Raspberry Pi, you'll first have log onto it. If you don't have a screen + keyboard connected to your Raspberry, you can connect using another computer using an RJ45 (ethernet) cable and use SSH. To use SSH, open a terminal (on windows: `Windows key + R`, and then type `powershell` + `Enter`). If you didn't change the default name of the Raspberry,
enter the following command:```bash
ssh [email protected]
```The default password is `raspberry`.
### Clone or download
Download this project onto the computer (or Raspberry).
If you're using a Raspberry, are usually using Windows and are not familiar with Linux, you can download the project onto your Windows computer and use [FileZilla](https://filezilla-project.org/) to move the folder from your computer to the Raspberry.
### Change directory
Open a terminal and `cd` into the project you just downloaded. For example if you put it onto the `Documents` folder you'll do:
```bash
cd Documents/precision_scale-raspberry_pi
```### Change the parameters
Open the file named `parameters.yml` and change the values of the connexion parameters according to the ones given by the manufacturer of the scale, or the one you parameterized onto your scale.
---
#### Note
You can use Julia to know which serial port is used for the connexion. Simply execute this code and copy/paste the results into the `portname` value in `parameters.yml`:
```julia
using Pkg; Pkg.activate(".")
using SerialPorts
list_serialports()
```---
### Run the script
Run the script into Julia:
```bash
julia monitor_weight.jl
```If you're running the script onto a Raspberry-Pi, you probably want to use `nohup` so you can reconnect to the process afterward (no hang-up after disconnection). To do so, run the following command instead.
```bash
nohup julia monitor_weight.jl
```That's it! Julia is now monitoring the data sent by the scale.
---
## Python dependency
If you want to avoid the Python dependency, use the branch named [Using-LibSerialPort.jl-instead-of-SerialPorts.jl](https://github.com/ARCHIMED-platform/Precision_scale-Raspberry_Pi/tree/Using-LibSerialPort.jl-instead-of-SerialPorts.jl) which uses LibSerialPort. This is far better but does not build on my Raspberry Pi (don't know why).