Archive:Bahn Freifunk

From The Munich Maker Lab's Wiki
Revision as of 11:21, 7 January 2016 by Tiefpunkt (talk | contribs) (braindump)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 
bahn.freifunk.de

Release status: experimental [box doku]

Description Free WiFi for all ICE passengers
Author(s)  Severin

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.

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. The TPLINK TL-MR3020 seems to be a good candidate. Will order one in the next reichelt order.