Skip to content

Instantly share code, notes, and snippets.

@Tech500
Tech500 / index7.h
Last active January 16, 2022 00:50
Web page for "UnrealMediaServer" that displays RTSP "live" video feed
//index7.h
const char HTML7[] PROGMEM = R"====(
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Unreal Media Server WebRTC player</title>
<script type="text/javascript" src="http://gc.kis.v2.scr.kaspersky-labs.com/FD126C42-EBFA-4E12-B309-BB3FDD723AC1/main.js?attr=5_kmXRo0UtYPkMmvi2pueMJ6TwZtFe75E64hAzwNX3T7zLrRHvxN1HY6Y5-TWOn1wOXmCU82BwjNFhbXOfXXoZzIOwXMUFzny9SKZ2ckHOwGLIDBjuLnuE1JrU5lRPY9" charset="UTF-8"></script><link rel="stylesheet" crossorigin="anonymous" href="http://gc.kis.v2.scr.kaspersky-labs.com/E3E8934C-235A-4B0E-825A-35A08381A191/abn/main.css?attr=aHR0cDovL3d3dy51bWVkaWFzZXJ2ZXIubmV0L3VtZWRpYXNlcnZlci9kZW1vaHRtbDVXZWJSVENwbGF5ZXIuaHRtbA"/><script src="http://www.umediaserver.net/umediaserver/webrtcadapter.js"></script>
@Tech500
Tech500 / NTP_System_Time.ino
Last active February 27, 2023 22:43
Use NTP time to schedule events to run at specific times.
// NTP_System_Time.ino
//schufti --of ESP8266.com Forum provided source for NTP time.
//Developer of code not given
#include <WiFi.h>
#include <WiFiUdp.h>
#include <sys/time.h>
#include <time.h>
@Tech500
Tech500 / ESP32_Receiver.ino
Last active February 7, 2022 21:08
ESP-NOW ESP32_Receiver.ino --working
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// "Version 2.0 'ESP32Receiver.ino' 02/02/2022 15:00 EST" Developed by William M. Lucid, tech500
//
// Developing AsyncWebServer 11/07/2019; modifying with fileRead and not found function. Adding wifi log of reconnects.
//
// Portion of NTP time code was developed from code provided by schufti --of ESP8266Community
//
// listFiles and readFile functions by martinayotte of ESP8266 Community Forum. readFile function modified by RichardS of ESP8266 Community Forum for ESP32.
//
@Tech500
Tech500 / ESP32_Sender.ino
Last active February 7, 2022 20:58
ESP-NOW ESP32_Sender --working
#include <esp_now.h>
#include <esp_wifi.h>
#include <WiFi.h>
#include <WiFiUdp.h>
#include <sys/time.h> // struct timeval --> Needed to sync time
#include <time.h> // time() ctime() --> Needed to sync time
#include <BME280I2C.h> //Use the Arduino Library Manager, get BME280 by Tyler Glenn
#include <EnvironmentCalculations.h> //Use the Arduino Library Manager, get BME280 by Tyler Glenn
#include <Wire.h> //Part of version 1.0.4 ESP32 Board Manager install -----> Used for I2C protocol
//////////////////////////////////////////////////////////////////////////////////
//Hosted Domain, web page -code sends data for Dynamic web page every 15 Minutes
/////////////////////////////////////////////////////////////////////////////////
void webInterface()
{
gpslat = gps.location.lat();
gpslng = gps.location.lng();
char glat[10]; // Buffer big enough for 9-character float
@Tech500
Tech500 / collectdata2.php
Created February 22, 2022 17:10
File to receive data on domain server and dynamically create html code for new web page.
<?php
/*
ESP32: send data to your Domain
Uses POST command to send DHT data to a designated website
The circuit:
* BME280
* Post to Domain
Original version of this code by Stephan Borsay
1:47:57 AM Mailer: Mailer: Failure sending mail.
1:47:57 AM Error: Mailer: Mailer: Failure sending mail.
1:47:57 AM Mailer: at System.Net.Mail.SmtpClient.Send(MailMessage message) at CoreLogic.Mailer.Send(String to, String subject, String body, List`1 attach, List`1 filenames, String& error)
1:47:57 AM Error: Mailer: at System.Net.Mail.SmtpClient.Send(MailMessage message) at CoreLogic.Mailer.Send(String to, String subject, String body, List`1 attach, List`1 filenames, String& error)
1:47:57 AM Mailer: Mailer: Unable to read data from the transport connection: net_io_connectionclosed.
1:47:57 AM Error: Mailer: Mailer: Unable to read data from the transport connection: net_io_connectionclosed.
1:47:57 AM Mailer: at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine) at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller) at System.Net.Mail.Smtp
#include <rom/rtc.h>
#include <Ticker.h>
#define uS_TO_S_FACTOR 1000000 /* Conversion factor for micro seconds to seconds */
void verbose_print_reset_reason(int reason)
{
switch ( reason)
@Tech500
Tech500 / WiFi_Reset.ino
Created July 6, 2022 12:57
Sketch to demonstrate method of reset WIFI connection
///////////////////////////////////////////////////////////////////////////////////////////////////////
//
// ESP8266/ESP32
//
// "WiFi_Reset.ino" by William Lucid on Github.com by Tech500 02/16/2021 @ 10:43 EST
//
// Start WiFi plus log disconnect and reflect
//
// Sketch demonstrates starting WiFi, Disconnects of WiFi, and Resets of WiFi;
// plus logs WiFi Connects and WiFi Disconnects, additionally watchdog trigger events are logged.
String str;
if (!LittleFS.begin())
{
Serial.println("LittleFS failed to mount !");
}
Dir dir = LittleFS.openDir("/");
while (dir.next())