This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Script for building up DDNS service using Cloudflare and https://ip.sb or http://icanhazip.com/ | |
import requests | |
import time | |
import json | |
update_interval = 21600 #Update interval, default to 6hr, aka 21600s | |
api_token = "" #your cf global api key | |
email_address = "" #your email address | |
target_domain = "" #e.g gist.github.com | |
domain = target_domain.split(".")[1] + "." + target_domain.split(".")[2] | |
identifiyer = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from LCD import LCD | |
import time | |
import os | |
lcd_object = LCD() | |
#lcd_object.message("Test", 1) | |
wait_time = 5 | |
def clock_n_temp(): | |
temp_reading = os.popen("vcgencmd measure_temp").read().split("=")[1].split("\\")[0] | |
arm_clock_freq_hz = int(os.popen("vcgencmd measure_clock arm").read().split("=")[1].split("\\")[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This piece of code will only run if: | |
#You have a Raspberry Pi 3 or later with a UPS board using 18650 batteries(https://github.com/linshuqin329/UPS-18650/) | |
#side notes: in which is my dev env | |
import os | |
import struct | |
import smbus | |
import sys | |
import time | |
off_plan = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import sys | |
def OSInfo(): | |
carrier = dict() | |
carrier['up_since'] = os.popen("uptime -s").read().split("\n")[0] | |
carrier['uptime'] = os.popen("uptime -p").read().split("up ")[1].split("\n")[0] | |
carrier['hostname_v4'] = os.popen("hostname -I").read().split(" ")[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<h1>MicroPython HTTP Server on Raspberry Pi Pico W</h1> | |
Your IP address is: %s:%d | |
<br> | |
</html> |