-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Detailed instructions how to assemble the atm and bring it into operation.
- Loading branch information
1 parent
161e248
commit 09d64f2
Showing
38 changed files
with
626 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
## Autostart | ||
|
||
###### Activate the Service: | ||
|
||
``` | ||
$ cd ~/LightningATM | ||
$ sudo cp LightningATM.service /etc/systemd/system/LightningATM.service | ||
$ sudo systemctl enable LightningATM.service | ||
$ sudo reboot | ||
``` | ||
|
||
###### Other commands to control the service: | ||
|
||
``` | ||
$ sudo systemctl status LightningATM.service | ||
$ sudo systemctl stop LightningATM.service | ||
$ sudo systemctl start LightningATM.service | ||
``` | ||
|
||
- Note: From now on the ATM will start automatically. If you want to observe the app.py in tmux, you should stop the "LightningATM.service" manually, bevor you start the app.py in the tmux. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
## Installation and testing the camera | ||
|
||
The 5MP Camera OV5647 for the Raspberry Pi is available from different manufacturers and with slightly different designs. | ||
To test the function of the camera you can take a picture and download it to you computer. | ||
|
||
### Installation | ||
|
||
The ribbon cable is a bit special as the connectors on the camera and the Raspberry Pi are slightly different sizes. So the cable tapers. | ||
Before sliding the cable into the slot, the black latch must be released by gently pulling upwards. | ||
The cable can then simply be pushed in. The silver contacts must point away from the detent. See image! | ||
When the cable is centered, you can lock the latches in place by sliding them back slightly. | ||
|
||
connection | ||
|
||
<img src="../pictures/camera_installation.jpg" width="300"> | ||
|
||
### Activate camera | ||
|
||
- Login to the Raspberry Pi | ||
|
||
$ ssh [email protected] | ||
- Directory displayed: `pi@raspberrypi:~ $` | ||
|
||
- Call up the Raspi-Config and activate the camera | ||
|
||
$ sudo raspi-config | ||
|
||
- Choose: `Interfacing Options Configure connections to peripherals` | ||
- Choose: `Camera Enable/Disable connection to the Raspberry Pi Camera` | ||
- Confirm: `Would you like the camera interface to be enabled?` -> `\<YES>` | ||
- Confirm: `The camera interface is enabled` -> `\<OK>` | ||
- Go To: `\<Finish>` | ||
- When ask for: `Would you like to reboot now?` -> `\<YES>` | ||
- If you have not already restarted from the menu, then restart manually to activate the changes | ||
|
||
$ sudo reboot | ||
raspi-config | ||
|
||
![](../pictures/camera_raspi-config_1.png) | ||
![](../pictures/camera_raspi-config_2.png) | ||
|
||
Your config menu can look slightly different, depends of you hard- and software | ||
|
||
### Take a picture | ||
|
||
- Take a picture after logging in to the Raspberry Pi | ||
|
||
$ raspistill -v -o test.jpg | ||
|
||
Note: The -v is only optional and will show more display data. The -o is necessary to write the file. | ||
|
||
The recording lasts 5 seconds (time delay 5000 (ms)). You can shorten the recording time, but you should not make the time too short, otherwise the picture quality will suffer. One second (= 1000 ms) is definitely possible. The command then looks like: | ||
|
||
$ raspistill -v -o test.jpg -t 1000 | ||
|
||
Further functions for a recording can be found in the help `$ raspistill --help` | ||
|
||
- Check if the image has been saved | ||
|
||
$ ls -l | ||
The file `test.jpg` should now appear in the list. | ||
|
||
- Check the directory structure | ||
|
||
$ pwd | ||
|
||
The directory should read: `/home/pi/` | ||
|
||
raspistill command | ||
|
||
<img src="../pictures/camera_terminal_raspistill.png" width="500"> | ||
|
||
### Transfer the image to the computer | ||
|
||
- Open a *second terminal window* on the computer | ||
- Switch to a folder of your choice (example `C:\temp`) | ||
- The command to copy for a Windows system is | ||
|
||
$ scp [email protected]:/home/pi/test.jpg . | ||
-> The password from the Raspberry Pi must be entered for comfirmation | ||
|
||
- If everything went well, the image was transferred to the computer and can now be vieweden | ||
|
||
- Note: The command is slightly different on a Mac or Linux system | ||
|
||
$ scp '[email protected]:/home/pi/test.jpg' ./ | ||
scp command | ||
|
||
<img src="../pictures/camera_terminal_scp.png" width="700"> | ||
|
||
Example of a recording | ||
|
||
The structure | The picture | ||
:-------------------------:|:-------------------------: | ||
![](../pictures/camera_example_structure.jpg) | ![](../pictures/camera_example_image.jpg) | ||
|
||
Note: This camera was pretty cheap and has a variable lens that was pretty loose and difficult to adjust. You might want to use a better one for your project. | ||
|
||
### Aditional hints | ||
|
||
- If you want to take several pictures, the pictures must be numbered consecutively. E.g. test1.jpg, test2.jpg etc. | ||
- Then you can transfer all images at once | ||
|
||
$ scp [email protected]:/home/pi/*.jpg . or scp '[email protected]:/home/pi/*.jpg' ./ | ||
- You can do also videos. The command is `raspivid` | ||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
### Configure the coin validator (set 6 coins / e.g. 5 cents to 2 euros) | ||
|
||
- Set the switches on the coin validator to "NO" (contact normal open) and "Medium" (medium pulse speed). | ||
- Apply the 12V to the coin validator (without Raspberry Pi) => The coin validator will flash and show 0 (zero) | ||
- Press and hold simultaneously the ADD and MINUS buttons until A appears in the display | ||
- When B appears, switch back to A by ADD or MINUS | ||
- Press SET (slowly), then E will appear on the display | ||
- This indicates: You are in them menu to set the amount of differnet coin types | ||
- Set it to 6 (6 coins = 5 cents to 2 euros) with ADD (or MINUS) and press SET | ||
- Now the display shows H1 (for the first coin). The first of 6 LEDs has come on | ||
- Now specify how often the coin should be inserted for calibration | ||
- Set to 20 with ADD (or MINUS) and then press SET | ||
- The display now shows P1 for further settings of coin 1 and you can define the output signal | ||
- 5 cents = 2 pulses / 10 cents = 3 / 20 cents = 4 / 50 cents = 5 / 10 euros = 6 / 2 euros = 7 | ||
- Set to 2 pulses (for 5 cents) with ADD (or MINUS) and then press SET | ||
- The last thing on the display is F1, which represents the accuracy of the coin recognition. The value 8 worked well | ||
- Set to 8 with ADD (or MINUS) and then press SET | ||
- The parameters for the first coin have now been set | ||
- Now the second LED is on and the display shows H2 | ||
- Now repeat the same steps again for the second coin (e.g. 10 Cent) up to coin 6 vor (e.g. 2 Euro) | ||
- When all coins are set, all LEDs flash briefly to confirm and the display shows A again | ||
- After a short time, 0 (zero) appears again in the display | ||
|
||
### Calibrating the coin validator | ||
|
||
- Press the SET button (slowly) twice | ||
- The first LED light and A1 will show in the display | ||
- Now insert the first coin (5 cents) 20 times | ||
- Use as many different coins as posible | ||
- Finally all LEDs flash to confirm and the display shows A2 | ||
- Repeat for the remaining coin types | ||
- All LEDs flash briefly again to confirm and the display shows 0 (zero) again | ||
- The coin validator is now ready | ||
|
||
coin validator | ||
|
||
<img src="../pictures/coin_validator_closeup.jpg" width="600"> | ||
|
||
coin calibration | ||
![coin calibration](../pictures/coin_validator_calibration.jpg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## Set up and test the display | ||
|
||
### Update display software | ||
|
||
``` | ||
$ cd ~ | ||
$ git clone https://github.com/waveshare/e-Paper | ||
$ cd ~/e-Paper/RaspberryPi*/python | ||
$ sudo python3 setup.py install | ||
``` | ||
|
||
### Testing the display | ||
|
||
'Note:' This is special for the "Waveshare 2in13 V2". Yours may be different. | ||
|
||
``` | ||
$ cd ~ | ||
$ cd e-Paper/RaspberryPi_JetsonNano/python/examples | ||
$ sudo python3 ./epd_2in13_V2_test.py | ||
``` | ||
|
||
If everything has been correctly connected and installed, the display will now show a demonstration and finally the screen will cleare. | ||
|
||
display | ||
![display](../pictures/display_2.13inch.jpg) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
### Special settings in the app.py file | ||
|
||
The `app.py` file is the main program of the ATM. Here you can easily customize the code. But be careful when making changes here. | ||
|
||
##### Open the app.py | ||
|
||
``` | ||
$ cd ~/LightningATM/ | ||
$ nano app.py | ||
``` | ||
|
||
##### Optional setting *only for the pocket version:* Skip the "Prepare for LNURL" page: | ||
|
||
- Search for `display.update_lnurl_cancel_notice()` with `CTRL+W`. (It exists twice) | ||
- There is a place where it says `if activewallet == "lntxbot"`, please edit the two lines (see picture) | ||
|
||
###### Comment out the following two lines with `#` | ||
|
||
``` | ||
# display.update_lnurl_cancel_notice() | ||
# time.sleep(5) | ||
``` | ||
|
||
-> This will skip the LNURL "query page" as it is not relevant for the pocket version (without push button). | ||
|
||
##### Alternative setting: coin preselection if the setting in config.ini does not work: | ||
|
||
###### Adjustment of the pulses for the respective coins | ||
|
||
- Search for `if config.PULSES == 2` in app.py with `CTRL+W` | ||
- There you will find the setting options for the coins. | ||
- Note: If you can't find `if config.PULSES == 2` in the app.py file, then you might have a higher version then V0.3.0 and the coin settings are in the config.ini. You can skip this point. | ||
|
||
###### For example: | ||
|
||
``` | ||
if config.PULSES == 2: | ||
config.FIAT += 0.02 | ||
.. | ||
logger.info("2 cents added") | ||
.. | ||
``` | ||
|
||
The settings are now set in the same way as the coin validator is parameterized: | ||
|
||
###### For the example, two pulses = 5 cents | ||
|
||
``` | ||
if config.PULSES == 2: | ||
config.FIAT += 0.05 | ||
.. | ||
logger.info("5 cents added") | ||
.. | ||
``` | ||
|
||
- Repead the change up to 2 euros = 2.00 (200 cents) | ||
- Note: As I said, you only have to do this if the setting in config.ini doesn't work | ||
|
||
app.py - Skip the "Prepare for LNURL" (just an example) | ||
![edit app](../pictures/edit_app_terminal_1.png) | ||
|
||
|
||
|
Oops, something went wrong.