ricardoquesada / bluepad32

Bluetooth gamepad, mouse and keyboard support for ESP32 and PicoW
https://bluepad32.readthedocs.io/
Other
503 stars 53 forks source link

Arduino Nano ESP32 / Lolin S3 mini: Serial output not working #65

Closed ricardoquesada closed 4 months ago

ricardoquesada commented 5 months ago

Bluepad32 + Arduino IDE currently does not work as expected using Arduino Nano ESP32.

https://store-usa.arduino.cc/products/nano-esp32

ricardoquesada commented 4 months ago

fixed. confirmed by jjs357 user. It is working Ok now.

Freihaendich commented 4 months ago

I tried to follow the guide, but it is not working for me right now. I have an Arduino Nano ESP32 and a PS4 Controller.

ricardoquesada commented 4 months ago

@Freihaendich wait until v4.0-beta2 is released.... alternative use develop branch of https://github.com/ricardoquesada/esp-idf-arduino-bluepad32-template

ricardoquesada commented 4 months ago

re-opening... using "print" works Ok, but not with Serial.printf()... WTF... something is wrong with UART... not sure what.

ricardoquesada commented 4 months ago

Same issue with the Lolin S3 Mini. What these two boards have in common is that the share the UART and USB OTG ports... they have just one port.

And Serial, instead of being redirected to "right" port, it gets redirected somewhere else (?).

ricardoquesada commented 4 months ago

Having "USB CDC on Boot : Enabled" fixes the issue...

But the bug seems to be that "boards.txt" is not being used correctly, because nano_nora entry (the Arduino Nano ESP32) has nano_nora.build.cdc_on_boot=1.

And that would explain why the Arduino Nano ESP32 gets recognized as a different board

ricardoquesada commented 4 months ago

Something seems to be happening when BTstack is initialized. I'm not calling btstack_stdio_init()... so something else, not clear what yet

ricardoquesada commented 4 months ago

The solution for "Arduino Nano ESP32" is to:

Screenshot_20240309_180435

ricardoquesada commented 4 months ago

For other boards, like "Lolin S3 Mini" do:

Screenshot_20240309_195149

craig-am commented 3 months ago

I am trying to run the example on an Adafruit Huzzah32 and I get this compiler error about PINS_COUNT not being define anywhere \Users\ck\Documents\Arduino\libraries\Bluepad32_for_NINA-W10_boards\src\utility\spi_drv.cpp" -o "C:\Users\ck\AppData\Local\Temp\VMBuilds\Bluepad32_ESP32_Gamecontroller_Connection_Test\esp32_featheresp32\Debug\Bluepad32_for_NINA-W10_boards\utility\spi_drv.cpp.o" spi_drv.cpp: In static member function static void SpiDrv::begin()

spi_drv.cpp: 91:20: error: 'PINS_COUNT' was not declared in this scope if (SLAVERESET > PINS_COUNT) { ^~~~~~