Raspberry Zero GPIO No UART Data - raspberry-pi

I have a 3.3v serial device connected to my raspberry pi but I cannot communicate
in the /boot/config.txt file I added:
[all]
enable_uart=1
this is /boot/cmdline.txt
console=tty1 root=PARTUUID=ca42d8b9-02 rootfstype=ext4 fsck.repair=yes rootwait
ls -la /dev/* ( actually from a raspberry pi B+, not working )
lrwxrwxrwx 1 root root 7 Mar 25 17:20 serial0 -> ttyAMA0
Any ideas ?

Related

How to remove modules which are in use?

I'm using ov5647 MIPI camera in raspberry pi,
I make ov5640 driver as dynamic, now I try to remove ov5647 module with
sudo rmmod ov5647
but what I got is this:
$ sudo rmmod ov5647.ko
rmmod: ERROR: Module ov5647 is in use
this is lsmod output:
$ lsmod | grep ov5647
ov5647 20480 1
v4l2_fwnode 24576 2 bcm2835_unicam,ov5647
v4l2_async 24576 3 bcm2835_unicam,v4l2_fwnode,ov5647
videodev 249856 10 bcm2835_unicam,rpivid_hevc,bcm2835_isp,ov5647,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2,v4l2_async
mc 49152 10 bcm2835_unicam,rpivid_hevc,bcm2835_isp,ov5647,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2,v4l2_async
how to remove ov5647 module which is in use?

How to change buffer size for spidev on raspberry pi

I'm trying to transfer image data from a camera to the raspberry pi over SPI using the spidev interface. The maximum buffer size possible is 4096, I need about 200,000. This suggested:
sudo su
cd /sys/module/spidev/parameters
chmod 666 bufsiz
echo 65534 > bufsiz
but every time I execute the last line I get:
root#raspberrypi:/sys/module/spidev/parameters# echo 65534 > bufsiz
bash: echo: write error: Input/output error
I can see the file contents with:
cat bufsiz
which returns 4096 but I cannot change it. Here are the permissions in case they would be helpful:
-rw-rw-rw- 1 root root 4096 May 28 14:23 bufsiz
any help is appreciated. Thanks!
From this:
add spidev.bufsiz=xxxx to /boot/cmdline.txt and remember to keep everything on one line.

rsync ignoring file permissions

I'm sorting and rationalising my backups to my raspberry pi + ext drive
One is a win10 PC that I mount
sudo mount -t cifs //192.168.1.92/blah/PC /mnt/PC -o username=xx,password=xx,ro,uid=pi,gid=pi
and then the source directory (eg)
pi#raspberrypi:~ $ ls -la /mnt/PC/pictures/
total 24284
pi#raspberrypi:~ $ ls -l /mnt/PC/..../Pictures/2009_07_15/ | grep 70
-rwxr-xr-x 1 pi pi 2387027 Jul 15 2009 IMG_0063.JPG
-rwxr-xr-x 1 pi pi 2385117 Jul 15 2009 IMG_0070.JPG
-rwxr-xr-x 1 pi pi 3457076 Jul 15 2009 IMG_0071.JPG
pi#raspberrypi:~ $
pi#raspberrypi:~ $
ive rationalised backups so have some pictures in destination from another source
so the (existing) destination is
pi#raspberrypi:~ $ ls -l /mnt/seagate/PC/../2009_07_15/ | grep 70
-rwxrwxrwx 1 pi pi 2387027 Jul 15 2009 IMG_0063.JPG
-rwxrwxrwx 1 pi pi 2385117 Jul 15 2009 IMG_0070.JPG
-rwxrwxrwx 1 pi pi 3457076 Jul 15 2009 IMG_0071.JPG
when I do
rsync -n -vv -rtdiz --no-owner --no-perms --no-group --progress --log-file=/tmp/rsynclog --backup-dir=/mnt/seagate/deletedfiles/backup-2020-01-07 --delete /source /destination
it says it will delete the files in 'destination' and then copy the same file from 'source'
pi#raspberrypi:~ $ cat /tmp/rsynclog | grep 2009_07_15
2020/01/08 11:55:02 [31205] backed up Documents.../2009_07_15/Thumbs.db to /mnt/seagate/deletedfiles/backup-2020-01-08/....2009_07_15/Thumbs.db
2020/01/08 11:55:02 [31205] backed up Documents..../2009_07_15/IMG_0071.JPG to /mnt/seagate/deletedfiles/backup-2020-01-08/....2009_07_15/IMG_0071.JPG
etc etc
2020/01/08 11:56:45 [31205] .d..t...... Documents/.....Pictures/2009_07_15/
2020/01/08 11:56:45 [31205] .f Documents/.. .2009_07_15/IMG_0061.JPG
2020/01/08 11:56:45 [31205] .f Documents/../Pictures/2009_07_15/IMG_0062.JPG
2020/01/08 11:56:45 [31205] .f Documents../Pictures/2009_07_15/IMG_0063.JPG
etc
I assume because the permissions are different
OK - i could just chmod all the files in 'destination' but I'd like to know what ive done wrong in the rsync command .
The difference i have found which could account for the transfers is
on the source , the mounted windows machine
pi#raspberrypi:/mnt/PC/Documents/path,... $ ls -l | grep ALL
drwxr-xr-x 2 pi pi 0 Jan 1 07:54 ALL PHOTOS
on the destination , the seagate attached HD
pi#raspberrypi:/mnt/seagate/PC/Documents/path,... $ ls -la | grep ALL
drwxrwxrwx 1 pi pi 20480 Dec 18 22:08 ALL PHOTOS

Android emulator 29.2.0.0 Segfault

Running Android Emulator on cloud VPS with nested virtualization support.
Everything worked find until the latest sdkmanager --update. Now I am having SegFault on emulator startup:
#!/usr/bin/env bash
export DISPLAY=:2.0
sudo -H -u vnc xhost +localhost
#sdkmanager --update
emulator #android-28-x86 -verbose -memory 2048 -gpu swiftshader_indirect -no-audio -no-snapshot -no-boot-anim -skin 768x1280 ${1}
Concatenated QEMU options:
/root/android-sdk/emulator/qemu/linux-x86_64/qemu-system-x86_64 -dns-server 127.0.0.53 -no-audio -serial null -device goldfish_pstore,addr=0xff018000,size=0x10000,file=/root/.android/avd/android-28-x86.avd/data/misc/pstore/pstore.bin -cpu android64 -enable-kvm -smp cores=2 -m 2048 -lcd-density 160 -object iothread,id=disk-iothread -nodefaults -kernel /root/android-sdk/system-images/android-28/google_apis_playstore/x86//kernel-ranchu-64 -initrd /root/android-sdk/system-images/android-28/google_apis_playstore/x86//ramdisk.img -drive if=none,index=0,id=system,file=/root/android-sdk/system-images/android-28/google_apis_playstore/x86//system.img,read-only -device virtio-blk-pci,drive=system,iothread=disk-iothread,modern-pio-notify -drive if=none,index=1,id=cache,file=/root/.android/avd/android-28-x86.avd/cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=cache,iothread=disk-iothread,modern-pio-notify -drive if=none,index=2,id=userdata,file=/root/.android/avd/android-28-x86.avd/userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=userdata,iothread=disk-iothread,modern-pio-notify -drive if=none,index=3,id=encrypt,file=/root/.android/avd/android-28-x86.avd/encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=encrypt,iothread=disk-iothread,modern-pio-notify -drive if=none,index=4,id=vendor,file=/root/android-sdk/system-images/android-28/google_apis_playstore/x86//vendor.img,read-only -device virtio-blk-pci,drive=vendor,iothread=disk-iothread,modern-pio-notify -netdev user,id=mynet -device virtio-net-pci,netdev=mynet -device virtio-rng-pci -show-cursor -L /root/android-sdk/emulator/lib/pc-bios -soundhw hda -vga none -append 'qemu=1 no_timer_check androidboot.hardware=ranchu androidboot.serialno=EMULATOR29X2X0X0 clocksource=pit no-kvmclock android.qemud=1 console=0 android.checkjni=1 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.opengles.version=131072 cma=272M#0-4G qemu.wifi=1 mac80211_hwsim.channels=2 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ skip_initramfs rootwait ro init=/init loop.max_part=7 dm="1 vroot none ro 1,0 5159992 verity 1 PARTUUID=19E87A23-1C27-4616-8116-0088D1F64FD2 PARTUUID=19E87A23-1C27-4616-8116-0088D1F64FD2 4096 4096 644999 644999 sha1 3d4097abf29343cf6b86b9d6703c131e82429f69 5f81fddb8cc753b134fc2901766e57a49cfae566dba7ca48630fdddc30913f84 1 ignore_zero_blocks" androidboot.veritymode=enforcing androidboot.verifiedbootstate=orange root=/dev/dm-0 ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000 qemu.dalvik.vm.heapsize=512m' -android-hw /root/.android/avd/android-28-x86.avd/hardware-qemu.ini
emulator: Android qemu version 29.2.0.0 (build_id 5871853) (CL:N/A)
emulator: Starting QEMU main loop
./start-emulator.sh: line 5: 49651 Segmentation fault emulator #android-28-x86 -verbose -memory 2048 -gpu swiftshader_indirect -no-audio -no-snapshot -no-boot-anim -skin 768x1280 ${1}
The machine was created like this:
sdkmanager 'system-images;android-28;google_apis_playstore;x86'
sdkmanager --licenses
echo 'no' | avdmanager create avd --force --name android-28-x86 --abi google_apis_playstore/x86 --package 'system-images;android-28;google_apis_playstore;x86'
Any idea how to quick fix this? Any option to rollback to the previous version through sdkmanager?
Edit: tried Android 26. Same thing. Segfault.
Edit2: Also tried to install the emulator from here: https://chromium.googlesource.com/android_tools/+archive/refs/heads/master/sdk/emulator.tar.gz
I replaced the folder android-sdk/emulator with it. Tried to run it, but encountered a missing kernel-qemu error.
Not sure what to do at this point. The distros of sdkmanager and android_tools are incompatible?
emulator: Concatenated backend parameters:
/root/android-sdk/emulator/emulator64-x86 #android-28-x86 -verbose -memory 2048 -gpu swiftshader_indirect -no-audio -no-snapshot -no-boot-anim -skin 768x1280
emulator: Android virtual device file at: /root/.android/avd/android-28-x86.ini
emulator: virtual device content at /root/.android/avd/android-28-x86.avd
emulator: virtual device config file: /root/.android/avd/android-28-x86.avd/config.ini
emulator: using core hw config path: /root/.android/avd/android-28-x86.avd/hardware-qemu.ini
emulator: Found AVD target API level: 28
emulator: Read property file at /root/android-sdk/system-images/android-28/google_apis_playstore/x86//build.prop
emulator: No boot.prop property file found.
emulator: Warning: config.ini contains invalid skin.path entry: (null)
emulator: autoconfig: -skindir (null)
emulator: ERROR: This AVD's configuration is missing a kernel file! Please ensure the file "kernel-qemu" is in the same location as your system image.
emulator: ERROR: ANDROID_SDK_ROOT is defined (/root/android-sdk) but cannot find kernel file in /root/android-sdk/system-images/ sub directories
root#VS-683:~# ls -la android-sdk/system-images/android-28/google_apis_playstore/x86/
total 2816004
drwxr-xr-x 3 root root 4096 Sep 18 17:06 .
drwxr-xr-x 3 root root 4096 Sep 18 17:06 ..
-rw-r--r-- 1 root root 190 Sep 18 17:05 advancedFeatures.ini
-rw-r--r-- 1 root root 1806 Sep 18 17:05 build.prop
drwxr-xr-x 3 root root 4096 Sep 18 17:05 data
-rw-r--r-- 1 root root 1048576 Sep 18 17:05 encryptionkey.img
-rw-r--r-- 1 root root 6010832 Sep 18 17:05 kernel-ranchu-64
-rw-r--r-- 1 root root 1667536 Sep 18 17:05 NOTICE.txt
-rw-r--r-- 1 root root 18163 Sep 18 17:06 package.xml
-rw-r--r-- 1 root root 1701411 Sep 18 17:05 ramdisk.img
-rw-r--r-- 1 root root 297 Sep 18 17:05 source.properties
-rw-r--r-- 1 root root 2769289216 Sep 18 17:06 system.img
-rw-r--r-- 1 root root 1048576 Sep 18 17:06 userdata.img
-rw-r--r-- 1 root root 102760448 Sep 18 17:06 vendor.img
-rw-r--r-- 1 root root 1235 Sep 18 17:06 VerifiedBootParams.textproto
Tried to create a symlink from kernel-ranchu-64 to kernel-qemu. The emulator doesn't seem to be loading anything...
Hm... perhaps I should've download the emulator from the different source. Not from the chromium project.
From here perhaps? https://dl.google.com/android/repository/emulator-linux-4969155.zip
Edit3: gdb output:
Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
0x0000000000898358 in ?? ()
So I downloaded the latest emulator (5719087 - 29.1.4) from here: https://android.googlesource.com/platform/prebuilts/android-emulator/+archive/7fa8974e268068384138470b4910f39f5c465236/linux-x86_64.tar.gz
I have absolutely no idea how I got 5871853. It is not even available in the android repository.
So the conclusion is that one should never run sdkmanager --update. This is simply too unstable.

AT command gives no response

I have a Raspberry Pi 3 running Raspian Lite
pi#raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
I am following this tutorial, setting up an Adafruit Fona 808 for GSM/GPS connections. I've installed screen and pppd as instructed.
pi#raspberrypi:~ $ sudo apt-get install screen ppp
Reading package lists... Done
Building dependency tree
Reading state information... Done
ppp is already the newest version (2.4.7-1+4).
screen is already the newest version (4.5.0-6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
The problem is that when I start screen and enter 'AT' I get no response.
I start the screen session like so:
pi#raspberrypi:~ $ sudo screen /dev/serial0 115200
I see a black screen with blinking cursor. I enter 'AT' on my keyboard but no characters appear on the screen. I press enter, still nothing appears.
I'm using screen version 4.05.00
pi#raspberrypi:~ $ screen --version
Screen version 4.05.00 (GNU) 10-Dec-16
I am not sure how to troubleshoot this issue.
Any suggestions?
Running the following:
pi#raspberrypi:~ $ sudo ls -l /dev/
I noticed that serial0 is pointed at ttyS0
lrwxrwxrwx 1 root root 5 Feb 3 23:49 serial0 -> ttyS0
So, running the following worked:
pi#raspberrypi:~ $ sudo screen /dev/ttyS0 115200
In screen:
AT
OK