Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Personal Stock Control System

>Don't you know the struggle with going to the grocery store and only then realizing you forgot to check what you still got at home and what you should buy.
I had this problem quite often and ended up buying the stuff i already had, which led to me having 10 bottles of ketchup in my basement. The worst of it is, that i nearly always forgot to buy the stuff i needed. This ended up with me having to go for a second ride.
I had this problem quite often and ended up buying the stuff i already had, which led to me having 10 bottles of ketchup in my basement. The worst of it is, that I nearly always forgot to buy the stuff i needed. This ended up with me having to go for a second ride.
<br />For a guy living in a <b>rural area</b> this is more than annoying.

![img of finished system with link to youtube video](./img/tempImgOfSystem.jpg)
Expand All @@ -25,13 +25,13 @@ I had this problem quite often and ended up buying the stuff i already had, whic


## Description
This is a "small" personal project where i'll use Java, JavaFX, the Gson-Libary, Apache-Web-Server, JSON-server and Outpan.com as Barcode libary to fix this problem for me.
This is a "small" personal project where I'll use Java, JavaFX, the Gson-Library, Apache-Web-Server, JSON-server and Outpan.com as Barcode library to fix this problem for me.
<br /><b>You can keep track of the items you have, the ones that are running out and the ones that are already empty.
You can print out an overview of the stocks or a list of items that are already out of stock.
If you're on the go, you can VPN into your home network and check which item and how many of them are still in stock.</b>

I'll try to keep the setup costs as low as possible, so it'll be a system everyone can build.
I have to admit, that it got more expensive than i thought. (You could decrease the price by just buying a Pi (35€) and a smaller screen (30-45€) to about 100€).
I have to admit, that it got more expensive than I thought. (You could decrease the price by just buying a Pi (35€) and a smaller screen (30-45€) to about 100€).

Physical parts are:
- TaoTronics USB Laser-Barcodescanner (23€)
Expand All @@ -44,7 +44,7 @@ Physical parts are:
- Official Raspberry Pi 2A PSUn>
- HDMI cable
- Raspberry Pi Stickers
- Tontec 7 inch High Resolution 1024 * 600 Screen Display LCD TFT Monitor(55€)
- Tontec 7 inch High Resolution 1024 * 600 Screen Display LCD TFT Monitor (55€)

------------------------------
Total costs: 178€
Expand All @@ -71,14 +71,14 @@ Total costs: 178€
<h2>Documentation of the problems with solutions</h2>
<h4>Running JavaFX with Maven</h4>
<p>The first small problem was to get JavaFX running with Maven. Since i wanted to use the Logging-Framework Log4J, Maven was pretty easy to use and a good choice. <br />
<b>Problem</b>: Deploying JavaFX as .jar to be executed via the commanline <br />
<b>Problem</b>: Deploying JavaFX as .jar to be executed via the commandline <br />
<b>Solution</b>: Using the "JavaFX Maven Plugin" from https://github.com/javafx-maven-plugin/javafx-maven-plugin and building the .jar file on a PC/MAC/Linux computer</p>

<br />

<h4>Running the JavaFX .jar on PI</h4>
<p>Starting a JavaFX Application on a RaspberryPi isn't that easy, since Oracle removed JFX from their ARM install. <br />
<b>Problem</b>: Installing Java ARM and getting JavaFX seperately <br />
<b>Problem</b>: Installing Java ARM and getting JavaFX separately <br />
<b>Solution</b>: Installing the latest Oracle Java ARM version, removing all the other Java installations (making sure the now installed one is used). Downloading the "JavaFX Embedded SDK" here: http://gluonhq.com/labs/javafxports/downloads/ and extracting the parts in the corresponding folders of the oracle Java version.</p>

<br />
Expand All @@ -99,7 +99,7 @@ Total costs: 178€

<h4>Make the GUI resize for different screens without fullscreen</h4>
<p>If the GUI should be the size of the full display, but without using the fullscreen option <br />
<b>Problem</b>: Fullscreen makes the access to the Desktop harder, you might want to be able to access the Desktop while your GUI is runnign. <br />
<b>Problem</b>: Fullscreen makes the access to the Desktop harder, you might want to be able to access the Desktop while your GUI is running. <br />
<b>Solution</b>: In your programcode, when setting up the primaryStage, set the size of your primaryScene to the dimensions of you display. You can do this with:</p>

```java
Expand All @@ -117,7 +117,7 @@ new File(System.getProperty("user.home") + "/Desktop")
```

<p><b>Problem</b>: On the Pi, the user.home/Desktop is not the Desktop you get displayed when starting up the Pi. <br />
<b>Solution</b>: You can create a soft link of the file on the user.home/Desktop to the file you created on your visible Desktop. Once your programm changes the user.home/Desktop file, since you linked them, the one on your visible Deskotp will also be changed. This is done like this:</p>
<b>Solution</b>: You can create a soft link of the file on the user.home/Desktop to the file you created on your visible Desktop. Once your program changes the user.home/Desktop file, since you linked them, the one on your visible Desktop will also be changed. This is done like this:</p>

```bash
ln -s {target-filename} {symbolic-filename}
Expand All @@ -126,6 +126,6 @@ ln -s {target-filename} {symbolic-filename}
<br />

<h4>PI is not using the right Resolution of your Display</h4>
<p>If you realize, that your JavaFX Application is smaller and squished you should change the hdmi settings of the PI<br />
<p>If you realize, that your JavaFX Application is smaller and squished you should change the HDMI settings of the PI<br />
<b>Problem</b>: The displayed resolution is smaller than the actual resolution your display is capable of <br />
<b>Solution</b>: Take a look at https://www.raspberrypi.org/documentation/configuration/config-txt.md on how to change the displayed resolution. For me the solution was to change the hdmi_group -> 2 (since it's a monitor and not a TV) and then you just have to search the right resolution in the hdmi_mode table. For me it was hdmi_mode -> 16</p>