Using a WII remote to control DiddyBorgRed

I had real trouble getting a playstation remote to connect to the Pi, maybe because two of them were clones.

I have managed to get a WII remote to connect to Bluetooth using cwiid and the python instructions at https://www.raspberrypi.org/learning/robo-butler/wiimote-setup/

Now I want to connect to the diddyborg and guide him?

Any pointers/advise would be much appreciated.

The digital buttons are
Up pressed
Left pressed
Right pressed
Down pressed
Button A pressed
Minus Button pressed
Plus Button pressed
Home Button pressed
Button 1 pressed
Button 2 pressed
Button B pressed

piborg's picture

I am guessing the Wiimote appears as a joystick like the PS3 controller would.

If so what you will need to do is figure out which numbers to use for which axes / buttons.
There is a guide to do this with jstest on one of our older scripts:
JoyBorg - Control your PicoBorg robot with a joystick

Alternatively if you are running with the GUI installed you can try jstest-gtk to show the joystick state.
Install with:
sudo apt-get -y install jstest-gtk
Then run this line in a terminal within the graphical desktop:
jstest-gtk
This should show a list of joysticks attached to the system and the live feedback if you go into properties:

Once you have the numbers you want it should just be a case of changing the values in the "Settings for the joystick" section towards the top of the script.

Sadly I could not get the joystick section of the Wii remote to work, only the buttons. So have given up and finally managed to get an old PS3 working via BT but not the newer or clone ones to work.

piborg's picture

It is interesting that the newer remote does not work but the old one does.

Is the newer remote a PS4 remote?
If not are there any differences between the newer and older ones?

pi@SPARE:~ $ wget http://www.pabr.org/sixlinux/sixpair.c
--2016-08-13 10:58:53--  http://www.pabr.org/sixlinux/sixpair.c
Resolving www.pabr.org (www.pabr.org)... 62.210.16.61
Connecting to www.pabr.org (www.pabr.org)|62.210.16.61|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4022 (3.9K) [text/x-csrc]
Saving to: âsixpair.câ

sixpair.c           100%[=====================>]   3.93K  --.-KB/s   in 0.001s

2016-08-13 10:58:53 (3.56 MB/s) - âsixpair.câ saved [4022/4022]

pi@SPARE:~ $ gcc -o sixpair sixpair.c -lusb
pi@SPARE:~ $ sudo reboot
Using username "pi".
pi@192.168.1.48's password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 13 10:55:35 2016 from office.home
pi@SPARE:~ $ sudo ~/sixpair
Current Bluetooth master: b8:27:eb:cf:3f:c6
Setting master bd_addr to b8:27:eb:cf:3f:c6
pi@SPARE:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:CF:3F:C6 SPARE [default]
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller B8:27:EB:CF:3F:C6 Discoverable: yes
[bluetooth]# agent on
[NEW] Device 00:B5:61:01:00:00 00-B5-61-01-00-00
Agent registered
[bluetooth]# connect 00:B5:61:01:00:00
Attempting to connect to 00:B5:61:01:00:00
[CHG] Device 00:B5:61:01:00:00 Connected: no
Failed to connect: org.bluez.Error.Failed
[bluetooth]#

... and the same...

pi@SPARE:~ $ sudo ~/sixpair
Current Bluetooth master: b8:27:eb:cf:3f:c6
Setting master bd_addr to b8:27:eb:cf:3f:c6
pi@SPARE:~ $ sudo bluetoothctl
[NEW] Controller B8:27:EB:CF:3F:C6 SPARE [default]
[NEW] Device 00:B5:61:01:00:00 00-B5-61-01-00-00
[NEW] Device 00:26:5C:02:BA:D8 PLAYSTATION(R)3 Controller
[CHG] Device 00:26:5C:02:BA:D8 Connected: yes
[bluetooth]# discoverable on
Changing discoverable on succeeded
[CHG] Controller B8:27:EB:CF:3F:C6 Discoverable: yes
[bluetooth]# agent on
Agent registered
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
Failed to connect: org.bluez.Error.InProgress
[CHG] Device 00:26:5C:02:BA:D8 Connected: no
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:26:5C:02:BA:D8 Connected: yes
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:26:5C:02:BA:D8 Connected: no
[CHG] Device 00:26:5C:02:BA:D8 Connected: yes
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
[bluetooth]# trust 00:26:5C:02:BA:D8
Changing 00:26:5C:02:BA:D8 trust succeeded
Failed to connect: org.bluez.Error.Failed
[CHG] Controller B8:27:EB:CF:3F:C6 Discoverable: no
[CHG] Device 00:26:5C:02:BA:D8 Connected: no
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:26:5C:02:BA:D8 Connected: yes
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
Failed to connect: org.bluez.Error.InProgress
[CHG] Device 00:26:5C:02:BA:D8 Connected: no
[bluetooth]# connect 00:26:5C:02:BA:D8
Attempting to connect to 00:26:5C:02:BA:D8
Failed to connect: org.bluez.Error.Failed
[CHG] Device 00:26:5C:02:BA:D8 Connected: yes
[bluetooth]# trust 00:26:5C:02:BA:D8
Changing 00:26:5C:02:BA:D8 trust succeeded
[bluetooth]# 

Same result with all three, odd thing is it someetimes says connected but the lights on the PS3 continue to flash. The only one that works is non duel shock! Any ideas?

No's are
Model No is CECHZC2U A1 serial No 8031112048666
Model No is CECHZC2U A1 serial No ZW61010460188
Only pysical differance seems to be the sticky label on the back!
The one that works...
Model No CECHZC1E serial No 447025602617

piborg's picture

Well that is strange, but I guess that model has a different behavior.

We have quite a few controllers here of different ages, but they all have the same model: CECHZC2E
This is a dual-shock model, I presume that is the difference between a 1E and a 2E.

I am not sure why they are different, but I quick hunt on the net turned up this post:
http://community.eu.playstation.com/t5/PS3/PS3-controller-model-number-m...
They suggest that the build quality of the 2Us seemed lower, does this fit your experience?

We have had others who experienced trouble getting PS3 controllers working, maybe they had the 2U model as well.

Hello. I just stopped by via a Google search. The controller you have (with the serial number 8031112048666) is not a real Sony controller, it is a counterfeit. That's why you are having issues with it. The counterfeit controllers have inferior design and parts, has trouble syncing, and the thumbsticks suck.

Feel free to open your two controllers up and you can see the horrible knockoff parts inside!

Here is a picture of a cheap counterfeit controller I received on eBay with the same serial number.

Attachments: 

You are right, to late to return it! Also have two non fake, clone remotes that don't work either.
Wonder if "someone " can broaden connectability for Bluetooth remote controls and pi/borgs

Subscribe to Comments for "Using a WII remote to control DiddyBorgRed "