Push Waze Traffic Info through RDS-TMC?

rhodesman

Corporal
Mar 21, 2017
182
Maryland
I don't have rtti subscription, i cannot collect data to trace :\. I'm mobile developer, real problem in mobile is making phone talk to cic.

When i have time i will look at the binaries that you sent me. They might have connection strings in it.
Just as an FYI: I was looking into some older white papers I found that BMW published about their Navi systems and Traffic data and it looks like "RTTI" is what BMW calls ANY type of traffic information. In fact, the RDS-TMC traffic data my car gets now comes from a company they contracted to supply the traffic data for both FM radio broadcast AND Internet data delivery. Not really a big "ah-ha" but knowing that the traffic data is coming from the same place and just parsed differently depending on the market and model/optioned vehicle makes me feel more confident that getting any data type will span multiple delivery methods.

I started to dig into the traffic data as I can see it via the iDrive display and after reading the wikis on TMC from openstreetmap I noticed a correlation! Because TMC-FM data has a limited bandwidth, sending a ton of data is not feasible (like all the GPS coords, traffic type, speed of traffic, etc). TMC actually uses a more simple process that leverages the GPS unit's location processing and lookup. (You can see this simplification by viewing the list of reported traffic in iDrive.) Instead of sending gobs of data and coordinates to draw the traffic on the map, like Waze does, TMC-FM will take the closest intersections on said road where the traffic starts and ends as well as the road name/number and direction of travel. I do believe it also reports a level of severity (maybe 1-5 or something) because the traffic colors become more red the more severe the traffic report is.

Taking the data I get from Waze, I think I can parse this down for a TMC-FM/RTTI report as follows:
WAZE DATA:
Code:
{
    "alerts": []
    , "jams": [{
        "country": "US"
        , "city": "Lutherville-Timonium, MD"
        , "severity": ""
        , "delay": 82
        , "speed": 2.975
        , "type": "NONE"
        , "line": [{
            "x": -76.637208
            , "y": 39.45547
        }, {
            "x": -76.636583
            , "y": 39.455485
        }, {
            "x": -76.636065
            , "y": 39.455522
        }, {
            "x": -76.635303
            , "y": 39.455591
        }, {
            "x": -76.634862
            , "y": 39.455651
        }, {
            "x": -76.63436
            , "y": 39.455734
        }, {
            "x": -76.633815
            , "y": 39.455862
        }, {
            "x": -76.632918
            , "y": 39.456036
        }]
        , "street": "W Padonia Rd"
        , "roadType": 7
    }, {
        "country": "US"
        , "city": "Cockeysville, MD"
        , "severity": ""
        , "delay": 81
        , "speed": 1.7777777777777777
        , "type": "NONE"
        , "line": [{
            "x": -76.631014
            , "y": 39.472082
        }, {
            "x": -76.630866
            , "y": 39.473529
        }, {
            "x": -76.630777
            , "y": 39.474231
        }]
        , "street": "Greenside Dr"
        , "roadType": 2
    }]
}
Translated into RDS-TMC FM DATA:
Code:
{[
    {
        "country": "US"
        , "city": "Lutherville-Timonium, MD"
        , "severity": "1"
        , "from": "Deereco Rd"
        , "to": "York Rd"
        , "direction": "east"
        , "street": "W Padonia Rd"
    }, {
        "country": "US"
        , "city": "Cockeysville, MD"
        , "severity": "1"
        , "from": "Hidey Rd"
        , "to": "Warren Rd"
        , "direction": "north"
        , "street": "Greenside Dr"
    }]
}
 

Deadknight

Lurker
Jul 29, 2017
21
I appreciate your work. I remember reading somewhere that tmc is very slow and not always realtime. Then i tried to search, is there a possibility to "create proxy connected drive server over bluetooth" and found this forum from google.

The main problem here is sending rtti data to cic system.

I think i saw that you still have subscription to connected drive.
If you configure your pi as a bluetooth device that tether net to cic. Maybe you can find which data goes in or out for rtti.(or full connected drive api). If api is out, writing server is easy part.

There is a topic here, you can check for net over bluetooth.

http://www.bimmerfest.com/forums/#/topics/635748

Ps:If you are going to do coding please be careful.
 

rhodesman

Corporal
Mar 21, 2017
182
Maryland
Okay guys, I have...something! Not 100% what I am aiming for, but its a great first step! I have built a quazi modern police "detector". it uses Waze data and your current location to display any alerts on a small 16x2 LCD screen via an arduino uno. The system runs in two parts,
  1. A raspberry Pi connected to the internet grabs your current position and send it to my server for processing.
  2. server receives the data, then filters and queries waze for any alerts (and traffic) in your area.
  3. the server then sends the raspberry pi back the curated data
  4. raspberry pi checks the data (sent via json) for any current alert information and sends the data over serial to the Arduino for displaying anything on the LCD
  5. The traffic data is there, but not processed at this time (still working on getting it to update the iDrive GPS map)
Only problem I have is that I'm somehow grabbing the GPS location wrong from the GPS dongle and after about a minute or so I get a socket error from the GPS and the raspberry pi (via the app) will crash. I could use someones help to look at my code and see if anything is out of sorts. I think the problem is either I am not closing the connection to the GPS once I get the data or (ideally) I am not using the watch command properly thus I keep opening & watching socket connections without closing any.

I just need a second set of eyes on it, anyone who can help I will gladly share the hardware setup and allow you to use my personal server to help beta test my app. I might go to market with it, but will probably just allow people to have it for free because I suck at marketing (even though I work for a marketing company!) LOL.

You can find the github repo here: https://github.com/rhodesman/waze-alerts

Please reply here or PM me if you grab the code, since this is running on my personal server, I don't want to have a panic if data starts to go nuts on it and I'm not aware of anyone testing. ;)

because everyone likes pictures...
[Broken Image Removed]
 
Last edited by a moderator:
  • 1Like
Reactions: doublespaces

rhodesman

Corporal
Mar 21, 2017
182
Maryland
Pretty neat! So there is nothing actually RDS here, just parsing Waze data and displaying it on a dedicated RPi screen?
for the time being, yeah. That's my end goal (or pushing the data directly onto the iDrive system) to get the traffic data from waze to display on the idrive map. But I also wanted to do something with the alerts from waze and that was slightly lower hanging fruit. Once I get the data going in and out of the raspberry pi efficiently (still a bit buggy, but after a code refactor last night, it's better), I'll turn my sights on the iDrive map. the data is there, I just need to find a way to get it onto the screen!
 
  • 1Like
Reactions: doublespaces

doublespaces

Administrator
Oct 18, 2016
8,224
AZ
for the time being, yeah. That's my end goal (or pushing the data directly onto the iDrive system) to get the traffic data from waze to display on the idrive map. But I also wanted to do something with the alerts from waze and that was slightly lower hanging fruit. Once I get the data going in and out of the raspberry pi efficiently (still a bit buggy, but after a code refactor last night, it's better), I'll turn my sights on the iDrive map. the data is there, I just need to find a way to get it onto the screen!
If you can work the chimes, that would be pretty sweet.
 
  • 1Like
Reactions: rhodesman

Deadknight

Lurker
Jul 29, 2017
21
Okay guys, I have...something! Not 100% what I am aiming for, but its a great first step! I have built a quazi modern police "detector". it uses Waze data and your current location to display any alerts on a small 16x2 LCD screen via an arduino uno. The system runs in two parts,
  1. A raspberry Pi connected to the internet grabs your current position and send it to my server for processing.
  2. server receives the data, then filters and queries waze for any alerts (and traffic) in your area.
  3. the server then sends the raspberry pi back the curated data
  4. raspberry pi checks the data (sent via json) for any current alert information and sends the data over serial to the Arduino for displaying anything on the LCD
  5. The traffic data is there, but not processed at this time (still working on getting it to update the iDrive GPS map)
Only problem I have is that I'm somehow grabbing the GPS location wrong from the GPS dongle and after about a minute or so I get a socket error from the GPS and the raspberry pi (via the app) will crash. I could use someones help to look at my code and see if anything is out of sorts. I think the problem is either I am not closing the connection to the GPS once I get the data or (ideally) I am not using the watch command properly thus I keep opening & watching socket connections without closing any.

I just need a second set of eyes on it, anyone who can help I will gladly share the hardware setup and allow you to use my personal server to help beta test my app. I might go to market with it, but will probably just allow people to have it for free because I suck at marketing (even though I work for a marketing company!) LOL.

You can find the github repo here: https://github.com/rhodesman/waze-alerts

Please reply here or PM me if you grab the code, since this is running on my personal server, I don't want to have a panic if data starts to go nuts on it and I'm not aware of anyone testing. ;)

because everyone likes pictures...

There might be something here

client.js 74
Code:
if(listener.isConnected() == false) {
  listener.connect(function() {
  listener.watch();
  });
  callGps(function(tpv) {
    mainProg(tpv);
  });
}
You do not wait connection to call your position function.

Code:
if(listener.isConnected() == false) {
  listener.connect(function() {
    listener.watch();
    callGps(function(tpv) {
      mainProg(tpv);
    });
  });
}
I haven't checked your application loop but this is an error i think.

(why node.js :D)
 
Last edited by a moderator:
  • 1Informative
Reactions: rhodesman

rhodesman

Corporal
Mar 21, 2017
182
Maryland
There might be something here

client.js 74
[...]
Thanks! I did make a ton of edits to the code and refactored a bunch of stuff. Currently, after discovering Waze changed their data format, I'm having to rewrite the server code for searching the waze data. Once I get that buttoned up I'll be pushing a whole new repo to github with client and server code.

(why node.js :D)
LOL, I'm a front end developer/user interface designer so javascript is more familiar to me. However, I've never written a full node.js app like this, so it's been a huge learning experience for me to say the least!
 
  • 1Like
Reactions: doublespaces

rhodesman

Corporal
Mar 21, 2017
182
Maryland
If you can work the chimes, that would be pretty sweet.
there actually is a popup alert system built into iDrive (like when you get warnings about fuel or DTC/traction control settings changing). If there is a way to tap into that, that would be DOPE! However, that is so beyond my capabilities as of now, might need someone who is an ACTUAL programmer to help me on that part. ;)
 

rhodesman

Corporal
Mar 21, 2017
182
Maryland
Re-reading this thread and if we can get some more programming/data collection help, I would LOVE to resurrect this!! All my code is sitting there and the raspberry pi is already setup and can run it just fine, it's just that data parsing for TMC I'm at a loss with.
 
  • 1Agree
Reactions: doublespaces

cookiesowns

Lurker
Nov 13, 2017
24
I just edited the code in my github repo. I removed the calls to my local server that was in the code, so I think I'm good now.
You might want to rebase your GH branch or force push with that commit removed. It's forever on the public internet so people can see the hostname.

That said, I'll take a look soon. I'm a JS / Web engineer as well but will be working with a team of embedded devs soon, maybe I can make a side project out of this.
 
Top