-
-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Switch to Makuna/DFMiniMp3 and simplified USB debugging * Adapt SD-Card folder and track names * SD-Card folder description * Implement own advert functionality * Docs * Add cosmetic pause functionality * Add high_level_state parameter * Cleanup * Add emergency sound processing * New sounds & ROS startup successful * Fix new timing issue, add Mode & GPS handling * Fix ROS startup sound order and protected redundancy call of OnPlayFinished() * Fix emergencies * Restrict GPS ping to area recording mode * Fix GPS ping, add rain handling * Add randomized mowing background sounds & further GPS ping fixes * Add new and german sound files * Add soundfiles from alfakenzo * Soundfile corrections * Add Sound "IMU init failed" * Add repeatDuration * Fix rand mow sound during waiting for GPS fix * Add debug prefix string * Restructure SoundSystem from OOP to FP * Work around playFolderTrack16() * Work around non working stop() when OnPlayFinish ed() * Improved emergency handling * Change translation * Skip needless namespace * Fix emergency during flash & docked. Add/change sounds * Add VCC warning * Add volume and language control via LL buttons * Change some sounds, add collision sound for SA/SC models * Default Volume * No "Bida bida" on stop-button * Squashed commit of the following: commit 1d40d64 Author: Jörg Ebeling <[email protected]> Date: Fri Sep 29 21:05:32 2023 +0200 Fit indentation commit be7b9e3 Author: Jörg Ebeling <[email protected]> Date: Thu Sep 28 23:09:22 2023 +0200 Better var names commit 9fb76f6 Author: Jörg Ebeling <[email protected]> Date: Thu Sep 28 00:21:02 2023 +0200 Process UIBoard available * Fix missing soundsystem.cpp for 0_13_X * Current measurements on 3.3V line * Implemented SD-Card type/format detection (old/new) and old SD-Card format support * Fix missing -DENABLE_SOUND_MODULE * Add DFPIS5V compile flag * PR cleanup * PR cleanup * Stick to previous DFP lib 1.2.2 * Removed or replaced problematic sound files * Merge branch 'main' * Merge branch 'feature/nv-config' * Merged 'nv_config' PR and integrated LL/HL config packet * Fix CI * Fix volume down announcement * Add "ROS stopped" announcement * Update ci.yaml * Update ci.yaml * Update ci.yaml * Add 0.13.x resistor comment, update button description, update some minor info * Fix SD-Card detection tampering by volume change * DFP lib version bump * Cut-off Pin-11 (IO2) recommendation for DFPlayer-Clones * Add forgotten readme img * Add new 'JL AB23A799755' clone * Add new 'JL AB23A799755' clone * PlayMowSounds only if ROS is running as well as some minor (comment) changes * Minor code corrections * Align HighLevel States and SubStates with ROS * Simple HighLevelState class for easier handling of HighLevel-Mode and SubMode * Tiny code adaptions and HighLevelState class usage * Add Docking advert and randomized background, move Darth-Vader background sound from mowing to docking * Add Docking advert and background as well as some minor code adaptions * Code review * Prepare background-sound option and small code corrections * Transitional config packet & background sound option * Merge main * Restructure sound in OtherCore as well as Autoplay Detection * Restructured sound track naming and handling * LL/HL logic handling cleanup * Add new DFPlayer clone, adapt some description * Fix comment * Enable sound module @ HW 0.13.x --------- Co-authored-by: Clemens Elflein <[email protected]>
- Loading branch information
1 parent
c9d557b
commit 42f5810
Showing
102 changed files
with
1,151 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
# Sound via "DFPlayer Mini" | ||
|
||
> [!IMPORTANT] | ||
> Owner of mainboard version 0.13.x need to check if the required R7 and R13 | ||
> resistors got assembled.<br> | ||
> They're located on the top side of the PCB, underneath the DFPlayer.<br> | ||
> If not assembled, you need to solder 1k resistors (otherwise all sounds get played continuously) | ||
> [!IMPORTANT] | ||
> <a href="../../img/dfplayer-clone_cut-pin.png"><img src="../../img/dfplayer-clone_cut-pin.png" title="Cut-off Pin-11 if DFP-Clone and MoBo <= 0.13.x" width="25%" align="right"></a> | ||
> Users who use any of the DFPlayer-Clones,<br> | ||
> in an open-mower-mainboard up to version 0.13.x,<br> | ||
> should cut off Pin-11 from their DFPlayer-Clone.<br> | ||
> If not, volume control will not work and always play at 100%!<br><br> | ||
> [!WARNING] | ||
> Consider about switching your DFPlayer's VCC from 3.3V to 5V | ||
> (via solder jumper JP1 on your OpenMower MainBoard) | ||
**Explanation:**<br> | ||
I'm with sound since June 2023.<br> | ||
In the first month, I killed 2 Picos because his tiny Buck-Boost Converter "RT6150" cracked.<br> | ||
After a short correspondence with Clemens, he pointed me to the DFPlayer | ||
as a possible reason.<br> | ||
Because: By OM default design, the DFPlayer's VCC is 3.3V (via JP1), | ||
which is provided by the small Buck-Boost Converter on the Pico.<br> | ||
After I switched my DFPlayer's VCC to 5V (via JP1), I didn't lost any Pico anymore.<br> | ||
It's not confirmed yet if that really was the reason for my killed Pico's, | ||
and you're invited to validate the assumption by leaving your DFPlayer on 3.3V. **But be warned**, even if the Pico is cheap, it's awful to replace it! | ||
|
||
### Update 10/13/2023 | ||
|
||
As I was still in doubt if it's really necessary to switch DFPlayer's VCC to 5V, | ||
I did some measuring today: | ||
|
||
- Placed an 0.2Ω resistor (4W) within Pico's 3V3 output line | ||
- Measured with an oscilloscope the occuring voltage over the resistor:<br> | ||
0.028 V<sub>AVG</sub> => divided by 0.2Ω = 140mA => looks fine<br> | ||
0.195 V<sub>PP</sub> => divided by 0.2Ω = 975mA => hugh :-/ but this is V<sub>PP</sub>! | ||
- Within the Pico Datasheet it's written (somewhere), thats allowed to draw up to 300mA | ||
- The specs of the Buck-Boost Converter "RT6150" (used on the Pico) say:<br> | ||
"*Up to 800mA Continuous Output Current*", as well as<br> | ||
"*... current limit.*" | ||
|
||
End of October 2023, I discussed my doubts with Clemens and he answered: | ||
> The short peaks are also what worries me. The overcurrent protection will probably only take effect in the event of a longer overload. That's how you run it above the spec (even if for a short time) and that potentially breaks it at some point | ||
> [!IMPORTANT] | ||
> You may run `OM_DFP_IS_5V=true` (to get full sound support), even if **not** switched to 5V, but we worry that you might kill your Pico's PMIC after some time | ||
## Sound Buttons | ||
|
||
| Custom CoverUI V1<br>Stock C500(A/B) | Custom CoverUI V2 | RM-ECOW-V1.0.0<br>(NX80i, ...) | RM-EC3-V1.1<br>(NX100i) | SA/SC-Pro<br>(240*160 Pixel) | Function | | ||
| ------ | -------- | ---- | ---- | --- | --- | | ||
| <kbd>Mon</kbd> | <kbd>Sun</kbd> | <kbd>4H</kbd> | <kbd>1</kbd> | <kbd>↑</kbd> | Volume up | | ||
| <kbd>Tue</kbd> | <kbd>Mon</kbd> | <kbd>6H</kbd> | <kbd>2</kbd> | <kbd>↓</kbd> | Volume down | ||
|
||
## DFPlayer Module / Clones | ||
|
||
Beside the original [DFPlayer by DFRobot](https://www.dfrobot.com/product-1121.html) module, there are a couple of "DFPlayer-Mini" clones in the wild. | ||
|
||
If you order a "DFPlayer-Mini" by Amazon or the like, there's a >90% chance that you get one of these clones, instead of the original one. | ||
|
||
That's why I tried to adapt the code in that way, that some of these clones get also supported. | ||
|
||
Check the larger chip on the backside of the module, to verify if your DFPlayer is supported. The following DFPlayer chips are supported/tested at the moment: | ||
|
||
- `DFROBOT LISP3` is the one on my original [DFPlayer by DFRobot](https://www.dfrobot.com/product-1121.html) module | ||
- `MH2024K-24SS` which is one of the older clones, whose support is okay | ||
- `AB23A799755` is a newer clone and seem to be supported very well | ||
- `GD3200B` is also one of the newer clones, but partly fail in support! | ||
|
||
The used DFPlayer library also indicate support for `YX5200-24SS` and `MH2024K-16SS`, but I couldn't test these by myself. If you've one of these, give it a try. | ||
|
||
## SD-Card | ||
|
||
Look like all DFPlayer support a SD-Card size up to 32GB. | ||
As we don't have a lot soundfiles (<10MB), choose the smallest one you can find, format it with a FAT32 file system and copy all these [files and folder](./soundfiles/) to your SD-Card. | ||
|
||
Do not simply delete all files from an ancient SD-Card which you found in a dusty box!<br> | ||
These tiny DFPlayer beasts are sensitive to SD-Card trash like orphaned files or unclean FAT tables and tend to loop or hang when initialized.<br> | ||
Always prefer to cleanly format it with a FAT32 partition! | ||
|
||
### Folder/Track Structure | ||
|
||
Due to some incompatibilities with the libs and the clone chips, we unfortunately can't use DFPlayer's internal "advert" functionality for our usage. | ||
|
||
So we had to trick a little bit with the folder structure: | ||
|
||
- OM's old original sounds are now (partly) converted, translated, extended and reside now in a 2 digit, language specific subfolder. They're mainly 'advert' tracks as they're typically spoken adverts, which may interrupt background sounds like noises or music. | ||
- Folder 'mp3' contain background sounds (noises or music), which are hardcoded in the sources. | ||
- The single soundfile in the root folder, is used/required for DFPlayer "auto-play" detection. If you like to change it, you need to take care that the new file is as least 5 seconds long. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Created by Apehaenger on 02/02/23. | ||
// | ||
// This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. | ||
// | ||
// Feel free to use the design in your private/educational projects, but don't try to sell the design or products based on it without getting my consent first. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
// | ||
// | ||
#ifndef _DEBUG_H_ | ||
#define _DEBUG_H_ | ||
|
||
// Define to stream debugging messages via USB | ||
//#define USB_DEBUG | ||
|
||
#ifdef USB_DEBUG | ||
|
||
#define DEBUG_SERIAL Serial | ||
// #define DfMiniMp3Debug DEBUG_SERIAL // Also output DFPlayer IN/OUT cmd data | ||
|
||
// Some bloody simple debug macros which superfluous '#ifdef USB_DEBUG' ... | ||
#define DEBUG_BEGIN(b) \ | ||
DEBUG_SERIAL.begin(b); \ | ||
while (!DEBUG_SERIAL); | ||
#define DEBUG_PRINTLN(str) DEBUG_SERIAL.println(str) | ||
#define DEBUG_PRINTF(fmt, ...) \ | ||
do { \ | ||
DEBUG_SERIAL.printf(fmt, ##__VA_ARGS__); \ | ||
} while (0) | ||
#define PRINTF_BINARY_PATTERN_INT8 "%c%c%c%c%c%c%c%c" | ||
#define PRINTF_BYTE_TO_BINARY_INT8(i) \ | ||
(((i) & 0x80ll) ? '1' : '0'), (((i) & 0x40ll) ? '1' : '0'), (((i) & 0x20ll) ? '1' : '0'), (((i) & 0x10ll) ? '1' : '0'), \ | ||
(((i) & 0x08ll) ? '1' : '0'), (((i) & 0x04ll) ? '1' : '0'), (((i) & 0x02ll) ? '1' : '0'), (((i) & 0x01ll) ? '1' : '0') | ||
|
||
#else | ||
|
||
#define DEBUG_BEGIN(b) | ||
#define DEBUG_PRINTLN(str) | ||
#define DEBUG_PRINTF(fmt, ...) | ||
#define PRINTF_BINARY_PATTERN_INT8 | ||
#define PRINTF_BYTE_TO_BINARY_INT8(i) | ||
#endif | ||
|
||
#endif // _DEBUG_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+54.5 KB
Firmware/LowLevel/soundfiles/01/018_RPI shut down and powered off.mp3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+26.4 KB
Firmware/LowLevel/soundfiles/01/025_Emergency triggered by collision sensor.mp3
Binary file not shown.
Oops, something went wrong.