# Control Game Servos

**URL:** <https://discourse.nodered.org/t/control-game-servos/21377>\
**Category:** General\
**Created:** [7 February 2020 02:13 UTC](https://discourse.nodered.org/t/control-game-servos/21377 "2020-02-07T02:13:30Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesarius](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cesarius](https://discourse.nodered.org/u/cesarius)\
**Post date:** [7 February 2020 02:13 UTC](https://discourse.nodered.org/t/control-game-servos/21377/1 "2020-02-07T02:13:30Z")

</div>

Hi,

I recognize that I am a rookie in this node-red and therefore I want to ask for your advice.

I need to add a videogame control, Genius brand, to control 2 servos that I have connected to my raspberry 3.

I would appreciate your guidance to achieve it.

regards

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 February 2020 11:28 UTC](https://discourse.nodered.org/t/control-game-servos/21377/2 "2020-02-07T11:28:31Z")

</div>

First thing you need to do is get information about the controller and determine how you will connect it. Does the controler talk MQTT, is there an API describing how to read the data coming from it.

---

<div class="post-metadata">

**Author:** ![cesarius](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cesarius](https://discourse.nodered.org/u/cesarius)\
**Post date:** [7 February 2020 18:48 UTC](https://discourse.nodered.org/t/control-game-servos/21377/3 "2020-02-07T18:48:31Z")

</div>

The control (joystick) is local, connected directly via USB to the raspberry.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [7 February 2020 23:22 UTC](https://discourse.nodered.org/t/control-game-servos/21377/4 "2020-02-07T23:22:05Z")

</div>

And what are you using to read the joystick?

---

<div class="post-metadata">

**Author:** ![cesarius](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cesarius](https://discourse.nodered.org/u/cesarius)\
**Post date:** [7 February 2020 23:47 UTC](https://discourse.nodered.org/t/control-game-servos/21377/5 "2020-02-07T23:47:46Z")

</div>

thank dear.

I am using the "usbenum" node before the "gamepad" node.

The gamepad control I am using is this Genius brand.

> **[Genius MaxFire Grandias 12 - Accesorios de Juegos de pc (Negro): Amazon.es:...](https://www.amazon.es/Genius-MaxFire-Grandias-12-accesorios/dp/B005IDE1I6)**
>
> Compra online Genius MaxFire Grandias 12 - Accesorios de Juegos de pc (Negro). Envío en 1 día GRATIS con Amazon Prime.

Attached flow chart.

Any guidance will help me a lot. I am honestly new to this !

 ![Captura de Pantalla 2020-02-07 a la(s) 20.42.24](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0e1867cd2514b26b9a1aa0684d6688b5b4505b75.png) [Captura de Pantalla 2020-02-07 a la(s) 20.42.39|690x469](https://discourse.nodered.org/uploads/short-url/4oJnX1TDLut0Z8x99XifeVcIMb4.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 February 2020 10:38 UTC](https://discourse.nodered.org/t/control-game-servos/21377/6 "2020-02-08T10:38:05Z")

</div>

what is the full name of that node? something like node-red-contrib-?????

---

<div class="post-metadata">

**Author:** ![cesarius](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cesarius](https://discourse.nodered.org/u/cesarius)\
**Post date:** [8 February 2020 23:47 UTC](https://discourse.nodered.org/t/control-game-servos/21377/7 "2020-02-08T23:47:06Z")

</div>

the full names of each node are

for usb:  
node-red-contrib-usb 1.0.0

and the gamepad:  
node-red-contrib-game\_controllerizer 0.3.10

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 February 2020 00:08 UTC](https://discourse.nodered.org/t/control-game-servos/21377/8 "2020-02-09T00:08:14Z")

</div>

I don't think I'll be able to help you. It looks like node-red-contrib-usb hasn't been updated in four years and node-red-contrib-game\_controllerizer looks to be an output emulation a game controler (I could be wrong but the readme is in Japanese and I don't read it)

---

<div class="post-metadata">

**Author:** ![molesworth](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/molesworth/32/11748_2.png) [@molesworth](https://discourse.nodered.org/u/molesworth)\
**Post date:** [9 February 2020 10:11 UTC](https://discourse.nodered.org/t/control-game-servos/21377/9 "2020-02-09T10:11:50Z")

</div>

Following up on @zenofmud's comments, node-red-contrib-usb currently doesn't provide a way to read data from a USB device. The "usbenum" node will enumerate (i.e. list) USB devices, but the data transfer functions are mentioned in the notes as "under testing" and not included at the moment.

There are a couple of possible ways round this. The first option is to contact the author of node-red-contrib-usb to ask if the read and write operations could be added. However, since it's been 4 years since the last update, they may not be interested in doing further work on it.

Alternatively, if you're up for writing some function code, there is a library, [node-hid](https://github.com/node-hid/node-hid), which seems to offer all the functionality you'd need - listing devices, opening one and reading data from it. The usage section in the documentation gives a lot of detail and useful information.

**NOTE** : the node-hid data reading method makes use of an event handler. As a newbie with Node-RED and Node.js myself, I'm not sure how you implement callbacks or event handlers within the framework, but wiser heads than mine may be able to answer that.

---

<div class="post-metadata">

**Author:** ![cesarius](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cesarius](https://discourse.nodered.org/u/cesarius)\
**Post date:** [10 February 2020 14:55 UTC](https://discourse.nodered.org/t/control-game-servos/21377/10 "2020-02-10T14:55:19Z")

</div>

Okay, I appreciate the good intention

---

<div class="post-metadata">

**Author:** ![cesarius](https://avatars.discourse-cdn.com/v4/letter/c/c6cbf5/32.png) [@cesarius](https://discourse.nodered.org/u/cesarius)\
**Post date:** [10 February 2020 14:57 UTC](https://discourse.nodered.org/t/control-game-servos/21377/11 "2020-02-10T14:57:54Z")

</div>

Thank you, I am also a beginner in node-red and in programming if I will see how to solve the case.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 April 2020 14:57 UTC](https://discourse.nodered.org/t/control-game-servos/21377/12 "2020-04-10T14:57:54Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
