Adruino/botboarduino programming

Hello everyone,
I have a botboarduino and I was trying to compile and program it for the Pheonix
I seem to be doing something wrong because it will not compile
I get a lot of errors.
I did download the sketch from the forum as suggested.
I did nothing to it except unzip.
here is the list of errors that shows up when I verify/compile
I hope someone can tell me what I am doing wrong
Thanks in advance
Thomas-
New Text Document.txt (7.06 KB)

Hi Thomas,

First, thank you for taking the time to attach your error log to your post (instead of simply pasting it in your post). This helps keep the questions/answers clearer. :slight_smile:

libraries\PS2X_lib\PS2X_lib.cpp.o (symbol from plugin): In function `PS2X::NewButtonState()': (.text+0x0): multiple definition of `PS2X::NewButtonState()' sketch\PS2X_lib.cpp.o (symbol from plugin):(.text+0x0): first defined here
Among the warnings and errors in your log, we noticed many multiple definition issues, such as the one above concerning function PS2X::NewButtonState(). A multiple definition error during compilation indicates that your compiler / IDE found 2 or more valid sources for the code of a function. The error is raised because it does not know which one to choose (since they may be only similar in name/signature but different in implementation/code).

The simple fix for such a situation is to usually remove all definitions except one. In this case, your compiler found two sources for this function (as seen above):

]libraries\PS2X_lib\PS2X_lib.cpp.o/:m]
]sketch\PS2X_lib.cpp.o/:m]

This would indicated that you have a copy of the PS2_lib.cpp/h in at least two places. One of them is the libraries folder (usually under the Arduino folder in your Documents folder) and another is in the folder of your current sketch. Libraries should normally only ever be in the libraries folder, therefore you should be able to fix this issue by simply removing the PS2_lib.cpp and PS2X_lib.h form the folder of your sketch. Reload the project and it should compile properly (providing there is no other issues).

If you do have other compilation issues, please go to File -> Preferences and activate the Verbose mode for the compilation. This will provide an error log with even more details about what went wrong!

Let us know how it goes, and good luck!

Sincerely,

Ok so I started fresh, unisntalled the software and all the libraries and related files
i reinstalled the software and only downloaded the the botboarduino_CH3R for the Pheonix, I also downloaded the PS2 lib and put it in the libraries folder where the readme stated to do
I then opened the sketch and tried t compile it and got this error
I did turn on the verbose as you suggested
New Text Document.txt (10.6 KB)

Hi Thomas,

Which version of the Arduino IDE are you using? Also, which version of Windows are you using?

I ask because from what I found quickly online, this error message seems to creep up on users running Windows XP only. This may be due to some incompatibility between the tool chain (what does the work behind the scenes for the Arduino IDE) and the operating system.

If you are not running the most recent version of the Arduino IDE, please obtain a fresh copy here.

There are more details on the GitHub Issues’ page for the Arduino project here:
github.com/arduino/Arduino/issues/2989
github.com/arduino/Arduino/issues/5845
github.com/arduino/Arduino/pull/5863

Sincerely,

I downloased the newest version yesterday and that was the second error text I posted
I am running XP, I was trying to keep it on an older laptop.
I do have a Windows 10 I can try this on.
I will load it all up on that laptop and see how it goes.
Will let you know tonight.

OK, let us know if it works any better.

Also, as an alternative, you could always setup a USB drive with Ubuntu 32-bit (or many other alternative Linux distribution) as a “Live CD”. This allows you to boot in Linux and use Arduino there, without actually installing it.

Alternatively, you can use Wubi to install it as a “file” inside Windows, which makes it very easy to use and a good alternative to get modern libraries and such to run well on an old laptop.

Sincerely,

Sébastien,
I thought I had Ubuntu on that laptop but when I tried to boot it up it didn’t fully boot so I gave up and decided to use my newer laptop.
I am going t try and load the code later tonight and will let you know

Thanks for your help

Sebastien,
I have hooked up the PS2 remote per the instructions
DAT = 8, CMD = 7, CLK = 9, SEL/ATT = 6 I have downloaded and uplaoded “BotBoarduino_CH3R_PS2” to the botboarduin
it uploads with a few errors I think, by the orange color of the text in the compile window. it does upload to the board.
the LED on the PS2 reciever is blinking until I press the start button on the PS2 remote. I just purchase this remote from Lynxmotion and it came with the interface board.
In the past when I had my first board I use to hear beeps, several notes when the start button was pressed. I do not get that now.
Do you know if the code “BotBoarduino_CH3R_PS2” actually works with board or do I need to make adjustments?
I have attached the compile window for your review

Thanks
New Text Document.txt (14 KB)

Hi Thomas,

The last compile you did seems to work. There are a few warnings (not necessarily errors though) that may merit attention in the future, but other than that, it seems to compile properly.

One things that catches our attention is that you mention the following:

An important point here is that the LED on the PS2 receiver is blinking. In our tests, once the PS2 receiver is powered and the PS2 controller is turned on too, within seconds the LED on the PS2 receiver becomes solid (indicating a connection). At that point, pressing START should produce the expected result (the beep you mention above).

Does your PS2 receiver LED become solid when you turn on your PS2 controller? If it does but this still doesn’t work, let us know and we can try a different diagnostic.

Sincerely,

Ok just verified it again and it did blink until I turned on the remote. once it went solid I pressed the start button on the remote and no beeps.
after abut a minute the board produces a beep and the led on the receiver goes dim and the power LED on the remote turns off. Also the L LED on the board is on very dim. the board makes a beep about every minute.
I have attached pictures of hw it is hoked up right.
it is not hooked to the SSC board at the moment.
I am confused to the operation of the PS2 receiver.
Maybe the code is wrong, not sure as I used it as is, no modifications…Do I need to modify it


Should I rewrite the code or is there something else going on?

Hi Thomas,

The code should work as-is.

//-------------------------------------------------------------------- //[Botboarduino Pin Numbers] #ifdef __BOTBOARDUINO__ #define SOUND_PIN 5 // Botboarduino JR pin number #define PS2_DAT 8 #define PS2_CMD 7 #define PS2_SEL 6 // On the PS2 receiver this pin may be called ATT (attention) #define PS2_CLK 9 // If we are using a SSC-32 then: // If were are running on an Arduino Mega we will use one of the hardware serial port, default to Serial1 above. // If on Non mega, if the IO pins are set to 0, we will overload the hardware Serial port // Else we will user SoftwareSerial to talk to the SSC-32 #define cSSC_OUT 12 //Output pin for Botboard - Input of SSC32 (Yellow) #define cSSC_IN 13 //Input pin for Botboard - Output of SSC32 (Blue) #endif
As you can see above, the default pinout in the default code seems to match your wiring.

Try the attached files to with the BotBoarduino attached to the PS2 receiver (nothing else should be connected). You will have to temporarily replace your PS2X library with the attached one. Simply move the folder PS2X_lib out of the Arduino\libraries folder and replace it with the one in this .ZIP file.

Once uploaded to the BotBoarduino, start the PS2 controller and open the Serial Monitor. Make sure to use the proper baud rate (57600) and paste in your reply a copy of the results after a few button presses.

Sincerely,
PS2X_Example_BotBoarduino.zip (2.16 KB)
2017-01-17 - PS2X_lib.zip (16.4 KB)

I upload the sketch and the LED on the Receiver is on solid. the power and mode LEDs on the remote were blinking together then turned off
this is the message I got from the serial monitor
“No controller found, check wiring, see readme.txt to enable debug. visit www.billporter.info for troubleshooting tips
Unknown Controller type”
I think the remote may be defective

It is possible that the BotBoarduino isn’t picking up the receiver properly every startup due to signal/timing issues (which causes the code to read the wrong “device ID”).

Go to your Arduino\libraries\PS2X_lib folder and edit the file PS2X_lib.h. Uncomment this line. Recompile the test code (so that it now uses the modified library) and try the connection again.
This time, you should see extra message in the serial monitor, including the actual controller type (device ID) found during initialization.

Please post the result here. You may want to try this test a few times and see if you get different values.

Sincerely,

Doesn’t look like it sees the controller at all.
“Controller mode not matched or no controller found
Expected 0x41, 0x73 or 0x79, but got FF
No controller found, check wiring, see readme.txt to enable debug. visit www.billporter.info for troubleshooting tips
Unknown Controller type”
Ready to call CS and get my money back

Hi Thomas,

The extra message (from debug) says the following:

Which indicates the receiver is responding, but it is responding with a non standard value. This is most likely due to a wiring issue causing the timing of the serial communication to be off.

If the wiring seems good, then it may indeed be a defective receiver. If that is the case, we can proceed with a replacement of your controller/receiver pair (RB-Kee-05). For this to happen, we would need you to contact us through our support center.

In your message, make sure to include the following:

]Your order or invoice number/:m]
]A link to this thread (for context)/:m]

Sincerely,

So last night I broke out the Scope to see if the signals were actually there. Can you tell me what the signals should be. I tried a google search but not sure which is correct.

The communication is serial in nature. The first function executes is PSX::c****onfig_gamepad (found here). After setting up the various pins needed, it proceeds to call PS2X::read_gamepad (found here) twiceto detect the controller type.

Therefore, to determine what is sent exactly, you should check the PSX::read_gamepad function.

Of course, unless your scope can analyze serial protocols, you may not get much out of it for this type of debugging (other than is the signal changing or not). A logic analyzer would be the appropriate tool for such a task.

Sincerely,

Sébastien,
I got a new PS2 remote
Is there aything I should do before plugging it in?

Hi Thomas,

The most important step is to check at which voltage it runs. Most of the older PS2 controllers needed a voltage translation on the adapter board to work properly. The newer ones usually don’t, but it is always good to be careful.

Other than that, you can go right ahead and try it out with the test example with debug turned on, so that you can tell which ID the controller has. Of course, if it reports 0xFF, than this would most likely mean a bad wiring (0xFf = the data line staying all continuously).

Sincerely,