NodeSpotHeating: verschil tussen versies

Uit MakerSpace Leiden
Ga naar: navigatie, zoeken
(What does it do)
Regel 1: Regel 1:
 
[[Categorie:Project]][[Categorie:Docs]][[Categorie:PaymentSystem]][[Categorie:ACNode]]
 
[[Categorie:Project]][[Categorie:Docs]][[Categorie:PaymentSystem]][[Categorie:ACNode]]
 +
 +
note: code nu at https://github.com/dirkx/makerspaceleiden-payment-node-7segments/tree/COUNTDOWN - to be merged to the main tree once tested.
  
 
Node for paying for spot heating in the Metal area (the thing `high up'). It is a variation on the [[Payment Terminal with 4 seven segment displays|payment terminals used for coffee and beer]].
 
Node for paying for spot heating in the Metal area (the thing `high up'). It is a variation on the [[Payment Terminal with 4 seven segment displays|payment terminals used for coffee and beer]].

Versie van 21 sep 2022 om 20:43


note: code nu at https://github.com/dirkx/makerspaceleiden-payment-node-7segments/tree/COUNTDOWN - to be merged to the main tree once tested.

Node for paying for spot heating in the Metal area (the thing `high up'). It is a variation on the payment terminals used for coffee and beer.

What does it do

Swipe ones to get 15 minutes of heating. Swipe twice for 30 minutes; and so on. The display will show 15:00, 30:00 and so on. And then change every second to 14:59, 14:58 and so on.

Once you've swiped - the display changes from the price to a countdown. You can swipe at any time - and if your payment clears; you simply get another 15 minutes added to the `on time'.

During this time the heating is on. Once it reaches 00:00 - the heating switches off.

Important for maintainers

See SpaceTegoed for technical information, Payment and Paring REST protocol for the protocol and [github for code].

The descriptive name of the node in the CRM needs to start with the minutes of heating provided; as digitas; as the very first thing in the descriptive text. E.g. "15 minutes of heating" or "15 minuutjes warmte". As the software picks up this as the countdown value (together with the price).

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
NodeSpotHeating 1.65 ???? 192.168.6.???

Version deployed as of September 2022: https://github.com/dirkx/makerspaceleiden-payment-node-7segments/releases/tag/v1.06

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 
   NodeSpotHeating {
  "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. MM:SS -- a minute and second countdown. Once at zero - the heating switches off.
    5. FAIL - payment failed
    6. 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
  5. During initial pairing / post an OTA
    1. REG Registering with the server
    2. PAIR requesting to pair; swipe an admin tag.
    3. any error message - scrolling error message.

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

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:
  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 relays - 5 Volt, voor 230 VAC / 2000 watt.
  7. 3 doorvoerwartel; 12mm: 0.35 euro (voorraad space, https://www.aliexpress.com/item/32866592761.html)
  8. netsnoer - weggooikast space
  9. draadjes - electronica hoek
  10. drie tie-wraps (voorraad space)

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

Compileren software

  1. Installeer een recente versie van [[1]].
  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.

Versions build

Node Spot Heating

  • Wifi-Mac address ends with XXXX

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