Raspberry I2C Error: Could not open file `/dev/i2c-1' or - raspberry-pi

I have a problem in getting the I2C working on a Raspberry Zero 2 with Buster (10) 2022-09-22.
The I2C interface is enabled (Preferences > Raspberry Pi Configuration > Interfaces).
If I run the command: i2cdetect -y 1
I get the error: Error: Could not open file `/dev/i2c-1' or...
Any suggestion?

Related

(Fusing Layers Illegal instruction) when running detect.py of yolov5 on Raspberry pi 4

I have cloned the yolov5 repository in my raspberry pi OS
git clone https://github.com/ultralytics/yolov5
Updated torch and installed the requirements.txt file
However, when I run inference with detect.py
python3 detect.py --source data/images --weights yolov5s.pt --conf 0.25
It shows an error saying
detect: weights=['yolov5s.pt'], source=data/images, data=data/coco128.yaml, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=False, save_conf=False, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=exp, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5 🚀 v6.2-219-ga83d2a5 Python-3.9.2 torch-1.13.0 CPU
Fusing layers...
Illegal instruction
I ensured I have installed the requirements and updated torch so I do not know what is going wrong, and I will appreciate any help

Raspberrypi 4 can't get the data from gps module

I'm currently missing with GPS configuration and didn't know where is the problems, please if someone have an idea to share with me the solution,
I'm using Raspberrypi 4 Model B 4GB RAM and a sim808 GPS module,
Sim808 GPS module
I did TX pin to RX, RX to TX pin, VCC to 5V, ground to ground.
also I did those configuration:
sudo nano /boot/cmdline.txt :
dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
sudo nano /boot/config.txt :
/boot/config.txt
sudo nano /etc/default/gpsd :
etc/default/gpsd
output
Please help!

Raspberry Pi CM4 UBoot NVME-access

Does anyone have a working UBoot config for accessing an NVME drive from UBoot running on a Raspberry Pi CM4?
I've compiled everything and UBoot is detecting my NVME correctly:
pci_bind_bus_devices: bus 1/pci_0:0.0: found device 0, function 0: find ret=-19
pci_find_and_bind_driver: Searching for driver: vendor=2646, device=2263
pci_find_and_bind_driver: Match found: nvme
pci_auto_config_devices: start
pci_auto_config_devices: device nvme#0
PCI Autoconfig: BAR 0, Mem, size=0x4000, address=0xc0000000 bus_lower=0xc0004000
pci_auto_config_devices: done
but it doesnt call nvme_uclass_post_probe() and therefore it doesnt create any block device.
Running the command "nvme scan" from the UBoot command line i'am getting a timeout in nvme_submit_sync_cmd(). -> ETIMEDOUT.
I'am using a Kingston A2000 SDD with the latest firmware "S5Z42109".
Does anyone have an idea?
Thanks.

How do I solve QEMU and HAXM portable launch issues?

I am having issues with HAXM and QEMU portable launch in Winodws. I have tried running the apps with admin permissions but that didn't solve my issue.
Vbox works fine. I am trying to create a portable QEMU but without good acceleration it's WAY to slow.
:\DELETE\QEMU_INSTALLED>qemu-system-x86_64.exe -hda ./debian.qcow2 -boot d -cdrom debian-10.4.0-amd64-netinst.iso -m 1024 -usb -cpu max -net nic,model=virtio -accel hax
Failed to open the HAX device!
Open HAX device failed
Failed to get Hax capability:6u
No accelerator found.
qemu-system-x86_64.exe: -accel hax: failed to initialize hax: Invalid argument
C:\DELETE\QEMU_INSTALLED>..\haxm-windows_v7_6_1\haxm_check.exe
VT support -- yes
NX support -- yes
installed haxm-windows_v7_6_1 intelhaxm-android.exe

Can't register rteth0 for FEC Ethernet card on SabreLite iMX6Q

I'm a new user on RTnet and try to make Rtnet work on Freescale Sabre Lite iMX6Q board. But I got an issue, RTnet can't use rt_fec.ko module driver to register rt_eth0 even though non real time driver is disable.
I'm using:
Linux kernel 3.0.43 download from Xenomai git://git.xenomai.org/ipipe-gch.git/?h=ipipe-3.0-imx6q
Xenomai 2.6 download from git.xenomai.org/xenomai-2.6.git/
RTnet 0.9.13 download from rtnet.org/download.html
Please see my kernel configuration and boot log in attached link.
Xenomai is loaded:
"*I-pipe: Domain Xenomai registered.
Xenomai: hal/arm started.
Xenomai: scheduling class idle registered.
Xenomai: scheduling class rt registered.
Xenomai: real-time nucleus v2.6.3 (Lies and Truths) loaded.
Xenomai: debug mode enabled.
Xenomai: starting native API services.
Xenomai: starting POSIX services.
Xenomai: starting RTDM services.* "
And FEC ethernet driver (non real-time driver) is loaded when kernel is booting
*"FEC Ethernet Driver
fec_enet_mii_bus: probed "*
Xenomai is built following install guideline for ARM platform from Xenomai:
http://xenomai.org/installing-xenomai-2-x/
RTnet is built by below command, because SABRE Lite use FEC ethernet card with Micrel KSZ9021 Gigabit chip so I put "--enable-fec" in configure command to build real-time driver for FEC ethernet card:
"./configure --host=armv7l-timesys-linux-gnueabi --with-rtext-config=/home/sonnguyen/rtnet-xenomai-rootfs/usr/xenomai/bin/xeno-config --with-linux=/home/sonnguyen/build/rtnet-xenomai-ipipe-imx6q --enable-rtcfg-dbg --enable-rtwlan --enable-net-routing --enable-router --enable-nomac --enable-rtcap --enable-proxy --enable-checks --enable-fec "
Then
"make DESTDIR=/home/sonnguyen/rtnet-xenomai-rootfs install"
I also changed RT_DRIVER from default value to "rt_fec" in rtnet.conf.
After kernel is booted, I ran "./rtnet start" and got this:
"RTnet: initialising real-time networking
RT FEC Ethernet Driver
./rtnet: line 385: can't create /sys/bus/pci/drivers/rt_fec/bind: nonexistent directory
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device "
Then I tried:
"# lspci
lspci: /sys/bus/pci/devices: No such file or directory
ls /sys/bus/
ac97 hid mdio_bus platform sdio spi
event_source i2c mmc scsi serio usb "
No pci directory under /sys/bus/. Then I thought because the script can't find the ethernet physical bus, it can't register rteth0.
Then I looked into rtnet script and did some minor change. In the script it requires physical ethernet device ID (mentioned in REBIND_RT_NICS), so I tried to find out what it is and got this when make eth0 up with non real-time driver:
"eth0: Freescale FEC PHY driver [Micrel KSZ9021 Gigabit PHY] (mii_bus:phy_addr=1:06, irq=-1)
PHY: 1:06 - Link is Up - 1000/Full "
I think 1:06 is my physical bus ID, then I change the code in rtnet from:
for dev in $REBIND_RT_NICS; do
if [ -d /sys/bus/pci/devices/$dev/driver ]; then
echo $dev > /sys/bus/pci/devices/$dev/driver/unbind
fi
echo $dev > /sys/bus/pci/drivers/$RT_DRIVER/bind
done
To
echo 1:06 > /sys/bus/mdio_bus/drivers/Micrel\ KSZ9021\ Gigabit\ PHY/unbind
echo 1:06 > /sys/bus/platform/drivers/rt_fec/bind
And I tried again with "./rtnet start", this time I got this:
RTnet: initialising real-time networking
RT FEC Ethernet Driver
sh: write error: No such device
initializing loopback...
RTnet: registered rtlo
RTcap: real-time capturing interface
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCGIFFLAGS: No such device
RTcfg: init real-time configuration distribution protocol
RTmac: init realtime media access control
RTmac/TDMA: init time division multiple access control mechanism
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl: No such device
ioctl (add): No such device
ioctl (add): No such device
ioctl (add): No such device
ifconfig: SIOCGIFFLAGS: No such device
Waiting for all slaves...ioctl: No such device
ioctl: No such device
But it still said "No such device"
This is lsmod after I ran ./rtnet start
lsmod
Module Size Used by Not tainted
tdma 25691 0
rtmac 9724 1 tdma
rtcfg 58071 0
rtcap 7151 0
rt_loopback 1279 2
rtpacket 6365 0
rtudp 10738 0
rt_fec 12742 0
rtipv4 29987 2 rtcfg,rtudp
rtnet 40746 9 tdma,rtmac,rtcfg,rtcap,rt_loopback,rtpacket,rtudp,rt_fec,rtipv4
./rtifconfig
rtlo Medium: Local Loopback
IP address: 127.0.0.1
UP LOOPBACK RUNNING MTU: 1500
Only rtlo is registered.
I also tried with kernel linux without non real-time FEC driver (please refer in another config file in attached Skydrive link), but still the same issue happened.
Do you have any idea how to solve this issue? I did many search but still can not figure out how to fix it.
Because I can't attach the files to my post, so I put all of my configuration files in the link below:
https://onedrive.live.com/redir?resid=162EDF85AEBD2EFE!717&authkey=!AJ1Fjd_XiohUwes&ithint=file%2czip
Best Regards,
Nguyen Hung Son