Raspberry Pi will not detect mpu6050 - raspberry-pi

I have an mpu6050 and I am trying to get it to work with my raspberry pi. I the following pins connected to the raspberry pi like this:
vcc --------- 5V (pin 4)
gnd --------- Ground (pin 6)
scl --------- scl (pin 5)
sda --------- sda (pin 3)
xda --------- not connected
xcl --------- not connected
add --------- not connected
int --------- not connected
When I run sudo i2cdetect -y 1, I get:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
The green light on the mpu6050 is on. Also, the day before the mpu6050 was working fine.

Related

nfs-kernel-server failed to start on debian

A bit new to this topic and would be great if one can provide some pointers in this case:
i have been trying to use NFS on an in-house built cluster. everything worked from the link i followed except common file sharing topic.
installed NFS-kernel-server on master node
installed NFS-common on slave / worker nodes
configured /etc/exports on master node as required
configured /etc/fstab properly on worker nodes with the mount location
But unable to start nfs-server on master node and the errors show issue with the dependencies
if needed i can provide output from journalctl -xe but main error shows "Failed to mount NFSD configuration filesystem."
Any pointer / solution would be greatly helpful.
Output from journalctl -xe:
*The unit proc-fs-nfsd.mount has entered the 'failed' state with result 'exit-code'. Dec 13 10:06:39 ccc-001 systemd1: Failed to
mount NFSD configuration filesystem.
-- Subject: A start job for unit proc-fs-nfsd.mount has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- A start job for unit proc-fs-nfsd.mount has finished with a failure.
-- The job identifier is 1032 and the job result is failed. Dec 13 10:06:39 ccc-001 systemd1: Dependency failed for NFS Mount Daemon.
-- Subject: A start job for unit nfs-mountd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- A start job for unit nfs-mountd.service has finished with a failure.
-- The job identifier is 1034 and the job result is dependency. Dec 13 10:06:39 ccc-001 systemd1: Dependency failed for NFS server and
services.
-- Subject: A start job for unit nfs-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- A start job for unit nfs-server.service has finished with a failure.
-- The job identifier is 1027 and the job result is dependency. Dec 13 10:06:39 ccc-001 systemd1: Dependency failed for NFSv4 ID-name
mapping service.
-- Subject: A start job for unit nfs-idmapd.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- A start job for unit nfs-idmapd.service has finished with a failure.
-- The job identifier is 1037 and the job result is dependency. Dec 13 10:06:39 ccc-001 systemd1: nfs-idmapd.service: Job
nfs-idmapd.service/start failed with result 'dependency'. Dec 13
10:06:39 ccc-001 systemd1: nfs-server.service: Job
nfs-server.service/start failed with result 'dependency'. Dec 13
10:06:39 ccc-001 systemd1: nfs-mountd.service: Job
nfs-mountd.service/start failed with result 'dependency'. Dec 13
10:06:39 ccc-001 systemd1: Condition check resulted in RPC security
service for NFS server being skipped.
-- Subject: A start job for unit rpc-svcgssd.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- A start job for unit rpc-svcgssd.service has finished successfully.
-- The job identifier is 1042. Dec 13 10:06:39 ccc-001 systemd1: Condition check resulted in RPC security service for NFS client and
server being skipped.
-- Subject: A start job for unit rpc-gssd.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- A start job for unit rpc-gssd.service has finished successfully.
-- The job identifier is 1041. Dec 13 10:06:39 ccc-001 sudo[4469]: pam_unix(sudo:session): session closed for user root*

How to ensure that the autovacuum daemon is running in my PostgreSQL Docker Container?

I am benchmarking my database running in a Docker container against fragmentation issues and found out that the autovacuum daemon is not running.
SELECT
schemaname, relname,
last_vacuum, last_autovacuum,
vacuum_count, autovacuum_count -- not available on 9.0 and earlier
FROM pg_stat_user_tables;
gives:
| schemaname | relname |last_vacuum| last_autovacuum |vacuum_count| autovacuum_count |
|------------|-------------|-----------|-----------------|------------| -----------------|
| public | mt_doc_order| <null> | <null> | 0 | 0 |
I am therefore running into fragmentation performances effects:
How can I make sure that this autovacuum daemon is running when I am starting my PostgreSQL Docker Container?
Run the SQL statement
ALTER SYSTEM SET autovacuum = on;
as superuser, then restart the PostgreSQL server process.

How to activate bcm2835_wdt watchdog kernel module for raspberry pi 3?

I have been trying to activate bcm2835_wdt watchdog module of raspberry pi 3 for 6 hours but I couldn't.
modprobe bcm2835_wdt returns no error but lsmod command doesn't return bcm2835_wdt module in the list.
I have loaded watchdog and chkconfig
then;
sudo chkconfig watchdog on
when I try to start service
sudo /etc/init.d/watchdog start
I got an error
[....] Starting watchdog (via systemctl): watchdog.service Job for watchdog.service failed because the control process exited with error code.
See "systemctl status watchdog.service" and "journalctl -xe" for details.
failed!
journalctl -xe returns;
-- Kernel start-up required 2093448 microseconds.
--
-- Initial RAM disk start-up required INITRD_USEC microseconds.
--
-- Userspace start-up required 5579375635 microseconds.
Jan 11 16:03:45 al sudo[935]: root : TTY=pts/1 ; PWD=/ ; USER=root ; COMMAND=/etc/init.d/watchdog start
Jan 11 16:03:45 al sudo[935]: pam_unix(sudo:session): session opened for user root by root(uid=0)
Jan 11 16:03:46 al systemd[1]: Starting watchdog daemon...
-- Subject: Unit watchdog.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit watchdog.service has begun starting up.
Jan 11 16:03:46 al sh[949]: modprobe: **FATAL: Module dcm2835_wdt not found in directory /lib/modules/4.9.59-v7+**
Jan 11 16:03:46 al systemd[1]: watchdog.service: Control process exited, code=exited status=1
Jan 11 16:03:46 al systemd[1]: Failed to start watchdog daemon.
-- Subject: Unit watchdog.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit watchdog.service has failed.
My question is how to enable watchdog kernel module bcm2835_wdt for raspberry pi3 ?
Thank you in advance...
May the bcm2835_wdt has been compiled into the kernel on your system, so you don't see it with lsmod. Just try:
# cat /lib/modules/$(uname -r)/modules.builtin | grep wdt
kernel/drivers/watchdog/bcm2835_wdt.ko
If you can see it in the list, it has been compiled within the kernel. You may also see if it has been enabled with this:
journalctl --no-pager | grep -i watchdog
Regarding you watchdog configuration, see this error:
modprobe: **FATAL: Module dcm2835_wdt not found in directory /lib/modules/4.9.59-v7+**
The module has been called dcm2835_wdt, not bcm2835_wdt.
Also, keep in mind that your watchdog may be used by SystemD, so you should refer to that for using it.
If you don't mind, you may also try a fork bomb to see if the watchdog is able to restart you system when a problem is detected:
python -c "import os, itertools; [os.fork() for i in itertools.count()]"

Raspberry Pi iBeacon connection timing out

I am currently attempting the Raspberry Pi iBeacon tutorial posted by RadiusNetworks at
http://developer.radiusnetworks.com/2013/10/09/how-to-make-an-ibeacon-out-of-a-raspberry-pi.html
but I am having issues with the connection timing out after a few seconds. I have performed a fresh build of raspbian, and have tried with 2 different dongles (AZIO V400 and IOGEAR GBU521), and I have tried with Bluez 5.8 per the tutorial as well as Bluez 5.11, both on fresh Raspbian loads.
When I call the start script I see:
pi#piBlueTest ~ $ ./start
Launching virtual iBeacon...
LE set advertise enable on hci0 returned status 12
< HCI Command: ogf 0x08, ocf 0x0008, plen 44
1E 02 01 1A 1A FF 4C 00 02 15 E2 C5 6D B5 DF FB 48 D2 B0 60
D0 F5 A7 10 96 E0 00 00 00 00 C9 00 00 00 00 00 00 00 00 00
00 00 00 00
> HCI Event: 0x0e plen 4
01 08 20 00
Complete
This triggers an "Entered" event on the iPhone using the "Locate iBeacon" app, and shows a distance in meters for a few seconds. It then shows "Distance: unknown" as the range for several more seconds, followed by an "exit" event occurring. When I run the sequence with "hcidump" running, I get
HCI sniffer - Bluetooth packet analyzer ver 5.11
device: hci0 snap_len: 1500 filter: 0xffffffff
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x0c
Error: Command Disallowed
< HCI Command: LE Set Advertising Data (0x08|0x0008) plen 44
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Data (0x08|0x0008) ncmd 1
status 0x00
< HCI Command: LE Set Advertising Parameters (0x08|0x0006) plen 15
min 1280.000ms, max 1280.000ms
type 0x00 (ADV_IND - Connectable undirected advertising) ownbdaddr 0x00 (Public)
directbdaddr 0x00 (Public) 00:00:00:00:00:00
channelmap 0x07 filterpolicy 0x00 (Allow scan from any, connection from any)
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertising Parameters (0x08|0x0006) ncmd 1
status 0x00
< HCI Command: LE Set Advertise Enable (0x08|0x000a) plen 1
> HCI Event: Command Complete (0x0e) plen 4
LE Set Advertise Enable (0x08|0x000a) ncmd 1
status 0x00
> HCI Event: LE Meta Event (0x3e) plen 19
LE Connection Complete
status 0x00 handle 64, role slave
bdaddr B8:F6:B1:1C:15:C8 (Public)
> ACL data: handle 64 flags 0x02 dlen 11
ATT: Read By Type req (0x08)
start 0x0001, end 0xffff
type-uuid 0x2a00
> HCI Event: Disconn Complete (0x05) plen 4
status 0x00 handle 64 reason 0x13
Reason: Remote User Terminated Connection
It appears that the iPhone is trying to initiate a connection to the pi, and then fails at negotiating that connection which then ends the advertisement.
I have completed the steps from the tutorial to the letter, and cannot seem to determine what is causing the disconnect. I have tried changing bluez versions, and tried different hardware, but to no avail. Any ideas what step I may be missing? I have searched everything I can think of for clues, but have not found the answer yet. Thanks in advance for any advice!
Try setting the device to "advertise and not-connectable" (3 instead of 0) instead of "advertise and connectable"
sudo hciconfig $BLUETOOTH_DEVICE leadv 3
We suddenly had a beacon going down after a few seconds due to a laptop trying to connect. Setting the device to not-connectable solved the problem.
Looks like you have it solved but I'll go ahead and post for others that may have the same problem I did and find this thread.
Like Chris, I completed the steps from the tutorial with the exception of using bluez 5.11. After some experimentation I had to change the order of the steps in the "start" script. Not sure why but this seems to be the only order in which it will work correctly. Maybe I did something wrong?
#!/bin/sh
. ./ibeacon.conf
echo "Launching virtual iBeacon..."
sudo hciconfig $BLUETOOTH_DEVICE up
sudo hciconfig $BLUETOOTH_DEVICE noleadv
sudo hciconfig $BLUETOOTH_DEVICE leadv 0
sudo hcitool -i hci0 cmd 0x08 0x0008 1e 02 01 1a 1a ff 4c 00 02 15 $UUID $MAJOR $MINOR $POWER 00 00 00 00 00 00 00 00 00 00 00 00 00
echo "Complete"
Perhaps you can stop this from happening by making whatever device is attempting a connection stop doing so. This is not normal for iOS. Did you tell it to attempt a connection? Are you sure it is the iOS device doing this? Perhaps it is your computer?
Alternately, if you cannot get it working yourself, I can provide a free .iso file with the exact code we put on the units we sell preassembled. This could eliminate a build problem. Please send a note through our sales contact if you want to try this.

Not able to configure Idea-3g NetSetter in RHEL 6.1,System is taking it as mass staorage not as modem

I have installed Redhat(not purchased) 6.1 (New Redhat) and i am trying to connect Idea-3g NetSetter in it. I have already installed ppp & wvdial by Yum and have made necessary changes in /etc/wvdial.conf file But i am not able to configure it.
When i went through logs,i found my system is taking this device as mass staorge device & not taking it as a modem device.I went google but it also doesnt help me
In Wvdial.conf file i have to make an entry of /dev/ttyUSB0 but there is no file like ttyUSB under dev directory.There is tty1,tty2 etc. So how i can resolve this problem.Kindly help me..Some nessary infomration are here
[root#server ~]# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot open /dev/ttyUSB0: Inappropriate ioctl for device
--> Cannot open /dev/ttyUSB0: Inappropriate ioctl for device
--> Cannot open /dev/ttyUSB0: Inappropriate ioctl for device
[root#server ~]# lsusb
Bus 002 Device 003: ID 0bda:0138 Realtek Semiconductor Corp.
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 006: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552 (HSPA modem)
Bus 001 Device 004: ID 0c45:643d Microdia
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
[root#server ~]#vi /proc/version
Linux version 2.6.32-131.0.15.el6.i686 (mockbuild#x86-001.build.bos.redhat.com) (gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC) ) #1 SMP Tue May 10 15:42:28 EDT 2011
[root#server ~]# tail /var/log/messages (Last Few Lines)
May 4 22:49:18 server kernel: usb 1-1.2: USB disconnect, address 6
May 4 22:49:18 server kernel: scsi 15:0:0:0: rejecting I/O to dead device
May 4 22:49:19 server gnome-keyring-daemon[2212]: removing removable location: /media/20110811_0533
May 4 22:49:19 server gnome-keyring-daemon[2212]: no volume registered at: /media/20110811_0533
May 4 22:49:31 server kernel: usb 1-1.2: new high speed USB device using ehci_hcd and address 7
May 4 22:49:31 server kernel: usb 1-1.2: New USB device found, idVendor=12d1, idProduct=1446
May 4 22:49:31 server kernel: usb 1-1.2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
May 4 22:49:31 server kernel: usb 1-1.2: Product: HUAWEI Mobile
May 4 22:49:31 server kernel: usb 1-1.2: Manufacturer: HUAWEI Technology
May 4 22:49:31 server kernel: usb 1-1.2: configuration #1 chosen from 1 choice
May 4 22:49:31 server kernel: scsi17 : SCSI emulation for USB Mass Storage devices
May 4 22:49:31 server kernel: scsi18 : SCSI emulation for USB Mass Storage devices
May 4 22:49:36 server kernel: scsi 17:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
May 4 22:49:36 server kernel: scsi 18:0:0:0: Direct-Access HUAWEI SD Storage 2.31 PQ: 0 ANSI: 2
May 4 22:49:36 server kernel: sr1: scsi-1 drive
May 4 22:49:36 server kernel: sr 17:0:0:0: Attached scsi generic sg2 type 5
May 4 22:49:36 server kernel: sd 18:0:0:0: Attached scsi generic sg4 type 0
May 4 22:49:36 server kernel: sd 18:0:0:0: [sdc] Attached SCSI removable disk
[root#server ~]# cd /dev/
[root#server dev]# ls
agpgart log ram1 sda5 tty15 tty40 tty9
autofs loop0 ram10 sda6 tty16 tty41 ttyS0
block loop1 ram11 sda7 tty17 tty42 ttyS1
bsg loop2 ram12 sda8 tty18 tty43 ttyS2
bus loop3 ram13 sdb tty19 tty44 ttyS3
cdrom loop4 ram14 sdc tty2 tty45 urandom
cdrom2 loop5 ram15 sg0 tty20 tty46 usbmon0
cdrw loop6 ram2 sg1 tty21 tty47 usbmon1
char loop7 ram3 sg2 tty22 tty48 usbmon2
console lp0 ram4 sg3 tty23 tty49 v4l
core lp1 ram5 sg4 tty24 tty5 vcs
cpu lp2 ram6 shm tty25 tty50 vcs1
cpu_dma_latency lp3 ram7 snapshot tty26 tty51 vcs2
crash MAKEDEV ram8 snd tty27 tty52 vcs3
disk mapper ram9 sr0 tty28 tty53 vcs4
dri mcelog random sr1 tty29 tty54 vcs5
dvd mem raw stderr tty3 tty55 vcs6
dvdrw net rfkill stdin tty30 tty56 vcsa
fb network_latency root stdout tty31 tty57 vcsa1
fb0 network_throughput rtc systty tty32 tty58 vcsa2
fd null rtc0 tty tty33 tty59 vcsa3
full nvram scd0 tty0 tty34 tty6 vcsa4
fuse oldmem scd1 tty1 tty35 tty60 vcsa5
hpet port sda tty10 tty36 tty61 vcsa6
hugepages ppp sda1 tty11 tty37 tty62 vga_arbiter
hvc0 ptmx sda2 tty12 tty38 tty63 video0
input pts sda3 tty13 tty39 tty7 watchdog
kmsg ram0 sda4 tty14 tty4 tty8 zero
[root#server dev]#vi /etc/wvdial.congf
[Dialer Defaults]
Modem=/dev/ttyUSB0 ***what to write here***
Baud = 115200
Init 1 = AT+CGMM
Init 2 = AT+CMEE=1
Init 3 = ATE0
Init 4 = AT^HS=0,0
Init 5 = AT+CFUN?
Init 6 = AT+CLCK="SC",2
Init 7 = AT+CPIN?
Init 8 = AT+CLCK="SC",2
Modem Type = USB MODEM
Phone=*99#
Username =""
Password =""
New PPPD = yes
Dial Command=ATDT
Stupid Mode=1
ISDN=0
Kindly help me How i can troubleshoot it,Where & what changes should i made so that rhel 6 can take it as modem not a mass staorage device if i am thinking right
I am Giving output of wvdial coomand,it is restarting again and again and showing ppd error 16.I tried to figure out it and founf this error is for modem hang.I tried a lot but problem is as it is.
[root#server ~]# wvdial
--> WvDial: Internet dialer version 1.60
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat May 5 07:25:25 2012
--> Pid of pppd: 2905
--> Using interface ppp0
--> Disconnecting at Sat May 5 07:25:27 2012
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 5 seconds
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Cannot get information for serial port.
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Starting PPP immediately.
--> Starting pppd at Sat May 5 07:25:32 2012
--> Pid of pppd: 2925
--> Using interface ppp0
--> Disconnecting at Sat May 5 07:25:34 2012
--> The PPP daemon has died: A modem hung up the phone (exit code = 16)
--> man pppd explains pppd error codes in more detail.
--> Try again and look into /var/log/messages and the wvdial and pppd man pages for more information.
--> Auto Reconnect will be attempted in 10 seconds
[root#server ~]# vi /dev/tty
tty tty25 tty42 tty6
tty0 tty26 tty43 tty60
tty1 tty27 tty44 tty61
tty10 tty28 tty45 tty62
tty11 tty29 tty46 tty63
tty12 tty3 tty47 tty7
tty13 tty30 tty48 tty8
tty14 tty31 tty49 tty9
tty15 tty32 tty5 ttyS0
tty16 tty33 tty50 ttyS1
tty17 tty34 tty51 ttyS2
tty18 tty35 tty52 ttyS3
tty19 tty36 tty53 ttyUSB3
tty2 tty37 tty54 ttyUSB4
tty20 tty38 tty55 ttyUSB_utps_diag
tty21 tty39 tty56 ttyUSB_utps_modem
tty22 tty4 tty57 ttyUSB_utps_pcui
tty23 tty40 tty58
tty24 tty41 tty59
It's fairly common for such devices to first present themselves as a mass storage device, probably containing documentation and drivers.
Try ejecting the mass storage device first. The real modem device will probably turn up.
Automating this
Once you confirm that this is indeed the problem you can automate the ejection.
It's described reasonably well in this forum discussion, but in short you add a udev rule which calls eject or usb-modeswitch as soon as the device is detected.
That way the correct device node will be created and you don't need to worry about the problem in WvDial.