Raspberry Pi: Difference between revisions
Line 30: | Line 30: | ||
Use <code>nmap -F 192.168.8.1-254</code> to fast scan all devices in the local network. The default passwords are listed at [https://tutorials-raspberrypi.com/raspberry-pi-default-login-password/ Raspberry pi default login-password]. | Use <code>nmap -F 192.168.8.1-254</code> to fast scan all devices in the local network. The default passwords are listed at [https://tutorials-raspberrypi.com/raspberry-pi-default-login-password/ Raspberry pi default login-password]. | ||
<code> | <code>nmap -sn 192.168.8.0/24</code> might work better. | ||
Try <code>ping raspberrypi.local</code>. | Try <code>ping raspberrypi.local</code>. |
Revision as of 21:18, 28 June 2024
Some of my Raspberries
- Raspeberry 1 (or perhaps 1B) with a camera module on a wood stick. 26 pins. UART.
Simple things used in every Project
Raspistill
raspistill -w 2592 -h 1944 -o name.jpg
Take a photo and send it to an external server Template:GithubDownload
<script src="https://emgithub.com/embed.js?target=https%3A%2F%2Fgithub.com%2Fpytorch%2Fpytorch%2Fblob%2Fmaster%2Ftorch%2Fnn%2Fcpp.py&style=github&showBorder=on&showLineNumbers=on&showFileMeta=on"></script>
Crontab
Sshpass
Server side
Finding the IP address
The SSH is disable by default after 2016. Below is show how to enable without using keyboard.
Nmap (Network mapper).
Use nmap -F 192.168.8.1-254
to fast scan all devices in the local network. The default passwords are listed at Raspberry pi default login-password.
nmap -sn 192.168.8.0/24
might work better.
Try ping raspberrypi.local
.
Enable ssh
On another computer, mount the Raspian boot SD card, navigate to the boot folder cd /Volumes/boot
, create a blank file called ssh touch ssh
. That's all.
Using the Raspian GUI: Preferences -> Raspberry Pi Configuration -> Interfaces -> SSH.
Using the terminal: sudo raspi-config
or use systemctl
:
sudo systemctl enable ssh
sudo systemctl start ssh
Project Ideas
- Bluetooth LE & Polar Heart Beat Monitor
- Camera piano
- Controlling CD Drive motor
- Info TV/ Dashboad
- Microscope and photo stacking
- Online thermometer with local backup
- Solar powered on/off line timelapse photography
- Sound spectrum
- Weather station --- Raspberry Pi
- Connect the APC220 radio module and submit the data to Internet
Peripherals
- Analog sensors https://www.rototron.info/raspberry-pi-analog-water-sensor-tutorial/
- Camera
- Dissolved oxygen meter https://www.instructables.com/Plotly-Atlas-Scientific-Graph-Real-Time-Dissolved-/ https://elexhub.com/product/gravity-analog-dissolved-oxygen-sensor-meter-kit/ https://how2electronics.com/dissolved-oxygen-sensor-arduino-interfacing-tutorial/ https://atlas-scientific.com/circuits/ezo-dissolved-oxygen-circuit/# https://atlas-scientific.com/probes/dissolved-oxygen-probe/
- Laptop Keyboard: https://raspberrypi.stackexchange.com/questions/5007/using-an-old-laptop-keyboard-with-raspberry-pi https://www.youtube.com/watch?v=AKWheG8wKxM
- Temperature, pH
Sensors
- MG-811 MG811 CO2 Carbon Dioxide Sensor For Arduino UNO R3 Raspberry Pi
- CCS811 CO2 Carbon Dioxide Detector Air Quality Monitor Meter Sensor for Arduino
- MQ-2 Kohlenmonoxid Sensor CO Gas-Sensor, Rauch-Sensor, Raspberry Pi, Arduino
- CJMCU MICS 6814 Kohlenmonoxid Stickstoff Sauerstoff Sensor Co No2 Nh3 Arduino
- MH-Z19 IR infrared Carbon Dioxide Gas Sensor For Air CO2 Concentration Monitor
- Environment Sensor HAT für Raspberry Pi Zero 2 W WH A 3 Model B Plus 4 2GB 8GB
- CD30 Air Quality Sensors Module for CO2 and RH/T Measurements I2C PWM Modbus
Bluetooth
Erase the SD card
Use camera to format the SD card, or see https://www.raspberrypi.org/forums/viewtopic.php?t=204167 .
Bluetooth on Raspi 3
sudo apt update
sudo apt upgrade
sudo apt-get install python-bluez
#sudo apt install bluetooth pi-bluetooth bluez blueman
sudo nano /etc/systemd/system/dbus-org.bluez.service
. Modify ExecStart=/usr/lib/bluetooth/bluetoothd –C
sudo sdptool add SP
sudo reboot
sudo apt-get install bluetooth bluez libbluetooth-dev
sudo python3 -m pip install pybluez
Start script if Wifi is connected
- Put your script in /etc/network/if-up.d and make it executable. It will be automatically run each time a network interface comes up. https://unix.stackexchange.com/questions/166473/debian-how-to-run-a-script-on-startup-as-soon-as-there-is-an-internet-connecti
- Add your script to /etc/network/if-up.d/. Name your script without a '.sh' extension.
Also after adding script run chmod +x /etc/network/if-up.d/yourscriptname to give necessary permission. Make sure the network interface (e.g. wlan0 or eth0) that should trigger your script when turned on is mentioned in the file /etc/network/interfaces. https://askubuntu.com/questions/258580/how-to-run-a-script-depending-on-internet-connection
- To see only wifi status $ nmcli radio wifi https://askubuntu.com/questions/398581/is-there-a-terminal-command-to-verify-if-wifi-is-enabled#398602
- To run a script when the WiFi is connected you can use wpa_cli. In man wpa_cli you find for option -a: https://raspberrypi.stackexchange.com/questions/96050/run-a-script-when-wifi-is-connected-to-a-particular-wifi-network
- By the time the interface is up, it doesn't means that you have a connectivity at all. If the interface is configured to get IP from DHCP for example, few seconds are needed for the IP configurations. To check for Internet connectivity, you can query the IP of a known webpage with nslookup or dig. If you get a valid answer you can proceed. Otherwise, wait and repeat for a certain number of retries before aborting. https://stackoverflow.com/questions/33086020/run-script-after-network-is-connected