Discussion API for DIY Control Panel

Hello commanders. The question is quite complicated, but maybe there is someone who knows. There is such an application as gameglass.gg. Displays important controls and indications and much more on tablets and smartphones. And the idea came up to make a physical version of such a panel. Well, that is, to have a box with buttons on the table, and not to poke on the touch screen. Video crafts craftsmen. They look cool, tumblers, buttons. But the light indication is missing. For example: Get ready for a hyper jump. press the button, the red light turns on, and when the FSD is charged, the light turns green. Gameglass.gg somehow keeps track of these variables and can display different metrics. And if I understand correctly, then it uses some kind of API. And it is important to understand that I am using arduino leonardo as a controller. Thanks to the MEGA32U4 chip, this controller is immediately recognized by the PC as a keyboard, gamepad or HID device. I figured out how to bind the keys, but I still haven’t found how and most importantly where to get feedback from the game, maybe there are coding experts here.
 
Ok, continuing from your other thread. There's an official API documented for player journal and the status file (status.json). Anything that is in there you can use - but I'm afraid the FSD charge state is not one of them. You could fake it, though, by taking the trigger signal and use a timer.
How to write from the PC to your Arduino, though, will be your problem 😁 - I only use the Arduino output as game controller to send signals to an Autohotkey script on my PC.
 
With a Leonardo you are rather limited with the number of buttons and LED's that you can use, I would suggest looking at a Mega or equivalent which has a lot more inputs/outputs available.

To get information to the Arduino from the PC you can use a USB serial port on the PC to write to the serial port on the Arduino. The Arduino USB port can do multi-duty as a keyboard, joystick/controller and serial port simultaneously. You should be able to get most of the information that you need from the status.json file without having to parse the much more verbose journal files.
 
With a Leonardo you are rather limited with the number of buttons and LED's that you can use,
😉 Not really. SPI port expander (forgot the chip name) let's you connect many digital I/Os, using only three pins on your Arduino. How many depends - expander chip, available addresses, whether you want to use soft SPI ports.
 
Not really. SPI port expander (forgot the chip name) let's you connect many digital I/Os, using only three pins on your Arduino. How many depends - expander chip, available addresses, whether you want to use soft SPI ports.
True, but it adds to the complexity of the build and programming.
 
Coincidentally, I am doing something very similar right now, and as I have had the same issue with using a Mega to be recognized as an HID, I have decided to isolate all the components and communicate them through MQTT (Mosquitto). I use PHP to read and process all events from the Journal and all the .json files in the same folder. I trigger events with an event dispatcher for each one of them. I have several subscribers who are responsible for obtaining the data they are interested in and transforming it into simple strings to send to the Arduino via MQTT. The Arduino processes them and reacts based on the information it receives; everything is very real-time. Here is a video where you can see a demonstration: Demo Elite Dangerous Dashboard (Arduino + WS2812B) . Optionally, to facilitate construction and elaborate the design, I have also designed an interface with HTML and Web Sockets. Additionally, to solve the HID part, I have made Python also subscribe to Mosquitto and be the one to launch the keyboard commands according to the events that occur, in this way, I have the loop closed and everything communicates with everything through simple messages in real-time.
 
Back
Top Bottom