Giter VIP home page Giter VIP logo

Comments (11)

benjaminaigner avatar benjaminaigner commented on July 23, 2024

Dear @jonathanrobichaud4

sry for the long answer delay, holiday time here :-).
We can support you as much as possible, but we do need some more infos.

  • You can change the name of the ESP32 via the $NAME xxx command?
  • You can pair with the ESP32?
  • How do you send the mouse/keyboard commands (other uC; terminal program;....)?

If the commands are processed ($NAME, $ID,...), the serial interface works as expected,
so should the HID commands.
Sending HID commands is done in this format:
https://github.com/asterics/esp32_mouse_keyboard#hid-input
But not in ASCII command format, but binary.

from esp32_mouse_keyboard.

jonathanrobichaud4 avatar jonathanrobichaud4 commented on July 23, 2024

The commands do work and I can pair with the esp just fine. Right now I am using a program named serial which is for Mac devices. I put it into the hex mode and tried to use it with the start bit and everything. "fd 00 00 73" kind of like that. I tried with the 0x in front of each as well. If you need anything else please let me know! I am writing this on my phone so it's a bit sparse sorry.

from esp32_mouse_keyboard.

benjaminaigner avatar benjaminaigner commented on July 23, 2024

Dear @jonathanrobichaud4

OK, thx for the infos. What about:

  • What is the BT central device (PC/Notebook or mobile; which host OS)
  • In many serial terminal programs, a \r or \n are sent as well. This should be switched off in your program
  • What serial interface of the ESP32 is used (UART0 with the debug output or UART2)?

from esp32_mouse_keyboard.

jonathanrobichaud4 avatar jonathanrobichaud4 commented on July 23, 2024

It's an android device and I'm not sure what uart is in use. And I will check later today if my program sends the \r or \n.

from esp32_mouse_keyboard.

jonathanrobichaud4 avatar jonathanrobichaud4 commented on July 23, 2024

what program do you recommend for communication? Putty or some other windows specific one? I have a windows pc I can fire up as well. How can I tell what uart interface I am using. Right now I'm communicating through usb but can do the commands like $NAME as well as the demo ones

from esp32_mouse_keyboard.

benjaminaigner avatar benjaminaigner commented on July 23, 2024

Hi,
OK, Android devices should work without problem.
Regarding the UART: I think this is the source of your problem:

  • We have 2 functions for parsing UART data:
    void uart_external_task(void *pvParameters)
    and
    void uart_console_task(void *pvParameters)
  • uart_console_task processes the data received from the UART0, which is the programming and debugging UART (connected via USB; normally used with idf.py flash/monitor
  • uart_external_task processes the data from the second UART (pin 16/17 for RX&TX)
  • The console task does NOT implement the RAW HID commands. We just used this task for testing mouse/keyboard via the keys w,a,s,d,c for mouse and q for keyboard.

Unfortunately, we didn't need the RAW HID for the UART0 (console_task), so it is not implemented.

A fast solution would be:

uart_read_bytes(CONSOLE_UART_NUM, (uint8_t*) &character, 1, portMAX_DELAY);

After this line, add uart_parse_command(character,&commands);
And break the while(1) loop directly afterwards.

from esp32_mouse_keyboard.

jonathanrobichaud4 avatar jonathanrobichaud4 commented on July 23, 2024

I tried that out but it didn't help. when I tried sending commands I got a freertos error and the esp reset

from esp32_mouse_keyboard.

jonathanrobichaud4 avatar jonathanrobichaud4 commented on July 23, 2024

it says :

FreeRTOS: FreeRTOS Task "console" should not return, Aborting now!

from esp32_mouse_keyboard.

benjaminaigner avatar benjaminaigner commented on July 23, 2024
  1. Have you tried it without modification and sending w,s,a,d keystrokes to the ESP32? Does the mouse move accordingly?
  2. Did you use break;, return; or continue; after uart_parse_command?

from esp32_mouse_keyboard.

jonathanrobichaud4 avatar jonathanrobichaud4 commented on July 23, 2024

I tried a few different things but I just ended up using a different project that worked for what I needed it to do! Thanks for the help though!

from esp32_mouse_keyboard.

benjaminaigner avatar benjaminaigner commented on July 23, 2024

Dear @jonathanrobichaud4

I'm glad you find something that worked for you!
Anyway it would be nice if you give our project a star 👍
Good luck with your project,

greetings

from esp32_mouse_keyboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.