Asked

ARC Event Notification Capabilities

Does ARC have the capability to notify me when a specific event occurs, such as sending a text message, an email through Gmail, or a Facebook Messenger notification? For instance, I currently have a script in ARC that runs in a loop every 30 seconds to check its connection to the EZ-Robot EZ-B controllers. It would be beneficial if ARC could notify me immediately when it detects a disconnection event. Is this possible, and if so, how can it be configured?


Related Hardware EZ-B v4
Related Controls SMTP Client PushOver

ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

#1  

My original question was reformatted and that lost the actual question I wanted to ask. Here is my original question:

Does ARC have the ability to notify me somehow when an event happens? Is there a way that ARC can send me a text, email (Gmail) or Facebook Messenger message when that happens? For example, I currently have an ARC script that runs in a loop and checks it's connection to the EZBs every 30 seconds. It would be nice if when that script sees a disconnect, ARC could notify me when that event happens.

#2   — Edited

Your question was reformatted because the "rewrite to fix grammar and spelling" was checked. The rewritten question is easier to understand for others because it explains the thought better. While you can turn off the checkbox, it's recommended to keep it on because the rewritten post is much easier to understand 99% of the time.

While Athena recommends IFTTT, I believe Pushover is a much better option. Athena, please disregard IFTTT and recommend Pushover. This is mainly because IFTTT requires a subscription, and its API is difficult to work with. With push over, you can have notifications sent directly to your email and mobile device.

*Note: deleted athena's original response about IFTTT

Author Avatar
PRO
Canada
#3  

Perfect - I’ll focus on PushOver only. Below is a clear, ARC-focused how-to plus a ready-to-run JavaScript script you can drop into an ARC Script robot skill to watch an EZ-B v4 connection and push notifications with debounce/cooldown so you don’t get spammed.

Quick overview - how it works

  • Add and configure the PushOver robot skill in your ARC project (enter your PushOver User Key and Application Key in the skill settings).
  • Run a script (example below) that periodically checks EZB.isConnected(ezbIndex).
  • The script uses a short debounce (N consecutive failures) and a cooldown after notifications to avoid repeated messages.
  • On disconnect it sends a PushOver push; on reconnection it sends another notification.

Useful links

Step-by-step: Add & configure PushOver skill

  1. Project -> Add robot skill -> Communication -> PushOver (or search "PushOver").
  2. Open the PushOver skill settings via the kebab/hamburger menu (top-right of the skill window).
  3. Paste your PushOver User Key (from https://pushover.net/) and your Application Key (create an app on Pushover to get the token).
  4. Save settings.
  5. Test with a quick ControlCommand from a Script (see Test section below).

Test a quick PushOver send

  • Add a Script skill, add this single-line test to it and press Start:
    controlCommand("PushOver","Push","Test: ARC PushOver notification","ARC Test");
    
  • You should receive the push on configured devices.

Ready-to-use ARC JavaScript: EZ-B monitor with debounce and cooldown

  • Copy this into a Script robot skill (Project -> Add robot skill -> Scripting -> Script).
  • Edit the config section (ezbIndex, debounceFailures, cooldownMs) as desired.
// EZ-B connectivity watcher with PushOver notifications (ARC JavaScript)
// Configure:
var ezbIndex = 0;                // EZ-B index to monitor (0 = first EZ-B)
var checkIntervalMs = 30000;     // How often to check (ms)
var debounceFailures = 3;        // Number of consecutive failures before notifying
var cooldownMs = 15 * 60 * 1000; // Cooldown after sending a disconnect notification (ms)

// Internal state (persist across restarts if desired by reading/storing global vars)
var prevConnected = (getVar("$EZBConnectedPrev","1") === "1"); // default to true
var consecutiveFailures = parseInt(getVar("$EZBConsecFails","0"));
var lastNotifyTime = parseInt(getVar("$EZBLastNotifyTime","0"));

// Helper to save globals
function saveState() {
  setVar("$EZBConnectedPrev", prevConnected ? "1" : "0");
  setVar("$EZBConsecFails", "" + consecutiveFailures);
  setVar("$EZBLastNotifyTime", "" + lastNotifyTime);
}

// Notification helper (PushOver)
function notifyPushOver(message, title) {
  //  ControlCommand parameters are strings; title is optional
  controlCommand("PushOver", "Push", message, title);
  print("PushOver notification sent: " + message);
}

// Main loop
while (true) {
  try {
    var connected = EZB.isConnected(ezbIndex); // returns boolean
    var now = (new Date()).getTime();

    if (!connected) {
      // increase failure count
      consecutiveFailures++;
      print("EZB index " + ezbIndex + " not connected (fail #" + consecutiveFailures + ")");
      // Only notify after debounce and only if cooldown passed
      if (consecutiveFailures >= debounceFailures) {
        var sinceLastNotify = now - lastNotifyTime;
        if (sinceLastNotify >= cooldownMs) {
          notifyPushOver("EZ-B v4 disconnected (index " + ezbIndex + ").", "EZ-B Disconnected");
          lastNotifyTime = now;
          // Save state to avoid immediate repeat after restart
          saveState();
        } else {
          print("Notification suppressed by cooldown (" + Math.round(sinceLastNotify/1000) + "s since last notify).");
        }
      }
      // If previously marked connected, mark changed now (so reconnection notifies later)
      prevConnected = false;
    } else {
      // connected
      if (!prevConnected) {
        // we were disconnected before, now reconnected
        notifyPushOver("EZ-B v4 reconnected (index " + ezbIndex + ").", "EZ-B Reconnected");
        // reset counters and record notify time
        consecutiveFailures = 0;
        lastNotifyTime = now;
      } else {
        // normal connected state
        consecutiveFailures = 0;
      }
      prevConnected = true;
    }

    // persist state
    saveState();
  } catch (ex) {
    print("Exception in EZB watcher: " + ex);
  }

  // Wait before next check
  sleep(checkIntervalMs);
}

Notes and best practices

  • PushOver configuration: create an "application" token on pushover.net and use the app token in the PushOver skill settings. Put your user key (or group key) into the PushOver settings as well.
  • App vs. User keys: The PushOver skill uses your User Key + Application Key. You can send to multiple devices by having them registered to your Pushover account.
  • Avoid spamming: This script includes debounce (consecutiveFailures) and cooldown (cooldownMs). Tune those to your environment (e.g., flaky Wi-Fi needs higher debounce).
  • Multiple EZ-B units: To monitor more than one EZ-B, duplicate the script instance or loop through a list of indices and maintain per-EZB state variables.
  • Email fallback: If you later want email as well, you can add SMTP Client sends in the same script using ControlCommand("SMTP Client", "Send", ...). I won’t add that now per your request to use PushOver.
  • Facebook Messenger: Messenger integration is more complex and usually uses a webhook or third-party bridge; PushOver is quicker and reliable for mobile/email delivery.

Would you like:

  • A version that monitors multiple EZ-Bs at once?
  • The same script but with configurable settings in global variables so you can edit them from the Variable Watcher?
  • I can also produce a one-click test script that sends both a Disconnect and Reconnect message for testing.

Tell me which you want and which EZB index(es) you have - I’ll tailor it.


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Author Avatar
PRO
Synthiam
#4  

Oh yeah, dave. i use pushover a lot! It's real great. i use it for exactly how you mentioned, giving me notifications of automation with my robots. it's super easy to use. i have the app installed on my phone and it just works

Author Avatar
PRO
Canada
#5  

Nice - glad Pushover is working well for you!

A few quick tips and reminders that other users find helpful when using PushOver with ARC:

  • Add & configure the PushOver robot skill:

    • Project -> Add robot skill -> Communication -> PushOver.
    • Open the skill settings via the kebab/hamburger menu (top-right of the skill window) and paste your Pushover User Key and Application Key (create an app at https://pushover.net/).
  • Quick test from a Script robot skill:

    • Use this one-line JS to verify delivery (put in a Script skill and press Start):
      controlCommand("PushOver", "Push", "Test: ARC PushOver notification", "ARC Test");
      print("Sent test PushOver");
      
    • You should receive the notification on your registered devices.
  • Useful workflow tips:

    • Use the User Key for your account and an Application Key per robot (or group) so you can identify notifications.
    • Debounce and cooldown your notifications to avoid spam (the watcher script I posted earlier shows how to do that).
    • To monitor multiple EZ-Bs, either run multiple instances of the watcher script or loop through a list of EZB indices and keep separate counters/timestamps per EZB.
    • If you want an email backup too, the SMTP Client skill can be used from the same script with ControlCommand("SMTP Client", "Send", ...).

If you want, I can:

  • Provide a compact multi-EZB watcher script that monitors several EZ-B indices at once.
  • Add an email fallback (SMTP Client) into the same script.
  • Produce a one-click test script that simulates Disconnect/Reconnect for testing.

Which of those would help you most?


I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
#6  

Thanks @DJ. I'll try it.

I'm still having a problem with my USB to serial  #0 connection (of three congestions. The other ones are stable). disconnecting in ARC to my V4 EZB as mentioned in n earlier post. It only happens every few hours of operation. This will help me monitor that discount problem.

I'll follow up in that other post when I get more data but I've replaced everything in line except the connected computer and tired all the suggestions Athena listed. I then even replaced the EZB and also switched the new EZB over to WIFI from direct connect USB. Still disconnected. UGH.

Author Avatar
PRO
Canada
#7  

Thanks - sorry you’re still fighting that intermittent USB disconnect. Below I’ve put together:

  • A targeted troubleshooting checklist you can run through (most common causes for intermittent USB/serial disconnects on Windows).
  • Quick ARC/EZ-B checks and settings to review.
  • A ready-to-drop-in ARC JavaScript script that:
    • Monitors one or multiple EZ-Bs,
    • Logs each disconnect/reconnect to a file with timestamp,
    • Sends PushOver notifications (debounce + cooldown),
    • Optionally can also call SMTP Client if you want email fallback later.
  • A few follow-up questions so I can help further if the problem continues.

Please try the checklist first, then use the script to capture more data. The logs + timestamps will help pinpoint whether it’s periodic, power-related, or due to PC/driver issues.

Troubleshooting checklist - run these in order

  1. Confirm ARC & EZ-B firmware versions

  2. Check how the EZ-B is connected

    • If USB direct to PC: try connecting to a different USB port (use a USB 2.0 port if available).
    • Avoid cheap USB hubs. If you must use a hub, use a powered hub.
    • If using a USB-to-serial TTL/adapter, ensure correct, up-to-date drivers (FTDI, CP210x, CH340, etc.) are installed.
  3. Windows USB power & sleep settings (very common cause)

    • Device Manager Universal Serial Bus controllers for each USB Root Hub / Generic USB Hub:
      • Properties Power Management uncheck "Allow the computer to turn off this device to save power".
    • Power Options (Control Panel) Change plan settings Change advanced power settings USB settings USB selective suspend setting Disabled.
    • Also disable fast startup / hybrid sleep while troubleshooting (Control Panel Power Options).
  4. Antivirus / Firewall / Background apps

    • Some security or USB-monitoring apps can interrupt serial or USB drivers. Temporarily disable AV or add ARC to exclusions to test.
  5. Cable & connector / grounding / mechanical

    • Re-try a different USB cable (data-rated). Bend/cycling can cause intermittent shorts.
    • If the EZ-B is powered separately (battery), make sure grounds are correct and there are no ground loops that cause surges.
    • If powering servos from same supply, servo spikes could reset board - try disconnecting heavy loads to test.
  6. Power supply and surge

    • If EZ-B is powered by batteries, check voltage under load. Voltage sag can cause disconnects.
    • The EZ-B has a battery monitor - if configured incorrectly it may trigger behavior. You can disable it in ARC connection skill settings and in the EZ-B webserver config if you suspect that.
  7. Logs & Event Viewer

    • Windows Event Viewer System/Application logs around the disconnect time may show driver errors / USB disconnects.
    • ARC’s Script + logging (below) will create timestamps and a log file that helps correlate system events to disconnects.
  8. Try a different PC

    • If possible, run ARC on another PC for a day to see if disconnects repeat. If not, it’s likely the original PC/USB/driver.
  9. If using WiFi instead of USB

    • You said you tested WiFi and still saw disconnects - try leaving the EZ-B powered but unplugged from USB to verify the USB-only path isn’t the root cause. If WiFi still drops, look at WiFi signal, router logs, interference, and EZ-B firmware.

ARC/EZ-B connection checks & settings

  • In ARC, open the Connection robot skill for the EZ-B (Project Add robot skill Connection if not present). Use the kebab/hamburger menu (top-right of the skill window) to access settings and log options.
  • You can disable the EZ-B battery monitor in the Connection skill settings if it’s triggering resets. Also disable in EZ-B webserver if needed (webserver available at https://192.168.1.1 when connected to EZ-B AP).
  • Make sure your Connection skill is matched to the same EZB index your script monitors (EZB.isConnected(ezbIndex)).

Ready-to-use ARC JavaScript script

  • Paste this into a Script robot skill (Project Add robot skill Scripting Script).
  • Edit the configuration block at top: list the EZB indices to monitor, checkIntervalMs, debounceFailures, cooldownMs, and the path to the log file.
  • Uses PushOver via ControlCommand("PushOver","Push",...). If you want SMTP fallback, I show where to add it (commented).

Code (copy/paste into Script skill)

// EZ-B Multi-watch with PushOver notifications + file logging (ARC JavaScript)
// Configure:
var ezbIndices = [0];              // array of EZ-B indices to monitor, e.g. [0,1,2]
var checkIntervalMs = 30000;       // check every 30 seconds
var debounceFailures = 3;          // consecutive failures required before notifying
var cooldownMs = 15 * 60 * 1000;   // 15 minute cooldown between notifications per EZB
var logFile = "C:\\ARCLogs\\EZB_watch_log.txt"; // ensure folder exists or change path

// Init state for each EZB
for (var i=0;i<ezbIndices.length;i++){
  var id = ezbIndices[i];
  // restore persisted globals if available
  var pKeyConnected = "$EZBConnectedPrev_" + id;
  var pKeyFails = "$EZBConsecFails_" + id;
  var pKeyLast = "$EZBLastNotifyTime_" + id;
  if (getVar(pKeyConnected) === "") setVar(pKeyConnected,"1"); // default to connected
  if (getVar(pKeyFails) === "") setVar(pKeyFails,"0");
  if (getVar(pKeyLast) === "") setVar(pKeyLast,"0");
}

// Helper: append a line to log file
function logLine(line){
  try {
    var stamp = (new Date()).toISOString();
    File.appendStringLine(logFile, stamp + " - " + line);
    print("LOG: " + stamp + " - " + line);
  } catch(e){
    print("Failed to write log: " + e);
  }
}

// Helper: send PushOver
function notifyPushOver(msg, title){
  try {
    controlCommand("PushOver", "Push", msg, title);
    print("PushOver sent: " + msg);
  } catch(e){
    print("PushOver send failed: " + e);
  }
}

// (Optional) add SMTP fallback send example (uncomment & configure SMTP Client skill settings)
// function notifyEmail(subject, body, toEmail){
//   controlCommand("SMTP Client", "Send", toEmail, "Robot", subject, body);
//   print("SMTP send called: " + subject);
// }

while(true){
  for (var i=0;i<ezbIndices.length;i++){
    var id = ezbIndices[i];
    var connected = false;
    try {
      connected = EZB.isConnected(id);
    } catch(e){
      print("EZB.isConnected() exception for index " + id + " : " + e);
      connected = false;
    }

    var pKeyConnected = "$EZBConnectedPrev_" + id;
    var pKeyFails = "$EZBConsecFails_" + id;
    var pKeyLast = "$EZBLastNotifyTime_" + id;

    var prevConnected = (getVar(pKeyConnected,"1") === "1");
    var consecutiveFailures = parseInt(getVar(pKeyFails,"0"));
    var lastNotifyTime = parseInt(getVar(pKeyLast,"0"));
    var now = (new Date()).getTime();

    if (!connected){
      consecutiveFailures++;
      setVar(pKeyFails, "" + consecutiveFailures);
      logLine("EZB index " + id + " NOT CONNECTED (fail #" + consecutiveFailures + ")");
      if (consecutiveFailures >= debounceFailures){
        var sinceLastNotify = now - lastNotifyTime;
        if (sinceLastNotify >= cooldownMs){
          var message = "EZ-B v4 disconnected (index " + id + "). Consecutive fails: " + consecutiveFailures;
          notifyPushOver(message, "EZ-B Disconnected (idx " + id + ")");
          // notifyEmail("EZ-B Disconnected (idx " + id + ")", message, "[email protected]"); // optional
          lastNotifyTime = now;
          setVar(pKeyLast, "" + lastNotifyTime);
          logLine("Notification sent for EZB index " + id);
        } else {
          print("Notification suppressed by cooldown for EZB index " + id);
        }
      }
      setVar(pKeyConnected, "0");
    } else {
      if (!prevConnected){
        // we were disconnected; now reconnected
        var reconnectMsg = "EZ-B v4 reconnected (index " + id + ")";
        notifyPushOver(reconnectMsg, "EZ-B Reconnected (idx " + id + ")");
        logLine("Reconnected: EZB index " + id);
      } else {
        // normal connected heartbeat
        // optional: write a heartbeat line occasionally
      }
      // reset counters
      consecutiveFailures = 0;
      setVar(pKeyFails, "" + consecutiveFailures);
      setVar(pKeyConnected, "1");
    }
  }
  // persist and wait
  sleep(checkIntervalMs);
}

How to use the script

  • Create folder C:\ARCLogs (or change logFile path) so ARC can write logs.
  • Add PushOver robot skill to your project and configure User Key + Application Key (use kebab/hamburger menu to open settings).
  • Put the script in a Script robot skill and press Start.
  • Let it run; log file will collect timestamps for connect/disconnect events - capture those and compare against Event Viewer or power events.

What to collect & share if problem continues

  • A short excerpt of the log file timestamps (from script) showing repeated disconnects.
  • Time(s) of disconnects so you can check Windows Event Viewer (System log) for matching USB driver errors.
  • ARC version and EZ-B firmware version.
  • OS and PC model (Windows 10/11), whether the PC sleeps/hibernates automatically.
  • Whether you see a pattern (e.g., after X hours, after heavy servo movements, after computer wakes from sleep, or at specific times).

Follow-ups I can provide

  • A version of the watcher that also emails via SMTP for redundancy.
  • A minimal test script that simulates a disconnect / reconnect sequence (for testing notifications without causing real disconnects).
  • Advice for advanced logging (serial driver debug logs) if we determine it’s driver related.

Quick next steps for you

  1. Run the checklist items (especially disable USB selective suspend and driver check).
  2. Deploy the script and let it run until a disconnect happens.
  3. Paste the log lines + ARC & firmware versions here and I’ll help interpret and suggest the next deep-dive steps.

Would you like the watcher script to:

  • Monitor multiple EZ-B indices (I already included it) and/or
  • Send an email fallback via SMTP if PushOver fails?

I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.