r/spacex • u/rikkertkoppes • Feb 13 '17
Attempt at capturing telemetry from live webstream
Hi all, I have been working on creating an application that watches a live SpaceX launch webstream, captures the telemetry data from it and re-emits the values over a websocket bus.
https://github.com/rikkertkoppes/spacex-telemetry
Websocket Server
I have set up a websocket server at 162.13.159.86:13900
To connect to it, you can use mhub or a simple webpage using websockets or anything
npm install -g mhub
mhub-client -s 162.13.159.86 -n test -lwith this, you should receive test messages every 5 seconds or so
I will stream telemetry data when the webcast starts, and possibly a few times before to test it. This will be on the default node:
mhub-client -s 162.13.159.86 -o jsondata -lHere, I removed the "node" -n option and added the "output" -o option to get only json.
You can now do whatever you want with it, like piping it to a database or to file
mhub-client -s 162.13.159.86 -o jsondata -l > data.txt
mhub-client -s 162.13.159.86 -o jsondata -l | mongoimport --db spacex --collection telemetryBackground
This would allow others, to use that data for all sorts of (live) visualisations or post-launch analysis.
It is not at all done, but in the light if the upcoming launch, I thought I'd share it anyway, since some people may benefit already.
Caveats:
- I have not managed to get it properly working on Windows, only tested on ubuntu. Mac may or may not work.
The link to the webstream is currently hardcoded in the HTML, so if you want to play with the live stream of next week, you need to change it.It now points to the crs-10 tech webcast- It is really, really bare bones. Anything may happen
- The character recognition is not completely there, but you may be able to get some use out of it anyway.
The purpose of this post is basically to notify you that this now exists. If you would like to play with it, be my guest, I value your feedback. If you'd like to contribute, that is even better.
I will be polishing this thing some more in the next coming days, to be able to use the next launch as a test, the reason to get this out now is mostly due to the launch timeframe
18
u/MiniBrownie Feb 13 '17
Good job. This looks like a very interesting project with a bright future ahead of it. On Atlas launches the telemetry is hard to see, but on Ariane launches there is some easy-to-read telemetry. Am I right to believe, that this could fairly easily be transformed to get data from these launches as well?
This also looks like something, that flightclub.io could benefit from. I know he doesn't have much spare time and hasn't been very active here lately, but /u/TheVehicleDestroyer might be interested in this.
8
u/[deleted] Feb 13 '17
Something similar from NSF https://goo.gl/6jq9at
4
u/rikkertkoppes Feb 19 '17
That went nicely, here is the raw telemetry data for you to play with: https://github.com/rikkertkoppes/spacex-telemetry/blob/master/crs10.txt
4
u/JackONeill12 Feb 13 '17
This is great. One thing that would be nice would be an automatic way to store the captured data.
2
u/rikkertkoppes Feb 18 '17
Hi all, I have added server info in the op. As of this moment, I have some data flowing now as test, which is data from the last launch. Read the OP, but in short:
The character recognition is still not perfect (8's and 9's), but at least it is something you can mess around with
2
u/Srokap Feb 13 '17
I'd imagine ultimately you'd want telemetry dumped to file as sth as simple as CSV for later processing. Websocket is nice for live application, but nothing beats raw data in a file for later processing.
I wonder how some of browser side OCRs would handle that. You do a nice job normalizing the input. First thing I googled is https://github.com/antimatter15/ocrad.js shoudl be simple to give it a shot. Never used any of those, so curious how good would they be.
If shoving it all browser side would cause problems, I'd consider dumping series of preprocessed images and postprocess them in nodejs if we didn't care that much about live visualizations.
I might actually have a look at this and sent you a pull request.
128
u/mechakreidler Feb 13 '17
I probably will never use this, but just want to say it's a really cool idea and I love how much interesting content this subreddit produces
41
u/ygra Feb 13 '17 edited Feb 13 '17
Nice. I've seen in past webcasts that the unit for speed is sometimes m/s and sometimes km/s. So that would have to be read as well. I guess the results should include the units (or at least normalise them to probably the SI base units, i.e. m/s for speed and m for altitude).
14
u/Togusa09 Feb 13 '17
I've also been working on a similar applicatins for windows 8/10 that leverages the inbuilt windows video and OCR functions to extract the data and export a CSV: https://github.com/Togusa09/VideoTelemetryParser
It's still very much a work in progress.
2
u/Here_There_B_Dragons Feb 13 '17
Maybe we can get the nice gentlefolk at SpaceX to push this stuff over a websocket of some sort.
A few years ago, /u/orangeredstilton worked on an API to the old KSC countdown launch monitor, which showed the current launch status countdown - this information came from a websocket feed from NASA. Unfortunately, it only was used for a few NASA launches on SpaceX rockets, and nothing recently.
I had built a website front-end for this, but everything kind of died once the source feed stopped working :P https://i.imgur.com/kii9lxs.png
In my ideal world, I would have another monitor (4th one?) showing the upcoming countdown events, the poll status, telemetry, and other data...
4
u/rubikvn2100 Feb 13 '17
Good job men. You use some kind of Artificial Intelligent that can read text right?
Good to see applications use A.I. everywhere. We will have a lot of benefits from A.I. In the near future.
2
u/Keavon SN-10 & DART Contest Winner Feb 13 '17
I'm curious why you physically play the YouTube video in real time and capture the frames displayed to the screen. It seems like it could potentially skip frames or run too slowly for real time. Wouldn't it be better to download the video (
youtube-dl) and extract all the frames (ffmpeg) and then write your tool to take the frame image sequence dump and perform at-your-own-pace analysis on it?2
u/binarygamer Feb 13 '17 edited Feb 13 '17
I know your intentions are to stream real-time live data, but I think there is merit in a spin-off project: processing downloaded videos with open source OCR software, and uploading extracted telemetry for each flight to some repo/file share.
The combination of better OCR and frame by frame video analysis would make it easier to produce reliable data. Public .csv datasets would enable some casual plotting & community analysis. Perhaps a website could be built to display the plots against uploaded SpaceX videos too.
1
u/rikkertkoppes Feb 18 '17
Started the websocket stream on the actual live webcast now. No sensible data yet, just occasional dots from detecting stars :)
1
u/rikkertkoppes Feb 18 '17
countdown is live
1
u/rikkertkoppes Feb 18 '17
Stopping the stream, sad
1
u/rikkertkoppes Feb 19 '17
Started the websocket stream again, trying to recognize stars now
1
u/rikkertkoppes Feb 19 '17
countdown is live
1
u/rikkertkoppes Feb 19 '17
some hickups due to switch in the stream
1
u/Juggernaut93 Feb 13 '17
I have Ubuntu on VirtualBox, but because of some OpenGL issues I couldn't run it there. Also tried it on WSL, with no luck. I've finally tested it on Windows to try to make it work there, but I've only got black screen captured (and my mouse cursor). Is this the issue you had on Windows?
1
u/Shahar603 Subreddit GNC Feb 14 '17 edited Feb 14 '17
Nice project.
I've been working on a simular program in python . I'm now adapting it to work with a YouTube live stream and not only local video files. Here's an example for a graph it created for JCSAT-14 (Data during the coast phase was gathered using a simulation): https://plot.ly/~shahar603/34
1
u/aloser Feb 14 '17
It'd be great to pump this through Firebase so people wouldn't have to run it locally they could just put a listener on a Firebase location that you're updating live with your script.
Kind of like how they used to do their (now discontinued) public datasets. https://publicdata-weather.firebaseio.com/
3
u/[deleted] Feb 13 '17
I thought of the same idea! I wouldn't have known where to start, let alone create a working prototype.
I thought of combining it with my simulation (real time virtual reconstruction, rather than analytical) to watch a live 3D, version of the launch, but the telemetry would have to contain quite a bit more info for that.
Anyway, fantastic work - I'll get back to texturing my Falcon model...
1
u/joggle1 Feb 13 '17
Have you tried using bash on Windows? The latest version of Windows 10 has an option to use a special Ubuntu distribution that's able to communicate directly with the underlying Windows operating system. You can find details about it here.
Thanks for posting this tool. I'm playing around with Maya and may try dabbling with real-time visualizations if I can find the time for a side project like that.
1
u/Decronym Acronyms Explained Feb 13 '17 edited Feb 19 '17
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is a community product of r/SpaceX, implemented by ^request
I first saw this thread at 13th Feb 2017, 21:59 UTC; this is thread #2496 I've ever seen around here.
I've seen 6 acronyms in this thread; the most compressed thread commented on ^today has 114 acronyms.
^[FAQ] [Contact ^creator] [Source ^code]
0
u/[deleted] Feb 13 '17
[deleted] — view deleted comment