Category : raspberry-pi

Download the image writer from https://wiki.radxa.com/Rockpi4/downloads Run it as administrator: Select the image Write it to the card Wait for it to verify Stick it into the rock pi Boot up If it’s the right image, you’ll see both a green light on the rock pi, and a smaller blue light that starts flashing, meaning ..

Read more

Abstract This article is a recollection of fun memories from the Guinness World Record Scuba Diving Event with Allen “The Grouper” Sherrod, and my personal involvement in building an underwater live streaming system to broadcast the event live to the world. In the end, Allen Sherrod broke the world record! Here’s how we did it. ..

Read more

Install VLC Enable the camera and select finish, reboot. Start streaming Add contents: Save, test it: If it works, stop it again, Control + C Create a startup script with contents: Save it. Make it executable Add it to always start up Reboot and test that it starts up Reboot and test that it starts ..

Read more

Get the Windows binaries – ex: https://ffmpeg.zeranoe.com/builds/ -> download  ex: https://ffmpeg.zeranoe.com/builds/win32/shared/ Unzip it, add the path of ffmpeg to your PATH variable, start command prompt, test that ffmpeg works, ex: ffmpeg –help To grab your stream from an already running camera, make sure the entire url works, i.e. don’t just use /stream, use /stream/video.mjpeg Control + C to ..

Read more

Credits: https://www.assetbank.co.uk/support/documentation/install/ffmpeg-debian-squeeze/ffmpeg-debian-jessie/ cd ~   mkdir software cd software/   wget http://ffmpeg.org/releases/ffmpeg-2.7.2.tar.bz2 cd src/ tar xvjf ../ffmpeg-2.7.2.tar.bz2   cd ffmpeg-2.7.2/ ./configure \ –enable-gpl \ –enable-libfaac \ –enable-avfilter \ –enable-libmp3lame \ –enable-libtheora \ –enable-libopenjpeg \ –enable-libvorbis \ –enable-libx264 \ –enable-libspeex \ –enable-nonfree –enable-postproc \ –enable-pthreads \ –enable-shared \ –enable-swscale \   make   # wait a couple ..

Read more

#! /bin/bash # VBR=”3500k” # Bitrate FPS=”35″ # FPS QUAL=”fast” # ultrafast superfast veryfast faster fast medium slow slower veryslow YOUTUBE_URL=”rtmp://a.rtmp.youtube.com/live2″ # URL for YouTube RTMP SOURCE=”http://192.168.0.52:8080/stream/video.mjpeg” # Source UDP (this rpi ifconfig) KEY=”abcd-1234-????-????” # your YouTube key ffmpeg \ -re -threads 4 \ -i “$SOURCE” \ -f lavfi -i anullsrc \ -acodec libmp3lame -ar ..

Read more

# be root sudo su # install utils apt-get install ntfs-3g root@pi2:/home/pi# blkid   /dev/mmcblk0p1: SEC_TYPE=”msdos” LABEL=”boot” UUID=”7D5C-A285″ TYPE=”vfat” /dev/mmcblk0p2: UUID=”5d18be51-3217-4679-9c72-a54e0fc53d6b” TYPE=”ext4″ /dev/sda1: LABEL=”TinyTerra1″ UUID=”C642B17842B16E35″ TYPE=”ntfs”   # create mount dir mkdir /mnt/d1 # edit fstab nano /etc/fstab # add: # drive 1 terra UUID=”C642B17842B16E35″ /mnt/d1 ntfs defaults,errors=remount,rw 0 1   # mount it mount ..

Read more

# make the dir mkdir /mnt/mount1 # list the drives ls -l /dev/disk/by-uuid/ total 0 lrwxrwxrwx 1 root root 15 May 6 2015 13d368bf-6dbf-4751-8ba1-88bed06bef77 -> ../../mmcblk0p2 lrwxrwxrwx 1 root root 15 May 6 2015 15CD-3B79 -> ../../mmcblk0p1 lrwxrwxrwx 1 root root 10 Dec 6 22:22 ba20caf8-6ef0-42e7-9e45-4187bfa8e543 -> ../../sda1 # get the ID, ex: ba20caf8-6ef0-42e7-9e45-4187bfa8e543 # ..

Read more

sudo su nano cleanup.sh Paste this: # GUI-related packages – credits: https://gist.githubusercontent.com/samatjain/4dda24e14a5b73481e2a/raw/5d9bac8ec40b94833b4e9938121945be252fdee1/Slim-Raspbian.sh pkgs=” xserver-xorg-video-fbdev xserver-xorg xinit gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa gstreamer1.0-libav epiphany-browser lxde lxtask menu-xdg gksu xserver-xorg-video-fbturbo xpdf gtk2-engines alsa-utils netsurf-gtk zenity desktop-base lxpolkit weston omxplayer raspberrypi-artwork lightdm gnome-themes-standard-data gnome-icon-theme qt50-snapshot qt50-quick-particle-examples ” # Edu-related packages pkgs=”$pkgs idle python3-pygame python-pygame python-tk idle3 python3-tk ..

Read more

create directory mydrive, which is where we’ll mount the attached drive sudo mkdir /mnt/mydrive change permissions sudo chown -R pi:pi /mnt/mydrive sudo chmod -R 775 /mnt/mydrive/ look up the block id of the drive sudo blkid /dev/mmcblk0p1: SEC_TYPE=”msdos” LABEL=”boot” UUID=”2D2D-CD16″ TYPE=”vfat” PARTUUID=”eea0d6a7-01″ /dev/mmcblk0p2: UUID=”2f840c69-cecb-4b10-87e4-01b9d28c231c” TYPE=”ext4″ PARTUUID=”eea0d6a7-02″ /dev/mmcblk0: PTUUID=”eea0d6a7″ PTTYPE=”dos” /dev/sda1: LABEL=”500g02″ UUID=”D4BE5EA9BE5E83C0″ TYPE=”ntfs” PARTUUID=”e7f2080e-01″ Look ..

Read more

https://www.phidgets.com/?tier=3&catid=14&pcid=12&prodid=95 Given formula: Temperature C = ( VoltageRatio×222.2 ) – 61.111 VoltageRatio is the raw voltage you read divided by 5.0 VDC. Example: raw reading of 2.0145 VDC Voltage Ratio would then be: 2.0145 / 5.0 = 0.4029 Let’s re-write formula using raw voltage reading instead of ratio: C = R / 5 * 222.2 – 61.111 where ..

Read more

# install pip sudo su cd curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python get-pip.py pip –version # install DHT libraries sudo pip install Adafruit_Python_DHT # https://github.com/adafruit/Adafruit_Python_DHT/issues/63 sudo apt-get update sudo apt-get install rpi.gpio sudo apt-get install python3-rpi.gpio sudo apt-get install build-essential python3-dev sudo apt-get install python3-setuptools sudo apt-get install libzbar-dev libzbar0 git clone https://github.com/adafruit/Adafruit_Python_DHT.git cd Adafruit_Python_DHT sudo ..

Read more

Without the library, you can get this error: Could not locate the Phidget C library (libphidget22java.so). Make sure it is installed, and add it’ s path to LD_LIBRARY_PATH. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1320) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1214) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.0.RELEASE.jar!/:5.2.0.RELEASE] ..

Read more

#!/bin/bash ### BEGIN INIT INFO # Provides: tomcat7 # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start/Stop Tomcat server ### END INIT INFO PATH=/sbin:/bin:/usr/sbin:/usr/bin start() { cd /opt/tomcat/current/bin/ /bin/su pi /opt/tomcat/current/bin/startup.sh } stop() { /bin/su pi /opt/tomcat/current/bin/shutdown.sh } case $1 in start|stop) $1;; restart) ..

Read more

#!/bin/bash if [ -z “$1” ]; then echo echo usage: $0 network-interface [delay in seconds] echo echo e.g. $0 eth0 echo e.g. $0 wlan0 30 echo exit fi if [ -z “$2” ]; then DELAY=5 echo “Using default, showing bandwidth usage every $DELAY seconds” else DELAY=1 fi IF=$1 while true do R1=`cat /sys/class/net/$1/statistics/rx_bytes` T1=`cat /sys/class/net/$1/statistics/tx_bytes` ..

Read more

/home/pi/live.sh #!/bin/bash # Rotation # raspivid –nopreview –rotation 180 -o – -t 9999999 -b 3000000 -w 1280 -h 720 | cvlc –ffmpeg-hw -vvv stream:///dev/stdin –sout ‘#rtp{sdp=rtsp://:8554}’ :demux=h264   raspivid –nopreview -o – -t 9999999 -b 3000000 -w 1280 -h 720 | cvlc –ffmpeg-hw -vvv stream:///dev/stdin –sout ‘#rtp{sdp=rtsp://:8554}’ :demux=h264 /etc/init.d/startcam #! /bin/sh ### BEGIN INIT INFO ..

Read more

You don’t need any pull up or pull down resistors, use  pull_up_down=GPIO.PUD_DOWN instead. The setup: The wiring: The test program: test.py # Door open/closed detector # # (c) Alan Lupsha 2020 # wiki.lupsha.com import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # GPIO Numbers instead of board numbers MAGNET_GPIO = 18 GPIO.setup(MAGNET_GPIO, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # GPIO ..

Read more

You need to install JDK8 because JDK11 and others won’t work.  Otherwise, you’ll get errors like this one: Server VM is only supported on ARMv7+ VFP Install: sudo apt-get install openjdk-8-jre-headless openjdk-8-jdk-headless Verify: root@door:/home/pi/programs/doorswitch# javac -version javac 1.8.0_212 root@door:/home/pi/programs/doorswitch# java -version openjdk version “1.8.0_212” OpenJDK Runtime Environment (build 1.8.0_212-8u212-b01-1+rpi1-b01) OpenJDK Client VM (build 25.212-b01, mixed ..

Read more

Source: https://github.com/ttww/JavaFrameBuffer The error: pi@pi2 ~/jfb $ javah -d src/main/c -classpath bin org.tw.pi.framebuffer.FrameBuffer Error: Could not find class file for ‘org.tw.pi.framebuffer.FrameBuffer’. The fix: #!/bin/sh jniResult=libFrameBufferJNI.so   # Make sure to update these to your correct JDK path jniJdkHeader=/opt/jdk/current/include jniSysHeader=/opt/jdk/current/include/linux rm “$jniResult” echo “here is the correct compile command” javah -d src/main/c -classpath src/main/java org.tw.pi.framebuffer.FrameBuffer   # rm ..

Read more

# install maven and git sudo apt-get update && sudo apt-get install -y maven git verify install pi@door:~ $ git –version git version 2.20.1 pi@door:~ $ mvn –version Apache Maven 3.6.0 Maven home: /usr/share/maven Java version: 1.8.0_212, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-8-openjdk-armhf/jre Default locale: en_GB, platform encoding: UTF-8 OS name: “linux”, version: “5.4.79+”, arch: “arm”, ..

Read more

Also see: https://wiki.lupsha.com/raspberry-pi-3-setting-up-a-phidgets-voltage-reader-2/ #!/bin/bash # # hits the sensorreading app and grabs sensor raw value, and computes it, per phidgets 1117 raw to voltage # # Alan Lupsha 10/20/2019 # # hit the API and get the reading # # ex: {“userCommand”:”/sensor/0″,”errors”:[],”workLog”:[],”port”:{“index”:0,”value”:584}} # READING=`curl –silent -H “Accept: application/json” http://10.1.10.12:50003/sensor/0` echo “API reading: $READING” # # ..

Read more

Turns out you need a powered USB hub, otherwise the Pi 3 won’t see the Phidgets 8/8/8 board. The setup: Pi3 Phidgets 8/8/8 board ( https://www.phidgets.com/?tier=3&prodid=16 ) Phidgets 1117 voltage sensor https://www.phidgets.com/?&prodid=88 Rosewill self-powered 7 port USB hub https://www.newegg.com/rosewill-rhub-300-usb/p/N82E16817182057 Once a self-powered USB hub is provided, the Phidgets IO board is detected: Setting up the Pi: sudo su apt-get ..

Read more