New build - PicoBorg Reverse fails to load.
Forums:
I just built my DiddyBorg this morning and have updated all the software as instructed. When trying to run any of the example scripts (diddySequence.py and diddyWeb.py) I receive the following message:
Loading PicoBorg Reverse on bus 1, address 44
Found a device at 44, but it is not a PicoBorg Reverse (ID 00 instead of 15)
PicoBorg Reverse was not found
Trying bus 0 instead
Loading PicoBorg Reverse on bus 0, address 44
Traceback (most recent call last):
File "./diddySequence.py", line 15, in
PBR.Init()
File "/home/pi/diddyborg/PicoBorgRev.py", line 264, in Init
self.Init(False)
File "/home/pi/diddyborg/PicoBorgRev.py", line 234, in Init
self.bus = smbus.SMBus(self.busNumber)
IOError: [Errno 2] No such file or directory
Any help would be appreciated as I'm new to this. Thank you.
Randy
piborg
Tue, 03/14/2017 - 20:54
Permalink
PicoBorg Reverse (ID 00 instead of 15)
Not to worry, we have seen this problem as well and it seems to be just a software issue :)
From what I can tell it looks like recent versions of the Linux kernel for Raspbian (after 4.4.X) have some trouble with the I2C driver. This causes the commands which read data to receive 0s instead of the real values.
We found it could be fixed by setting the kernel to an older version, the most recent working one being 4.4.50. This can be done using rpi-update with the correct code for the 4.4.50 version:
This issue affects most of our boards at the moment. Hopefully this will get sorted in the future and it will not be necessary to go back to an earlier kernel version.
Let us know if this fixes the problem for you as well.
jbcrozet
Mon, 05/08/2017 - 17:56
Permalink
Any update?
Hi, I had the same issue and applied your fix which has worked. Annoying, however, that we can't update our OS. Is there any permanent fix in sight? Thanks. JB
piborg
Mon, 05/08/2017 - 19:40
Permalink
I2C driver issue
Unfortunately the problem is not with our code, but somewhere in newer versions Raspbian itself.
Basically the updates seem to stop I2C reads working on any level (always read 00), but I am not sure what has caused the problem or when it will be fixed.
On a side note using
rpi-update
is not really recommended for keeping up to date as it installs the latest "bleeding-edge" versions of things which are not yet considered stable.METTAUK
Mon, 05/22/2017 - 14:59
Permalink
I2C and Raspberry Pi updates
I've had a similar problem but did not run RPI-update, but did run the standard update/upgrade commands...
on a Pi 3b which also stopped the two PiBorg PicoBorg Reverses I have installed from working!
On other pi the update/upgrade also caused pan tilt software and relay controls to stop working. So guess Pi Foundation has changed how GPIO is addressed too???
piborg
Mon, 05/22/2017 - 17:24
Permalink
I2C and Raspberry Pi updates
This has all proven a bit strange, we are hoping to look into what is going on sometime this week but at this point it is rather unclear who is at fault and what exactly changed.
What we do know is the problem is not limited to Raspberry Pis. Someone else is trying to get the PicoBorg Reverse working on BeagleBone and having the same reading troubles: PicoBorg Reverse and Beaglebone. This is especially curious as he has other I2C devices behaving on the same board.
We found early on that the Raspberry Pi was not behaving well with clock stretching enabled. This is a mechanism which allows the device to let the processor know when it is ready to continue. Because of this the board instead works as fast as it can to try and get the data ready before the Raspberry Pi starts reading the values.
At the moment I am thinking along the lines that they have now implemented the clock stretching (which would be good), but in the process they have changed the timing when clock stretching is not used. If this is the case it can be fixed by changing the code on the PicoBorg Reverse itself, the downside is it requires a PICKit 2 or 3 to re-program the board.
METTAUK
Mon, 05/22/2017 - 17:52
Permalink
I2C and Raspberry Pi updates
I ran a update/upgrade on various Pi 10 days ago and hit a problem with python scripts that set gpio to high/low based on temperatures and a web enabled touch screen for relay switching using WebIOpi. On reboot it put all the set gpio to high, even though WebIOpi setup should set to them to out/low on boot. I had to scrap and use a back up version to reinstate a relay switching pi with pan/tilt camera etc as almost nothing worked. Sadly ignored this problem and rad update/upgrade on pi(s) with Reverses on them :-(
Your backdating solution worked for the Borgs.
piborg
Mon, 05/22/2017 - 18:09
Permalink
I2C check
I just had a thought, could you try these two sequences and tell us the returned values:
and
On a working copy with the LED off we see:
0x02
and0x0002
.METTAUK
Mon, 05/22/2017 - 22:05
Permalink
OK, not really sure what your
OK, not really sure what your asking me to do
If I type the code snippets you supplied at the the command line I get "Error: Read failed"
Here is the result from "sudo i2cdetect -y 1"
With two Reverses and one Ultra.
This is on a pi that has had the kernel backdated as
Sorry, I'm guessing i need to type
and
into somthing other than the command line at pi@MyRaspberry:~ $
I am very happy to help though...?
piborg
Mon, 05/22/2017 - 22:24
Permalink
i2cset and i2cget
They are just simple command line programs to talk with I2C based devices.
The problem is I have given you commands for the standard PicoBorg Reverse I2C address, yours have been changed. The error is simply saying it failed to talk to a device at address 0x44.
Try with the 0x0A address instead:
and
METTAUK
Mon, 05/22/2017 - 22:43
Permalink
Ah, I see... :-)
Ah, I see... :-)
I get
0x00
and
0x0002
So the same as your result. But what happens with latest kernel and how to fix that is well beyond my already over extended ability!
piborg
Tue, 05/23/2017 - 18:32
Permalink
I think we have a solution
I got a chance to test this today, I can confirm that the latest download from raspberrypi.org works fine, but after a
sudo apt-get dist-upgrade
things stop working.The problem is not limited to PicoBorg Reverse either, the same effect can be seen on UltraBorg and our ThunderBorg prototypes.
I did some playing around, as far as I can tell this is a slight change in behaviour from either the SMBus library or the actual I2C driver. What we found is using raw file I/O to do the write and read as separate calls seems to work.
I have re-written the
ThunderBorg.py
script to use theio
andfcntl
libraries instead of thesmbus
library, and all seems to be well for both write commands and read commands :)This is good news as it seems that the only thing which needs to be change is the Python library itself, not the code on the board. In other words we should be able to update the code on the website to fix the problem.
We will do some more detailed testing tomorrow to confirm that everything does indeed work, then I will make a start on fixing the PicoBorg Reverse and UltraBorg libraries so they work as well.
METTAUK
Wed, 05/24/2017 - 08:18
Permalink
Thanks for confirming the issue
I will wait for your updates before updating Rpi from the foundation. Its a shame there is nothing on their web site / forum explaining this as it affects more than just Borg! Also waiting for my Thunderborg... :-)
piborg
Wed, 05/24/2017 - 11:02
Permalink
Updates
Hopefully we will get the changes made and tested today, if not probably tomorrow.
This sort of problem has happened before, either the Raspberry Pi B+ or 2 when first released seemed to have timing issues. This affected both GPIO and I2C behaviour, in particular it stopped the software PWM functionality from WiringPi behaving correctly :(
We are expecting to start shipping ThunderBorgs sometime next week, we are nearly ready :)
il diavolo
Tue, 05/23/2017 - 22:21
Permalink
Should I wait for your solutions?
I was about to do a dist-upgrade on my DiddyBorg Pi 3 as I haven't up-dated it for a while. Will this affect my 18 month old PicoBorg Reverse and UltraBorg? Should I wait until you've sorted this out as I don't want my Diddy to get sick and baddy!
piborg
Wed, 05/24/2017 - 11:03
Permalink
I would wait
I would recommend waiting, both boards will probably stop working after the update at the moment.
Hopefully we will have updated libraries later today, otherwise it will probably be tomorrow.
piborg
Wed, 05/24/2017 - 13:46
Permalink
PicoBorg Reverse library fix
We have finished testing the new logic on the PicoBorg Reverse library, it seems to work well on both the old and new versions of Raspbian ^_^
There are three ways you can go about updating the library on your Raspberry Pi:
1. Update PicoBorgRev.py only
This will keep any changes you have made to other scripts intact :)
For PicoBorg Reverse itself:
Additionally for DiddyBorg installs:
Additionally for DiddyBorg Red Edition installs:
2. Re-install the examples
This will loose any changes you have made to scripts and any other scripts in the examples folder, but is much less typing.
For PicoBorg Reverse itself:
Additionally for DiddyBorg installs:
Additionally for DiddyBorg Red Edition installs:
3. Copy / view the new code
This should work in all cases, but is much more manual.
You can view the new version of the library here: Improved PicoBorgRev.py script. This should be used to replace any copies of
PicoBorgRev.py
.You can tell if the script is new or old by looking at the import section (starts around line 30).
Old script:
New script:
No other scripts need to be changed, all of the same functions are available and work in the same way ^_^
UltraBorg
We are fairly certain the same problem exists with UltraBorg and the same changes will fix it. I am going to start working on the UltraBorg library today and will let you know when an updated version is available.
piborg
Wed, 05/24/2017 - 15:23
Permalink
UltraBorg library fix
We have made the same changes for UltraBorg as well, this solves the ID reading as
FF
in the updated Raspbian in the same way.See the full post here: UltraBorg library fix.
METTAUK
Thu, 05/25/2017 - 21:43
Permalink
Thanks
Great, will give both a go in next few days and re update Pi from RPF
GeekyTim
Wed, 05/31/2017 - 20:25
Permalink
I think you need to update
I think you need to update the Python3 version of the library too.
piborg
Thu, 06/01/2017 - 11:05
Permalink
Python 3 version updated
I have updated the Python 3 version with a new copy based on the same changes.
It can be downloaded from here: https://piborg.org/downloads/picoborgrev/PicoBorgRev3.py.txt
Jesus805
Sat, 11/03/2018 - 02:12
Permalink
Update Github?
Greetings,
I was wondering if you guys could update your Github repository with the newest fix.
https://github.com/piborg/diddyborg
Thank you for the fix!
piborg
Sat, 11/03/2018 - 17:21
Permalink
Old PicoBorgRev.py on GitHub
Thanks for pointing this out.
I will update the PicoBorgRev.py file in GitHub on Monday when I am back in the office :)
piborg
Mon, 11/05/2018 - 21:43
Permalink
Repo updated
The library has now been updated in the DiddyBorg repository ^_^
Jesus805
Tue, 11/06/2018 - 01:19
Permalink
Much appreciated, thank you!
Much appreciated, thank you!