Hello
I am new and have a problem, that GrovePi does not answer correct.
Reboot only does not help, but shutdown and switch off does.
Since i had this severel times, i would like to ask the experts what to do.
I get following error message:
Traceback (most recent call last):
File "/home/pi/Desktop/Kony/k1/multi_digital_read_led_blink.py", line 58, in <module>
grovepi.digitalWrite(led0,d2)
File "/home/pi/Desktop/GrovePi/Software/Python/grovepi.py", line 209, in digitalWrite
write_i2c_block(address, dWrite_cmd + [pin, value, unused])
File "/home/pi/Desktop/GrovePi/Software/Python/grovepi.py", line 173, in write_i2c_block
return bus.write_i2c_block_data(address, 1, block)
File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/util.py", line 59, in validator
return fn(*args, **kwdefaults)
File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/smbus.py", line 269, in write_i2c_block_data
list_to_smbus_data(data, vals)
File "/usr/local/lib/python3.5/dist-packages/smbus_cffi-0.5.1-py3.5-linux-armv7l.egg/smbus/smbus.py", line 303, in list_to_smbus_data
data.block[i + 1] = val
OverflowError: can't convert negative number to unsigned
The program i use is modifid: multi_digital_read_led_blink.py
#!/usr/bin/env python
# GrovePi LED blink test for the Grove LED Socket (http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? Ask on the forums here: http://www.dexterindustries.com/forum/?forum=grovepi
#
'''
## License
The MIT License (MIT)
GrovePi for the Raspberry Pi: an open source platform for connecting Grove Sensors to the Raspberry Pi.
Copyright (C) 2017 Dexter Industries
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
import time
import grovepi
# Connect the Grove Button to digital port D2,D3 and D4
button2 = 2
button3 = 3
# Connect the Grove LED to digital port D4,D5,D6
led0 = 4
led1 = 5
led2 = 6
grovepi.pinMode(button2,"INPUT")
grovepi.pinMode(button3,"INPUT")
grovepi.pinMode(led0,"OUTPUT")
grovepi.pinMode(led1,"OUTPUT")
grovepi.pinMode(led2,"OUTPUT")
while True:
try:
d2=grovepi.digitalRead(button2)
d3=grovepi.digitalRead(button3)
#Blink the LED
grovepi.digitalWrite(led0,d2)
grovepi.digitalWrite(led1,d2) #
grovepi.digitalWrite(led2,not d2) #
print ("LED",d2,d3)
time.sleep(1)
except IOError: # Print "Error" if communication error encountered
print ("Error")
And i use original raspberry NOOBS_v2_7_0 added with:
Setup GrovePi:
sudo curl -kL dexterindustries.com/update_grovepi | bash
sudo reboot
sudo i2cdetect -y 1
cd /home/pi/Desktop/GrovePi/Firmware
sudo chmod +x firmware_update.sh
sudo ./firmware_update.sh
Any idees, what the problem might be?
Thanks