a1967629423 / esp32c3-rs-qq

Apache License 2.0
16 stars 1 forks source link

ESP32C3 rs-qq的简易不完整实现

项目配置

在根目录创建app.json和device.json,结构分别如下

app.json

{
    "wifi": {
      "ssid": "SSID",
      "pass": "PASS"
    },
    "time": {
      "time_host": "192.168.1.1:7000"
    },
    "qq": {
      "uin": 10000,
      "password": "PASSWORD",
      "group_code": 10000,
      "master_uin": 10000
    },
    "mqtt": {
      "url": "mqtt://192.168.1.1:1883",
      "receive_topic": "qq/received",
      "send_topic": "qq/send"
    }
  }

device.json

{
  "display": "GMC.214688.001",
  "product": "iarim",
  "device": "sagit",
  "board": "eomam",
  "model": "MI 6",
  "finger_print": "xiaomi/iarim/sagit:10/eomam.200122.001/9285333:user/release-keys",
  "boot_id": "6fc5a573-d976-013c-20b4-4c00b3a199e1",
  "proc_version": "Linux 5.4.0-54-generic-9AmjXwjq (android-build@google.com)",
  "imei": "259136341828576",
  "brand": "Xiaomi",
  "bootloader": "U-boot",
  "base_band": "",
  "version": {
    "incremental": "5891938",
    "release": "10",
    "codename": "REL",
    "sdk": 29
  },
  "sim_info": "T-Mobile",
  "os_type": "android",
  "mac_address": "00:50:56:C0:00:08",
  "ip_address": [
    10,
    0,
    1,
    3
  ],
  "wifi_bssid": "00:50:56:C0:00:08",
  "wifi_ssid": "<unknown ssid>",
  "imsi_md5": [
    160, 148, 68, 243, 1, 2, 44, 31, 87, 226, 130, 80, 163, 39, 126, 140
  ],
  "android_id": "d8d603f0a7f4d8d2",
  "apn": "wifi",
  "vendor_name": "MIUI",
  "vendor_os_name": "gmc"
}

如未创建在开启编译后会自动生成

如果不需要MQTT功能可以去掉mqtt字段

时间的获取

目前时间的获取方式是通过网络获取的,可以网络内跑一个这个来简单授时

Rust on ESP32 STD demo app

A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.

CI

Highlights:

Build

QEMU (WIP, experimental)

Flash

NOTE: The above commands do use espflash and NOT cargo espflash, even though both can be installed via Cargo. cargo espflash is essentially espflash but it has some extra superpowers, like the capability to build the project before flashing, or to generate an ESP32 .BIN file from the built .ELF image.

Alternative flashing

Monitor

I (5991) esp_idf_svc::wifi: Got wifi event: 4 I (5991) esp_idf_svc::wifi: Set status: Status(Started(Connected(Waiting)), Stopped) I (6001) esp_idf_svc::wifi: Wifi event 4 handled I (6011) wifi:AP's beacon interval = 102400 us, DTIM period = 1 I (6451) esp_idf_svc::wifi: Providing status: Status(Started(Connected(Waiting)), Stopped) I (6951) esp_idf_svc::wifi: Providing status: Status(Started(Connected(Waiting)), Stopped) I (7451) esp_idf_svc::wifi: Providing status: Status(Started(Connected(Waiting)), Stopped) I (7951) esp_idf_svc::wifi: Providing status: Status(Started(Connected(Waiting)), Stopped) I (8221) esp_idf_svc::wifi: Got IP event: 0 I (8221) esp_idf_svc::wifi: Set status: Status(Started(Connected(Done(ClientSettings { ip: 192.168.10.155, subnet: Subnet { gateway: 192.168.10.1, mask: Mask(24) }, dns: None, secondary_dns: None }))), Stopped) I (8231) esp_idf_svc::wifi: IP event 0 handled I (8241) esp_netif_handlers: staSTA netif allocated: ip: 192.168.10.155, mask: 255.255.255.0, gw: 192.168.10.1 I (8451) esp_idf_svc::wifi: Providing status: Status(Started(Connected(Done(ClientSettings { ip: 192.168.10.155, subnet: Subnet { gateway: 192.168.10.1, mask: Mask(24) }, dns: None, secondary_dns: None }))), Stopped) I (8461) esp_idf_svc::wifi: Waiting for status done - success I (8461) esp_idf_svc::wifi: Started I (8471) esp_idf_svc::wifi: Configuration set I (8471) rust_esp32_std_demo: Wifi configuration set, about to get status I (8481) esp_idf_svc::wifi: Providing status: Status(Started(Connected(Done(ClientSettings { ip: 192.168.10.155, subnet: Subnet { gateway: 192.168.10.1, mask: Mask(24) }, dns: None, secondary_dns: None }))), Stopped) I (8501) rust_esp32_std_demo: Wifi connected, about to do some pings I (8511) esp_idf_svc::ping: About to run a summary ping 192.168.10.1 with configuration Configuration { count: 5, interval: 1s, timeout: 1s, data_size: 56, tos: 0 } I (8521) esp_idf_svc::ping: Ping session established, got handle 0x3ffc767c I (8531) esp_idf_svc::ping: Ping session started I (8531) esp_idf_svc::ping: Waiting for the ping session to complete I (8541) esp_idf_svc::ping: Ping success callback invoked I (8551) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=1 ttl=64 time=14ms bytes=64 I (9531) esp_idf_svc::ping: Ping success callback invoked I (9531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=2 ttl=64 time=1ms bytes=64 I (10531) esp_idf_svc::ping: Ping success callback invoked I (10531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=3 ttl=64 time=2ms bytes=64 I (11531) esp_idf_svc::ping: Ping success callback invoked I (11531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=4 ttl=64 time=0ms bytes=64 I (12531) esp_idf_svc::ping: Ping success callback invoked I (12531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=5 ttl=64 time=1ms bytes=64 I (13531) esp_idf_svc::ping: Ping end callback invoked I (13531) esp_idf_svc::ping: 5 packets transmitted, 5 received, time 18ms I (13531) esp_idf_svc::ping: Ping session stopped I (13531) esp_idf_svc::ping: Ping session 0x3ffc767c removed I (13541) rust_esp32_std_demo: Pinging done I (13551) esp_idf_svc::httpd: Started Httpd IDF server with config Configuration { http_port: 80, https_port: 443 } I (13561) esp_idf_svc::httpd: Registered Httpd IDF server handler Get for URI "/" I (13561) esp_idf_svc::httpd: Registered Httpd IDF server handler Get for URI "/foo" I (13571) esp_idf_svc::httpd: Registered Httpd IDF server handler Get for URI "/bar"