To configure the script settings select “Script Notification” in the Halt Notifier window and click Settings (see Figure 1). The Script Settings window opens (see Figure 2).
In the Script Settings window, you select the script file you want to execute when a halt occurs. The window also shows a list of default scripting languages that are supported. You can add or remove any scripting language or reset the list to the default scripting languages.
Select a Script File
To use Script Notification, you must select a script file in the Script Settings window.
To choose a script file, click Browse. See Figure 3. The script file language should be within the list of scripting languages in the Script Settings window. If it does not match, add the scripting language (see Add a Scripting Language) to the list and then select the script file.
When MPLAB® X IDE encounters a breakpoint, the selected script is executed and the output of the script file, if any, will be directed to the MPLAB X IDE output window. The Project name, Project directory, Debug directory and reason for halt information will be passed as an argument along with the script (see example below).
Example: Python script to send a text message via Verizon
A script can contain whatever actions you want to take place when a halt occurs. One example is sending a text message. See the next two topics on how to send a text message using WhatsApp and Twitter.
Send a Text Message Using Yowsup and WhatsApp Messenger
Yowsup is a python library that lets you use the WhatsApp service. It allows you to login and provides you with all the capabilities of an official Whatsapp client. You can create a full-fledged custom Whatsapp client. Refer to this url for more details:
https://github.com/tgalal/yowsup
Send a Text Message Using Twitter
There are several Twitter API’s available for sending messages. All of Twitter’s APIs are based on the HTTP protocol. Any software you write which uses Twitter’s APIs sends a series of structured messages to Twitter’s servers.
There are many scripting languages supported by Twitter. Refer to this link for more details:
https://dev.twitter.com/overview/api/twitter-libraries
Add a Scripting Language
To add a scripting language, click Add. A new row is created within the list. See Figure 4.
Double-click in each empty field (do not use the <TAB> key) and type in the appropriate Display Name, Executable, and Extension. When done, press the <ENTER> key. Then, you can Select a Script File.
Delete a Scripting Language
To delete a scripting language from the list, click anywhere in the row to be deleted and click Delete. See Figure 5. Default scripting languages cannot be deleted.
Reset the Language List
To return the scripting language list to the default settings, click Reset. See Figure 6 and Figure 7 for before and after reset views.