I2C on my Pi(s) is not detecting any slave.
I am obviously missing something here, the PI's I2C is "working" but do not detect the device. I did (and redid) everytghing suggested by Sirajo on I2C not detecting ? issues in hardware or any other?
The I2C devices tested are : NCD9830(chip only) ; HT16K33(adafruit) ; LCD with PCF8574.
The hardware has been verified ;
The i2c lines has been probed in order to verify if pull-up "hold the line too hard" and I do get nice square signal.
Nothing is ever showing up.
If I ask ...
$ ls /dev/*i2c*
I get ...
/dev/i2c-1
therefore the i2c1 is active
If I ask ...
$ sudo i2cdetect -y -1
I do get the table but NO I2C address showing up.
What is the missing part ?
Related
I'm in confusion that will an I2C device get detected in raspberry pi even when there
are no device drivers and DTS files related to it.
Will it show up when we use this command
ls /dev/i2c-*
and are we able to detect its address when I try to probe using
i2cdetect -y bus_number
In short:
... when there are no device drivers and DTS files related to it.
Will it show up when we use this command
ls /dev/i2c-*
No. This command will list available I2C buses, not devices.
and are we able to detect its address when I try to probe using
i2cdetect -y bus_number
Maybe. In most cases yes.
A bit more elaborated:
Depending of what kind of I2C device it is, and what you want to do with it, you might still be able to communicate with it.
driver - best case
If you have relevant device tree change to describe this I2C device (on what bus it is located, its address, extra signals if needed - like interrupt pin, etc) and associated driver is present (built-in or as a module, check *_defconfig options in Linux kernel source) - driver should probe device during either boot or manual module loading.
Why best case? If you have a driver you don't have to think about protocols and programming, and, as an example, reading a value from ADC device might be as simple as:
root#pi:~# cat /sys/bus/iio/devices/iio:device0/in_voltage0_raw
291
i2ctools
Another approach would be to use i2cget/i2cset tools from i2ctools package. No device tree changes needed. With these tools you can talk with any unclaimed I2C device on any enabled I2C bus in device tree.
You'll need to implement communication with I2C device by your own. From security and stability perspective - IMO this is the worst case to go, but is good for hardware debugging and, in some cases, initial bring-up.
Example is here.
Note regarding i2cdetect - this command tries to detect devices on particular bus, but gives no warranty. As per man i2cdetect:
As there is no standard I2C detection command, i2cdetect uses arbitrary SMBus commands (namely SMBus quick write and SMBus receive byte) to probe for devices.
I've been trying to communicate different models of Roomba vacuum robots, 9xx and 6xx series, with a raspberry using the sci port of the roomba with no success. The sequence of steps have been:
connect pins 3 (rxd), 4 (txd), and 6 (ground) of the roomba port (5v) with a sparkfun logic level converter.
connect the output (3.3v) from the logic level converter to the gpio of the raspberry pi. Roomba Rxd to rpi txd, roomba txd to pi rxd, ground to ground.
connect rpi 5v to logic level converter HV and at the same time LV to gpio pin 1 (3.3v) for feeding high and low voltage required by the logic level converter.
disable serial console of the rpi
enable serial port hardware of the rpi
install and then open minicom in the rpi using this command
minicom -b 115200 -o -D /dev/serial0
place the roomba in the charging dock
I would now expect to read information about the charging process of the roomba in the minicom console but that's not happening.
Anyone knows if any of those steps is wrong?
My goals are to been able to read robots bump sensors in first place and then control movements of the robot from a pc using the rpi in between.
Thanks for any help.
Check this webseite. it's explaining exactly how to connect the roomba to the raspberry using an logic level converter
https://domoticproject.com/roomberry-surveillance-robot-roomba-raspberry-pi-zero-w-camera/
I am looking to add a real-time clock to my Raspberry Pi using i2c, but I want to use i2c-0 (GPIO 0 and GPIO 1) rather than i2c-1 (GPIO 2 and GPIO 3). The real-time clock gets detected by the Raspberry Pi, but when I add
dtoverlay=i2c-rtc,ds1307
to /boot/config.txt, it doesn’t say ‘UU’ (in use) instead of the address (68) when using
i2cdetect -y 0
Is there any way of adding something to the config.txt file in order to target the i2c-0 instead of the i2c-1?
I used the Adafruit tutorial in order to add it, but obviously only worked when connecting to the i2c-1 and not i2c-0.
I'm playing arround with a Raspberry pi zero but it has some issues powering my WIFI dongle.
Nov 21 21:42:49 raspberrypi kernel: [ 456.466068] usb 1-1.1: rejected 1 configuration due to insufficient available bus power
It works, but it requires some manual labour to to turn it on:
echo 1 > /sys/bus/usb/devices/1-1.1/bConfigurationValue
In my case, this enables the device and then all is well. However, I need to repeat this step after each boot (tried init script, no luck yet).
My question is how to solve this problem. Preferably i'd just like to disable the power check (if possible) and just have the kernel configure the device.
Is this possibe/is there a better solution?
I had a similar problem (my router sometimes acted weird and my Pi didn't reconnect) and I use a script that checks every minute if the Pi has a wifi connection, if not it "reboots the wifi". (Got it from this tutorial http://alexba.in/blog/2015/01/14/automatically-reconnecting-wifi-on-a-raspberrypi/)
#!/bin/bash
# The IP for the server you wish to ping (8.8.8.8 is a public Google DNS server)
SERVER=8.8.8.8
# Only send two pings, sending output to /dev/null
ping -c2 ${SERVER} > /dev/null
# If the return code from ping ($?) is not 0 (meaning there was an error)
if [ $? != 0 ]
then
# Restart the wireless interface
ifdown --force wlan0
ifup wlan0
fi
Although it probably is not the most elegant solution you could just follow this tutorial and replace
ifdown --force wlan0
ifup wlan0
with this I guess:
echo 1 > /sys/bus/usb/devices/1-1.1/bConfigurationValue
But since you say that you say that you just need to run this script on boot and it works until you power the Pi back off again making a simple python script like
import os
os.system("echo 1 > /sys/bus/usb/devices/1-1.1/bConfigurationValue")
and making sure it starts on boot by adding this line in the /etc/rc.local file just above the exit 0 in that file:
sudo python /path/to/the/python/script/this_script.py
This should do the trick although I'm pretty sure the Pi has a good reason disabling your Wifi dongle (I'm pretty sure you could 'burn out' your Pi by using to much current if there was no protection). What Wifi dongle are you using and what are your powering you Pi with? I'm sorry for my not so clear answer, I'm just starting to get into the Pi but I hope I was at least of some help.
I want to interface raspberrp pi and Mbed microcontroller through I2c bus. Both operate at 3.3v, I have connected Rpi SCL ----> mbed SCL, RPI SDA------> mbed SDA, RPI gnd -----> mbed gnd. After connecting all these things I run sudo i2cdetect -y 1 command its does not shows any more address connected to Rpi . Both the modules have internal pull up resistor
...
I²C is a master-slave protocol. That means one devices takes over the role of the master, and one (or multiple) devices connected to the I²C bus act as an I²C device.
In your case it seems like the raspberry pi is working as the master. To put the mbed device into I²C slave mode you have to instantiate one I2CSlave class.
Documentation and a tiny example is on the official site:
https://developer.mbed.org/users/mbed_official/code/mbed/docs/tip/classmbed_1_1I2CSlave.html