Giter Club home page Giter Club logo

Comments (26)

alexinstrell avatar alexinstrell commented on September 17, 2024 1

Hi 86Leonidas2, thanks so much for having a look at this. I've given it a go this morning, following your instructions, and with a few variations of ESP32 and Ps3 Controller (and varying which MAC address is put into the controller and the code, trying the original Ps3 Console MAC, the BT MAC from the ESP32 and even the '01: (to) 06' format as used in the demo sketch, having used sixaxis to change it. But it gets errors in compiling. Here's the error message (alas I don't know enough to interpret this, it seems there is something about 'const char' vs 'char' going on, plus other issues...

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024 1

Thanks Parvaiz, have given it a go and enjoying messing around with it today. It does handle a little differently with the 4wd so I'll make some adjustments to learn what impact that has. Appreciate your help!

from esp32-ps3.

86Leonidas2 avatar 86Leonidas2 commented on September 17, 2024

I had the same problem I struggled for 2 days with a Sixaxis Dual Shock 3 controller. To fix the issue I uninstalled the arduino ide and re-installed the 1.8.11 version of it.(You can find it here https://www.arduino.cc/en/main/OldSoftwareReleases) then you go to file->preferences and to the "Additional Board Manager URLs" you paste, "https://dl.espressif.com/dl/package_esp32_index.json" and hit ok. After that you go to Tools->Board->Board Manager and type "esp32" and install the latest version(v1.0.6) and close. Find your board on Tools->Board and click it. Next step you go to Tools->Manage Libraries... search for ps3 controller host and install the ps3 controller host v1.1.0. Restart arduino ide and go to File->Examples->(Scroll Down) PS3 Controller Host->Ps3Demo, scroll down where it says Ps3.begin("01:02:03:04:05") and change the MAC address to the one Sixaxis pairing tool tells you. Upload the code and you should be good to go. Open the serial monitor to view the results. It's quite fun!

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024

Below is the error message that I got in compilation, when I tried to upload as described.
The MAC address inserted is the BT MAC of that particular ESP32, I used sixaxis pairing tool to put this MAC into the Ps3 Controller also.

In case the format of the MAC is relevant:
7c:9e:bd:48:bf:02

(I also tried this with the original MAC address from the controller,
00:1a:80:d1:03:89

that relates to the Ps3 Games console, putting that in the code and controller). Doesn’t work either atm.)

Error message (verbatim except I have redacted the full file path where the library sits under and replaced with text ‘XXXXFILEPATH’; I did check the library was in the right place, and I’ve not had a ‘library not found’ error):

Arduino: 1.8.11 (Windows 10), Board: "Node32s, Default, 80MHz, 921600, None"
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c: In function 'ps3_l2cap_init_services':
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:77:29: warning: passing argument 1 of 'ps3_l2cap_init_service' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
ps3_l2cap_init_service( "PS3-HIDC", BT_PSM_HIDC, BTM_SEC_SERVICE_FIRST_EMPTY );
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:27:13: note: expected 'char *' but argument is of type 'const char *'
static void ps3_l2cap_init_service( char *name, uint16_t psm, uint8_t security_id);
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:78:29: warning: passing argument 1 of 'ps3_l2cap_init_service' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
ps3_l2cap_init_service( "PS3-HIDI", BT_PSM_HIDI, BTM_SEC_SERVICE_FIRST_EMPTY+1 );
^

XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:27:13: note: expected 'char *' but argument is of type 'const char *'
static void ps3_l2cap_init_service( char *name, uint16_t psm, uint8_t security_id);
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c: In function 'ps3_l2cap_deinit_services':
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:92:31: warning: passing argument 1 of 'ps3_l2cap_deinit_service' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
ps3_l2cap_deinit_service( "PS3-HIDC", BT_PSM_HIDC );
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:28:13: note: expected 'char *' but argument is of type 'const char *'
static void ps3_l2cap_deinit_service( char *name, uint16_t psm );
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:93:31: warning: passing argument 1 of 'ps3_l2cap_deinit_service' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
ps3_l2cap_deinit_service( "PS3-HIDI", BT_PSM_HIDI );
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c:28:13: note: expected 'char *' but argument is of type 'const char *'
static void ps3_l2cap_deinit_service( char *name, uint16_t psm );
^
XXXXFILEPATHXXXX\Arduino\libraries\PS3_Controller_Host\src\ps3_l2cap.c: At top level:
cc1.exe: warning: unrecognized command line option '-Wno-frame-address'
c:/users/kelly/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find crt1-sim.o: No such file or directory
c:/users/kelly/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/1.22.0-97-gc752ad5-5.2.0/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld.exe: cannot find _vectors.o: No such file or directory
collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Node32s.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024

If you or anyone can unpick that I'd be really grateful! Thanks

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell facing exactly the same issue, tried multiple things but no luck. Have you resolved this issue? If yes, kindly let me know how.
Regards.

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024

@parvaizahmad hi, yes will do if I find anything. To be honest, rather than trying to solve this with the Ps3 controller, I was told on another forum that the Ps4 Controller may be a better option (there is a code library for using that too by same author). I have one arriving in next couple days, so will try that and if it works, will let you know.

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell thanks for response. By the way I have figured out the solution but was not able to trace the exact problem. If you want to work with PS3 controller you have to downgrade you Arduino IDE, ESP32 library as wall as PS3 Host controller library. Working combination is below:
Arduino IDE: Version 1.8.11
ESP32 library : Version 1.0.2
PS3 Host Controller Library: Version 1.0.0
If you have already installed an arduino ide uninstall and make sure that all the temp files as well as caches are removed related to arduino libs and IDE, make a fresh installation of above mentioned components and it will work.

  • Do let me know about PS4 with esp32.

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024

Hi again ParvaizAhmad (is Ahmad your first name?). Working through your steps thanks, I uninstalled all three parts, reinstalled the IDE 1.8.11, but then trying to install v1.0.2 ESP32 board manager, it won't do it. I hit install on that version, the board manager gets as far as 'downloading tools 2/3', then freezes and the whole programme crashes. I have removed the library source files etc. Am I missing something in how to install the 1.0.2 board manager? Is there a URL I need to put in somewhere (I saw a 'JSON' URL referred to when I installed the current version of the board manager. Perhaps there is one I need for the old?
Or is there something else (I'm a beginner at this, not sure about 'caches' etc!)

Thanks for your help on this!

Alex

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell did you removed the caches of Arduino IDE? You can use https://dl.espressif.com/dl/package_esp32_index.json link to install the board, well on my end I am able to install all the things without any error, use steps mentioned here to remove arduino ide,
https://support.arduino.cc/hc/en-us/articles/360021325733-How-to-do-a-complete-uninstall-of-the-Arduino-IDE
By the way my first name is Parvaiz

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell contact me on my email id I may be able to help you through call.

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell check this https://www.youtube.com/watch?v=6c8ieMyK2sQ

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024

Hi Parvaiz, thanks so much for this and for the new video on Youtube, I've also added this comment there and subscribed. I went through your advice on removal of old (hidden) cache files when I uninstalled the current IDE ready to reload the previous version, and this seems to be the thing that made the different from previous unsuccessful attempts. Didn't try 1.8.11 as per suggestion on GitHub, as I saw you used 1.8.15 in this video, and that has worked. Do we know whether it still works with latest IDE 1.8.16? For anyone else struggling with this, I also noticed that when reinstalling the IDE, the file location for your sketchbook will revert back to the default 'Arduino' folder; if, like me, you had set a custom folder previously, don't forget when you reinstall the IDE, to set it to the folder you want and make sure you have only libraries you want in there. I wondered why on reinstall it said the Ps3Controller host library (current version) was already installed (despite me having removed the file)...that was the reason, it reverted to looking in the old sketchbook file location, which I had forgotten about and still contained the library file. Having 'cleaned up' and got rid of all old files, the way was clear to install these old versions, and it all worked.

Thank you for this! I do have a follow on question; should I want to now use this code to control a device (in this case a rover), but combine it with other code (sensors etc) I need for the whole machine, are we going to run into problems, as we are now using older 'unsupported' IDE, board manager and library? I know the above solution can work in isolation, it's a question of can we/how do we make this work 'permanently' alongside other functions.

I'm now going to try and collate together good code for driving a rover using these control inputs (probably single stick as you have done). Mine is 4wd with 4 gear motors, left and right motors 'tied' together, with a TB6612FNG motor driver. That leaves all the other controls free for robot arms, sensors and so on.

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell I think we should be good with 1.8.16, because problem is not with Arduino IDE, it is with esp32 board and Ps3 Host controller library, as long as we use the compatible versions of esp32 board and ps3 Host controller library we are good with any version of Arduino IDE until the problem between esp32 and ps3 library is not fixed. I think you can you any other latest library with these two older libraries it shouldn't be any problem there.
Earlier I mentioned 1.8.11 because I did not test with the latest but then I tried with different versions of Arduino IDE and found that issue is not with ide.
Well I did not saw your comment on video by the way.

from esp32-ps3.

alexinstrell avatar alexinstrell commented on September 17, 2024

That's strange, thought I had posted the comment (it's same as this!). Just tried again, then refreshed and mine disappeared (though it says 4 comments when only 1 shown?). Is there some moderator (so maybe it will take time), or are they hidden? I don't know YouTube well!

On another note; I'm struggling to find code for ESP32 that takes the inputs from Ps3 and allows me to control the rover (via my TB6612 motor driver), specifically I want to map the x and y stick values so I can have proportional steering. Would you be happy to share the code you are using for your ESP32 and motor driver? It should work for both 3 wheels (2 motors and a castor) and my 4 wheel, 4 motor vehicle, with motors in parallel sets left and right. Thanks again.

Alex

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@alexinstrell You can find that sketch on github branch I have updated the branch, link is in the description of video.

from esp32-ps3.

Sriram510 avatar Sriram510 commented on September 17, 2024

Hi Parvaiz, thanks so much for this and for the new video on Youtube, I've also added this comment there and subscribed. I went through your advice on removal of old (hidden) cache files when I uninstalled the current IDE ready to reload the previous version, and this seems to be the thing that made the different from previous unsuccessful attempts. Didn't try 1.8.11 as per suggestion on GitHub, as I saw you used 1.8.15 in this video, and that has worked. Do we know whether it still works with latest IDE 1.8.16? For anyone else struggling with this, I also noticed that when reinstalling the IDE, the file location for your sketchbook will revert back to the default 'Arduino' folder; if, like me, you had set a custom folder previously, don't forget when you reinstall the IDE, to set it to the folder you want and make sure you have only libraries you want in there. I wondered why on reinstall it said the Ps3Controller host library (current version) was already installed (despite me having removed the file)...that was the reason, it reverted to looking in the old sketchbook file location, which I had forgotten about and still contained the library file. Having 'cleaned up' and got rid of all old files, the way was clear to install these old versions, and it all worked.

Thank you for this! I do have a follow on question; should I want to now use this code to control a device (in this case a rover), but combine it with other code (sensors etc) I need for the whole machine, are we going to run into problems, as we are now using older 'unsupported' IDE, board manager and library? I know the above solution can work in isolation, it's a question of can we/how do we make this work 'permanently' alongside other functions.

I'm now going to try and collate together good code for driving a rover using these control inputs (probably single stick as you have done). Mine is 4wd with 4 gear motors, left and right motors 'tied' together, with a TB6612FNG motor driver. That leaves all the other controls free for robot arms, sensors and so on.

It still doesn't work for me. do you know if how the code can be written in the IDE to connect and read data?

from esp32-ps3.

vandjac avatar vandjac commented on September 17, 2024

I followed all the steps in Parvaiz's video, and it still didn't work for me. I am using a knockoff Chinese controller. Do you have to use a genuine Sony PS3 controller?

from esp32-ps3.

Erkki507 avatar Erkki507 commented on September 17, 2024

Hi,
I'm new here i also have some issues about connecting my Ps3 controller to ESP32. And I'm not sure if the problem is in coding or wiring or both or neither.
I have:
ESP32-WROOM-32U
L298N motor controller
Arduino IDE: Version 1.8.11
ESP32 library : Version 1.0.2
PS3 Host Controller Library: Version 1.0.0
The problem is that my controller won't connect to ESP if I use 9V battery or similiar as a power supply for ESP and electric motors trough L298N but if I connect 5V to the ESP micro usb port and 9V battery to L298N as a power source for electric motors and LN298N my contoller connects to ESP without problems.
So how i can get this working with only one power source.
Wiring diagram below.

image

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@Erkki507 are you connecting ground properly? Can you check output voltages of L298 driver at 5 volts terminal?

from esp32-ps3.

parvaizahmad avatar parvaizahmad commented on September 17, 2024

@vandjac it should work fine, may be there is some issue with your controller or esp32 board,

from esp32-ps3.

Erkki507 avatar Erkki507 commented on September 17, 2024

Hi,
sorry I have had other projects so I haven't been able to work with this project. I have with another ps3 controller and checked voltages and connected everything multiple times but still only way to get ESP32 and controlled connected is use own powersupply for ESP32 trought micro usb port. I have ordered another ESP32 so we will see if it works right way or is there some problems with my wiring or code.

from esp32-ps3.

ypatidisioannis avatar ypatidisioannis commented on September 17, 2024

Hello there!

I am having an issue trying to connect PS3 OEM controllers with an ESP32 but I can't. Does anyone have a solution with that?

Actually what I see is that the sixaxistool can't write the address of the master in BT . I open the sixaxistool, I connect the OEM controller and I push the update button, then I unplug the controlles from the USB and when I plug it again it doesn't show me the address I wrote.

Any ideas why?

Thank you!

from esp32-ps3.

Muntaharul avatar Muntaharul commented on September 17, 2024

Hi again ParvaizAhmad (is Ahmad your first name?). Working through your steps thanks, I uninstalled all three parts, reinstalled the IDE 1.8.11, but then trying to install v1.0.2 ESP32 board manager, it won't do it. I hit install on that version, the board manager gets as far as 'downloading tools 2/3', then freezes and the whole programme crashes. I have removed the library source files etc. Am I missing something in how to install the 1.0.2 board manager? Is there a URL I need to put in somewhere (I saw a 'JSON' URL referred to when I installed the current version of the board manager. Perhaps there is one I need for the old? Or is there something else (I'm a beginner at this, not sure about 'caches' etc!)

Thanks for your help on this!

Alex

can you solve the problem

from esp32-ps3.

Muntaharul avatar Muntaharul commented on September 17, 2024

Hello there!

I am having an issue trying to connect PS3 OEM controllers with an ESP32 but I can't. Does anyone have a solution with that?

Actually what I see is that the sixaxistool can't write the address of the master in BT . I open the sixaxistool, I connect the OEM controller and I push the update button, then I unplug the controlles from the USB and when I plug it again it doesn't show me the address I wrote.

Any ideas why?

Thank you!

hi you you solv the problem

from esp32-ps3.

Muntaharul avatar Muntaharul commented on September 17, 2024

I followed all the steps in Parvaiz's video, and it still didn't work for me. I am using a knockoff Chinese controller. Do you have to use a genuine Sony PS3 controller?

have you find the solution ps3 not connect to esp32

from esp32-ps3.

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.