念慈菴

[Course Design] wifi personal business card

 
Overview

WiFi business card based on esp8266ex

It’s nearing the end of the semester and I can’t finish the document, so I’ll just make do with it.

"The code will be open source on Github, so stay tuned."

1 Introduction

2 knowledge points

3 Introduction to onboard resources

4 Circuit Function Analysis

5 welding

6 code

6.1 Ideas

The idea of ​​the code for this board is quite simple. First, turn on the AP mode to create an unencrypted wifi, then turn on the dns service, and finally start the website. There are basically corresponding libraries on the arduino, which can be called directly

The first is to import these libraries

Depth screenshot_select area_20210607191907.png

Then initialize the timer, file system, WIFI, DNS, and write the parameters according to the instructions on the back of the board.

Depth screenshot_select area_20210607203838.png

The WS2812 on the board has a breathing light written on it. It uses trigonometric functions to control the brightness changes, and the display effect is more natural.

Depth screenshot_select area_20210607204301.png

Next is the function to read each file. This part is automatically generated using python.

Depth screenshot_select area_20210607204614.png

ps. Instructions for using file2cpp.py

Note: Since the code has been around for too long (written last year), the naming rules are mixed with underscores and camel case.

Additional explanation is the first few lines

Depth screenshot_select area_20210607205339.png

They are all literal meanings, respectively.

  • Folder to be read (can only be data, otherwise the upload tool will not recognize it)
  • The file name and path of the generated file
  • Specific file of index (only one can exist)
  • The specific function of ESP8266WebServer is ESP8266WebServer xxxxxxx(80) in the ino code;

    Copy the generated code directly to the ino file and add initServer(); to setup().

I haven’t written any comments at all, I’ll add them later~


Let’s just pick a web page template for explanation.

Open gayhub, search template 100, and pick one with many templates

Depth screenshot_select area_20210607211412.png

Clone it and choose a good one

Depth screenshot_select area_20210607212011.png

Demo 1.GIF

Look at the size, it’s 1.6MB, it can fit perfectly

Depth screenshot_select area_20210607213927.png

Run the script first. Since this file system only supports a maximum path of 32 characters, several errors were reported.

Depth screenshot_select area_20210607215037.png

Then change the long path, and then check whether the source code calls other websites. If so, you need to download it manually and change the path.

After no error is reported, generate code

Depth screenshot_select area_20210607220647.png

Copy to .ino file, compile and upload

Depth screenshot_plasmashell_20210607221315.png

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-07-02 13:38:42

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号