Closed SpacelySpaceSprockets closed 5 years ago
Hi,
what is the output if you run:
import wiringpi as wp
wp.wiringPiSetupPhys()
?
0
Thanks for your answer - that basically only means that you have the wiringpi libraries installed and this should be working.
What you could do is run the functions from the init function of class ADS1256 (file pipyadc.py) one after the other or debug from this point: https://github.com/ul-gh/PiPyADC/blob/6b314561c47e3cada06c24e0dd35286d6251e6a5/pipyadc.py#L267
I can't help you more than this without further information, I am afraid.
stepping through with pdb I get this
/home/pi/PiPyADC/pipyadc.py(329)init() -> self.reset() (Pdb) --Call-- /home/pi/PiPyADC/pipyadc.py(525)reset() -> def reset(self): (Pdb) /home/pi/PiPyADC/pipyadc.py(529)reset() -> self._chip_select() (Pdb) --Call-- /home/pi/PiPyADC/pipyadc.py(343)_chip_select() -> def _chip_select(self): (Pdb) /home/pi/PiPyADC/pipyadc.py(346)_chip_select() -> if self.CS_PIN is not None: (Pdb) /home/pi/PiPyADC/pipyadc.py(347)_chip_select() -> wp.digitalWrite(self.CS_PIN, wp.LOW) (Pdb) --Return-- /home/pi/PiPyADC/pipyadc.py(347)_chip_select()->None -> wp.digitalWrite(self.CS_PIN, wp.LOW) (Pdb) /home/pi/PiPyADC/pipyadc.py(530)reset() -> self._send_byte(CMD_RESET) (Pdb) --Call-- /home/pi/PiPyADC/pipyadc.py(358)_send_byte() -> def _send_byte(self, mybyte): (Pdb) /home/pi/PiPyADC/pipyadc.py(365)_send_byte() -> wp.wiringPiSPIDataRW(self.SPI_CHANNEL, "%s" % chr(mybyte&0xFF))
Program crashes on the last line... values are...
/home/pi/PiPyADC/pipyadc.py(367)_send_byte() -> wp.wiringPiSPIDataRW(self.SPI_CHANNEL, "%s" % chr(mybyte&0xFF)) (Pdb) pp self.SPI_CHANNEL 1 (Pdb) pp mybyte&0xFF 254 (Pdb)
chr(254) = '\xfe'
Hi, not sure, (I've had the second beer for today, it's past midnight here and I also don't have access to the hardware) but this could be a WiringPi issue. You can try out the PiGPIO branch if you want: https://github.com/ul-gh/PiPyADC/tree/pigpio. If you want, I can look into this later, but today - not a chance.. Best wishes, Ulrich
we can take this up again tomorrow. Enjoy the beer
Yep, it worked with the pigpio branch
This could be related to the Python 3 issue #18, which is fixed via the latest commits. If there are still problems, please reopen this issue.
I have a new RPi3 with a new waveshare High-Precision AD/DA board.
I installed your code, but when I run the examples, the board doesn't seem to initialize...I put a couple of print statements in to see where it was making it too..
and it outputs...
but nothing else. So Its failing at
ads = ADS1256()
Am I forgetting something? It runs with some C code, so I don't think it's a hardware problem.
Thanks