This is how I install pymysql
sudo apt-get update
sudo apt-get install python3-setuptools
curl -L https://github.com/PyMySQL/PyMySQL/tarball/pymysql-0.6 | tar xz
cd PyMySQL*
sudo python3 setup.py install
sudo apt-get update
sudo apt-get install python3-setuptools
curl -L https://github.com/PyMySQL/PyMySQL/tarball/pymysql-0.6 | tar xz
cd PyMySQL*
sudo python3 setup.py install
When I use a DHT sensor, either the 11 or 22, I install the Adafruit drivers like this:
sudo apt-get update
sudo apt-get install python3-pip
sudo python3 -m pip install --upgrade pip setuptools wheel
sudo pip3 install Adafruit_DHT
Firstly, I put the 8Gb SD card in the reader. Then I copy and paste the NOOBS from my harddrive, to the SD card.
The the RPi is booting, and resizing the SD card. Whens that's done, I …
read moreTo install the drivers, do this:
sudo rm -rf LCD-show
git clone https://github.com/goodtft/LCD-show.git
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD35-show
To return to HDMI, do this:
chmod -R 755 LCD-show
cd LCD-show/
sudo ./LCD-hdmi
This is a 1-wire digital themometer.
VCC -> 3.3v
DQ -> GPIO04
GND -> GND
First you need to add one wire support, by adding this line to config.txt:
dtoverlay=w1-gpio
Use:
sudo nano /boot/config.txt
To edit the file.
This little program prints both Celsius and Fahrenheit …
read moreThe first thing is to start with a fresh installation of Rasbian. To be sure you are up-to-date do this:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install rasberrypi-ui-mods
sudo apt-get install rasberrypi-net-mods
Then connect it like this:
If you need to …
read moreSometimes it is handy to start an application right after boot time. This is how I did it, to start chromium-browser in fullscreen mode.
cd .config
mkdir lxsession
cd lxsession
mkdir LXDE-pi
cd LXDE-pi
nano autostart
This is the autostart file:
Another autostart file, which hides the "Chromium didn't …
read moreThis little program count the rising edges of an IR sensor connected to GPIO 21.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 … |
After a fresh Rasbian installation I do the following:
sudo apt-get update && sudo apt-get install -y apache2 php7.0 libapache2-mod-php7.0 mariadb-server phpmyadmin
Logon credentials for myphpadmin: Username: myphpadmin Password: password entered during installation
If you do not get any …
read moregit clone https://github.com/adafruit/Adafruit_Python_CharLCD.git
cd ./Adafruit_Python_CharLCD
sudo python setup.py install
sudo apt-get install build-essential python-dev scons swig
Lots of stuff running across the screen, but it ends with:
Finished processing dependencies for Adafruit-CharLCD==1.1.1
read moresudo apt-get install rpi
This program log on to a website, and get som information.
The import block:
1 2 3 4 5 6 | #!/usr/bin/python
import time
from time import gmtime, strftime
import socket
import Adafruit_CharLCD as LCD
import requests
|
Assignment:
time_counter = 0
lcd_rs = 25
lcd_en = 24
lcd_d4 = 23
lcd_d5 = 17
lcd_d6 …
<– back
Camera 0
daemon = on
process_id_file = /var/run/motion/motion.pid
setup_mode = off
camera_name = (not defined)
logfile = /var/log/motion/motion.log
log_level = 6
log_type = all
videodevice = /dev/video0
v4l2_palette = 17
input = -1
norm = 0
frequency = 0
rotate = 0 …
1 2 3 4 5 6 7 8 9 10 11 12 13 | #!/usr/bin/python
import ftplib
server = 'yourftpserver.something'
username = 'yourusername'
password = 'yourpassword'
ftp_connection = ftplib.FTP(server, username, password)
remote_path = "/home/yourusername/ftp"
ft_connection.cwd(remote_path)
fh = open("filetouploadincludepath … |
I found this on this site: code.activestate.com
My script and the script from the link, differs at the end. My script uses the ehlo and the starttls.
EHLO is the extended Hello, and tells the server that the client might want to use the extended SMTP protocol insted …
read moreMy boat is laying at a mooring, and I live 45min away. I do not go out to check it on a daily basis. I want to get an e-mail from the boat on a fixed time, morning and evening, to see that everythoin is OK.
Log into the Raspberry Pi as Pi, and add the user with
sudo adduser <username>
Then use usermod to add the user to the specified group:
sudo usermod -G <group> -a <username>
Group is the name of the group, for example sudo …
read moreThis is the way I record my 3d printing, using a Raspberry Pi and its camera module. At Thingeverse I found an enclosure for the camera. A quick search reveals a lot of hits: Thingeverse raspberry pi camera.
I printed out housing for both the …
read moreThis is a draft for me to remember what I did...
Allways remember to change the default raspberry password.
The heart of this project is the Raspberry Pi 3, and a cheap webcamera. You can't use the Pi cam module.
The following software has to bee installed …
read morePage 1 / 1