I have got it working!
In /boot/config.txt i have
dtoverlay=i2c-bcm2708
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
and i get
root@raspberrypi:/home/pi/rover/democode# python volts.py
Battery Voltage: 4.072
4.072
4.072
I hope this help others.
Stefan
volts.py output problem
-
- Posts: 31
- Joined: Sat Oct 28, 2017 4:21 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: volts.py output problem
Kind regards
Stefan / SM7TIX
Stefan / SM7TIX
-
- Posts: 75
- Joined: Fri Jan 26, 2018 5:03 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
-
- Posts: 31
- Joined: Sat Oct 28, 2017 4:21 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: volts.py output problem
My lsmod
(rover)pi@raspberrypi:~ $ lsmod
Module Size Used by
bnep 20480 2
hci_uart 24576 1
bluetooth 368640 21 hci_uart,bnep
ecdh_generic 28672 1 bluetooth
brcmfmac 307200 0
brcmutil 16384 1 brcmfmac
spidev 16384 0
cfg80211 573440 1 brcmfmac
rfkill 28672 4 bluetooth,cfg80211
snd_soc_bcm2835_i2s 16384 0
snd_bcm2835 32768 0
snd_soc_core 188416 1 snd_soc_bcm2835_i2s
snd_compress 20480 1 snd_soc_core
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_pcm 98304 4 snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
snd_timer 32768 1 snd_pcm
spi_bcm2835 16384 0
snd 69632 5 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
uio_pdrv_genirq 16384 0
fixed 16384 0
uio 20480 1 uio_pdrv_genirq
i2c_bcm2708 16384 0
i2c_dev 16384 0
fuse 106496 1
ipv6 434176 35
(rover)pi@raspberrypi:~ $ lsmod
Module Size Used by
bnep 20480 2
hci_uart 24576 1
bluetooth 368640 21 hci_uart,bnep
ecdh_generic 28672 1 bluetooth
brcmfmac 307200 0
brcmutil 16384 1 brcmfmac
spidev 16384 0
cfg80211 573440 1 brcmfmac
rfkill 28672 4 bluetooth,cfg80211
snd_soc_bcm2835_i2s 16384 0
snd_bcm2835 32768 0
snd_soc_core 188416 1 snd_soc_bcm2835_i2s
snd_compress 20480 1 snd_soc_core
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_pcm 98304 4 snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
snd_timer 32768 1 snd_pcm
spi_bcm2835 16384 0
snd 69632 5 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
uio_pdrv_genirq 16384 0
fixed 16384 0
uio 20480 1 uio_pdrv_genirq
i2c_bcm2708 16384 0
i2c_dev 16384 0
fuse 106496 1
ipv6 434176 35
Kind regards
Stefan / SM7TIX
Stefan / SM7TIX
-
- Posts: 20
- Joined: Sun Oct 15, 2017 11:13 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: volts.py output problem
Yes it now works. Thanks Stefan
-
- Posts: 20
- Joined: Sun Oct 15, 2017 11:13 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: volts.py output problem
Hi
I ran volts.py, lightsense_ambient, lightsense_surface and rangefinder, all returned values and I was able to see the value change when I manipulated the sensor/s, all except rangefinder this returned a steady value of 87. I put an obstacle at various distances but not change in the value.
I ran volts.py, lightsense_ambient, lightsense_surface and rangefinder, all returned values and I was able to see the value change when I manipulated the sensor/s, all except rangefinder this returned a steady value of 87. I put an obstacle at various distances but not change in the value.
-
- Posts: 75
- Joined: Fri Jan 26, 2018 5:03 pm [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: volts.py output problem
The Python scripts all ran for me, at least initially.
The rangefinder example works correctly, distance values vary depending on where the sensor is pointed (objects at different distances).
After about the 2nd or 3rd time, I started getting the message “error on write”, and sometimes voltage would return as all zeros.
It seems we are not alone: https://www.raspberrypi.org/forums/view ... p?t=178000
I am considering moving to the 4.14 kernel using rpi-update.
The rangefinder example works correctly, distance values vary depending on where the sensor is pointed (objects at different distances).
After about the 2nd or 3rd time, I started getting the message “error on write”, and sometimes voltage would return as all zeros.
It seems we are not alone: https://www.raspberrypi.org/forums/view ... p?t=178000
I am considering moving to the 4.14 kernel using rpi-update.
- TomTheWhittler
- Posts: 29
- Joined: Wed Sep 13, 2017 5:04 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: volts.py output problem
I would be careful with rpi-update
I did that before I started to play with the python software and now nothing really works.
I had to do that several times as the Rpi software server kept timing out so things did
not update and install correctly.
First error on running the Python was that it could not find SMbus drivers.
I got that fixed and now it gives a different error of not being able to communicate.
Still hunting this down in the little spare time I have available at the moment.
I am tempted to do a fresh operating system install on a nice 64gb Sansdisk micro card.
I did that before I started to play with the python software and now nothing really works.
I had to do that several times as the Rpi software server kept timing out so things did
not update and install correctly.
First error on running the Python was that it could not find SMbus drivers.
I got that fixed and now it gives a different error of not being able to communicate.
Still hunting this down in the little spare time I have available at the moment.
I am tempted to do a fresh operating system install on a nice 64gb Sansdisk micro card.
Research is the only place in a company where you can continually have failures and still keep your job.
I knew immediately that was where I belonged.
I knew immediately that was where I belonged.
Who is online
Users browsing this forum: No registered users and 10 guests