Voice alerts test build

More
24 Jun 2016 01:50 - 24 Jun 2016 01:51 #51020 by phantom8
Replied by phantom8 on topic Voice alerts test build
Currently, the implementation of voice alert simply plays a MP3 file. Will it be useful to be able to read out values? For instance, read out the telemetry value as "Your model's voltage is at 3.9 Volt". I believe Taranis has something like this. If we want to be able to speak out the values, we'll need to keep track of the playing status of the audio module. For DFPlayer, we can connect to the BUSY pinout and monitor the playing status. Can be done with another MCU GPIO pin. I suppose we can also connect to the TX pin of the DFplayer and continuously querying its playback status. However, this will require another RX pin on MCU or whatever new module we may come up with. Is this feature worth looking into?
Last edit: 24 Jun 2016 01:51 by phantom8.

Please Log in or Create an account to join the conversation.

More
24 Jun 2016 06:34 #51023 by Fernandez
Replied by Fernandez on topic Voice alerts test build
Maybe also question is how to deal with all alarms, and sounds, will we need specific alarms / sounds menu?
Or will we put in every screen some alarms options?

A speak on request could also be usefull, so when touching a touch button it gives you some info, such as volt or flight time etc.

Please Log in or Create an account to join the conversation.

More
24 Jun 2016 13:17 #51032 by victzh
Replied by victzh on topic Voice alerts test build
My next design will use an MCU, with more freedom in secondary device protocols. You can use fast SPI to MCU and then retranslate it at slower speed to external device. Or use serial connection - whatever you choose.

Please Log in or Create an account to join the conversation.

More
25 Jun 2016 02:26 - 25 Jun 2016 02:26 #51049 by phantom8
Replied by phantom8 on topic Voice alerts test build

Fernandez wrote: Maybe also question is how to deal with all alarms, and sounds, will we need specific alarms / sounds menu?
Or will we put in every screen some alarms options?

A speak on request could also be usefull, so when touching a touch button it gives you some info, such as volt or flight time etc.


The current Telemetry config allows you to define the criteria to trigger an alarm. When the alarm is raised, the system will use the corresponding Telemetry alarm entry in the sound.ini file to play the tone if the output device is a buzzer. For voice alert, the voice file numbers/names are currently being hardcoded such that Telemetry Alarm 1 will always play the specific mp3 file. If we were to implement the ability to speak out telemetry values, we'll need to enhance the sound.ini file and/or Telemetry config menu. Your idea of speaking on request via button/switch can also be catered into the same system.
Last edit: 25 Jun 2016 02:26 by phantom8.

Please Log in or Create an account to join the conversation.

More
25 Jun 2016 04:53 #51050 by silpstream
Replied by silpstream on topic Voice alerts test build
@phantom8, the ability to read out values is definitely useful. I'm wondering, would a queue work so that we don't need to poll for a busy signal or find a rx pin?

Please Log in or Create an account to join the conversation.

More
25 Jun 2016 05:09 - 25 Jun 2016 05:10 #51051 by phantom8
Replied by phantom8 on topic Voice alerts test build
For example, if we play a message "Voltage three point eight volt". It will consist of 5 voice files. We can't just queue the voice files to DFPlayer, it doesn't support it. As soon as we tell the DFPlayer to play the next file, it'll stop the current playback. Thus, we'll need a way to tell when exactly the first file finish playing. Then, we'll tell it to play the next file, and so on.
Last edit: 25 Jun 2016 05:10 by phantom8.

Please Log in or Create an account to join the conversation.

More
25 Jun 2016 05:39 #51053 by mwm
Replied by mwm on topic Voice alerts test build

Fernandez wrote: Maybe also question is how to deal with all alarms, and sounds, will we need specific alarms / sounds menu?
Or will we put in every screen some alarms options?

A speak on request could also be usefull, so when touching a touch button it gives you some info, such as volt or flight time etc.


My plan was to add a field to the Telemetry config page letting you select an alarm rather than having them hard wired in. The selection would be based on the name of the section in the sound.ini file. The page would also be extended to allow you to have alerts based on channel values, and an "=" warning which would by default only fire once instead of repeatedly. That way you could get things like "High rates" on switches and "Control centered" on the aux inputs. You could make the switch ones play continuously (some people want that) by using a < or > test instead of =.

I want the ability to read values as well. But I'm not going to worry about it until after the alerts stuff is working.

FWIW, I've got the perfect solution for not having enough pins - if you're willing to upgrade the mcu. Some of the high end STM32's have DACs built in, and can play audio files with no external hardware. So no connections needed :evil:. Seriously, I haven't checked to see if any of them are pin compatible with anything Walkera makes, but we're talking about our own cpu boards in other threads. There was a youtube video of deviation ported to the STM32F429i Discovery board, which is ~$20 with a 320x240 color touch screen, and is my choice for that. It has the DACs on it to play audio, so support for such may happen at some point in the distant future....

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
25 Jun 2016 08:30 #51055 by HappyHarry
Replied by HappyHarry on topic Voice alerts test build
you got a link to that youtube video mike? as I'm about to try something similar

Please Log in or Create an account to join the conversation.

More
25 Jun 2016 16:04 #51065 by mwm
Replied by mwm on topic Voice alerts test build
Unfortunately, no. I found it ~18 months ago when I was looking into STM32 development boards, and haven't been able to find it again. IIRC, there was a note about it being unreleased because the author wasn't happy with it.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
26 Jun 2016 21:13 #51099 by mwm
Replied by mwm on topic Voice alerts test build

silpstream wrote: I want to look at the hardware.ini stuff too, first block for me was the sequence that it gets loaded, which you already know about. Gotta find some time to look at that, then it might be easier configuring pins from there.


You don't need to w worry about when hardware.ini gets loaded, because it doesn't get "loaded" per se, it just gets parsed. Write your own parser that looks for the sections you need and ignores everything else and run that whenever it's convenient. The existing parser should ignore your stuff as well. But performance isn't much of an issue at this point, as it'll only get done once during the past on sequence. If that starts being an issue, we can go over everything in it.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
27 Jul 2016 10:02 #52203 by Morlacus
Replied by Morlacus on topic Voice alerts test build
Hello,

I am very interested to try to implement voices alerts in my Devo 12s/deviation 5.00.

Before doing anything, I would know if what I intend to do has chances to work. I would like to make a separate box including a DF player linked to the 12S via the trainer port.
The DF player would be wired exactly in the same way proposed by Deal57 in the #47110 post.
The speaker would be a 36 mm 8 ohms 1W
I would use a 1S lipo (if not enough a 2S with a 5v ubec)
As I cannot use genspeech on windows I would record directly the mp3 files via Audacity (I am French). After renaming them I would put them in a mp3 directory in a sd card put in the DF player.
All done for the hardware, just to put the jack in the trainer port...

For the soft, it's more complex.
I would use the buildt proposed by Phantom 8 in the #50790 post deviation-devo12-v5.0.0-fc59a95.zip.
I would like to know where this built differs from the 5.00.
Sure for the deviation-devo12-v5.0.0-fc59a95.dfu. and the hardware.ini

If the devo12-lib.dfu the same ? I suppose but would like to be sure.
Are other directories or files different ?

In order to have swich voice feedback I would make a modelxx.map file in the manner given by phantom8 and put this file in the model directory for each model.

At this point is it possible to include the standard alerts proposed by MWM in his voice alert build which are in his MP3MINI.ZIP ? That would be great but I do not understand how.
Thanks for your help

Please Log in or Create an account to join the conversation.

More
25 Sep 2016 08:47 #54237 by mtx63
Replied by mtx63 on topic Voice alerts test build
is there any news. final version?

Please Log in or Create an account to join the conversation.

More
25 Sep 2016 22:01 #54268 by mwm
Replied by mwm on topic Voice alerts test build
No. There's a good test build from others, but that's about it. I've been buried and not able to get back to this.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
23 Oct 2016 07:54 #55301 by Fernandez
Replied by Fernandez on topic Voice alerts test build
Just to give an update I soldered up an DF player module loaded the default MP3 files, starting with 4 digit nrs in the root of 4gb sd. 0000-0018. The DF player easiliy works, it plays the files using the short to ground of the up down buttons, also volume adjust works default it is at its loudest. When playing a file the LED on the module is on.
I am using a mini speaker scavenged from an old loptop, but I find it not oad enough. (speaker is boxed)

I think I'll order small amplifier hope to get it loader;
www.banggood.com/5pcs-PAM8403-Miniature-...27.html?rmmds=search

I am just wondering when plugging the dfplayer to the ppm port, having it enabled in hardware.ini, then just starting up the transmitter, should it play the "welcome to deviation" ? In my case no sound yet.


Here some details I found in the Banggood forum on the DF player, the guy mentioned that the original datasheet is very lacking, might be of interest to implement some features, there is even an equalizer inside;

After some time of experimenting, I found the datasheet on the DF Robot website very incomplete and even incorrect for many commands.

Although the Arduino library that is offerd by DF Robot fullfils a need, it is pretty easy to write a sketch without the library. The program listed below (Arduino Uno) is made to reveal all the available commands in the module. In the leading comment of the sketch, all commands I found available in the module are documented. You can type in your Serial Monitor a DFPlayer mini command with its parameters and see and hear what is happening.

It is very easy to make your own sketch based on all available (and undocumented) commands. I hope it will help. Copy/paste the sketch text below or download a copy here.






/*
DF Player mini command discovery
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Program is mend to discover all the possibilities of the command
structure of the DFPlayer mini. No special libraries are needed.

In general, there are 3 ways to address a MP3 or WAV file:
(1) Track order:
All songs are stored a certain order on the card. The order is however
not garanteed and very depending on the order how the files were written to the card. This
method is not suitable when it is absolutly neccessary that a specific track is played. Commands
using this written order are (0x01, 0x02, 0x03, 0x08, 0x11, 0x3C, 0x3D, 0x3E, 0x4B, 0x4C, 0x4D).
The name of a song is arbitrary.
(2) Folder number and song number:
Folders are named 01~99 and songs 001~255.mp3 or 001~255.WAV. It's possible to exactly address
a specific song with command 0x0F. Command 0x17 is related. When adressing a specific file,
the file is always internaly converted to the stored track number. This number can be requested by
commands 0x4B, 0x4C or 0x4D.
(3) Folder named "mp3" and song number:
A folder is named "mp3" and songs with a name of exact a 4-digit number (0001~2999) e.g. 0235.mp3.
It's possible to exactly address a specific song with command 0x12.The according track number can
be requested by commands 0x4B, 0x4C or 0x4D.

This program is simple and can be the basis for your own mp3 player sketch.
Note: The DF Player commands are not always correct described in the manual. I tried to fix it, but
there is still a something to do. The commands recoverd so far are listed below.

How to use this sketch:
Enter three (separated) DECIMAL numbers in the Serial Monitor with no end of line character.
First number : Command
Second number: First (High Byte) parameter
Third number : Second (Low Byte) parameter
E.g.: 3,0,1 will play the first track on the TF card

VERY IMPORTANT: Use serial 1K resistors or a level shifter between module RX and TX
and Arduino to suppress audio noise
Connect Sound module board RX to Arduino pin 11 (via 1K resistor)
Connect Sound module board TX to Arduino pin 10 (via 1K resistor)
Connect Sound module board Vcc to Arduino Vin when powered via USB (preferably 3.0)
else use seperate 5V power supply
Connect Sound module board GND to Arduino GND


General DF Player mini command structure (only byte 3, 5 and 6 to be entered in the serial monitor):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Byte Function Value
==== ================ ====
(0) Start Byte 0x7E
(1) Version Info 0xFF (don't know why it's called Version Info)
(2) Number of bytes 0x06 (Always 6 bytes)
(3) Command 0x__
(4) Command feedback 0x__ If enabled returns info with command 0x41 [0x01: info, 0x00: no info]
(5) Parameter 1 [DH] 0x__
(6) Parameter 2 [DL] 0x__
(7) Checksum high 0x__ See explanation below. Is calculated in function: execute_CMD
(8) Checksum low 0x__ See explanation below. Is calculated in function: execute_CMD
(9) End command 0xEF

Checksum calculation.
~~~~~~~~~~~~~~~~~~~~
Checksum = -Sum(byte(1..6)) (2 bytes, notice minus sign!)

DF Player mini Commands without returned parameters (*=Confirmed command ?=Unknown, not clear or not validated)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMD CMD
HEX DEC Function Description Parameters(2 x 8 bit)
==== === =================================== = ======================================================================
0x01 1 Next * [DH]=X, [DL]=X Next track in current folder.Loops when last file played
0x02 2 Previous * [DH]=X, [DL]=X Previous track in current folder.Loops when last file played
0x03 3 Specify track(NUM) * [DH]=highByte(NUM), [DL]=lowByte(NUM)
1~2999 Playing order is order in which the numbers are stored.
Filename and foldername are arbitrary, but when named starting with
an increasing number and then placed in one folder, files are (often)
played in that order and with correct track number.
e.g. 0001-Joe Jackson.mp3...0348-Lets dance.mp3)
0x04 4 Increase volume * [DH]=X, [DL]=X Increase volume by 1
0x05 5 Decrease volume * [DH]=X, [DL]=X Decrease volume by 1
0x06 6 Specify volume * [DH]=X, [DL]= Volume (0-0x30) Default=0x30
0x07 7 Specify Equalizer * [DH]=X, [DL]= EQ(0/1/2/3/4/5) [Normal/Pop/Rock/Jazz/Classic/Base]
0x08 8 Specify repeat(NUM) * [DH]=highByte(NUM), [DL]=lowByte(NUM).Repeat the specified track number
0x09 9 Specify playback source (Datasheet) ? [DH]=X, [DL]= (0/1/2/3/4)Unknown. Seems to be overrided by automatic detection
(Datasheet: U/TF/AUX/SLEEP/FLASH)
0x0A 10 Enter into standby – low power loss * [DH]=X, [DL]=X Works, but no command found yet to end standby
(insert TF-card again will end standby mode)
0x0B 11 Normal working (Datasheet) ? Unknown. No error code, but no function found
0x0C 12 Reset module * [DH]=X, [DL]=X Resets all (Track = 0x01, Volume = 0x30)
Will return 0x3F initialization parameter (0x02 for TF-card)
"Clap" sound after excecuting command (no solution found)
0x0D 13 Play * [DH]=X, [DL]=X Play pointered track
0x0E 14 Pause * [DH]=X, [DL]=X Pause track
0x0F 15 Specify folder and file to playback * [DH]=Folder, [DL]=File
Important: Folders must be named 01~99, files must be named 001~255
0x10 16 Volume adjust set (Datasheet) ? Unknown. No error code. Does not change the volume gain.
0x11 17 Loop play * [DH]=X, [DL]=(0x01:play, 0x00:stop play)
Loop play all the tracks. Start at track 1.
0x12 18 Play mp3 file [NUM] in mp3 folder * [DH]=highByte(NUM), [DL]=lowByte(NUM)
Play mp3 file in folder named mp3 in your TF-card. File format exact
4-digit number (0001~2999) e.g. 0235.mp3
0x13 19 Unknown ? Unknown: Returns error code 0x07
0x14 20 Unknown ? Unknown: Returns error code 0x06
0x15 21 Unknown ? Unknown: Returns no error code, but no function found
0x16 22 Stop * [DH]=X, [DL]=X, Stop playing current track
0x17 23 Loop Folder "01" * [DH]=x, [DL]=1~255, Loops all files in folder named "01"
0x18 24 Random play * [DH]=X, [DL]=X Random all tracks, always starts at track 1
0x19 25 Single loop * [DH]=0, [DL]=0 Loops the track that is playing
0x1A 26 Pause * [DH]=X, [DL]=(0x01:pause, 0x00:stop pause)

Commands with returned parameters (*=Confirmed command ?=Unknown, not clear or not validated)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CMD CMD
HEX DEC Function Description Parameters(2 x 8 bit)
==== === =================================== = ==========================================================================
0x3A 58 Medium inserted * [DH]=0, [DL]=(1:U-disk, 2:TF-card)
0x3B 59 Medium ejected * [DH]=0, [DL]=(1:U-disk, 2:TF-card)
0x3C 60 Finished track on U-disk * [DH]=highByte(NUM), [DL]=lowByte(NUM)
Not validated. Returns track number when song is finished on U-Disk
0x3D 61 Finished track on TF-card * [DH]=highByte(NUM), [DL]=lowByte(NUM)
Returns track number when song is finished on TF
0x3E 62 Finished track on Flash * [DH]=highByte(NUM), [DL]=lowByte(NUM)
Not validated. Returns track number when song is finished on Flash
0x3F 63 Initialization parameters * [DH]=0, [DL]= 0 ~ 0x0F. Returned code when Reset (0x12) is used.
(each bit represent one device of the low-four bits)
See Datasheet. 0x02 is TF-card. Error 0x01 when no medium is inserted.
0x40 64 Error ? [DH]=0, [DL]= 0~7 Error code(Returned codes not yet analyzed)
0x41 65 Reply ? [DH]=0, [DL]= 0~? Return code when command feedback is high
0x00 no Error (Other returned code not known)
0x42 66 The current status * [DH] = Device number [DL] = 0 no play, 1 play
0x43 67 The current volume * [DH]=0, [DL]= Volume (0x00-0x30)
0x44 68 The current EQ * [DH]=0, [DL]= EQ(0/1/2/3/4/5) [Normal/Pop/Rock/Jazz/Classic/Base]
0x45 69 The current playback mode * [DH]=0, [DL]= (0x00: no CMD 0x08 used, 0x02: CMD 0x08 used, not usefull)
0x46 70 The current software version * [DH]=0, [DL]= Software version. (My version is 5)
0x47 71 The total number of U-disk files * [DH]=highByte(NUM), [DL]=lowByte(NUM). Not validated
0x48 72 The total number of TF-card files * [DH]=highByte(NUM), [DL]=lowByte(NUM)
0x49 73 The total number of flash files * [DH]=highByte(NUM), [DL]=lowByte(NUM). Not validated
0x4A 74 Keep on (Datasheet) ? Unknown. No returned parameter
0x4B 75 The current track of U-Disk * [DH]=highByte(NUM), [DL]=lowByte(NUM), Current track on all media
0x4C 76 The current track of TF card * [DH]=highByte(NUM), [DL]=lowByte(NUM), Current track on all media
0x4D 77 The current track of Flash * [DH]=highByte(NUM), [DL]=lowByte(NUM), Current track on all media
0x4E 78 Folder "01" [DH]=x, [DL]=1 * [DH]=0, [DL]=(NUM) Change to first track in folder "01"
Returns number of files in folder "01"
0x4F 79 The total number of folders * [DH]=0, [DL]=(NUM), Total number of folders, including root directory

This software is free to use and free to share

Additional info can be found on DFRobot site, but is not very reliable
Additional info:http://www.dfrobot.com/index.php?route=product/product&product_id=1121

Ype Brada 2015-04-06

Please Log in or Create an account to join the conversation.

More
26 Oct 2016 05:20 #55392 by mwm
Replied by mwm on topic Voice alerts test build
There's a timing issue in this build. It uses all the original timing, which worked fine for playing beeps in the µcu. But the dfplayer doesn't boot fast enough, so the "Welcome" message doesn't get played. If you provide external power to the dfplayer, it'll play, but that's a bit clumsy just for that message.

Do not ask me questions via PM. Ask in the forums, where I'll answer if I can.

My remotely piloted vehicle ("drone") is a yacht.

Please Log in or Create an account to join the conversation.

More
27 Oct 2016 09:27 - 27 Oct 2016 09:28 #55433 by Fernandez
Replied by Fernandez on topic Voice alerts test build
Hmm do not really understand, I did hook up dfplayer to external 3v3 (external lipo + pololu 3v3) I put the mp3 files into folder mp3 and I tried into the root. The DF player plays the mp3 in both cases using the buttons.

I connect to the PPM port using u7e happy harry voice build, I edit hardware.ini defined dfplyer.

I also tried suggestion happy harry for me no luck yet.
I am not sure what pin is for DF player in this build ppm out or the mcu pin?
How to select voice or buzzer beeps, as I have no buzzer anymore? Vibrator stil works.

No luck for me yet. Ayway I have all hardware ready if stuff needs to be tested etc, I can help.
Last edit: 27 Oct 2016 09:28 by Fernandez.

Please Log in or Create an account to join the conversation.

More
31 Oct 2016 19:39 #55572 by Fernandez
Replied by Fernandez on topic Voice alerts test build
Ok some progress with the latest U7E build of HappyHarry of 27th oktober, voice is being played at dfplayer at the ppm port "Welcome To Deviation" is being played at start and "Goodbye" at shut down of Tx.

But I have no idea how to get the alerts played of switches and or telemetry, I added "model10alert.txt" also tried with ini extention insided the models folder.

File looks as followed:
FMODE0: Switch to primary FPV Camera
FMODE1: Switch to secondary Gimbal Camera
HOLD0: Low Rate Selected
HOLD1: High Rate Selected
SW B0: Acro Mode
SW B1: Stabilize Mode
SW B2: Sport Mode
SW A0: GPS Hold Activated
SW A1: GPS Assist Deactivated
SW A2: GPS Return To Home Activated

But no sounds being played at switches.


I am wondering how it works, how does tx know at start up to play voice message 0000? "welcome to deviation?

I assume somewere must be defined all audio files on the dfplayer, nrs+label?
Then somewhere model file, must be defined when to play what.

Please Log in or Create an account to join the conversation.

More
31 Oct 2016 21:00 #55575 by Deal57
Replied by Deal57 on topic Voice alerts test build
When I tested this earlier this year, I was able to set up alarms, plus the "Welcome to Deviation" and "Goodbye" sounds (I believe i posted the video). Basically I set up the timer1 as a countdown to time out and it played the alert telling me time was up. I also set up a low voltage alarm (on a Proto-X - Hubsan with telemetry), and when it crossed the low voltage the system played. Here is the link to a short video showing the countdown timer. Proto-X Timer Voice Alert

I don't recall being able to set up any specific alarm for each other than to replace the file (named appropriately) on the MP3 chip.

It worked very nicely, but that was a 4.01 nightly from January. I haven't gone Ultimate with my 7e yet, so I'm not much help, but if you send me a new Devo6 DFU I'll be happy to test it as well.

Deviation Devo7e 3way switch mod, A7105, NRF24L01
Devo6s 2x2 switch mod, trim mod, haptic, multimodule, A7105, NRF24L01, CC2500
Devo12e 4-in-1 with voice mod -- it speaks!!

Please Log in or Create an account to join the conversation.

More
31 Oct 2016 23:21 #55577 by HappyHarry
Replied by HappyHarry on topic Voice alerts test build
fenandez are you following phantom8's instructions for creating the mapping files using his script? as i read it you need the model*.map file as well as the model*alert.txt file to make this work with switches etc

Please Log in or Create an account to join the conversation.

More
01 Nov 2016 08:46 - 01 Nov 2016 08:50 #55580 by Fernandez
Replied by Fernandez on topic Voice alerts test build
Hmmm model*.map didn't use that indeed, maybe need to do some more digging into this.
At the moment is not so clear for me how to play switches and telemetry.
But it plays the welcome / end message perfectly fine, were is that defined?
Can sounds also be selected from the Tx menu?

Will do some more test later, at least I can confirm that DFPLAYER and hardware itself, is very easy to build ad has excellent sound, all very promising. Definitively I want this into my U7E this is so greaaat!
Last edit: 01 Nov 2016 08:50 by Fernandez.

Please Log in or Create an account to join the conversation.

Time to create page: 0.134 seconds
Powered by Kunena Forum