chamomile

Wool and wool accessories

Pronounced "kƦməmil"


Large sheep the size of a small sheep! Likes tea, DIY, and nerd stuff. Sysadmin, release engineer and programmer by trade.


Personal Website
bleatspeak.net/

-nike-
@-nike-

Update on the eternal Button Box project: implemented a (at least for WarThunder) working artificial horizon


-nike-
@-nike-

The Design

The box was originally supposed to be a supplement of my Viggen flight computer box and include further important elements from my favorite swedish plane, but I decided at some point to make it more general and go in a more sciFi-ish direction. The three green buttons are left over autopilot controls from the original design, but the other elements are what I thought would be useful or simply look and feel good (the box is as much fidget toy as game controller). Biggest inspiration for the new design were the consoles shown at the beginning of Alien, because retro sciFi = best sciFi.

The front plate

Engraved aluminum ordered online. The box is a standard 4u 19'' server rack.

The Buttons

Switches and buttons

These all plug into a simple 5x5 button matrix PCB I designed a few years ago. We got 10 switches and 3 lit green buttons on the left, and 9 white and 1 red lit button on the right, as well as another switch (with guard) and a pull switch.

Rotary encoders

The encoders are directly connected to their Arduino, but I have not yet figured out a good way to read and interpret their output (especially when turned fast they currently signal high to vJoy the entire time, and sometimes are read as going in reverse).

Arduino to RasPi

Both Arduinos send the states of their buttons (1 or 0) over USB to the Raspberry Pi (together with an identifier and the target vJoy number).

RasPi to PC and vJoy

The RasPi relays these messages over WiFi to an UDP server on my PC, which in turn sets the button on one of the virtual joysticks. This works with acceptable little delay.

Button lights

The light settings are send the opposite way from the PC to the Relay and then the Arduinos, one of which has another one of my PCB creations connected to control the LEDs. I haven't really tested this yet, and am not sure if I did everything right in regards to total current to the LEDs and such things.

The Screen

The screen is a Pimoroni HyperPixel 720x720 with capacitive touchscreen, the only square touchscreen I could find for sale. It sits directly on the Pi's pins and is mounted to the front plate with a 3D printed bracket. Everything shown on the display is just full screen Firefox and a webpage hosted on my PC.

Getting game data

All game data is pulled by a dedicated Python script, assuming I don't run multiple games at once.

WarThunder

The one (1) good thing Gaijin ever did was exposing game data in json format on localhost:8111, even though they afaik never documented it in any form (that would have been a second good thing, can't have that).

DCS

I use DCS Bios that does some UDP multicasting shit I don't understand but luckily don't have to since it mostly works with a script I found.

MSFS

Have to look into this

My own games

Thinking about how I would implement something like this, I would probably favor the WarThunder way. Not sure how well this would work for large amounts of data/very fast polling rates, but I wouldn't have to do stuff like UDP multicasting.

Webserver to RasPi

The game data is processed by a central Python script and then either send off to the Arduinos as light settings or send to the website on the display over a websocket. Hosting is done in this Python script with flask. Pages I got so far are a test screen from Alien (that also appeared in Blade Runner) recreated in CSS and HTML and aforementioned artificial horizon (the horizon is drawn with SVG stuff I learned doing CSS crimes). Currently updating the SVG is very slow, not sure if this is a websocket or browser problem.


You must log in to comment.

in reply to @-nike-'s post:

in reply to @-nike-'s post: