Grove pi is not working before an exam

Hello community,

For my Exam, I need to create a project with a grovepi and some sensors/led

At the beginning, everything worked fine, my button sensor gave me the right results, the leds were working fine, the RFID was good, and the DHT too (it is what I used at that moment), but for some reason, subtly, a part of the grovepi is not working any more.
I failed my exam last year because of that because I couldn’t find the cause, this year I did the project again, and it was working fine, until yesterday.
I had exactly the same problem as last year:

  • My button is giving me 0, 218 or 255 values (not others, but randomly with the majority of 218)
  • My leds doesn’t respond the majority of the time

At least, this year, my DHT is still working.

This year, I tried everything:

  • I thought the OS was corrupted, so I reinstalled it from scratch (I did a script to help me install everything).
  • I tried to change the captors on all digit input, but same result.
  • I tried to debug step by step to know when it crash.

I don’t know why, but in the last try, it crashed just after I installed manually the grove pi package of python (and YES, I also attempted to install it with the recommanded script, it is what I’ve worked with since the beginning).
But I don’t know if it is linked at all.

I also saw on the log (below) that the SPI and the i2c are blacklisted, but I didn’t find where to remove it, and the file /etc/modprobe.d/raspi-blacklist.conf is empty.

To be honest, I don’t know where to look, my exam is next week, and even if I’m not so late, I would rather not fail because of a small problem I cannot find.

Kind regards,
Sebastien

PS: i didn’t know where to categorize it, if you can move it, or tell me, I can move it to the right place. Thank you.

UPDATE:
With your information, I tried to do an intensive debug, and i think i found out when it worked again when i disabled the nodered process.
The problem identified is that i can only read one sensor at a time. like if it has only one canal to get the information.
So i cheated a little bit with the delays and now everything is working. But i don’t know if it is normal to have only one canal? I know we don’t have infinity ones, but I didn’t think we only have one.


Check space left
================
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        59G  8.3G   48G  15% /
devtmpfs        1.8G     0  1.8G   0% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
tmpfs           1.9G  8.6M  1.9G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           1.9G     0  1.9G   0% /sys/fs/cgroup
/dev/mmcblk0p1  253M   48M  205M  19% /boot
tmpfs           383M  4.0K  383M   1% /run/user/1000

Check for dependencies
======================
python 2.7.16-1 install ok installed
python-pip 18.1-5+rpt1 install ok installed
git 1:2.20.1-2+deb10u6 install ok installed
libi2c-dev 4.1-1 install ok installed
python-serial 3.4-4 install ok installed
python-rpi.gpio 0.7.0-0.1~bpo10+4 install ok installed
i2c-tools 4.1-1 install ok installed
python-smbus 4.1-1 install ok installed
scratch 1.4.0.6~dfsg1-6 install ok installed

I2C still in blacklist
SPI still in blacklist


Check for addition in /modules
==============================
I2C-dev already there
i2c-bcm2708 already there
spi-dev already there


Hardware revision
=================
RPI4 Pi 4 Model B 4G v1.2

Check the /dev folder
=====================
i2c-1
spidev0.0
spidev0.1
ttyAMA0

USB device status
=================
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
Raspbian for Robots Version
===========================
cat: /home/pi/di_update/Raspbian_For_Robots/Version: No such file or directory


Hostname
========
nbel


Checking I2C bus for devices
============================

Checking I2C bus 0
==================
NOTE: it is normal for this one to fail
Error: Could not open file `/dev/i2c-0' or `/dev/i2c/0': No such file or directory

Checking I2C bus 1
==================
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- 04 -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

Checking for firmware version
=============================
GrovePi has firmware version: 255.255.255

2 Likes

Don’t know anything about GrovePi, but can ask some questions that may allow us to help.

Is it a GrovePi or GrovePi+ ?

I am under the impression that the recommended OS for the GrovePi(+) is the Legacy PiOS (32-bit).

Do you have individual test scripts that test each item without the other items plugged in?
(Can you test button when nothing else is plugged in?)

What does vcgencmd get_throttled return when things are not working?

What power source are you using?

1 Like

My understanding is that you can Ignore this note

1 Like

Have you verified that SPI and i2c are enabled in raspi-config?

One very weird thing that can be hard to detect is a read-only failure of the SDcard.

To detect if this has happened:

  1. login to your system
  2. touch mynewfile.txt
  3. shutdown -h now
    turn off power when green light stops flashing for good
  4. power on, login
  5. ls
    Is mynewfile.txt listed? If not save your code off somewhere, and throw away the SDcard
1 Like

Hello,
Thank you for the answer,
The grove pi is provided by the school, it is a GrovePi+ V3.0 01/11/2016
Last year, I made a mistake and used the last OS of raspbian, and i thought it was the error, but this year I did specially took the OS the teacher recommanded.
Here is the uname -a: Linux nbel 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux

Even if I think i tried to do the individual, I tried again, but this time with stopping NodeRed (I should have mentioned it was present.) And surprise, it worked.
I tried some things, and it seems it was because i had a daemon who was getting the dht, and it seems the canal was reserved or something.
Strange, because even if I think it is normal we can’t access to all sensors at the same time, I didn’t think we could only access to one at the time.

Here I tried to cheat with the sensors to got them at different moments, and to block them when my button is pressed (because it put it at false when a captor is used at that moment).
It is working now, I hope I won’t have to put an another sensor.

About the command vcgencmd get_throttled, I didn’t try it when it was blocked, but I have this: throttled=0x50000

Thank you for your answer, at least I could find the problem,
Kind Regards,
Sebastien

2 Likes

Hello @cyclicalobsessive ,

Thank you for your answer.
I know of this problem, for another course, I had a cubitruck who will have some I/O problems when a little bit hot, so you had to restart it. I did it 3 times during the exam because I couldn’t change it.
I also tried here, it was not the problem.
I will update the post, but i found the problem (I think), it is because I only have 1 canal for digit part, I can only read on 1 sensor at a time.
I don’t know if it is a problem or not, i cheated a little bit to delay the sensor output, and it is working now.

Thank you for your answer

2 Likes

Your power supply is not strong enough or your power cable is not good enough, or one of your actions/sensors is shorted to ground or drawing too much power pulling the voltage down momentarily.

1 Like

There is a software concept called a mutex that is often used for marshaling competition for resources.

1 Like