diff --git a/README.md b/README.md index bc36abf..f57961b 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Full Version | Pocket Version ### Installation guideline -_Carry out the points step by step as described here. This is the quickest way to succeed._ +_Carry out the points step by step as described here. This is the quickest way to succeed._ 😊 - [voltage converter](/docs/guide/voltage_converter.md) - [coin validator](/docs/guide/coin_validator.md) @@ -29,7 +29,6 @@ _Carry out the points step by step as described here. This is the quickest way t - [sd card and wifi](/docs/guide/sdcard_and_wifi.md) - [display](/docs/guide/display.md) - [edit config.ini](/docs/guide/edit_config.md) -- [edit app.py](/docs/guide/edit_app.md) - [debugging and tmux](/docs/guide/tmux_monitoring.md) - [autostart](/docs/guide/autostart.md) - [aditional information and tips](/docs/guide/information_and_tips.md) @@ -38,7 +37,9 @@ _Carry out the points step by step as described here. This is the quickest way t - [option: lockout relay](/docs/guide/relay.md) - [option: RPi image from scratch](/docs/guide/add_on_zero2.md) -A comprehensive guide on how to setup the LightningATM can be found here https://docs.lightningatm.me. Also join the Telegram group of LightningATM builders here https://t.me/lightningatm_building or contact 21isenough on Twitter (https://twitter.com/21isenough). +If you want to update your ATM version, see this guide: [Update](/docs/guide/we_need_your_help.md) + +More information of how to setup the LightningATM can be found here https://docs.lightningatm.me. Also join the Telegram group of LightningATM builders here https://t.me/lightningatm_building or contact 21isenough on Twitter (https://twitter.com/21isenough). To see the Lightning ATM in action, check out this video [LightningATM in action](https://twitter.com/21isenough/status/1170808396955738114?s=20) diff --git a/app.py b/app.py index e899e2c..2c6bbcd 100755 --- a/app.py +++ b/app.py @@ -111,12 +111,13 @@ def button_pushed(): lnurlproxy = config.conf["lnurl"]["lnurlproxy"] activewallet = config.conf["atm"]["activewallet"] + camera = config.conf["atm"]["camera"] # Determine if LNURL Withdrawls are possible if lnurlproxy == "active" or activewallet == "lntxbot": - # 1. Ask if wallet supports LNURL + # 1. Ask if wallet supports LNURL, if camera available # 2. Offer to cancel and switch to normal scan # 3. Process payment - if activewallet == "lntxbot": + if activewallet == "lntxbot" and camera == True: display.update_lnurl_cancel_notice() time.sleep(5) if config.PUSHES == 1: @@ -135,6 +136,14 @@ def button_pushed(): softreset() return + # If no camera is available, process LNURL directly + if activewallet == "lntxbot": + # Process LNURL + logger.info("LNURL process stared") + lntxbot.process_using_lnurl(config.SATS) + softreset() + return + if lnurlproxy == "active": display.update_lnurl_cancel_notice() time.sleep(5) @@ -483,7 +492,7 @@ def main(): except KeyboardInterrupt: display.update_shutdown_screen() logger.info("Application finished (Keyboard Interrupt)") - sys.exit("Manually Interrupted") + sys.exit(" Manually Interrupted") except Exception: logger.exception("Oh no, something bad happened! Restarting...") os.execv("/home/pi/LightningATM/app.py", [""]) diff --git a/docs/guide/autostart.md b/docs/guide/autostart.md index dfc9664..0fba594 100644 --- a/docs/guide/autostart.md +++ b/docs/guide/autostart.md @@ -1,6 +1,6 @@ -## Autostart +## Autostart and start/stop the ATM -###### Activate the Service: +###### Install and activate the autostart service: ``` $ cd ~/LightningATM @@ -9,7 +9,9 @@ $ sudo systemctl enable LightningATM.service $ sudo reboot ``` -###### Other commands to control the service: +- From now on the ATM will start automatically after booting. + +###### Commands to control the ATM: ``` $ sudo systemctl status LightningATM.service @@ -17,7 +19,8 @@ $ sudo systemctl stop LightningATM.service $ sudo systemctl start LightningATM.service ``` -- Note: From now on the ATM will start automatically after booting. 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. Don't forget to `start` the service again afterwards. +- `Note:` When the autostart service is once installed and activated, you only need to "start" the ATM if you previously stopped the ATM. +- `Note:` If you want to observe the app.py in tmux, you musst `stop` the "LightningATM.service" manually, bevor you start the app.py in the tmux. Then restart the ATM with the "start" command or simply restart the entire ATM afterwards by unplugging the power and plugging it back in. --- diff --git a/docs/guide/edit_app.md b/docs/guide/edit_app.md deleted file mode 100644 index 252ab05..0000000 --- a/docs/guide/edit_app.md +++ /dev/null @@ -1,34 +0,0 @@ -### 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` or just scroll down a few lines. -- There is a place where it says `if activewallet == "lntxbot"`, please edit the two lines below (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 to the pocket version - -app.py - Skip the "Prepare for LNURL" (example only fΓΌr ATM without push button) -![edit app](../pictures/edit_app_terminal_1.png) - ---- - -#### [edit_config](/docs/guide/edit_config.md) ᐊ previous | next ᐅ [debugging and tmux](/docs/guide/tmux_monitoring.md) - - - diff --git a/docs/guide/edit_config.md b/docs/guide/edit_config.md index a2d5f76..707879a 100644 --- a/docs/guide/edit_config.md +++ b/docs/guide/edit_config.md @@ -11,14 +11,14 @@ $ cd ~/LightningATM/ $ ./app.py ``` -- When you first start you will probably get an "Exiting.." message because the default display type is wrong. +- When you first start you will get an "No display configuration matched. Exiting...". - + -- You can ignore the message. The config.ini has now been created in the background. -- Now edit the config.ini as described in the next step. +- The config.ini has now been created in the background. +- Now edit the config.ini as described next step to set the display and other configurations. -`Note:` If the display is correct, the process will not "Exiting..". You have to stop it with `CTRL+C`. After a short time, `Manually Interrupted` is shown in the terminal window. +`Note:` If the display is already set correctly, the process will not "Exiting..". You have to stop it with `CTRL+C`. ### Open the config.ini file @@ -120,7 +120,7 @@ display ATM turned off! --- -#### [display](/docs/guide/display.md) ᐊ previous | next ᐅ [edit_app](/docs/guide/edit_app.md) +#### [display](/docs/guide/display.md) ᐊ previous | next ᐅ [debugging and tmux](/docs/guide/tmux_monitoring.md) diff --git a/docs/guide/tmux_monitoring.md b/docs/guide/tmux_monitoring.md index b262b5c..646f0ae 100644 --- a/docs/guide/tmux_monitoring.md +++ b/docs/guide/tmux_monitoring.md @@ -55,5 +55,5 @@ Two withdrawals were made here. Once 5 cents and once 1.60 euros (10 cents + 50 --- -#### [edit_app](/docs/guide/edit_app.md) ᐊ previous | next ᐅ [autostart](/docs/guide/autostart.md) +#### [edit_config](/docs/guide/edit_config.md) ᐊ previous | next ᐅ [autostart](/docs/guide/autostart.md) diff --git a/docs/guide/we_need_your_help.md b/docs/guide/we_need_your_help.md index af8540a..ef1b0c5 100644 --- a/docs/guide/we_need_your_help.md +++ b/docs/guide/we_need_your_help.md @@ -1,24 +1,48 @@ -## Would you like to help test the new version? πŸ“–πŸ§ +## Would you like to help test the new version? πŸ“œπŸ§ With this update comes a change of the GPIO inputs and outputs. This makes the inputs less sensitive to EMI interference that could lead to unwanted pulses. So if you had sporadic problems with your ATM, you should definitely try this update. In addition, the function of a lockout relay for the coin acceptor was also implemented with the update. A useful function that one or the other has certainly wished for after the coin impulses were lost or the coin value was incorrectly recognized. A detailed documentation can be found in the new chapter [option: lockout relay](/docs/guide/relay.md). +Also coming with this update is the option to enable or disable a camera. This has the advantage that you don't have to edit the app.py file to get rid of the LNURL query display, if you don't have a camera or a button. The option to set different languages will be added later. The implementation will take place in the next update. + +And finally, as a bit of service, the ATM briefly shows the Out of Service display once when it starts up. + To participate, you must update your AMT software once with this new version. Don't worry, we have written a step-by-step instructions for this that really anyone can use and all your configuration data such as wallet and settings will be retained. You can easily undo the whole thing afterwards --- -### 1. Update to the new version +### 1. Expand the config.ini -Log into the RPi and then stop the ATM service once, make a backup from directory LightningATM, clone the new Github to "temp", sync once from "temp" to "LightningAMT" and then delete the "temp" directory that is no longer needed. +Because we are also expanding the config.ini with this update, we unfortunately have to expand config.ini manually, otherwise we get an error message when starting the ATM. Expanding is not difficult and does not have to be undone later. First we log in again via SSH and stop the LightningATM service and call up the config.ini. $ sudo systemctl stop LightningATM.service + $ nano ~/.lightningATM/config.ini + +Then we add the following text between `centname = cent` and `# Set the Fee in %` + + # Set language: "en", "de", "fr", "it", "es", "pt", "tr" currently available + # Code 2 from https://www.science.co.il/language/Codes.php + language = en + + # Do you have a camera? "no" or "yes" + camera = no + + + +- When you finshed with changings in the config.ini, save and exit the editor: `CTRL+x -> y -> ENTER` +- `Help:` If you want to copy and paste the text, take the text to the clipboard and then place the cursor where you want to paste the text and right-click to paste. But important is just `language = en` and `camera = no`. + +### 2. Update to the new version + +Make a backup from directory LightningATM, clone the new Github to "temp", sync once from "temp" to "LightningAMT" and then delete the "temp" directory that is no longer needed. + $ mv LightningATM LightningATM_Backup $ git clone --branch master https://github.com/21isenough/LightningATM.git temp $ rsync -a temp/ LightningATM/ $ sudo rm -r temp -### 2. Start and test the version +### 3. Start and test the version $ cd LightningATM $ ./app.py @@ -27,7 +51,7 @@ Log into the RPi and then stop the ATM service once, make a backup from director - The ATM has started and you can use it normally or test the functions. - Stop the ATM with `CTRL+C` -### 3. If you don't like this version and want to get rid of it +### 4. If you don't like this version and want to get rid of it Make the backup the major version again and then delete the backup. @@ -38,7 +62,7 @@ Make the backup the major version again and then delete the backup. - Everthing should now be as befor. Even the wallat data. - Check if you have set a temporary button and reset it with `payoutdelay = 12` in the `config.ini` -### 4. Final step +### 5. Final step Restart the LightningATM service diff --git a/docs/pictures/edit_config_first_call_exiting.png b/docs/pictures/edit_config_first_call_exiting.png index e6e1407..feecdc9 100644 Binary files a/docs/pictures/edit_config_first_call_exiting.png and b/docs/pictures/edit_config_first_call_exiting.png differ diff --git a/docs/pictures/we_need_your_help_config.ini.png b/docs/pictures/we_need_your_help_config.ini.png new file mode 100644 index 0000000..c411173 Binary files /dev/null and b/docs/pictures/we_need_your_help_config.ini.png differ diff --git a/example_config.ini b/example_config.ini index 211029d..e580369 100644 --- a/example_config.ini +++ b/example_config.ini @@ -7,6 +7,13 @@ cur = eur # of your choice for price display (singular). centname = cent +# Set language: "en", "de", "fr", "it", "es", "pt", "tr" currently available +# Code 2 from https://www.science.co.il/language/Codes.php +language = en + +# Do you have a camera? "False" or "True" +camera = False + # Set the Fee in % fee = 2 @@ -24,7 +31,7 @@ dangermode = on # display = waveshare2in7 # display = inkyphat -display = papiruszero2in +display = # Automatically set during initial setup to LND or LNTXBOT # Current options are: