Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFID sensor #65

Open
NirViaje opened this issue Jun 16, 2020 · 5 comments
Open

RFID sensor #65

NirViaje opened this issue Jun 16, 2020 · 5 comments

Comments

@NirViaje
Copy link
Owner

RFID sensor for temperature, humidity, pressure, etc.

with RFID as User Interface, both analog and switch on/off etc

RFID传感器作为交互界面以及环境感知

@NirViaje
Copy link
Owner Author

NirViaje commented Jul 3, 2020

Developer Resources

Running a Local Build

In root directory of your Vuese project:

  1. Run yarn run build
  2. Run yarn link

In project that you want to use the libaries:

  1. If @vuese/cli is not yet installed, add it: yarn add @vuese/cli
  2. Run yarn link vuese-monorepo
  3. Navigate to node_modules/.bin and open vuese.cmd and vuese
  4. Change any instance of @vuese to vuese-monorepo\packages in both files

To generate the documentation locally, run the vuese binary from node_modules/.bin :

  1. Run node_modules\.bin\vuese gen (cmd)
    or
  2. Run node_modules/.bin/vuese gen (powershell)

Samples

Component Notation

  1. Samples/Components Folder
  2. Vuese Explorer

Component Documentation

  1. Samples/Docs Folder

@NirViaje
Copy link
Owner Author

NirViaje commented Jul 19, 2020

ESP32

image
esp32_pinout_wroom_pinout

M-BUS

20 GPIO, compare to 32 GPIO of esp32 WROOM

Notice2:M5PORT 说明(不同颜色的GROVE端口分别代表不同的功能)

  • 红色的PortA(21/22),为默认的I2C协议接口
    • PortA(红色)被作为信号总线连接至是ESP32的GPIO21/22 ,没有AD通道转换方案,因此不能用作模拟输入使用
  • 黑色的PortB(26/36), 支持DA/AD转换与信号总线通信
  • 蓝色的PortC(16/17), 支持Uart串口通信.在使用Unit进行功能拓展的时候,只需要匹配二者的端口的颜色,相应的进行连接即可正常使用.不仅提供简洁的硬件连接方式,还支持引脚的重映射

ADC端口

  • ADC1(8 通道 GPIO 32-39)
  • ADC2(10 通道 GPIO 0,2,4,12-15,25-27)

使用AD读取功能:

  1. 使用杜邦线连接机身侧面的能够AD转换的引脚
  2. 堆叠一个M5GO底座,使用其提供PortB
  3. 使用PbHUB连接至PortA,拓展出6个PortB

有关引脚分配和引脚重映射的更多信息,请查阅ESP32数据手册

工具链

esp32_technical_reference_manual_en

Great Docs on everything about esp8266

Xuhongv notes on ESP

ESP Smart-Config

image
image

Firmware

ESP-Touch

/**
  * @brief     Set mode of SmartConfig. default normal mode.
  *
  * @attention 1. Please call it before API esp_smartconfig_start.
  * @attention 2. Fast mode have corresponding APP(phone).
  * @attention 3. Two mode is compatible.
  *
  * @param     enable  false-disable(default); true-enable;
  *
  * @return
  *     - ESP_OK: succeed
  *     - others: fail
  */
esp_err_t esp_smartconfig_fast_mode(bool enable);
  //Init WiFi as Station, start SmartConfig
  WiFi.mode(WIFI_AP_STA);
  esp_smartconfig_fast_mode(true);  //with this line, 26821ms to connect successful
  WiFi.beginSmartConfig();

Low power

low_power_flow_chart3

Data acquisition or abnormal detection (GPIO trigger is not supported and frequent data uploading is not needed)

on battery supply

image

当ESP8266以AP方式连接到路由器且运行于Modem-sleep模式时,它会在两次DTIM Beacon间隔内关闭WIFI电路以达到省电效果,在下次Beacon到来前自动唤醒。睡眠时间由路由器的DTIM Beacon时间决定。睡眠的同时ESP8266可以保持与路由器的WI-FI连接,并通路由器接受来自手机或者服务器的交互信息。

一般路由器的DTIM Beacon间隔为100ms~1,000ms

作者:梁睿坤
链接:https://www.jianshu.com/p/8533e5a52890
来源:简书
简书著作权归作者所有,任何形式的转载都请联系作者获得授权并注明出处。

image

ESP.deepSleep(20e6); // 20e6 is 20 microseconds

ULP

install the toolchain -

ESP32自带独立的低功耗协处理器ULP,平均消耗电流4.7uA

ULP 协处理器的主频是 8MHz, ULP 协处理器在正常工作时,瞬时电流消耗为 1.4 - 2.2 mA 左右。理想的 ULP 协处理器用法是较长的周期性进入 Deep-Sleep 和短暂的醒来工作来换取功耗平衡。
此例子为了演示效果,我们的设定 ULP 协处理器睡眠周期设置为 3 S,醒来工作的周期不足 1ms, 用电流表测得电流值维持在 4.7uA

作者:espressif
来源:CSDN
原文:https://blog.csdn.net/espressif/article/details/78608569
版权声明:本文为博主原创文章,转载请附上博文链接!

RTC

The only parts of the chip which can still be powered on are: RTC controller, RTC peripherals (including ULP coprocessor), and RTC memories (slow and fast).

ulp_io_number = rtc_gpio_desc[gpio_num].rtc_num; /* map from GPIO# to RTC_IO# */

The minimum wakeup time represents clock cycles spend by ULP's FSM on internal tasks:

  1. Time to wakeup - 2 clock cycles
  2. Waiting until the 8M clock is stable - 16 clock cycles
  3. Preparation to go to sleep - 2 clock cycles

This makes the total of 20 clock cycles or 20/150KHz = ~133us

ULP coprocessor is started by a timer. The timer is started once ulp_run is called. The timer counts a number of RTC_SLOW_CLK ticks (by default, produced by an internal 150kHz RC oscillator).
The application can set ULP timer period values (SENS_ULP_CP_SLEEP_CYCx_REG, x = 0..4) using ulp_set_wakeup_period function.

Multi-core tasks

TaskHandle_t TaskA, TaskB;

void Task2code(void * pvParameters) {
  while(true) {
    ;
  }
}

void setup() {
  xTaskCreatePinnedToCore(
             Task2code,  /* Task function. */
             "Task2",    /* name of task. */
             10000,      /* Stack size of task */
             NULL,       /* parameter of the task */
             1,          /* priority of the task */
             &TaskA,     /* Task handle to keep track of created task */
             1);         /* pin task to core 0 */
}

Audio

NVS: Non-volatile storage

@NirViaje
Copy link
Owner Author

NirViaje commented Jul 19, 2020

Handnotes

image

  • Advanced library installation for PlatformIO

\.platformio\penv\Scripts> .\pio upgrade

Install ESP32 develop kits

install esp msys32 package

image

  • simply COM10 or other port in Windows
  • To exit IDF monitor use the shortcut Ctrl+].
  • make flash monitor to start serial monitor after finish compile and upload
    • idf.py -p PORT flash monitor

Copy example from ESP-IDF, here /esp is located in /msys32/home/user-name/esp/

cd ~/esp
cp -r $IDF_PATH/examples/get-started/hello_world .
$

Arduino on esp-idf

~/esp-idf$ git checkout ebdcbe8c60a3b5a228d9e80335d869cc01c527ab
  265  cd arduino/
  266  git submodule update --init --recursive
  267  git log | grep 7df50a9
  268  git checkout 7df50a97d17b0953ea01cad0355410a66bd8b8b4

c for esp-idf, cpp for arduino.

Versions need to take care

  1. ESP-IDF
  2. Arduino
  3. Gcc compiler and toolchain
  4. target code

Network protocol

Web Server = TCP Server + Request header etc

TCP+Web Server/Client, AJAX, etc

AJAX

esp32-wifi04


//fix with

1. python -m pip install --upgrade pip
2. pacman -S mingw-w64-i686-python2-cryptography

network operations

HTTP

@NirViaje
Copy link
Owner Author

Parts in need

  1. Wi-Fi link
    • smartconfig
      • with AP at the same time?
      • open the cover for smartconfig?
      • register multiple AP info
    • persistence of wifi connection information
    • if no smartconfig set wifi available (what if network error?
      • setup AP
      • get indicated by UI (no wifi connection? raised the AP?
        • try to connect the smartconfig wifi simultaneously, before anyone connect (the http?
      • get chance to reset smartconfig
        • or setup wpa
      • or use in standalone mode
    • OTA upgrade
  2. low power
    • sleep
      • with wifi connection
    • ulp with ADC detection of extra Hall sensor
      • signal filtering under low power
    • RTC
      • ntp
  3. UI with LED segments and other io
    • TM1637
    • beeper
    • cover hall
  4. Charging
    • IP5306_I2C
    • low power alert/alarm by UI
  5. network
    • long pooling
    • data structure
      • pull data
      • push data
    • mqtt?
  6. customize app
    • set the pack alert (queue
    • pack alert
      • beep and display
      • ending after the user took
      • timeout
      • data send back
  7. sensor and calibration
    • calibration in manufacture
      • filtering
      • persistance storage
      • error detect
    • bias surpress
    • time calibrate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant