HandHeldLegend / HOJA-LIB-ESP32

An API project to emulate various retro and modern controllers on ESP32.
Other
56 stars 12 forks source link

ESP32-based controller converter? #12

Open TheChatty opened 1 year ago

TheChatty commented 1 year ago

This project is already able to emulate a Switch Pro Controller. Is it possible to have different brand controllers paired, convert their protocol and feed it to the emulator like the 8BitDo USB dongle does? The emulator would then be paired to a real Switch console.

mitchellcairns commented 1 year ago

It's certainly possible but it's out of the scope and unplanned for this project. Let me know if you have any other questions on this!

TheChatty commented 1 year ago

Since documentation is lacking at the moment: how do you use your current piece of code?

mitchellcairns commented 1 year ago

Since documentation is lacking at the moment: how do you use your current piece of code?

Documentation is being worked on, nothing public yet please stay tuned should be something in the next two weeks.

mitchellcairns commented 1 year ago

Since documentation is lacking at the moment: how do you use your current piece of code?

I have created one example project with some detailed commentary for learning purposes. Let me know if this helps https://github.com/HandHeldLegend/HOJA-LIB-ESP32/tree/main/examples/basic-wired-gamepad

TheChatty commented 1 year ago

I'm missing an end-to-end example.

mitchellcairns commented 1 year ago

I'm missing an end-to-end example.

  • Does this project enable oneself to push push a button (shorten the defined GPIOs) and one can see the result on one's Switch console?
  • If yes, what steps a necessary to accomplish this (mainly how does the pairing work)?
  • Are there any nightlies I can flash my ESP32 to avoid the hassle of setting up a working IDE?
  • Please add gitpod.io compatibilty for easy compilation

Until I have the time to get all of the full documentation together, I recommend looking through the code using intellisense in VS Code IDE. I can certainly look into gitpod.io

No nightlies at the moment. Please take a close look at the example code, read all of the notes and let me know if you have any questions.

TheChatty commented 1 year ago

I've compiled a few ESP8266/ESP32 projects already (Tasmota, OpenMQTTGateway, ...) mostly using gitpod.io but I'm unable to get this compiled. And I'm still wondering how a useful end-to-end scenario would look like. Maybe @JPZV could shed a little light on how he's using it?

mitchellcairns commented 1 year ago

I've compiled a few ESP8266/ESP32 projects already (Tasmota, OpenMQTTGateway, ...) mostly using gitpod.io but I'm unable to get this compiled. And I'm still wondering how a useful end-to-end scenario would look like. Maybe @JPZV could shed a little light on how he's using it?

What build errors are you getting?

Thanks

TheChatty commented 1 year ago

Well... I using my above link to gitpod which creates a remote IDE and this source code. I then tried to manually install all required dependencies in the remote shell but eventually failed to setup ESP-IDF correctly:

gitpod /workspace/HOJA-LIB-ESP32 (main) $ idf.py build
Executing action: all (aliases: build)
Running cmake in directory /workspace/HOJA-LIB-ESP32/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/gitpod/.espressif/python_env/idf5.1_py3.8_env/bin/python -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /workspace/HOJA-LIB-ESP32"...
CMake Error: Error: generator : Ninja
Does not match the generator used previously: Unix Makefiles
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.
cmake failed with exit code 1, output of the command is in the /workspace/HOJA-LIB-ESP32/build/log/idf_py_stderr_output_5377 and /workspace/HOJA-LIB-ESP32/build/log/idf_py_stdout_output_5377

Hmm, after remove CMakeCache.txt and retrying I now get:

CMake Error at CMakeLists.txt:2 (idf_component_register):
  Unknown CMake command "idf_component_register".
mitchellcairns commented 1 year ago

It looks like you're trying to build the component-- try running the build command from the example directory and let me know if that works

TheChatty commented 1 year ago

That was it and now it worked and I got the basic-wired-gamepad.bin. This proves compilation with gitpod is easily possible (requires IDF5 and libusb installation). Now if this project would be set up correctly then all that would be required is to follow my above link, wait for automatic setup to finish and download and flash the compiled bin.

Still needed:

mitchellcairns commented 1 year ago

That was it and now it worked and I got the basic-wired-gamepad.bin. This proves compilation with gitpod is easily possible (requires IDF5 and libusb installation). Now if this project would be set up correctly then all that would be required is to follow my above link, wait for automatic setup to finish and download and flash the compiled bin.

Still needed:

It's something I will look into when I have more time available, I appreciate the effort and the recommendation!

Does that build environment also take care of building the bootloader?

TheChatty commented 1 year ago

Isn't the bootloader part of the IDF? In any case it's also present in the build directory.