Matkakortti

Rating: 
4.916665
Your rating: None Average: 4.9 (12 votes)

Application for reading HSL (Helsinki Region Transport) and Tampere (Nysse) travel cards.

Requires NFC support and Sailfish OS 3.3 or newer.

Source code: https://github.com/monich/harbour-matkakortti

Screenshots: 

Keywords:

Application versions: 
AttachmentSizeDate
File harbour-matkakortti-1.1.8-1.aarch64.rpm383.44 KB26/09/2023 - 01:50
File harbour-matkakortti-1.1.8-1.armv7hl.rpm396.99 KB26/09/2023 - 01:50
File harbour-matkakortti-1.1.7-1.aarch64.rpm384.11 KB22/06/2023 - 02:39
File harbour-matkakortti-1.1.7-1.armv7hl.rpm399.36 KB22/06/2023 - 02:39
File harbour-matkakortti-1.1.6-1.aarch64.rpm382.46 KB21/01/2023 - 15:53
File harbour-matkakortti-1.1.6-1.armv7hl.rpm397.53 KB21/01/2023 - 15:53
File harbour-matkakortti-1.1.5-1.aarch64.rpm382.21 KB15/01/2023 - 03:41
File harbour-matkakortti-1.1.5-1.armv7hl.rpm397.48 KB15/01/2023 - 03:41
File harbour-matkakortti-1.1.4-1.aarch64.rpm377.65 KB07/08/2022 - 03:50
File harbour-matkakortti-1.1.4-1.armv7hl.rpm391.7 KB07/08/2022 - 03:50
File harbour-matkakortti-1.1.3-1.aarch64.rpm377.34 KB20/11/2021 - 07:09
File harbour-matkakortti-1.1.3-1.armv7hl.rpm391.06 KB20/11/2021 - 07:09
File harbour-matkakortti-1.1.2-25.1.aarch64.rpm380.25 KB29/05/2021 - 22:21
File harbour-matkakortti-1.1.2-25.1.armv7hl.rpm360.47 KB29/05/2021 - 22:21
File harbour-matkakortti-1.1.1-22.1.aarch64.rpm230.46 KB25/05/2021 - 02:32
File harbour-matkakortti-1.1.1-22.1.armv7hl.rpm210.42 KB01/06/2020 - 01:28
File harbour-matkakortti-1.1.0-21.1.armv7hl.rpm209.41 KB31/05/2020 - 02:28
File harbour-matkakortti-1.0.8-19.1.armv7hl.rpm163.59 KB04/03/2020 - 01:51
File harbour-matkakortti-1.0.7-17.1.armv7hl.rpm163.11 KB07/02/2020 - 23:41
File harbour-matkakortti-1.0.6-14.1.armv7hl.rpm157.96 KB06/12/2019 - 03:38
File harbour-matkakortti-1.0.5-13.1.armv7hl.rpm157.52 KB05/12/2019 - 21:14
File harbour-matkakortti-1.0.4-12.1.armv7hl.rpm157.39 KB03/12/2019 - 02:30
File harbour-matkakortti-1.0.3-11.1.armv7hl.rpm156.88 KB30/11/2019 - 18:40
File harbour-matkakortti-1.0.2-10.1.armv7hl.rpm136.74 KB26/11/2019 - 04:12
File harbour-matkakortti-1.0.1-8.1.armv7hl.rpm131.09 KB24/11/2019 - 23:20
File harbour-matkakortti-1.0.0-7.1.armv7hl.rpm130.3 KB23/11/2019 - 03:06
Changelog: 
  • 1.1.8 (Sep 26 2023)
    - Don't pop the state when any unsupported NFC target is detected
  • 1.1.7 (Jun 22 2023)
    - Don't pop the state when unsupported Type 4 card is detected
    - Slightly improved Nysse card support
  • 1.1.6 (Jan 21 2023)
    - Updated Russian translation
    - A few minor HSL page tweaks
  • 1.1.5 (Jan 15 2023)
    - Handle consecutive HSL period tickets
    - Show inactive HSL period ticket on tap
    - Sailjail compatibility
  • 1.1.4 (Jul 7 2022)
    - Show price of HSL season ticket
    - Show boarding area for last HSL ticket
    - Tweaked formatting of group ticket price in HSL history
  • 1.1.3 (Nov 20 2021)
    - Improved reaction to unsupported NFC cards
    - Tweaked colors for light ambiences
  • 1.1.2 (May 29 2021)
    - Dynamic cover background
    - Show card type in the page header
    - Try the last used card type first
    - Freshened up the UI
  • 1.1.1 (Jun 1 2020)
    - Russian translation
    - Updated Chinese translation
  • 1.1.0 (May 31 2020)
    - Support for Tampere travel cards (somewhat experimental)
  • 1.0.8 (Mar 4 2020)
    - Handle extension tickets
  • 1.0.7 (Feb 7 2020)
    - Show remaining balance in the history view
    - React to system time changes
    - Fixed memory leak
  • 1.0.6 (Dec 6 2019)
    - Mark group tickets in the history tab
    - Fixed system time change detection
  • 1.0.5 (Dec 5 2019)
    - Fixed total price for group tickets
  • 1.0.4 (Dec 2 2019)
    - Polish translation
  • 1.0.3 (Nov 30 2019)
    - Redesigned cover
    - Swedish translation
    - Chinese translation
  • 1.0.2 (Nov 26 2019)
    - Added journey history
    - Fixed Finnish translation
  • 1.0.1 (Nov 24 2019)
    - Fixed multi-zone mapping
  • 1.0.0 (Nov 23 2019)
    - Initial version

Comments

tuplasuhveli's picture

Hey and thanks for the useful app!

I wanted to let you know about the troubles I'm having. First of all, I have a Nysse travel card, that currently has a balance of 0,60€. However, the app states my balance is 6,30€. Also, the app tells me my current season is valid until 21.01.11761121. What does that mean? I haven't bought a season ticket in years.

Let me know if I can help with testing / debugging / whatever!

slava's picture

Yeah, I very rarely travel to Tampere, almost never use my Nysse card and don't have much data on it to play with. If you run NFC logger, then run Matkakortti, touch your Nysse card, switch back to NFC logger, save the NFC conversation and send the tarball to slava at monich dot com, I could take a look.

tuplasuhveli's picture

Hey, I followed your instructions and sent you the tar ball. Let's see if the logs reveal something. :--)

slava's picture

Yes, I have received it, will take a look. No guarantee though, the data format isn't documented anywhere, it's all reverse engineering and guesswork.

inte's picture

Hey, I think you would have to apply for a card since it is actually ment to store seasonal/monthly tickets. I'm not sure if it is possible to buy a card without a subscription... I can check this out. IF you ever happen to be in Hamburg I'd be happy to borrow you mine:-)

inte's picture

Do you think it would be possible to add support for HVV travel cards as well?

https://www.hvv.de/en/service/questions-and-answers/tickets-all-year-sea...

https://www.hvv.de/en/service/hvv-apps

I could provide a HVV card NFC file dump if that helps?

Thank you!

slava's picture

I doubt it if I don't physically have one (which I don't). If I happen to be in Hamburg, can I buy one, or is it only sold to residents?

ari_jarvio's picture

Should change that logo and a wallpaper of minimized application to another. It misleads because there is only the symbol of HSL

slava's picture

I basically agree and I'm open to suggestions :) I honestly did try to design some sort of neutral graphics for the cover but misirably failed to come up with anything that would look reasonably attractive. I'm much better at coding than designing graphical assets :/

TMavica's picture

Maybe some sailor got a Octopus card in Jolla?

slava's picture

Unlikely :/

TMavica's picture

Hope u got a Hong Kong Octopus card

slava's picture

If someone is interested in support for Waltti cards (Lathi, Jyväskylä, Lappeenranta, Kouvola, Kotka etc.) and willing to take NFC logs, please contact me. I have a Lathi card but it's empty and I can't really test anything with it.

mugshot's picture

Additionally, is there any chance to implement the HSL tickets? Is it included in the open API?

slava's picture

If you mean the purchase history - yes, I'm planning to add it too. It's there, on the card, it's just a matter of parsing and displaying it. And yes, its format is documented too (pleasant surprise).

mugshot's picture

I was actually referring to buying a new ticket.

slava's picture

That's unlikely.

mugshot's picture

Ok. Is it supported by the HSL API, do you know? If "someone" likes and knows how to implement it.. :P

slava's picture

If you mean changing the contents of the card, that must involve use of authentication keys built into validators and devices in R-kioski or wherever you put money on it. I find it hard to imagine that the card would allow to modify its contents without any sort of authorization. On top of that, such a communication should be encrypted (and most likely is, if the guys who designed it, knew what they were doing) to prevent OTA interception of the keys.

AFAICT Oma Matkakortti android app doesn't update the card. If it did, it would be possible to decompile it and pull keys, APDUs or whatever out of it.

And no, there's nothing about it in that piece of documentation which I found on github. I also saw something on the HSL web side, describing the general architecture of the payment system, but I haven't really read it because my Finnish is not particularly good and I did't feel motivated enough to run it through Google trunslate.

If you mean buying tickets over the Internet, it's too boring, I wouldn't bother implementing that :)

mugshot's picture

Ah, not adding value to the card, but similar as the HSL Matkakortti Android App has, the abitily build a single ticket that's either charged from the mobile bill or credit card. HSL hasn't even implemented online balance yet (for example Turku has had it for over a decade), so no high hopes there.. :D
I can check if I find something regarding this from their documentation - unfortunately I can't help with the coding because of total lack of skills. :P

edit: This ticket API, https://sales-api.hsl.fi/
Note: Use of the HSL OpenMaaS API is free of charge.

jokureiska's picture

With XA2 Plus Dual SIM works fine.

mugshot's picture

For some reason it doesn't work on my XA2 (H4113). It does recognize the NFC state, but doesn't read my HSL card. And no errors in terminal either.
Edit: Also, github link goes to qrshare github. ☺

slava's picture

Fixed the link, thanks!

slava's picture

What if you try with charger connected?

mugshot's picture

Yep, that worked!

slava's picture

There's a problem with NFC on XA2 - it stops working when the battery charge falls below certain level (60% or so) and no charger is connected. NFC chip starts sending misterios notifications with GID=0x01 (RF Management) and OID=0x23 (there's no such OID in NCI spec). Since the documentation on the NFC chip (AFAICT it's pn553) is not publicly available, it's not possible to tell how to ask the chip to keep working :(

martonmiklos's picture

You are correct PN553E2EV is the NFC chip used in the XA2. Schematic is public for XA2: https://fccid.io/PY7-67442A/Schematics/Schematics-20171116-v1-PY7-67442A... thanks to the lazy Sony engineers who forgot to fill the FCC Confidentality request!

By looking the publicly available datasheet it has a 80C51 with builtin ROM.

 

It might be useful to peek through the HAL layers of these repositories looking for the 0x23 values:

https://github.com/NXPNFCProject

mugshot's picture

Ok, thanks for the info. Usually for me it's enough to check the balance at home before I take the train, so now that I know about the battery level issue I think I can live with it. :)

direc85's picture

That sounds like a firmware issue. I'd suggest you create a question over at TJC about this.

slava's picture

If somebody has any idea what this 0x01/0x23 thing is, please contact me!

Pages