Archive:Bahn Freifunk: Difference between revisions

From The Munich Maker Lab's Wiki
Jump to navigation Jump to search
(picture and obsolete notice)
No edit summary
Line 1: Line 1:
{{AttentionBox
{{outdated|type=member project}}
| title = Obsolete Project
| msg = This project is not active anymore, and has lost some of its relevance. Deutsche Bahn WiFi has changed quite a bit, and is also now available in 2. class. Kept here only for archival and reference purposes.
}}
{{project
{{project
| name = bahn.freifunk.net
| name = bahn.freifunk.net

Revision as of 13:07, 10 September 2022

Attention.png You are visiting an old member project. The information found on "Bahn Freifunk" might be out of date.
     
bahn.freifunk.net

Release status: obsolete [box doku]

Bahnfreifunk01.jpg
Description Free WiFi for all ICE passengers
Author(s)  Severin
Download  https://github.com/tiefpunkt/bahnfreifunk

The Deutsche Bahn offers free WiFi for first-class passengers in their ICE trains. Let's share some love, and make that available to everyone.

How To

ATTENTION: THIS IS VERY MUCH ALPHA STATUS

How to set up your very own Bahn Freifunk node:

Get the hardware

Get a TP-LINK TP-MR3020 and a LOGILINK WL0151, the only harware this has ever been tested on.

If you want to try other hardware, read the README first.

Download and install the firmware

Download the firmware here: [1]

Then, connect to your MR3020, login to the webinterface, and use the "Update Firmware" function to get the firmware on your device

Note: If you already have OpenWRT running on the device, please use the sysupgrade version of the firmware, which you can find here: [2]

Post Installation

Now that you have installed the Bahn Freifunk Firmware on your device, you need to do at least one thing to secure it: set a root password. Unfortunately, this is still a little bit complicated.

  1. Power up your Bahn Freifunk node
  2. Connect to the bahn.freifunk.net wifi (or use a cable)
  3. Open a terminal on your PC (or the Windows Comandline, if your on Windows)
  4. Type in "telnet 192.168.1.1". This will initiate a telnet connection to your node. You should see a linux command prompt.
  5. Run "passwd" in that command prompt, and enter your new root password twice.
  6. Use "exit" to close the connection

Usage

Now get a first class ticket, hop on an ICE train, take a seat in first class, but as close to second class as possible, and plugin your Bahn Freifunk node. Everything else should happen automatically. Connect to the "bahn.freifunk.net" WiFi network and check whether it all works.

The HotSpot

The WiFi is operated by T-Mobile (SSID: Telekom_ICE), and their hotspots still require to click a few buttons to get online. Luckily, that can be automated.

Since both the first and second class WiFi share the same SSID, we first need to find out, where we are. This can be done like so:

curl -X POST -d '{"location":{},"user":{},"session":{},"partnerRegRequest":{}}' --header "Content-Type: application/json;charset=utf-8" https://hotspot.t-mobile.net/wlan/rest/contentapi

The reply in first class looks like this:

{  
    "location":{  
        "locationString":{  
            "country":"DE",
            "provider":"TMD",
            "venueType":"ForFree",
            "venue":"DB_First",
            "city":"On-Train",
            "hotspotId":"DE_DB0221"
        },
        "features":{  
            "partnerRegRequired":false,
            "fmapEnabled":true,
            "rememberMeEnabled":true,
            "discounts":{  
                "supported":true,
                "enabledByMonitoring":true,
                "fastTrackSupported":true
            },
            "businessModel":{  
                "paid":{  
                    "vouchers":{  
                        "PASS_86400_0_EUR":{  
                            "serviceID":402,
                            "type":"PASS",
                            "provider":"TMD",
                            "limitation":{  
                                "duration":86400,
                                "volume":0,
                                "speedStepDown":false
                            },
                            "price":4.95,
                            "currency":"EUR",
                            "paymentType":[  
                                "clickandbuy",
                                "kreditkarte",
                                "mobile_aperto",
                                "paypal"
                            ]
                        },
                        "PASS_604800_0_EUR":{  
                            "serviceID":403,
                            "type":"PASS",
                            "provider":"TMD",
                            "limitation":{  
                                "duration":604800,
                                "volume":0,
                                "speedStepDown":false
                            },
                            "price":19.95,
                            "currency":"EUR",
                            "paymentType":[  
                                "clickandbuy",
                                "kreditkarte",
                                "mobile_aperto",
                                "paypal"
                            ]
                        },
                        "PASS_2592000_0_EUR":{  
                            "serviceID":405,
                            "type":"PASS",
                            "provider":"TMD",
                            "limitation":{  
                                "duration":2592000,
                                "volume":0,
                                "speedStepDown":false
                            },
                            "price":29.95,
                            "currency":"EUR",
                            "paymentType":[  
                                "clickandbuy",
                                "kreditkarte",
                                "mobile_aperto",
                                "paypal"
                            ]
                        }
                    }
                },
                "forFree":{  
                    "limitation":{  
                        "duration":0,
                        "speedStepDown":false
                    }
                }
            }
        }
    },
    "user":{  
        "wlanLoginStatus":"offline"
    },
    "session":{  
        "direction":0,
        "speedSteppedDown":false,
        "loggedInWithFmapVoucher":false
    },
    "partnerRegRequest":{  
        "status":"forbidden"
    },
    "general":{  
        "previewMode":false,
        "allowTestCreditcards":false
    }
}

The "venueType":"ForFree" and "venue":"DB_First" seem to be some good indicators.

We can then login as follows

curl -X POST -d '{"location":{},"user":{},"session":{},"partnerRegRequest":{}}' --header "Content-Type: application/json;charset=utf-8" https://hotspot.t-mobile.net/wlan/rest/freeLogin

Reply:

{"user":{"wlanLoginStatus":"online"},"session":{"limitation":{"duration":0,"volume":0,"speedStepDown":false}, "loginTime":"15:05","clockInitialValue":0,"direction":1,"remainingVolume":0,"speedSteppedDown":false, "businessModel":"forFree","accountType":"FLAT","loggedInWithFmapVoucher":false}}

And we're online :)

Hardware

The idea is to get an OpenWRT router, add a second WiFi dongle, code some magic firmware on it, and we're good to go.

Router

The TPLINK TL-MR3020 seems to be a good candidate. Will order one in the next reichelt order.

Another candidate for a router: https://wiki.openwrt.org/toh/unbranded/a5-v11

Dongle

Will try out a few:

Firmware