From 8570bd3614b84d6b0f69282edb8fc86231ac0c3e Mon Sep 17 00:00:00 2001 From: Jessie219-web <112080869+Jessie219-web@users.noreply.github.com> Date: Fri, 6 Sep 2024 17:02:29 +0800 Subject: [PATCH 1/4] delete wrong content --- .../Meshtastic_Network/T1000-E/t1000_e_intro.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/Network/Meshtastic_Network/T1000-E/t1000_e_intro.md b/docs/Network/Meshtastic_Network/T1000-E/t1000_e_intro.md index 9f9c459d8e8c..d3da782aa9ff 100644 --- a/docs/Network/Meshtastic_Network/T1000-E/t1000_e_intro.md +++ b/docs/Network/Meshtastic_Network/T1000-E/t1000_e_intro.md @@ -180,13 +180,3 @@ It is a high-performance tracker designed for Meshtastic, as small as a credit c |Press three times|Switch on/off the GPS|-|-| |Press and hold for 5s|Power off|Falling melody|| - -## Get Started - -### Configuration - - -Press the button once to power on the T1000-E tracker, the Bluetooth pairing will be activated automatically. - -#### Device Connection - From 926208831beffbee7f52f304e45ac1a67cb97d49 Mon Sep 17 00:00:00 2001 From: Jessie219-web <112080869+Jessie219-web@users.noreply.github.com> Date: Wed, 11 Sep 2024 14:16:09 +0800 Subject: [PATCH 2/4] update respeaker example --- .../XIAO_ESP32_S3/respeaker_player_spiffs.md | 39 ++++++------- .../respeaker_streams_i2s_tflite.md | 56 +++++++++++++++++++ .../XIAO_ESP32_S3/xiao_respeaker.md | 2 +- 3 files changed, 73 insertions(+), 24 deletions(-) diff --git a/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_player_spiffs.md b/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_player_spiffs.md index ea81608b0ade..10243017f47f 100644 --- a/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_player_spiffs.md +++ b/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_player_spiffs.md @@ -19,6 +19,7 @@ This project demonstrates how to use the reSpeaker Lite board to play MP3 files ### Library Required +* [ReSpeaker Lite library](https://github.com/limengdu/reSpeaker_Lite-Arduino-Library.git) * [ReSpeaker Lite arduino libhelix](https://github.com/limengdu/reSpeaker_Lite-arduino-libhelix) ### Functionality @@ -29,6 +30,15 @@ This project demonstrates how to use the reSpeaker Lite board to play MP3 files * Easy-to-use AudioPlayer class for seamless audio playback +### Uploading Files to SPIFFS + +You can refer to the [Wiki](https://wiki.seeedstudio.com/xiao_esp32s3_sense_filesystem/#serial-peripheral-interface-flash-file-system-spiffs) here. + +Make sure you have the necessary tools to upload files to SPIFFS. You can use the "ESP32 Sketch Data Upload" tool in the Arduino IDE or an external tool like "ESP32 File Uploader". + +Create a folder named "data" in your sketch directory and place the MP3 files you want to play inside it. + +Upload the files to SPIFFS using the chosen tool. ### Code @@ -73,31 +83,14 @@ void loop() { ### Configuration +`startFilePath`: The directory path where the MP3 files are located in SPIFFS (default: "/"). -* Uploading Files to SPIFFS - -SPIFFS is a file system intended for SPI NOR flash devices on embedded targets. It supports wear levelling, file system consistency checks, and more. - +`ext`: The file extension of the audio files (default: "mp3"). +You can modify these constants in the sketch to match your specific file structure and requirements. +### Customization -Make sure you have the necessary tools to upload files to SPIFFS. -You can use the `ESP32 Sketch Data Upload` tool in the Arduino IDE 1.x or other tools. +`printMetaData`: This function is called when metadata is extracted from the audio file. You can customize the function to handle the metadata according to your needs. -:::tip For Arduino IDE 2.x -**Install**: - -Copy the [VSIX file](https://github.com/earlephilhower/arduino-littlefs-upload/releases) to `~/.arduinoIDE/plugins/` on Mac and Linux
-or `C:\Users\\.arduinoIDE\plugins\` on Windows (you may need to make this directory yourself beforehand).
-Then restart the IDE. - -**Usage**: - -For windows: [Ctrl] + [Shift] + [P], then `Upload LittleFS to Pico/ESP8266/ESP32`.
-For macOS, [⌘] + [Shift] + [P], then `Upload LittleFS to Pico/ESP8266/ESP32`. -::: - - -Create a folder named "data" in your sketch directory and place the MP3 files you want to play inside it. - -Upload the files to SPIFFS using the chosen tool. +`AudioSourceSPIFFS`: You can change the file filter by uncommenting the line //source.setFileFilter("*Bob Dylan*"); and replacing the filter with your desired criteria. \ No newline at end of file diff --git a/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_streams_i2s_tflite.md b/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_streams_i2s_tflite.md index 76a2bbe00cb9..dea2724a6721 100644 --- a/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_streams_i2s_tflite.md +++ b/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/respeaker_streams_i2s_tflite.md @@ -40,6 +40,59 @@ Open the `streams-generator-i2s.ino` sketch in the Arduino IDE. Upload the sketch to your reSpeaker Lite board. +```cpp +#include "AudioTools.h" +#include "AudioLibs/TfLiteAudioStream.h" +#include "model.h" // tensorflow model + +I2SStream i2s; // Audio source +TfLiteAudioStream tfl; // Audio sink +const char* kCategoryLabels[4] = { + "silence", + "unknown", + "yes", + "no", +}; +StreamCopy copier(tfl, i2s); // copy mic to tfl +int channels = 1; +int samples_per_second = 16000; + +void respondToCommand(const char* found_command, uint8_t score, + bool is_new_command) { +// if (is_new_command) { + char buffer[80]; + sprintf(buffer, "Result: %s, score: %d, is_new: %s", found_command, score, + is_new_command ? "true" : "false"); + Serial.println(buffer); +// } +} + +void setup() { + Serial.begin(115200); + AudioLogger::instance().begin(Serial, AudioLogger::Warning); + + // setup Audioi2s input + auto cfg = i2s.defaultConfig(RX_MODE); + cfg.channels = channels; + cfg.sample_rate = samples_per_second; + cfg.use_apll = false; + cfg.buffer_size = 512; + cfg.buffer_count = 16; + i2s.begin(cfg); + + // Setup tensorflow output + auto tcfg = tfl.defaultConfig(); + tcfg.setCategories(kCategoryLabels); + tcfg.channels = channels; + tcfg.sample_rate = samples_per_second; + tcfg.kTensorArenaSize = 10 * 1024; + tcfg.respondToCommand = respondToCommand; + tcfg.model = g_model; + tfl.begin(tcfg); +} + +void loop() { copier.copy(); } +``` Open the `Serial Monitor` to view the output and any log messages. @@ -74,3 +127,6 @@ Open the `Serial Monitor` to view the output and any log messages. * The TensorFlow Lite model can be replaced with your own trained model by updating the model.h file. +### Resource + +[TensorFlow Lite library](https://github.com/limengdu/reSpeaker_Lite-Arduino-Library/tree/main/examples/streams-i2s-tflite) \ No newline at end of file diff --git a/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/xiao_respeaker.md b/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/xiao_respeaker.md index 0b519bfa0164..bcc8d834ac0e 100644 --- a/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/xiao_respeaker.md +++ b/docs/Sensor/ReSpeaker_Lite/XIAO_ESP32_S3/xiao_respeaker.md @@ -75,7 +75,7 @@ Before we start this chapter, please make sure the ReSpeaker Lite's firmware is * [I2S Firmware Download](https://files.seeedstudio.com/wiki/SenseCAP/respeaker/ffva_i2s_v1.0.5.bin) -Check [Get Started](https://wiki.seeedstudio.com/reSpeaker_lite_introduction/#update-firmware) to flash the firmware. +Check [Get Started](https://wiki.seeedstudio.com/reSpeaker_usb_v3/#update-firmware) to flash the firmware. ### Software Preparation From 9a72f131f117a3fe63ed686ddea3465b0051d29d Mon Sep 17 00:00:00 2001 From: Jessie219-web <112080869+Jessie219-web@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:16:40 +0800 Subject: [PATCH 3/4] update T1000-E --- .../T1000-E/sensecap_t1000_e.md | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md b/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md index df00aa5ba057..69474c69463c 100644 --- a/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md +++ b/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md @@ -22,16 +22,17 @@ Download `Meshtastic` App: **Check the device name** + Visit [Meshtastic Web Flasher](https://flasher.meshtastic.org/).
Select device: `T1000-E Tracker Card`

pir

-Click `Open Serial Monitor`, connect the device, and you will see the device name. + +Click `Open Serial Monitor`, connect the device to your PC, check the serial log and you will see the device name.

pir

-Press the button once to power on the T1000-E tracker, the Bluetooth pairing will be activated automatically. import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; @@ -99,33 +100,20 @@ In order to start communicating over the mesh, you must set your region. This se **Region List** -Refer to [LoRa Region by Country](https://meshtastic.org/docs/configuration/region-by-country/) for a more comprehensive list. |**Region Code**|**Description**|**Frequency Range (MHz)**|**Duty Cycle (%)**|**Power Limit (dBm)**| | :-: | :-: | :-: | :-: | :-: | |UNSET|Unset|N/A|N/A|N/A| |US|United States|902\.0 - 928.0|100|30| -|EU\_433|European Union 433MHz|433\.0 - 434.0|10|12| |EU\_868|European Union 868MHz|869\.4 - 869.65|10|27| -|CN|China|470\.0 - 510.0|100|19| -|JP|Japan|920\.8 - 927.8|100|16| -|ANZ|Australia & New Zealand|915\.0 - 928.0|100|30| -|KR|Korea|920\.0 - 923.0|100|| -|TW|Taiwan|920\.0 - 925.0|100|27| -|RU|Russia|868\.7 - 869.2|100|20| -|IN|India|865\.0 - 867.0|100|30| -|NZ\_865|New Zealand 865MHz|864\.0 - 868.0|100|36| -|TH|Thailand|920\.0 - 925.0|100|16| -|UA\_433|Ukraine 433MHz|433\.0 - 434.7|10|10| -|UA\_868|Ukraine 868MHz|868\.0 - 868.6|1|14| -|MY\_433|Malaysia 433MHz|433\.0 - 435.0|100|20| -|MY\_919|Malaysia 919MHz|919\.0 - 924.0|100|27| -|SG\_923|Singapore 923MHz|917\.0 - 925.0|100|20| -|LORA\_24|2\.4 GHz band worldwide|2400\.0 - 2483.5|100|10| + + +Refer to [LoRa Region by Country](https://meshtastic.org/docs/configuration/region-by-country/) for a more comprehensive list. + :::info -**EU_433** and **EU_868** have to adhere to an hourly duty cycle limitation of 10%, calculated every minute on a rolling 1-hour basis. Your device will stop transmitting if you reach it, until it is allowed again. +**EU_868** has to adhere to an hourly duty cycle limitation of 10%, calculated every minute on a rolling 1-hour basis. Your device will stop transmitting if you reach it, until it is allowed again. ::: From ce512d801624bdb7f83a3093e7178180ca658c32 Mon Sep 17 00:00:00 2001 From: Jessie219-web <112080869+Jessie219-web@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:29:11 +0800 Subject: [PATCH 4/4] update T1000-E --- docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md b/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md index 69474c69463c..613973ee40f4 100644 --- a/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md +++ b/docs/Network/Meshtastic_Network/T1000-E/sensecap_t1000_e.md @@ -28,9 +28,9 @@ Select device: `T1000-E Tracker Card`

pir

-Click `Open Serial Monitor`, connect the device to your PC, check the serial log and you will see the device name. +Click `Open Serial Monitor`, connect the device to your PC, check the serial log, keyword `using nodenum`. -

pir

+

pir