maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Fahrplan for N900 now supports Translink in Queensland, Australia (https://talk.maemo.org/showthread.php?t=99029)

jonwil 2017-03-02 23:01

Fahrplan for N900 now supports Translink in Queensland, Australia
 
2 Attachment(s)
Since the current version of Fahrplan (at https://github.com/smurfy/fahrplan) no longer supports the N900 and since plans to mate the backend part of that with a N900 compatible frontend seem to have died (Halftux posted an unfinished binary back in 2015 with no source code being posted and no further updates), I have taken the version of Fahrplan in extras-devel and added support for Translink here in Queensland, Australia.

It works by making the same HTTP POST requests as the journey planner web page that's built into the official Translink app for Android (at https://app.jp.translink.com.au/plan...ourney-planner) and parsing the JSON you get back.

GPS lookups (i.e. find the location closest to your current GPS coordinates) are supported as well as looking up by string (e.g. type "Beenleigh" and get "Beenleigh Station", "Beenleigh Mall", "Beenleigh Library" etc back for you to pick the one you want)

I have attached a source tarball with all my changes in it plus a binary .deb package.
Running it will require libqjson0 0.8.1 from extras-devel (http://repository.maemo.org/extras-d...tle0_armel.deb) to be installed on your phone and compiling it will require that plus libqjson-dev 0.8.1 from extras-devel (http://repository.maemo.org/extras-d...tle0_armel.deb) to be installed in your dev environment. Everything else is the same as stock Maemo.

Please let me know what you think (e.g. are there things I can do better/differently, things that dont work or information I should be displaying but don't)

jonwil 2017-03-02 23:15

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
2 Attachment(s)
Just made a small fix, now it should work properly.

Halftux 2017-03-03 08:45

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
Quote:

Originally Posted by jonwil (Post 1524636)
Since the current version of Fahrplan (at https://github.com/smurfy/fahrplan) no longer supports the N900 and since plans to mate the backend part of that with a N900 compatible frontend seem to have died (Halftux posted an unfinished binary back in 2015 with no source code being posted and no further updates)

Yeah fahrplan is at the last position on my priority list. I will only working on it if all other projects are finished and I fear this will never happen. My personal interest is very low because I never take the train. I am a car driver. The application still needs some love. At the moment no GPS, no Calendar support and the gui need some polishing. However the backend is much better than fahrplan1.

Packed what I found on my hdd into a zip:

https://www.file-upload.net/download...plan2.zip.html

jonwil 2017-03-03 09:17

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
What libraries are required for this code? Do I need anything beyond the standard QT libraries that are included on the N900? (and if so, what package(s) do I need to install and where do I get them from)

Halftux 2017-03-03 10:22

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
Quote:

Originally Posted by jonwil (Post 1524656)
What libraries are required for this code? Do I need anything beyond the standard QT libraries that are included on the N900? (and if so, what package(s) do I need to install and where do I get them from)

You will need qtmobility12 from extras at least I wanted to use it for the calendar and gps things and the project file is configured to use it.
The project file needs to be cleaned, if you want compile it for all supported targets, furthermore I not removed the qml fremantle stuff what was already there.

jonwil 2017-03-04 05:04

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
At this point I am going to stick with the existing Fahrplan code rather than trying to get the incomplete Farhplan2 Fremantle UI working.

There is one more feature I would like to add if I can figure out how, namely being able to click on a leg of a journey and have a map be displayed.

Firstly I have to figure out how to make the items for each leg clickable (dont know enough about QT to do that yet), secondly I have to figure out how to trigger microb to open and display a web URL (since implementing my own internal browser widget to display the maps is out of the question) and thirdly I need to figure out what sort of map to display.

Do I display the existing Google static maps image URLs (which aren't the best in terms of size or usefulness) I get back in the JSON Translink sends me? (e.g. something like this https://maps.google.com/maps/api/sta...sITUCziNZXiow= )

Do I figure out the mess of how to get an API key, figure out how to keep it secret (despite this program being 100% open source and despite reverse engineering Maemo apps being trivial) and somehow generate my own static maps URLs with better parameters (e.g. larger size image, different zoom level etc) all the while trying to figure out how not to exceed the limit on the number of static map requests you can get from Google before you have to start paying?

Do I try and somehow open Nokia Maps and display something there?

Do I find another web-based mapping solution that doesn't have the limits of Google?

jonwil 2017-03-08 12:33

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
2 Attachment(s)
Just fixed an issue with time conversion where times between 12:00 and 1:00 (AM or PM) would not convert properly and would return wrong results.

Still trying to figure out what, if anything, I want to do about maps and things.

Halftux 2017-03-10 08:58

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
Uploaded fahrplan 0.0.35 to extra-devel.

- changed app version in mainwindow.h
- added pkgconfig in pro for qjson
- added Jonwil to the author list

Selecting Translink and do a search was working tested nothing more.
Well done jonwil.

jonwil 2017-03-18 02:36

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
2 Attachment(s)
I have fixed another issue where it was displaying "-1 transfers" in the case where the journey only had a single walking leg and no actual transport journeys.

I am so glad I found that the Translink journey planner website had a nice clean JSON backend I could take advantage of :)

Still not sure what to do about the maps though, at this point I am thinking that if I can figure out how to make the individual legs of the journey clickable I will make it open the Google Maps Static Map URL that comes in the JSON response data in the microb browser (at least that would display something useful-enough to e.g. see where you need to walk for a walking leg)

jonwil 2018-05-05 13:38

Re: Fahrplan for N900 now supports Translink in Queensland, Australia
 
I have just fixed Fahrplan on Translink, turns out Translink started using a DDOS protection service that means the SSL connection now needs the correct Server Name Indication value.
Backported the SNI support from QT 4.7.8 and made the necessary change to Fahrplan to use the support and now it works again.

The QT source change/backport has been committed to https://github.com/community-ssu/qt-x11-maemo

If you want to run the new Fahrplan you need to be running the latest CSSU-testing (with e.g. libqt4-core_4.7.4~git20110505+cssu12 installed) then install the new libqt4-network from https://drive.google.com/file/d/1L7T...ew?usp=sharing
and the new Fahrplan from https://drive.google.com/file/d/1gP7...ew?usp=sharing

The Fahrplan source code is available at https://drive.google.com/file/d/1O-u...ew?usp=sharing
(files were too big to attach to the post so I put them on Google Drive instead)

If you want to rebuild the new Fahrplan with the changes, you will need to grab the QT4 repo with the patches in it, build that and install the relavent bits into your SB repository then build Fahrplan.

Oh and obviously if you have other patches to QT such as the ones for supporting TLS 1.2 (or are running some other version of QT that doesn't include the SNI support) you will need to make the changes yourself)

But for someone who just wants to be able to do journey planning for Translink SE QLD on their N900, install the 2 new deb files and everything will work again :)

EDIT: I should probably have bumped the version number and updated the changelog but I just wanted to get it working as fast as possible :)


All times are GMT. The time now is 14:38.

vBulletin® Version 3.8.8