Payment Terminal with 4 seven segment displays

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken
Paying for cofee

experimental - security/privacy & reliability is not yet quite at the level required

Payment-7seg-samples.jpg front - waiting to be connected Crokypay Spot heater control as mounted.jpg

Prototype voor bier/koffie afrekenen. Zie SpaceTegoed voor een overzicht/plan, Payment and Paring REST protocol for the protocol and [github for code].

Prototype simpele/een functie terminal; betaling van 1.75 euro

Wat doet het

Bij dit type betaal terminal kan je maar voor één ding, met een vaste prijs, betalen.

Prototype simpele/een functie terminal; betaling van 1 euro

Gebruikt instructie

  1. Het 7 segment display toont het bedrag een euro's. (Dat blijft altijd hetzelfde (het komt elke nacht uit het CRM systeem - zie de prijslijst op https://makerspaceleiden.nl/crm/pettycash/).
  2. Swipe je tag langs de terminal.
  3. Het display toont '[--]' en vervolgens 'PAID'. Je hebt nu betaald. Je krijgt een emailtje met de details van je betaling. Hier staat het bedrag in; de naam/locatie van de terminal en eventueel een beschrijving. En je zit dit in het overzicht op de website.
  4. Daarna gaat het weer terug naar stap 1.

Een filmpje van een prototype: https://vimeo.com/manage/videos/625531264

Indien de betaling fout gaat zie je de text 'FAIL' en een cryptische 3 cijferige foutcode.

Op de server wordt bijgehouden wat er fout ging. Als gebruiker kun je in dit geval niet veel meer doen dan via het CRM betalen, cash betalen, het bij de mailing lijst melden, of het later weer proberen.

Trouble shooting

It is possible to 'telnet' into these units (on the normal telnet port #23) and see what normally would come out of the serial port. The units also sent their logging to syslog (to the spaceserver, 192.168.6.1).

Check the firewall, use a [MDNS] [resolver] (or simply the Arduino IDE) to discover their IP address. You can do this from the RaspPi next to the VinylCutter / Vinylsnijder.

MAC Versie Mac address IP address
NodeBier 1.05 3C:71:BF:43:0F:E4 telnet://192.168.6.131/
NodeKoffie 1.05 24:0A:C4:97:2B:74 telnet://192.168.6.189/
NodeChips 1.08 3C:71:BF:D0:6A:08 telnet://192.168.6.49/
NodeSpotHeating n/a n/a n/a


The NodeSpotHeating is a special version of this payment node.

Version deployed as of November 2021: https://github.com/dirkx/makerspaceleiden-payment-node-7segments/releases/tag/v1.05 -- with no PCB

Version deployed as of Januari 2024: https://github.com/dirkx/makerspaceleiden-payment-node-7segments/releases/tag/v1.07 -- against the green PCB

telnet

All of above can be reached by 'telnet'. A typical session looks like:

$ telnet 10.13.0.241 23
4x7-F1-05-430fe4 Serial connected 3C:71:BF:43:0F:E4
Good scan
Payment completed successfully.
Wed Nov  3 19:02:11 Heap: 181 Kb

Any error message (post joining the Wifi network) will show up here. If the issue is prior to joining WiFi - you will have to connect a USB cable (Baudrate 115200, 8N1). The Raspi has the right drivers installed.

Furthermore - if you connect to space.makerspaceleiden.nl via MQTT - then you can also see the output:

TOPIC: ac/log/tft-1.04-cbb67c 
   Grijpvoorraad {
  "rfid_scans": 0,
  "rfid_misses": 0,
  "ota": true,
  "state": 3,
  "IP_address": "192.168.6.200",
  "Mac_address": "C8:C9:A3:CB:B6:7C",
  "Paid": 0,
  "Version": "1.04",
  "Firmware": "tft-1.04-cbb67c",
  "heap": 139667
}

Display messages

  1. During startup
    1. F X-YY - version number firmware during booting.
    2. CONN - connecting to WiFi
    3. NTP - getting the time
    4. F CA - Fetching the Certificate Authority
    5. F PL - Fetching the price list
    6. FAIL - failed to connect to WiFi; will reboot.
    7. any error message - scrolling error message & after which either reboot or hang if it unrecoverable.
  2. At the end of startup (from this point onwards OTA is possible).
    1. ---- - fully started up; but have not yet gotten the pricelist
    2. no prices - price list could not be fetched. Will retry for a few minutes every 15 seconds; then reboot.
  3. In normal payment mode
    1. X.YY - price to pay when you swipe
    2. [--] - in the process of paying
    3. paid - you have paid
    4. FAIL - payment failed
    5. any error message - scrolling error message.
      1. FAIL -1 - netwerk/wifi error. Powercyle de unit.
      2. FAIL -4 - netwerk/wifi error. Powercyle de unit.
      3. FAIL 40X Gebruik je een geldige tag ?
      4. FAIL 500 Error op de server; mail noc@.
  4. During Over the Air reprogramming.
    1. PROG - start of OTA update
    2. F XX - OTA; uploading new firmware; XX is the percentage fetched
    3. DONE - successful end of OTA. Unit will reboot.
    4. any error message - scrolling error message & after which the device will switch back to the old/current firmware
      1. FO:AF - OTA authentication failed
      2. FO:BF - OTA begin failed
      3. FO:CF - OTA connect failed
      4. FO:RF - OTA receive failed
      5. FO:EF - OTA end failed
      6. FO:OF - OTA 'other' failure
  5. During initial pairing / post an OTA
    1. REG Registering with the server
    2. PAIR requesting to pair; swipe an admin tag.
    3. Er:NA Fault Name - unit was paired but does not yet have a name/pricelist assigned (v1.08 and higher)
    4. any error message - scrolling error message.

3D printed prototype

Note: er zijn inmiddels kant en klaar printjes voor een volgende - vraag dirkx.

wiring wiring box

Code is at https://github.com/MakerspaceLeiden/makerspaceleiden-payment-node-7segments.

Het 3D printje ([OpenSCAD en STL file]) in het code repository) is voor een stel afstandhouders & montage plaat die passen in een G21 doosje met transparant deksel. Zodat de RFID reader flush genoeg is om makkelijk pasjes te kunnen lezen. Er liggen nog G21 doosjes onder in de groene kast.

Er zit een kleine AC/5V DC schakelende voeding onder de montage plaat. Hiermee is alle 220 volt weggebouwd onder de montage plaat - die je 'extra' moet losschroeven na loshalen deksel. Er liggen nog wat van die voedingen in de E-laatjes.

v1.03 prototype v1.03 prototype v1.03 prototype

Caveat prototype - de standoffs zijn 2mm korter gemaakt om net wat meer ruimte te krijgen bij het display. Dit is gecorrigeerd in version 1.03 in van de STL/openScad file in git.

Bill of materials

Materialen; duurste onderdelen eerst:

  1. ESP32: 7 euro - https://www.amazon.nl/AZDelivery-Development-opvolger-compatibel-Inclusief/dp/B074RG86SR/ref=sr_1_9
  2. PVC Doosje: 4 euro - [[aliexpress or Amazon [1], [2] or [3].
  3. 7 segment display: 2.50 euro - https://www.amazon.nl/Youmile-Display-Gemeenschappelijke-Digitale-Man-vrouw/dp/B082193P1V/ref=sr_1_33
  4. 1 RFID reader; ~2.50 Euro; (https://www.amazon.nl/gp/product/B074S9FZC5)
  5. AC/5V transformer: 1.00 euro - https://www.aliexpress.com/item/33012749903.html
  6. 1 doorvoerwartel; 12mm: 0.35 euro (voorraad space, https://www.aliexpress.com/item/32866592761.html)
  7. netsnoer - weggooikast space
  8. draadjes - electronica hoek
  9. PLA (hoeft beslist geen PLA te zijn) - ~ 14 gram / krap 2 meter (voorraad space) om [[1]] uit te printen.
  10. 4 spijkertjes & willekeurige (super)glue voor PVC/PLA -- om de standoffs onder de montage plaat wat extra steun te geven middels de gaatjes in het kastje (voorraad space)
  11. drie tie-wraps (voorraad space)

Totaal: < 20 euro; 4 uur printen; 30 minuten solderen/assemblage.

Compileren software

  1. Installeer een recente versie van [[2]].
  2. Installeer een stable versie van de SDK voor de ESP32 volgens https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html
  3. Selecteer in tools het platform ESP32 en dan het board dat je gebruikt (WRover, Devkit)
  4. Installeer via de 'Library' optie de bibliotheken MFRC522-spi-i2c-uart-async, TM1637TinyDisplay en Arduino_JSON
  5. Haal een git/zip versie op van https://github.com/MakerSpaceLeiden/makerspaceleiden-payment-node-7segments/
  6. Zet de #defines met de netwerk namen goed. Kies een unique terminal naam.
  7. Overleg met noc@ voor een 'bearer token' voor toegang als je de productie versie maakt.
  8. Idem voor het OTA wachtwoord.
  9. Compiler & flash via serial (daarna kan het via OTA).
    1. Nota bene: with the cheaper boards; it may be needed to press 'BOOT' during the start of the programming.

Bouw instructie

If any more need to be build - contact Dirk-Willem; as he has 5 pre-made circuitboards with all/most of the wiring already made.

Payment-7seg-bouw-4.jpg Payment-7seg-bouw-8.jpg Payment-7seg-bouw-9.jpg Payment-7seg-bouw-1.jpg Payment-7seg-bouw-2.jpg Payment-7seg-bouw-3.jpg Payment-7seg-bouw-5.jpg Payment-7seg-bouw-7.jpg

Activatie

Zie SpaceTegoed#Het_koppelen_van_betaalterminals_aan_het_betaalsysteem voor de activatie procedure. Overleg even met het bestuur om je pas ge-accordeert te krijgen voor test/initiatie & test betalingen.

Wiring 7 segments display

Functie ESP32 Board
DATA GPIO 25 4
CLK GPIO 26 3
VCC 7 segments display 3V3 2
GND 7 segments display GND 1

Wiring RFID RC522 card

SCA/SS RFID GPIO 5 8
SCL RFID GPIO 18 7
MOSI RFID GPIO 23 6
MISO RFID GPIO 19 5
IRQ GPIO 22 4
GND GND 3
RST GPIO 21 2
VCC 3V3 1

Versions build

Beer node

Payment-7seg-bouw-11.jpg

  • Wifi-Mac address ends with 430FE4
  • Has Uses pin 15 rather than 15 and RST/IRQ is swapped
  • Versie 1.02 van de mount plate.
  • Standoffs niet platgespoten

Current software: https://github.com/dirkx/makerspaceleiden-payment-node-7segments/releases/tag/v1.05

Coffee node

Payment-7seg-bouw-10.jpg Payment-7seg-coffe.jpg

  • Wifi-Mac address ends with 972b75
  • Correct wiring.
  • Hole for the gland slightly too high.
  • Versie 1.04 van de mount plate.
  • Rode ledje is gedesoldeerd (want zwart maken lukte niet erg)

Current software: https://github.com/dirkx/makerspaceleiden-payment-node-7segments/releases/tag/v1.05

Crisp Node

Crokypay

  • Wifi-Mac address: 3C:71:BF:D0:6A:08
  • Software version 1.08
  • Uses Green PCB that has been butchered a fair bit.
  • Normal 220v AC/DC 5 volt power supply (0.2 Watt)
  • Top dot of the 7-segment display has been painted black
  • TODO: Boards are floating a bit - would benefit from some TLC or a rebuild

Heating Node

Spot heater control as mounted.jpg

See this page on paying for heating in the metal work area for details.