Closed lightmaster closed 4 years ago
I see an addressing problem with the script. (reading/writing the wrong register) I'm chasing it!
Sigh, nope not the wrong register - just new code resetting chip to factory defaults... and calibrating internal RC oscillators. My bad. Still hunting for possible issues.
Couldn't find any cause for write errors. Did find and fix a crash upon detect of overhead event.
Changes committed to /master. Fixes appear in v2.2.5 and later.
Please update to the latest version and then rerun with -d -v and let's see what we have...
Oh, also, please restart the pigpiod service with: sudo systemctl restart pigpiod.service
(before you test again.)
The error above is from that service... you might have to reboot the RPi to get a clean restart... -FYI
Whelp, looks like the I2C issue is likely nothing to do with the script, cuz this is the output of sudo i2cdetect -y 1
pi@LightningPi [06:41:20 PM] [~]
-> % sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
I'm at work for the night, so won't be able to double check the hardware until tomorrow. Not sure what could have failed, unless my breadboard is failing. I've another one I can swap with to test.
Also, apologies for making you look through the code when its likely not the culprit. Haven't used I2C before and just found out about that command to test connection.
Like minds, I was just going to ask you to check that. Good work! It's good that I did check the code since I found and fixed a crash! So no worries.
I'll be standing by to hear of your next testing...
You might want to double-check that SPI and I2C are both enabled via sudo raspi-config
if you are going to be switching between, too.
it's also a good idea to make sure your RPi has the latest and best of the software you are using. I keep mine up-to-date with
sudo apt-get update
sudo apt-get dist-upgrade
I answer yes to the list of updates so all are updated.
Also, a couple more easy checks:
ls /dev/i2c*
# which yields something like (only if the driver is loaded):
crw-rw---- 1 root i2c 89, 1 Sep 1 13:17 /dev/i2c-1
or SPI:
ls /dev/spi*
# which yields something like (only if the driver is loaded):
crw-rw---- 1 root spi 153, 0 Aug 31 18:23 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Aug 31 18:23 /dev/spidev0.1
Everything seemed good, but still nothing, so I ended up wiping the MicroSD card and starting from scratch. After updating everything, including using sudo rpi-update
, it was detected using sudo i2cdetect -y 1
. Must have been something unknowingly fubared.
Checklist:
Release with the issue: v2.2.3 Last working release (if known):
Hardware, Operating System, Python version: RPi 3B Rasbian Python 3.7.3
Description of problem: Probably related to #10, but getting an I2C read/write error.
Python errors shown in the logs (if applicable):
Additional information: