It's all very, very terrible. Don't do this at home!
That is…
pure chaos.
The Raspberry is booted
In theory, we can now start our NodeRED
Ok wonderful.
Then we need the local box now,
also a NodeRED.
Okay, this is the local NodeRED.
So as a reminder: The local NodeRED runs on the gaming PC,
Among other things, this monitors the Status.json from Elite Dangerous
and parses it and then sends it to the [Raspberry] Pi
who in turn listens via NodeRED,
receives the JSON file,
checks if this is a status event, for example
and then takes appropriate action if, for example, the landing gear is extended or something.
To feed the whole thing
we have to listen for changes to files here...
in this directory... and...
we can go there for a bit...
"Hello Caps Lock"
There's a space inside...
And then we can
open the Status.JSON,
in which we, among other things
have that FLAGS.
The status of the ship is encoded in the FLAGS,
how the ship is doing right now, if the shields are up, if the landing gear is out and so on... and...
there's a handy list there: https://elite-journal.readthedocs.io
where the status file is explained.
There we have, among other things, the FLAGS
encoded as a numerical value (integer)
So... that basically means this is aggregation magic
We can do any combination of these here
Express all meanings practically with a single number.
Here below were also a few examples,
here for example
there we have this int[eger]
it has the FLAGS 24, 16, 3, 2 and 0
for example, meaning mass lock, shields up, landing gear down, and docked.
That means we'll copy it right away.
Then we paste the in Visual Studio Code,
which is then basically as if the game would write out the value,
and then we should see a reaction.
And on the debug, exactly, wonderful, that worked.
So here our FLAG has arrived,
we just "docked", "shields up",
"in main ship", ..., "mass barrier",
That all looks fine.
That should all have arrived on the Pi, here is the payload,
that's where our FLAGS and the whole evaluation come in.
Good and that in turn is shot at the Neopixel.
The Neopixel just hasn't got any juice (current) yet.
So to see if this works in general,
if I've connected something wrong here, I'd rather do it with the power bank first,
than my USB port won't fly in my face, or something like that,
and…
Eventually it actually worked as it should.
One mistake was definitely that I
entered the wrong number of Neopixels.
But it's three pieces, we're hanging on pin 12,
So…
For example, the blinker works here, you can see it on the trigger down here, wait a minute...
Down here we have a trigger
and after 500ms it switches,
you can also see the flashing spot down here,
and…
it then sends it to the Split and this writes it
to the Neopixel.
Now there was still the consideration
that someone is rotten..
and sometimes not responding.
That there is a loose contact or something.
Ah yes…
I think we even have something there.
Here I definitely have the red [cable] with plus
and the white [port] is marked "D".
This is usually the data port.
Next to it is an arrow
that means that is the [port] where the signal should come in.
Now we have to insulate "professionally" again
otherwise we will create a short circuit here.
And hope there won't be another copyright strike
because this again sounds like some trash metal song.
Exciting, currently everyone is gray as it should be
Ah yes…
and all gray again please!
No, that didn't work.
Oh wait, that's right. That was even right.
"0" is the gear, respectively
if the landing gear is not out, the lamp should be red.
It should be outside here.
Let's take a look inside the payload
"Gear down" is "1", OK.
And when the landing gear is up
then the [lamp] shall turn red.
That is correct so far.
"Gear Down" is "0", OK.
And if we then, for example, shoot the FLAG in with "In danger".
then we get a blink to it.
Finally we are slowly making progress here.
OK…
Then let's go back to our example,
take our FLAG example again,
copy it up here,
now we should have "mass lock" with us
and "landing gear down"
Let's take a look at the payload.
"landing gear down" we have and
mass lock is on. OK. Very nice. That's how it's supposed to be.
So the idea is to put a thin plexi [glass] over it later,
and then to stick a foil or a printout over it
and then only to work with the light that still shines through,
I'm still figuring out what's the best thing to do.
So either something diffuse,
which softens the whole thing a bit, because I'll be sitting in the dark later
or just plastic, plexi, something, foil,
and then make a print what each LED stands for. Later.
I have 2, 4, 6, 8, 10, 12, 14, 15 pieces here now.
15 pieces.
gotta do some math
So it's like when one of these LEDs comes on,
then has an initial power consumption of about 30 mA
and then depending on which color you display.
That means with 15 LEDs I can easily get to 450 mA
A USB [2] is designed for a maximum of 500 [mA].
That's quite a lot for USB.
If there is something else attached to the same controller, it will probably no longer be enough
to operate 15 pieces.
So I need an external power supply for it in any case.
I think we'll prepare the string with 15 LEDs anyway
and see if that goes well. We can still cut.
Oh yes exactly. I definitely want 3 pieces for the landing gear.
But they don't necessarily have to come with a housing.
Guess we gotta "McGyver" here again
Maybe we can use a wire.
This is a trick I learned from Disney's Adventures of the Gummi Bears.
No joke.
In one of the first episodes there was text on a stone tablet
and this one broke
and in order to be read, it had to be put back together again,
and to keep the parts connected they used a string
wrapped around the board.
I would prefer a cable tie for this,
but unfortunately I don't have any.
Also, I'm just doing this to get an idea of ​​what it might look like in the end.
If I like it I'll probably glue it together.
OK, that seems to be working.
Decisions, decisions...
The problem if you don't build something that already exists
is that you have to create it from scratch.
And although we see a lot of great looking stuff in science fiction movies, for example
there's actually very little really workable stuff in those movies.
Just looks good.
So it's really not that easy
Also, I'm not aiming for a specific game [as a goal], I want to keep it universal.
For all space games I like to play.
Yeah I like it.
I think I'll continue with this approach.
So they would look good here too, but
whenever I'd press a button I wouldn't see the status lights anymore
so I probably need them up here.
Also important: I need a switch
so that I can toggle the status lights off and on
so I can restart the lights
if they go crazy again.
OK
this on this side is the [signal] input.
You can tell by the arrow and the white wire.
Not to be confused with blue or red.
I said seventeen pieces
1,2,3.…
In the end it doesn't matter that much, because you can add or remove as you like
It doesn't matter to them where exactly on the chain they sit.
Okay, time to change the code.
We no longer only have 3 but now 17
Looks good
Here is our persistent [LED]
Here is the one
which is responsible for showing alarms.
Then let's connect this to a cell phone charger
to see what happens.
Looks good.
We haven't had a misfire yet
Then we simulate "landing gear retracted"
Perfect.
"Gear extended".
Perfect.
We can change the background from black to…
red.
That is interesting.
I didn't know that, the brightness also seems to be passed on.
Means when one LED sets the brightness, all other LEDs follow suit.
That's fine.
Ok, what is the most expensive…
I think blue is the most expensive [color].
Let's try blue, brightness 100%. Give me everything!
290 milliamps!
Not too shabby.
I'll write that down.
The thing is,
this isn't just a single LED
there are several LEDs inside
and if I just turn on the blue [LED].
the other two [LED] have nothing to do.
In theory, I can turn on all three LEDs at once.
A mix of colors is used
however, this can triple the required voltage depending on the colors used.
So be careful with the upper limit.
Let's see
290-ish
divided by 17
that makes about 17 mA per blue LED
that roughly fits my [previous] calculation.
What does the data sheet say about this again...
I didn't remember correctly.
I thought it was 30mA per LED but it's only 20mA.
Here you can see that.
We have a maximum of 60mA per LED here.
Blue is the most expensive of them.
And has about 16 - 17 mA, that fits the calculation.
Full white - all LEDs on - which I have no intention of ever doing.
You have to keep that in the back of your mind.
So my previous calculation was not 30 but with 20 [mA]
OK, one more time…
So 300mA is my highest expected consumption.
Unless I use a color mix.
I mean you can read the data sheet day and night.
It is better to check at the end what is really going on.
Because when I end up connecting it to USB on the PC
and then it bangs I no longer have a USB on my PC, right?
If I'm lucky that is.
So if I can run this on a cell phone charger
I would be very happy.
Because I don't have to stress my computer with it at all.
If I adjust this brightness
it should apply to everything.
Save on computer…
Yes, that is _significant_ brighter.
Good to know.
There is another problem that I have yet to find a solution for.
The loop is triggered twice here.
So,
The rhythm of the "In Danger" LED is messed up.
This is automatically reset as soon as the ship is no longer in danger
like that
because that ends all loops.
I have yet to figure out how to do it.
I guess I need to set a global FLAG that the loop is already running so the loop doesn't start twice.
But that's just a small problem
Oh that's easy [explained].
Let me get the short piece to show.
I try to capture that on camera.
This is the type of LED in use here.
This is a WS2811 LED, an outdated model
there are more modern ones and these are commonly known as Neopixels.
And what we have here is
a positive and a negative [terminal] for the current
and we have a data port to send a signal
and this signal is passed on.
So if this LED gets the signal
and the message inside says "LED #1 come on!"
the LED looks for "Am I number 1 in the chain?".
If this is not the case, the signal is sent on to the other side
where the connection to the next LED is established.
The great thing is
if you use a mini computer like a Raspberry
you only have a limited number of PINs to drive an LED with.
With this technique you have a long chain of LEDs that only need one PIN.
So you still have a lot of PINs left.
The disadvantage of this is if one of the LEDs in the middle breaks
every LED in the chain will then also be broken
or no longer working. You have to replace the broken one first.
That's kind of undesirable for a [real] vehicle or plane or whatever. Now
for a toy, on the other hand… it doesn't matter.
And that's the magic behind a Neopixel.
FSD charging...
I probably don't need that
"Cooling" would be nice. It's a very small icon on the screen.
Ok if we show "Charging" we can also show "Cooling".
We could combine that.
I mean the ship can either be charging or cooling down but it can never do both at the same time.
Let's try.
What is the next free LED we have
That's the six
Let's take blue for the Supercruise
No, no, that's not good.
Blue is charging.
When we are about to cool down we want…
have the blue.
When it's just charging we want... a combination.
This is red
This should be green
With Supercruise we want to have green
then blue on cooling
and when charging
let's try a combination
How about [yellow]... let's see how that looks.
And if none of this is the case
so we're not charging, we're not cooling down,
we don't have the supercruise on,
Let's just turn off the light.
Let's try that.
First... nothing.
Then "Charging"
Okay, this is yellow
yellowish.
That's okay, that's the effect I wanted to get by combining two colors.
We could make that a little brighter.
We could also make it blinking.
Let's see, let's assume we're in supercruise
that would be green
Let's say we're cooling down
that would be blue
and now back to nothing.
I'm not sure if the game logic really works like that,
but i think it can only ever be one of these,
but since this is an if/else construct
it should exit already after the Supercruise as a priority.
After that comes Cooling and then Charging.
We'll find out later as we play.
And I've done it wrong again.
Hammering CTRL+S to save each and every change is
so ingrained in muscle memory since the early Windows days
because the stuff used to fail and crash all the time
and if you didn't save your work then it was lost.
So back then I trained my muscle memory to remember every little change
and it's still there to this day.
Same logic
when we run out of fuel
or low on fuel
we want to have a red light on.
And if not, it may be off.
Refueling… okay, let's combine this.
When we're low on fuel...
we want red
and
when we fill up
we want green.
R-G-B, this should be here.
So if we're low on fuel now
Hm... maybe we should turn that around because when we fill up that should be read first
Makes sense.
Because it can happen that we fill up because there is only a little [fuel] left,
and the moment we stop
this is getting interesting again.
I have to replace this too
OK, perfect. Combined light.
The next [LED] is a no brainer.
"Guns out".
Extended [and] not extended.
When "Flight Assist" is off...
we show red.
because
We're so stupid, we need Flight Assist all the time.
And when it's off, we're helpless in space.
That's quite a topic... I need and want to train more for that
but it is the way it is at the moment.
I need Flight Assist.
So if we don't have a Flight Assist then we kind of have an emergency.
Yes, of course, I can do it.
Then let's go.
So what I'm currently doing is using a Neopixel string (chain)
programming it with NodeRED to read the status values ​​from the game Elite Dangerous.
This is essentially the state of the ship
for example whether the shields are still holding or
whether you have just lowered the landing gear and stuff like that.
And for that I basically want to have small status indicators
and for that I use a…
Wait, I'll make it bigger.
A long chain of LED,
which are programmed via a single PIN in the middle
and pass a signal through.
This way I can drive all the LEDs with a single PIN from a Raspberry Pi.
It just needs to be powered externally.
And in principle I can hang as many as I want.
Theoretically without limit, in practice you will eventually have problems with the amps.
Sometime after 1000 I think it's over.
That's a lot of lights.
And then the whole thing will be installed later
in my "Primary Buffer Panel" as I baptized it,
it's basically a joystick
Hold on, I'll get this thing.
That is the thing.
This is basically connected to the computer via USB.
This has a built-in display on which I can show various things via HDMI
I've got a couple more knobs on this thing here
And lots of colorful buttons to press.
And I can then usually just assign them in the game like a joystick
Or I can work with macros to trigger any keyboard shortcuts
if the game does not recognize the joystick.
Or has no joystick support at all.
For example, one game that as far as I know doesn't have a joystick is No Man's Sky
and if I want to use that thing in No Man's Sky then I can basically
issue keyboard actions instead of joystick actions
which then trigger something in the game.
And the whole thing is a lot of fun
but I still need feedback from the game back again.
With Elite you can do this by reading out such FLAGS
In principle, the entire state of the [space] ship is encoded inside this
It really isn't much magic. So.
I can show you that from below.
On big camera
and
it looks awful
but the bottom line is that it's all quite harmless because I've got here
a small controller
It looks like that, yes. It's just a little USB [joystick] controller
it costs about 10 EUR
I modified mine a bit
I have two of them, that's why I can hold one up so nicely for the camera
Yes, and in principle you connect every button with one of the inputs that the board (control unit) can do
and finally connects the whole thing to the computer.
Over here in the corner
This right here
This is an LCD controller
i bought it from the internet
it fits this type of LCD that I butchered from an old laptop.
It's not a particularly pretty LCD, but it still works.
Yes
And the whole thing is then switched on via a large power switch
I do that mainly because it a.) is fun
and b.) doesn't get the USB in the on connecting when all the lights go on.
What I have here now are still not enough options to connect to the joystick
that's why I have a few loose cable strands here, where nothing is hanging on them yet
I could practically put the second board next to it and then run two
or what my actual plan is: I want to switch to an Arduino for that.
This is a micro-computer that you can program yourself
where I have more inputs
and then be able to say more precisely what should happen
because with this joystick here that's the way it is
the inputs are pre-assigned, I can no longer change anything
And in any case, with an Arduino I would be completely free in the way it reacts
and what it writes.
The plan is in principle
I'm going to build the LED in this honeycomb shape here
those are sawn off caps from a
car, from a tire (wheels)
there are protective caps for the wheel nuts.
They're made of plastic, I found them in the basement.
I saw them open below, they fit exactly for the LED
Yes, and then they come somewhere on here later.
And then there is a small glare protection over it
and then the real cockpit feeling slowly develops here.
I am neither. What I'm doing here is terribly amateurish and dangerous.
And it's a small miracle that the building hasn't burned down yet.
Now I have my ever long string (chain) on LED. They're programmed now
via a system called NodeRED
this allows everyone, even as a non-programmer, to click programs together.
So the program is now ready
Now it would be time to try it out in the game.
Yes, and then I finally have my status indicators.
No no, I don't have a 3D printer
This is not done with a 3D printer. As said that is
a housing of (for) wheel nuts.
From plastic.
I can even tell you what kind here.
This is Opel (brand). Opel something.
I have to work here as cheaply as possible because I have 3 children and really don't have any money left over for this kind of fun.
But I like colored lights.
So I'm still in the discovery phase here, yes.
I'm still not quite sure how do I actually do this in the end.
That's why the whole thing is made out of cardboard.
Could be made way nicer. Made of wood or aluminum or anything else or with a 3D printer
but then I can't change anything.
Or change quickly.
And that's why I like to take my cardboard first
so I can just do my prototyping
And if I don't like it, I just throw it in the bin.
But for now I'll just leave it like that
I can program the LED, that is
if I don't like the arrangement I can change it again.
If I later stuck labels on it then no more.
We're starting to have some form now.
And three more individual [LEDs] for the landing gear.
They'll get their own case later.
So I'm quite happy with that.
Let's see if we can get this here.
I won't connect the display this time.
I can't get it right anymore.
The wiring is really too loose for me right now, I'm afraid of a short circuit.
So… just the lights.
Oh, only 2.8 gigabytes [patch]
That can only be a matter of hours until that is there.
Then let's see if it [the game] is still running.
If that works, I can use the [joystick] here... yes, that works.
The [other joystick] should also work
Well then... to the surface.
Then we should actually lose the lights over here when we retract the landing gear.
Wow awesome, that works!
That works too, so if I turn on the light from the ship then
does one of the LEDs come on here?
OK
Then let's find a destination
Very cool
Now the fuel collector has gone active
Okay, now let's fly closer
we get the warning light displayed, it starts flashing
Yes…
and now it has to
Exactly, it's getting hot now.
Now it's getting hot again.
Very nice, that works too.
All the warning lights come on as they should
Flew very close to the sun to see if that would work.
Ah yes…
So if you pay attention now, I'm going to start charging the frame shift drive (FSD)
Then it turns yellow or something green-yellowish.
Now I can jump, now it's turning green
and now I'm just in the jump
It stays green until I stop the FSD again.
The nice thing is you can really go wild there
because you can combine it however you like
You can control the lights however you want
And if you don't like it anymore, you can change it.
It's all about clicking in this NodeRED stuff
I don't have to compile (translate) a program every time and upload it again or something.
And that's quite pleasant because I want as many different games
as possible connect to this system.
If I had to compile a program every time
that would be extremely annoying and all that...
here I just click it together.
That was the point.
night vision on.
For example, I have the night vision on right now
That is
the lamp.
So. Night vision off.
night vision on.
Then we'll extend the hangers.
Here come the hangers.
Whoa
Collision. In the middle of space.
I hope he doesn't hold it against me.
I mainly use these buttons [here] on the map here
because it's actually quite pleasant here.
I like to use them in some menus.
There are games that aren't that great
or have no hotkeys available for this at all.
You'd have to play around with keyboard commands that are triggered by the joystick.
So it's always a huge job to configure the stuff the way you need it.
And did I mention that we're playing on LINUX here?