New Plugin – ExternalNotificationPlugin

We have yet another plugin!

The ExternalNotification Plugin will allow you to connect a speaker, LED, strobe light, fame thrower or other device to notify you when a message has been received from the mesh network.

This was requested by @Lure.Exciting.Salads about a week ago and it was such a good idea, I thought it’d be good to make it available sooner than later.

The plugin will be available in the next version of the device firmware (and tomorrow’s nightly build). To configure it, we’ll also need a new version of the Python API.

Documentation:

Example video:

5 Likes

I downloaded 1.1.34 bins off nightly builds server, and updated meshtastic python API to version 1.1.33.

However, I’m not sure how to use this plugin. This is what I’m trying to do:

What I’m I doing wrong?

1 Like

The python API needs to be updated and rebuilt to support the new settings. Not sure when the next version will come out … @geeksville ?

I am a little confused.

The NotificationPlugin.md states

ext_notification_plugin_output
What GPIO is your external circuit attached?

GPIO of the output. (Default = 13)

But according to another thread GPIO 13 is used as a button to cycle through displays. Do we have a spot where we could start mapping GPIOs to some predetermined IOs. Obviously we are able to change them in code, but if we knew that GPIO13 was to cycle screens, GPIO15 is a notification LED etc we can solder according to docs and not have to change settings on firmware updates.

I’m with you on this. I’m using TTGO LoRa32 V2 1.6 board and on those GPIO12 is used to cycle screen while GPIO13 is used to connect external GPS module.
I understand all this can be edited but I’m not at that point yet.

GPIO 13 is only used for that purpose on the tbeam. There are not many pins that are commonly unused across boards, this is why the output pin for this plugin is a configuration option – to make it work for the largest number of possible devices.

I’m happy to change this if you have a better idea of where it could go as a default.

So you know, I use the tlora32 v1 as my main development platform. A pin mapping chart across different boards would be useful :slight_smile:

1 Like

Once the python API is updated, it’ll be a configuration option just like turning on the plugin.

2 Likes

I can’t wait to try it. I’m setting this up as a small pager type device (and tracker) for my kids when they are playing in the neighborhood. This LoRa32 V2 1.6 board allows me to package everything into approximately half the size as t-beam, using a small project box as enclosure.

2 Likes

This is what it sounds like when you have a passive buzzer instead of an active buzzer (Clicks very quietly. I put an LED in so that SOMETHING would work)

Also what a strange video, there’s such a dramatic/ominous noise at the beginning haha

4 Likes

Super cool! Can’t wait to see how you end up using this.

1 Like

Thanks to @mc-hamster I managed to add support for passive speakers using PWM. Going to clean up the code this week and pull request. (Nice little two-tone attention grabber)

Anyone interested in this feature being expanded? Flashing LED until acknowledged with button press?
Flash LED/Tone to confirm button press?
Power/reset tone?
Different “ring tones?”, or call it done at a single beep.

3 Likes

Good job, I’m very interested in this feature. I’m waiting for active speakers, should be here in a week or two.

Flashing LED until acknowledged but also buzzer buzzing once every 30sec until acknowledged. Buzzer can even have hardware toggle so it can be turned off or on as needed.

Different ring tones would be great also. For example if there ever is SOS button implemented, then that can activate special SOS tone.

2 Likes

A hardware switch would be very useful! I hadn’t thought of that.

2 Likes

Maybe I will cram a dip switch into my Pelican cases! Easy enable/disable on current and future hardware add-ons while in the field?

1 Like

I just received my active speakers today, surprisingly fast for AliExpress order. Right away I tried to build this in platformIO and enable the new plugin. However, tbeam booted up with rev 1.1.34 firmware and after a few seconds it shut off. It actually has screen contrast intensity indicator on the screen right from start, as if user button is pushed in.

These are the steps I took to flash new firmware:

  1. Clone GitHub project
  2. Modify external notification plugin .cpp file by uncommenting six lines, keeping default values
  3. Save external notification plugin .cpp file
  4. Build under env:tbeam
  5. Upload under env:tbeam

Both build and upload showed success. Can anyone tell me if I missed something or what could be the issue?

1 Like

Did you wire the speaker to pin 13? It is also used as an alternative for the user button by default.

You’ll have to change either the button pin or the speaker pin. @mc-hamster and I chatted about this a bit, and the hard part is choosing a pin that is universally open on all boards. I think I chose 2 as my new user button.

1 Like

I’m going to guess that to start you will want:

radioConfig.preferences.ext_notification_plugin_enabled = 1;
radioConfig.preferences.ext_notification_plugin_alert_message = 1;

If you can’t use GPIO 13, change this to something else:

radioConfig.preferences.ext_notification_plugin_output = 13;

Depending on your active speaker, you may want either an active low or active high output. If active low, you can leave the default as is. If active high, you will want to set:

radioConfig.preferences.ext_notification_plugin_active = 1;

2 Likes

Oh, I see. I will try to comment out alternate button on GPIO 13 in configuration.h file and try this again. Thanks for quick reply.

1 Like

You got it! You can set to any pin on line 174 in configuration.h

#define BUTTON_PIN_ALT 13

Or I think I also just changed the speaker output line 48 in ExternalNotificationPlugin.cpp

#define EXT_NOTIFICATION_PLUGIN_OUTPUT 13

If enough T-beam users mention it we’ll change the default :joy:

If you want to make that decision, go ahead. You’re already contributing to the plugin. :slight_smile:

1 Like