How2RPiWebsite.txt as of 28 July 2022 CURRENT SETTINGS rpijoin.php : expects rpijoin.php?op=mrp&pw=pi&s=sys 1st Floor RPi ($rpi1): 192.168.1.127 dx1st.py 3rd Floor RPi ($rpi3) : 192.168.1.81 wwr.py RaspiA : 192.168.0.5 : rpia.py main web folder: cd /var/www/html on RpiA just web Curating data: D:\cli\ci\Rpi\logs\[yyyy] Outage Recovery 1. Find the IPs of the three Rpis (check Arris modem) Arris: http://192.168.0.1/ un: admin pw: password LAN Setup | Client List find and figure out which IP is which RasPi 2. Update router port forwarding to Entry Pi's new address Arris: Firewall | Virtual Servers / Port Forwarding house conditions 80-80 TCP 192.168.0.[Rpi1] 80-80 3. Update FTP addresses for rpi1, rpi3, and rpiA Pis 4. Update rpiurls.txt on all RPis and casparinstitute.org/now 5. If necessary -- check recent data -- restart the First Floor RPi un: pi pw: fo0 PuTTY: sudo reboot restore function: cd /var/www/html nohup python dx1st.py [[ RPi 1st ]] nohup python wwr.py [[ RPi 3rd ]] nohup python rpia.py [[ RPiA ]] for testing sudo python dx1st.py [ shows diags ] 6. Restart ix2.php on Floor 1 RPi Dynamic DNS / Port Forwarding to Raspberry Pi - see above step 2 SETTING STATIC LOCAL IPs : https://pimylifeup.com/raspberry-pi-static-ip-address/ to get current IPs: ip r | grep default to get current nameserver: sudo nano /etc/resolv.conf # Generated by resolvconf nameserver 75.75.75.75 nameserver 75.75.76.76 nameserver 2001:558:feed::1 nameserver 2001:558:feed::2 to declare a static IP in local network: sudo nano /etc/dhcpcd.conf : add to end of file interface eth0 static ip_address=192.168.0.n/24 static routers=192.168.0.5 static domain_name_servers=75.75.75.75 finding raspi MAC address: ifconfig string after ether RPi1st: b8:27:eb:14:12:90 0.3 raspberrypi RPi3rd: b8:27:eb:40:f0:3c 0.6 raspise RPiA: b8:27:eb:4d:02:c0 0.5 raspberrypi access RPi-MAIN: see current settings above http://mpotts95420.hopto.org/ rpi FTP un: pi pw: fo0 mrp s1enna phpMyadmin un: root pw: s1enna pi fo0 Starting from scratch create webserver (below) implement one-wire: https://www.modmypi.com/blog/ds18b20-one-wire-digital-temperature-sensor-and-the-raspberry-pi add dtoverlay=w1-gpio to /boot/config.txt load 1wt.py onto cd /var/www/html and test check xbee function try this: https://raspberrypi.stackexchange.com/questions/45570/how-do-i-make-serial-work-on-the-raspberry-pi3-pi3b-pizerow sudo reboot = = = = = = Rpi1 -- ist Floor Pi see current settings above restore function: sudo reboot web - same as cd /var/www/html nohup python dx1st.py for testing python wwr.py FTP: pi fo0 root fo0 Weather data wlog_.txt stores in stored in d:\cli\ci\data\Rpi Rpi3 -- 3rd Floor Pi see current settings above restore function: sudo reboot cd /var/www/html nohup python wwr.py for testing python wwr.py FTP: pi fo0 root fo0 Weather data wlog_.txt stores in stored in d:\cli\ci\data\Rpi = = = = = = RPi-DEV 192.168.0.16 FTP: pi fo0 root fo0 nohup python bigben/py volume: https://www.bristolwatch.com/debian/mpg123.htm use mpg123 = = = = = = creating a webserver https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md sudo apt-get update sudo apt-get upgrade sudo apt-get update sudo apt-get install apache2 -y Enable FTP sudo raspi-config Interfacing options SSH Enable Yes Finish give pi/fo0 access to web folder sudo chown -R pi:www-data /var/www sudo chmod u+rxw,g+rx-w,o-rwx /var/www MySQL stuff http://raspberrywebserver.com/sql-databases/using-mysql-on-a-raspberry-pi.html sudo mysql -u root -p # logs into monitor Import Python serial sudo apt-get install python-serial = = = = = PHP stuff PHP errors are located in /var/log/apache2/ phpMyadmin: https://pimylifeup.com/raspberry-pi-phpmyadmin/ = = = = = MySQL / MariaDB stuff https://pimylifeup.com/raspberry-pi-mysql/ sudo mysql -u root -p RaspiSE: root password: e99pl@ntz; MySQL phpMyadmin pw: S1enna phpMyadmin un: username pw: password = = = = = USEFUL PuTTY stuff * after copying, paste with a right click * uparrow repeats previous command to become a superuser, start with php.ini: sudo su STOP / START webserver: /etc/init.d/apache2 stop // /etc/init.d/apache2 start find file: php -i | grep 'php.ini' /etc/php/7.0/cli/php.ininano get IP: ifconfig or hostname -I list files: ls PHP error log tail /var/log/apache2/error.log tmux [attach - to restore existing session] ^b + d[etach] c[reate new window] n[ext] p[revious] ?[list of windows, quit to exit] %[split] o[ther] temps: var/www/html/python3.6 1wt .py Temp sensor business cd /sys/bus/w1/devices/... below 3rd floor sensor: 28-0000068ede02 2nd floor living: 28-0000068ea885 cat w1_slave To stop a nohup process: ps -ef to find running processes ; also pid of python (doesn't give the program name) identify the process to stop kill PID Shell script tutorial: https://www.youtube.com/watch?v=ap-ABFNCBoE writing / preparing shell scripts nano [filename] begins with #! "hash bang" change owner perms chmod u+x [filename] check perms: ls -l to run script: ./[filename] (in this directory) or /bat/[filename] creating an alias: (transient) $ alias [name]='[command]' run by typing [name] creating a PERSISTENT alias edit: nano .bash_aliases add the alias, for example alias web='cd /var/www/html' allows you to get to the web folder from anywhere reload your profile: $ . .profile test, your alias should work