Thunderborg not found.
Forums:
In October I succesfully built my monsterborg and everything worked well. Now I had to reinstall Raspberry pi os and when trying to execute ./runMonsterJoy.sh
I get an error message saying missing thunderborg at 15, thunderborg was not found. I checked everything and it should work fine (I tested it using i2c detect and it says that i2c addres 15 is in use). Please let me know if you need further information.
Edit: I ran a pintest using wiringpi this is the result (I think this means every pin should be working fine):
piborg
Wed, 12/29/2021 - 11:42
Permalink
ThunderBorg not found, but shows up in i2cdetect
It is quite unusual that the ThunderBorg shows up in i2cdetect but still does not communicate. We will need a bit more detail on why it does not find the board to fix the problem.
The first thing to check is if you have installed anything else that is using the GPIO. This includes running other MonsterBorg scripts at startup (such as the Web UI). If two things are both trying to talk to the ThunderBorg at the same time it can prevent normal operation. You will also need to restart the Pi after running the pin test for the same reason.
If that is not the case we can try and talk to the ThunderBorg directly to see what is going wrong. Start by opening Python in the MonsterBorg directory:
Then run these commands to manually ask the board to identify itself:
This is the output we would expect when everything is working correctly:
NKP
Wed, 12/29/2021 - 16:05
Permalink
Thunderborg not found.
Hello,
Thanks for your response!
I'm quite sure the only thing that runs on start is monsterjoy which doesn't work.
I also tried the code you provided and it gives the correct output (the same result shown in the example):
piborg
Wed, 12/29/2021 - 18:23
Permalink
Try the standard initalisation
That's unexpected, but it does mean that the ThunderBorg is communicating correctly.
What result do you get if you do the initialisation from Python:
I would expect the last line to print:
NKP
Wed, 12/29/2021 - 20:06
Permalink
I tested it.
Hi,
Thanks for your response!
This are my results (the expected results):
NKP
Wed, 12/29/2021 - 21:09
Permalink
I may know why it does not work.
I think I know what the problem is. Before I got the error about not finding the thunderborg I got an error about that the module pygame was not found, I made it so the script (
./runMonsterJoy.sh
) will run in python3 because that does work since pygame seems only to be installed for python3. The problem is the thunderborg would not work then because the code doesn't work for python3. I tried to copy the pygame which is in dist-packages for python3 to the dist-packages for python2. Now I get another error, this probably means the pygame version isn't compatible with python2.Conclusion: I think I should install a version of pygame that is compatible with python2. (I'm not sure if this is possible since a few months ago they dropped support for python2.)
Could this be the problem? If so, do you know how to fix it?
piborg
Wed, 12/29/2021 - 21:55
Permalink
MonsterBorg without pygame
That would explain things, the standard copy of ThunderBorg.py does not work with Python 3 :(
The good news is that we have a newer script for controlling MonsterBorg that does not use pygame at all. It instead uses our Gamepad library to get controller inputs: https://github.com/piborg/Gamepad
The
monsterJoy.py
example should function the same as the standard joystick script, except it is setup for a PS4 controller by default. The controller type and button settings can be changed in the settings section towards the top of the new script.Installation is really simple:
The wiki page has a quick explanation of how everything works if you want to make any changes or improvements of your own :)
We also have a Python 3 version of ThunderBorg.py available if you prefer. See ThunderBorg with Python 3
NKP
Thu, 12/30/2021 - 11:21
Permalink
It works! (But something weird happens)
Hi,
It works!
Thank you so much!
The car is working perfectly but for some reason turning left is putting the joystick to the left top and turning right is putting the joystick to the right bottom. I use the Piborg gamepad and not the python 3 version of thunderborg. Do you maybe know why this happens?
piborg
Thu, 12/30/2021 - 12:10
Permalink
Correcting controller inputs
Turning left should be pushing the left stick up to set speed while pushing the right stick to the left to steer. Turning left should be pushing the left stick up to set speed while pushing the right stick to the right to steer.
If that is not the case then it is fairly simple to fix, it just means that Controllers.py has the wrong values for your controller :)
First check you have the correct controller set in monsterJoy.py:
there are presets for:
If you do not have a listed controller follow the instructions here under the "Setting up your own controllers" section (about half-way down the page). The names used in monsterJoy.py are:
but they can be changed to anything you want.
If you do have one of the listed controllers then the mapping is different from what is listed. You can follow the "Setting up your own controllers" as linked above to check if the names returned are correct for each axis and button. If they are wrong swap the values with what it thinks is being pressed and that should sort things out. If lots of values are wrong it may be quicker to redo the whole mapping from scratch.
Z3r0Th3H3r0
Fri, 04/22/2022 - 14:58
Permalink
Python 3.9 (Bullseye) Compatable
My i2cdetect shows my Thunderborg on bus 1 at 0x15 but it will not connect. When I tried connecting directly in the python interpreter to get the raw output, I got python errors.
I had already run 2to3 on ThunderBorg.py but apparently that only fixed the easy stuff.
Are there going to be Python 3.9 compatible versions of the module?
Z3r0Th3H3r0
Fri, 04/22/2022 - 15:04
Permalink
Disregard... I found the link
Disregard... I found the link in another post:
wget -O ThunderBorg3.py http://forum.piborg.org/downloads/thunderborg/ThunderBorg3.py.txt
Z3r0Th3H3r0
Fri, 04/22/2022 - 15:56
Permalink
Still not connecting...
Still not connecting...
This is confusing...it seems to be saying..."There is no board at 15 but I found a board at 15"
Loading ThunderBorg on bus 1, address 15
Missing ThunderBorg at 15
ThunderBorg was not found
Are you sure your ThunderBorg is properly attached, the correct address is used, and the I2C drivers are running?
Scanning I²C bus #1
Found ThunderBorg at 15
1 ThunderBorg board found
No ThunderBorg at address 15, but we did find boards:
15 (21)
If you need to change the I²C address change the setup line so it is correct, e.g.
TB.i2cAddress = 0x15
Z3r0Th3H3r0
Fri, 04/22/2022 - 15:57
Permalink
>>> print (TB.RawRead(0x99,6)
>>> print (TB.RawRead(0x99,6))
Traceback (most recent call last):
File "", line 1, in
File "/home/pi/Rover/ThunderBorg3.py", line 236, in RawRead
self.RawWrite(command, [])
File "/home/pi/Rover/ThunderBorg3.py", line 220, in RawWrite
self.i2cWrite.write(rawOutput)
OSError: [Errno 121] Remote I/O error
piborg
Fri, 04/22/2022 - 17:15
Permalink
OSError: [Errno 121] Remote I/O error
I just tried this on a recent Raspberry Pi install and the result came back with the expected result:
The standard initialisation also worked with the Python 3 version of the script:
I have not seen the
OSError: [Errno 121] Remote I/O error
before, but it sounds like it is having trouble with the I2C communications.What result do you get from this command:
sudo i2cdetect -y 1
This is what we would expect to see:
Also do you have any other devices or scripts using the I2C bus?
Z3r0Th3H3r0
Fri, 04/22/2022 - 19:00
Permalink
Solved
Had to force the i2c address to something other than 15 and then back to 15...now its working. :/