Control Game Servos

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

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.

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

And what are you using to read the joystick?

thank dear.

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

The gamepad control I am using is this Genius brand.

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.39|690x469

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

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

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)

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, 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.

Okay, I appreciate the good intention

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

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