New Tone Detection and Finder Software - Python Based

Status
Not open for further replies.

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
Hey,

So as you all know I have been writing scripts for both TTD and FD-Tone-Notify. During the process of developing a web ui for my iCAD Pi image for FD-Notify. I kind of realized the amount of work I had put in to doing it, and the numerous changes needed to make it work properly.

So I decided to start on journey in a different direction and create my own tone detection program. One that incorporates my previously made scripts for alert notifications and a web ui for configuration. It is Python based and will run on Windows and Linux including Raspberry Pi. Bundled in to a single executable file

I have Motorola QCII 1+1 two tone decoding and detecting working perfectly currently. Have not written alerting scripts yet, and before I do I want to ask the community here for two things.


I would like to ask for requests, what do you want to see in the program?

Second, I am interested in adding 5 Tone detection and finding as well. Since I know that is becoming more popular through out the US. I have some questions about it for you.

What is the standard for 5 tone in the US and Canada? I have seen a few different standards and have written a decoder for EIA, but am not sure if that is correct standard to include.

Lastly, do any of you have audio samples of 5 tone paging, and the codes it is paging?
 

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
I have released an alpha version of iCAD Tone Detection.

Current Working Features:
Two Tone Detection and Finding
Web GUI to manage and configure configurations and tones.
Sending Pre Recording Emails
Sending Pre Recording MQTT messages
Sending Post Recording Emails
Audio filters for recorded file.
- clipping filter
- noise filter
- - multiple modes for removing noise, heavy filter even mostly removes included tones
- silence remover
- - Removes portions of silence
- high pass filter
- low pass filter
- gain filter
- stereo conversion
- appending tone name to beginning of audio file using text to speech
- appending custom mp3 to beginning of audio file


FFMPEG is required
eSpeak Library required if you want to append text to speech tone names to start of MP3

Linux Download - https://bcfirewire.com/icad_td_alpha_1.tar.gz
Windows Download - https://bcfirewire.com/icad_td_alpha_1.zip
RPi - not compiled or tested yet

Please do some testing and let me know what you think.
 

CDTbolt10033

Member
Joined
May 6, 2020
Messages
249
Location
Waterloo Region, ON
When trying to run the Alpha 2 I get the following error:

Windows 10

Unhandled Exception:

Traceback (most recent call last):
File "<dist\obf\main.py>", line 3, in <module>
File "<frozen main>", line 11, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "<lib\flask_request_handler.py>", line 1, in <module>
File "<frozen lib.flask_request_handler>", line 18, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "<lib\mysql_handler.py>", line 1, in <module>
File "<frozen lib.mysql_handler>", line 13, in <module>
ModuleNotFoundError: No module named 'mysql'
 
Last edited:

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
When trying to run the Alpha 2 I get the following error:

Windows 10

Unhandled Exception:

Traceback (most recent call last):
File "<dist\obf\main.py>", line 3, in <module>
File "<frozen main>", line 11, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "<lib\flask_request_handler.py>", line 1, in <module>
File "<frozen lib.flask_request_handler>", line 18, in <module>
File "PyInstaller\loader\pyimod02_importers.py", line 493, in exec_module
File "<lib\mysql_handler.py>", line 1, in <module>
File "<frozen lib.mysql_handler>", line 13, in <module>
ModuleNotFoundError: No module named 'mysql'

Redownload and try again. When I compiled and built for Windows I forgot the MySQL python library. I have rebuilt and reuploaded to the same link.
 

CDTbolt10033

Member
Joined
May 6, 2020
Messages
249
Location
Waterloo Region, ON
It seems Pushover is not working on it I put my group key and app key in and it's set up for the tone I want it to alert to. Another thing that could be added to the Pushover side of things is a custom alert sound selection from your pushover custom sounds upl;oaded like "Moto Min VI Standard alert tone". Also when trying to create a MySQL server database it says the following:

Internal Server Error
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
 
Last edited:

CDTbolt10033

Member
Joined
May 6, 2020
Messages
249
Location
Waterloo Region, ON
Oh, I forgot to add this since I can't edit my post above anymore but would it be possible to add an editable subject in the tone config in emails and pushover alerts for example:
Subject: Example Township Fire Dept
Body: Example Station Page Received at 13:41 on 3/5/20

TTD has the subject able to edit and I use that to label what township/county fire dept that page belongs to.
 

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
Fixed the issues keeping Pushover from sending.

You can edit the subject and body of the emails using the web gui or directly in the config.json.

For pushover find message_html_string. That is the body of the pushover message.
Code:
"message_html_string": "<font color=\"red\"><b>%detector_name%</b></font><br><br><a href=\"%mp3_url%\">Click for Dispatch Audio</a>"

For Email there are two seperate pre and post recording:

Code:
        "pre_record_subject": "Dispatch Alert - %detector_name%",
        "pre_record_body": "%detector_name% Alert at %timestamp%<br><br>",
        "post_record_subject": "Dispatch Alert - %detector_name%",
        "post_record_body": "%detector_name% Alert at %timestamp%<br><br> %mp3_url%"

variables

- %detector_name% - gives the detector name
- %timestamp% - gives a human readable timestamp
- %mp3_url% - gives link to uploaded mp3 but only works for post recording emails.


For MySQL, you need to be running a MySQL server somewhere and have a user, database, and password created. Then add those credentials to the config.json as well. Which can be done via web-gui.

For Windows - you can install XAMMP which comes with MySQL and phpadmin. Then create a user and a database for that user. Then add to config.json via webui or manual editing.

For Linux - install MariaDB or MySQL, Nginx or Apache, and PhpMyAdmin and create a user and a database for that user. Then add to config.json via webui or manual editing.

Linux Download - https://bcfirewire.com/downloads/icad_td_alpha_3.tar.gz
Windows Download - https://bcfirewire.com/downloads/icad_td_alpha_3.zip
Raspberry PI - Not Compiled for this release.
 
Last edited:

johnmac

Member
Feed Provider
Joined
Oct 6, 2003
Messages
159
Location
Westminster, Ma
Fixed the issues keeping Pushover from sending.

You can edit the subject and body of the emails using the web gui or directly in the config.json.

For pushover find message_html_string. That is the body of the pushover message.
Code:
"message_html_string": "<font color=\"red\"><b>%detector_name%</b></font><br><br><a href=\"%mp3_url%\">Click for Dispatch Audio</a>"

For Email there are two seperate pre and post recording:

Code:
        "pre_record_subject": "Dispatch Alert - %detector_name%",
        "pre_record_body": "%detector_name% Alert at %timestamp%<br><br>",
        "post_record_subject": "Dispatch Alert - %detector_name%",
        "post_record_body": "%detector_name% Alert at %timestamp%<br><br> %mp3_url%"

variables

- %detector_name% - gives the detector name
- %timestamp% - gives a human readable timestamp
- %mp3_url% - gives link to uploaded mp3 but only works for post recording emails.


For MySQL, you need to be running a MySQL server somewhere and have a user, database, and password created. Then add those credentials to the config.json as well. Which can be done via web-gui.

For Windows - you can install XAMMP which comes with MySQL and phpadmin. Then create a user and a database for that user. Then add to config.json via webui or manual editing.

For Linux - install MariaDB or MySQL, Nginx or Apache, and PhpMyAdmin and create a user and a database for that user. Then add to config.json via webui or manual editing.

Linux Download - https://bcfirewire.com/downloads/icad_td_alpha_3.tar.gz
Windows Download - https://bcfirewire.com/downloads/icad_td_alpha_3.zip
Raspberry PI - Not Compiled for this release.
404 file not found error when clicking on the download links
 

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
Alpha 12

Added:
per tone configuration for
- Pushover
- - Title
- - Alert Sound
- - HTML Body

- Pre and Post Recording Emails
- - Subject
- - HTML Body

Tones A B and C D - for those that want to detect stacked pages. Leave C D tones value 0 unless using them for detection.

Long tone detection by setting A C D tone freq 0 and setting B to your long tone and Length to long tone length

Linux Download - https://bcfirewire.com/downloads/icad_td_alpha_2.tar.gz
WIndows Download - https://bcfirewire.com/downloads/icad_td_alpha_2.zip
Raspberry PI - https://bcfirewire.com/downloads/icad_td_alpha_2_rpi.tar.gz
 

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
How are the audio input and output entered into the json? Can you post a syntax?


It is in the format of two integers one for input and one for output. If you change these to 99 and run the program, it should use whatever is default, and you can change via WebGUI under iCad Config->iCad Config->Audio Tab.

Code:
"audio": {
        "input_device_index": 12,
        "output_device_index": 12
},
 

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA

jschmall

Member
Premium Subscriber
Joined
Jul 15, 2017
Messages
83
Location
Anderson, CA

xicarusx

Member
Feed Provider
Joined
Oct 2, 2008
Messages
104
Location
Sayre, PA
Can I ask why you had to remove BCFY Calls support?


I removed it due to the fact BCFY Calls isn't meant to be using in the way I was using it for this software. It is frowned upon to just post only detected toneouts via BCFY Calls. They want a full audio stream seperated by transmissions.
 
Status
Not open for further replies.
Top