Skip to content

Instantly share code, notes, and snippets.

//you need to connect to wifi first
void wifisendfile()
{
String host="xxx.xxx.xxx.xxx";//your host name or ip
//prepare httpclient
Serial.println("Starting connection to server...");
Serial.println(host);
WiFiClient client;
'從網址取得要查詢的ISBN
Dim isbn As String = Request.QueryString("isbn")
'宣告webclient物件
Dim webClient1 As New System.Net.WebClient
'將isbn送到博客來查詢,並讀取網頁原始碼到result中
dim result as String = webClient1.DownloadString("https://search.books.com.tw/search/query/key/" & isbn)
'找出書籍封面的網址位置
dim PicUrl as String = result.Substring(result.IndexOf("https://im1.book.com.tw"), result.IndexOf("&", result.IndexOf("https://im1.book.com.tw")) - result.IndexOf("https://im1.book.com.tw"))
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEScan.h>
#include <BLEUUID.h>
#include <BLEAdvertisedDevice.h>
#include <BLEBeacon.h>
BLEScan* pBLEScan;
BLEBeacon id;
int scanTime = 3; //In seconds
String reverse(String str) {
@youjunjer
youjunjer / ESP32BeaconScan
Last active April 25, 2019 16:48
ArduinoBluetoothControl
#include <BluetoothSerial.h>
BluetoothSerial SerialBT;//宣告藍芽物件=SerialBT
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);//序列視窗
SerialBT.begin("BLETEST");//<<藍芽廣播名稱,請自己記得
pinMode(4,OUTPUT);//風扇relay
pinMode(16,OUTPUT);//電燈relay
@youjunjer
youjunjer / gist:1d3a9f22605d2c30b3e1abfde79f1a01
Last active May 6, 2020 08:52
Arduino ESP32 save DHT11 to Google Sheet by IFTTT
#include <WiFi.h>
#include <WiFiMulti.h>
#include <HTTPClient.h>
//pls use sketch/include library/manage library find simpledht by winlin
//or you can use another library
#include <SimpleDHT.h>
int pinDHT11 = 2; //set dht11 at pin2
SimpleDHT11 dht11(pinDHT11);
WiFiMulti wifiMulti;
// This post referred to this git. I just trimmed cam and wifi part.
// https://github.com/v12345vtm/CameraWebserver2SD/blob/master/CameraWebserver2SD/CameraWebserver2SD.ino
#include "FS.h"
#include "SD_MMC.h"
//List dir in SD card
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
Serial.printf("Listing directory: %s\n", dirname);
@youjunjer
youjunjer / gist:b20f63fcf909862c7943dd955583916e
Last active September 5, 2020 19:48
ESP32-CAM Stream server, auto takepic and OTA
//Change Tools/Partition/Scheme to Minimal SPIFFS (Large APPS with OTA)
//IR sensor set at GPIO13
//Must Insert SD card
#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
@youjunjer
youjunjer / gist:c2068b70f124ee657ef5561cc01902e6
Last active March 4, 2024 19:10
ESP32-CAM take pictures and HTTP POST file to server
//Change Tools/Partition/Scheme to Minimal SPIFFS (Large APPS with OTA)
//IR sensor set at GPIO13
//Must Insert SD card
#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
@youjunjer
youjunjer / ESP32-CAM LineNotify
Created July 15, 2019 00:02
ESP32-CAM Send LineNotify
//Change Tools/Partition/Scheme to Minimal SPIFFS (Large APPS with OTA)
//IR sensor set at GPIO13
//Must Insert SD card
#include "esp_camera.h"
#include <WiFi.h>
#include "esp_timer.h"
#include "img_converters.h"
#include "Arduino.h"
#include "fb_gfx.h"
import cv2 as cv
import numpy as np
from urllib.request import urlopen
import os
import datetime
import time
import sys
#change to your ESP32-CAM ip
url="http://192.168.1.149:9601/stream"