i2cdetect on Raspberry pi 4 shows different addresses everytime the command is entered - i2c

I'm working with a Raspberry Pi 4 to test different sensors. Right now I am trying to connect the DLVR-L05D-E1BD pressure sensor by All Sensors. My problem right now is that when I enter sudo i2cdetect -y 1 in the command window to find the address, I get a bunch of addresses listed which changes everytime I enter the command. This continues until every address is shown in the table.
I also found out that if I remove the power or Vs connection from the sensor (so only SDA, SCL and ground are connected to the Pi) and then enter sudo i2cdetect -y 1, I get only one address (the expected one, 28).
To make sure nothing was wrong with the Pi I connected a particle sensor (Sensirion SPS30) and managed to detect it with the same command.
My code also sometimes manages to communicate with the pressure sensor while other times I get "Remote I/O error".
I've used two different units of the same model of pressure sensors and both have the same problem.
Any help or suggestion would be highly appreciated!
EDIT: When I reboot the Pi, I still have the same problems, however after a while the addresses just keeps changing everytime I run i2cdetect, never converging at showing all addresses.

Related

No GPS on Raspberry Pi LineageOS 18.1

UPDATED See edit!
I have installed LineageOS 18.1 for Raspberry Pi 4 (which is an awesome piece of software) and everything seems to be working correctly.
With the exception of GPS. I have an A9G connected to the Pi. It is connected to the first Pi's UART and I can see the data coming on ttyAMA0.
:/ # microcom -s 9600 /dev/ttyAMA0
$GNGGA,092800.998,4955.7547,N,00900.2330,E,0,0,,102.0,M,48.0,M,,*5E
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$BDGSA,A,1,,,,,,,,,,,,,,,*0F
$GPGSV,1,1,00*79
$BDGSV,1,1,00*68
$GNRMC,092800.998,V,4955.7547,N,00900.2330,E,0.000,0.00,211021,,,N*55
$GNVTG,0.00,T,,M,0.000,N,0.000,K,N*2C
$GNGGA,092801.998,4955.7547,N,00900.2330,E,0,0,,102.0,M,48.0,M,,*5F
$GPGSA,A,1,,,,,,,,,,,,,,,*1E
$BDGSA,A,1,,,,,,,,,,,,,,,*0F
$GPGSV,1,1,00*79
$BDGSV,1,1,00*68
$GNRMC,092801.998,V,4955.7547,N,00900.2330,E,0.000,0.00,211021,,,N*54
$GNVTG,0.00,T,,M,0.000,N,0.000,K,N*2C
$GNGGA,092802.998,4955.7547,N,00900.2330,E,0,0,,102.0,M,48.0,M,,*5C
I changed the GPS receiver to use ttyAMA0 in /vendor/build.prop
# GPS ro.kernel.android.gps=ttyAMA0
I also trying with adding
ro.kernel.android.gpsttybaud = 9600
or
ro.kernel.android.gps.speed = 9600
But not a single App can receive GPS data.
I have the feeling I am missing something very simple but essential.
Any help very appreciated
EDIT
Ok, I am a step further. The first problem was apparently, what a bummer, a permission issue.
I adjusted it in the file: /vendor/ueventd.rc
From:
/dev/ttyAMA0 0660 bluetooth bluetooth
To:
/dev/ttyAMA0 0660 system radio
Now it seems that the data is being received and correctly interpreted. But when I open a GPS testing App, the signal is flickering. It almost like if something else is reading from ttyACM0.
Is it possible?
just to clarify what I mean with "flickering", please take a look at https://cloud.sobi.pro/f/68f0398aea1549918376/
I also had the same flickering issue. I can see it in a map program or with physics toolbox where I can see the GPS LAT LONG. It flickers between the "real" position and 0.00000 for the LAT and LONG.
I am using LineageOS17.1 on a Raspberry Pi 4
my Ultimate GPS USB is from Adafruit and is on /dev/ttyUSB0
I tried updating build.prop in both /vendor and /system with the
ro.kernel.android.gps.speed = 9600
and
ro.kernel.android.gps = ttyUSB0
The solution that I eventually used was to remove the r0.kernel... from both build.prop and use the app GPS Connector
https://play.google.com/store/apps/details?id=de.pilablu.gpsconnector&hl=en_US&gl=US
Enable in developer options under "select mock location app" you can select the GPS Connector.
You can have the GPS Connector app start at boot.
If you find a more elegant solution than using an app, please reply.

STM-Link on Nucleo Board Not Enumerating

I have two nucleo boards (F4339ZI and F303K8) and neither of them show up as USB devices when I plug them into a computer via the USB port (CN1 - the USB micro port on the ST-Link, not the USB port for the board itself).
I have tried multiple host USB ports, with and without a USB hub, across two different computers, one running OS X and one running Linux. I have tried at least 6 different cables. The OSX machine is using a USB-C to USB-A converter (if that's the correct terminology). The Linux machine has USB-A ports.
In no case does the device show up using lsusb under Linux or system_profiler SPUSBDataType under OSX. Needless to say STM32CubeIDE and st-info can't see the boards. Other USB devices are functional.
The COM LED is slow blinking red which the manual (https://www.st.com/resource/en/user_manual/dm00244518-stm32-nucleo144-boards-stmicroelectronics.pdf) says means USB enumeration hasn't completed (matching what is seen from the OS level).
The boards successfully run their factory supplied blink programs when powered on.
I have tried (with the F4395I) moving JP3 to VIN so the board doesn't power up which should just leave the ST-Link running - still no enumeration though.
I tried connecting to a USB charger with JP1 off (and JP3 on U5V) and the board powers up and blinky runs. The manual referenced above says:
In case the board is powered by a USB charger, there is no USB enumeration, so the green LED LD6 stays in OFF state permanently and the target STM32 is not powered.
But everything works for me - LD6 goes a steady green as it does when connected to a computer.
Given it happens with multiple computers, OSs, cables and Nucleo boards I assume the error lies with me, the common factor in all the tests. This is my first use of Nucleo boards so I may well have a mis-assumption.
Out of frustration and lacking anything else to try I dug up every micro USB cable I could find. One had chokes on each end and magically, using that cable, everything just works as expected.
Can it be that I have at least 10 broken USB cables? I don't have an easy way to test them but I guess they might not have the data lines wired to save cost if manufacturers assumed people would only charge phones with them. I don't recall where they all came from...they have just accumulated in a box of USB cables.
Perhaps the Nucleo board sensitive to some horrible interference floating around my room?
Sorry for the noise! Broken cable was genuinely one of the things I suspected - but not 6 of them...

eInk screen is causing reboot on RaspberryPi0W

I'm trying to get to work a raspberry pi 0 W and a pervasive display eink screen together.
But, every time when the screen refresh, it reboots the pi 0. Software works great on a RPi3 but not on Rpi0w with Raspbian Lite.
Here is the soft : EpaperDisplay
Here is the screen : Screen
There is no log in /var/log/messages, neither in /var/log/syslog. Every time it reboots, it's erasing history, logs ...
If this was a software issue, you would probably see something in the logs (or you'd at least see a kernel panic message on the console in the HDMI output if you have a screen connected there).
If you have nothing in the HDMI screen when the pi crashes, I'd suspect that the display is using more power than your power supply can provide. Try with a PSU with a higher ampere rating.
If a better power supply does not help, it can be that the display sucks too much 3.3v from the raspberry pi than the zero can provide. In that case you should try feeding the display via a separate 3.3v regulator.

raspberry pi - Why can't I boot the system after shutdown?

I have a raspberry pi 3.
Whenever I want to shutdown, I always execute this command:
sudo shutdown -h now
And I will wait until only the red light is lighting. (And I always remove the power until only the red light is lighting)
But the problem is : every time I shutdown, I can't boot it again. I need to install the OS into the SD card again every time after I shutdown.
If anyone has the same problem ? Please help me. Thanks a lot.
I encountered this after my comment. As I mentioned, I perform the same steps to safely shutdown, unplug, and store.
Based on this page, you might be getting a corrupt SD card. Not sure if any of these apply.
https://www.raspberrypi.org/documentation/installation/sd-cards.md
If you are having trouble with corruption of your SD cards, make sure you follow these steps:
Make sure you are using a genuine SD card. There are many cheap SD cards available which are actually smaller than advertised or which will not last very long.
Make sure you are using a good quality power supply. You can check your power supply by measuring the voltage between TP1 and TP2 on the Raspberry Pi; if this drops below 4.75V when doing complex tasks then it is most likely unsuitable.
Make sure you are using a good quality USB cable for the power supply. When using a high quality power supply, the TP1->TP2 voltage can drop below 4.75V. This is generally due to the resistance of the wires in the USB power cable; to save money, USB cables have as little copper in them as possible, and as much as 1V (or 1W) can be lost over the length of the cable.
Make sure you are shutting your Raspberry Pi down properly before powering it off. Type sudo halt and wait for the Pi to signal it is ready to be powered off by flashing the activity LED.
Finally, corruption has been observed if you are overclocking the Pi. This problem has been fixed previously, although the workaround used may mean that it can still happen. If after checking the steps above you are still having problems with corruption, please let us know.
Hope that helps.
Cheers.
Ian

Grove Pi+ CO2 MH-Z16 sensor

I am using a Raspberry Pi 3 B model with a Grove Pi+ (1.2.2 firmware), and Raspbian for Robots Image.
I have plugged in the CO2 MH-Z16 sensor in RPISER port, and I am trying
to execute the code that is available in Dexter's Github
I am getting the following issues:
First time I tried the code, it was working but it was getting very strange results, always out of range and strange temperatures.
It calls the sensor every 18 second.
Now, when I plugged-in the sensor in de RPISER port (with the rpi on), the raspberry pi get frozen. If I tried to restart it, it is not restarting until the sensor is plugged out the rpi. I do not know what is going on, and how to solve this issue. Sometimes, the rpi does not get frozen but the mouse and the keyboard suddenly stop working. If I try to restart the rpi whith the sensor, the rpi is not restarting, it get stucks.
Can I use this sensor in another port?
Any help or any hint?
Oh yes update your firmware. I also took a long time..
https://www.dexterindustries.com/GrovePi/get-started-with-the-grovepi/updating-firmware/