Running a card directly through command line

Here you are welcome to report any Push2Run bugs you may have encountered

if you know of a workaround, it would be great if you would mention that too
Post Reply
mrjabbey1
Posts: 4
Joined: Sat Dec 18, 2021 11:49 am

Running a card directly through command line

Post by mrjabbey1 »

Hi,

I am following the instructions at the bottom of the help page (https://www.push2run.com/help_v3.6.2.0.html) to use the Push2Run command line. Unfortunately, every time I have tried this (and with the simple 'open the calculator' card as well as other ones) a new Push2Run instance is created, and the card is not run.

I don't believe I am doing anything wrong but please let me know if this is working for others.

Thanks!
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Running a card directly through command line

Post by RobLatour »

I just ran a quick test, and it is working as it should for me.

Of note, if Push2Run is already running, after you run it on the command line passing a phrase into it, a new (second) instance of Push2Run will open for a moment, but should close right away after that.

Basically, the second instance sends a command to the first instance to run the Push2Run card with the listen for phrase matching what you entered on the command line, and then once the second instance has sent that command to the first instance, it (the second instance) shuts itself down.

Is that not what is happening for you?

Also, I assume you running the most current version of the program, which is v3.6.2?
mrjabbey1
Posts: 4
Joined: Sat Dec 18, 2021 11:49 am

Re: Running a card directly through command line

Post by mrjabbey1 »

Hi Rob,

Thanks for the reply. I am running v3.6.2 (in fact I did a fresh install today). The second instance does not close and doesn't seem to send the command to first instance.

I've attached screenshots of the card and the cmd command for reference in case there is something wrong there, but I can run the card normally and it works...

Thanks!
Attachments
open the calculator card.png
open the calculator card.png (17.74 KiB) Viewed 5600 times
open the calculator cmd command.png
open the calculator cmd command.png (2.63 KiB) Viewed 5600 times
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Running a card directly through command line

Post by RobLatour »

That's exactly what I have, and I've just tested on both a W10 and W11 machine.

Having that said, my best guess is that your firewall is blocking the second instance of Push2Run from talking to the first. The two communicate through something called a UDP broadcast. Basically, the second instance sends a UDP broadcast within your local machine (127.0.0.1 - the machine Push2Run is running on) using port 10410 telling the first instance to run the command.

Depending on your firewall, when you first run Push2Run you may get prompted to allow Push2Run to communicate on your network.

Here, for example, is a screenshot of what Windows Defender Firewall comes up with, and how you should respond to it for Push2Run.
ss1.jpg
ss1.jpg (84.58 KiB) Viewed 5592 times
For whatever reason, Defender defaults to 'Public Networks', which I've always thought was the worse default possible, it should be imho 'Private Networks', if not none at all by default, but in any case that's just my opinion. Regardless, if you are running Windows Defender Firewall, or any other Firewall, you may want to confirm that it is set up to allow Push2Run to communicate within your private network.

Please let me know if that helped.

Rob
mrjabbey1
Posts: 4
Joined: Sat Dec 18, 2021 11:49 am

Re: Running a card directly through command line

Post by mrjabbey1 »

Hi Rob,

Thanks for the reply, I have gone into windows defender and made sure that the Inbound & Outbound connections on Push2Run are on private domain. I still get the same outcome though. And I have made sure all other antiviruses have been disabled during testing too.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Running a card directly through command line

Post by RobLatour »

Can you please post the Push2Run session logs of both instances? The first being the session log from the instance of Push2Run that is already ready running, the second being the log from the second instance of Push2Run which opens up and stays open after you enter the c: prompt command.

We should see, in the first log, the following:

2021-12-18 18:20:33.435 - Incoming command line request ...
2021-12-18 18:20:33.435 - open the calculator
2021-12-18 18:20:33.681 - action completed successfully

If not the broadcast isn't getting through.

Also, I assume the Push2Run card for the command 'open the calculator' is turned on in the main window.
mrjabbey1
Posts: 4
Joined: Sat Dec 18, 2021 11:49 am

Re: Running a card directly through command line

Post by mrjabbey1 »

Hi Rob,

The 'Open the calculator' is turned on in the main window.Looks like nothing got sent. Session logs below:

First session for the original instance:
2021-12-19 13:26:22.351 - Push2Run version 3.6.2.0 started
2021-12-19 13:26:22.402 - Windows UAC notify feature is on
2021-12-19 13:26:22.403 - Administrative privileges are enabled
2021-12-19 13:26:22.566 - Current network adapter is WiFi
2021-12-19 13:26:22.615 - Network status is up
2021-12-19 13:26:24.485 - Connection with Pushbullet established
2021-12-19 13:26:24.818 - Daily database backup already run
2021-12-19 13:26:24.823 - Daily settings backup already run

Second session (opens once the cmd command is run)
2021-12-19 13:27:31.817 - Push2Run version 3.6.2.0 started
2021-12-19 13:27:31.870 - Windows UAC notify feature is on
2021-12-19 13:27:31.871 - Normal privileges are in effect
2021-12-19 13:27:32.078 - Current network adapter is WiFi
2021-12-19 13:27:32.149 - Network status is up
2021-12-19 13:27:34.095 - Connection with Pushbullet established
2021-12-19 13:27:34.409 - Daily database backup already run
2021-12-19 13:27:34.413 - Daily settings backup already run

Thanks for the help!
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Running a card directly through command line

Post by RobLatour »

Well, I'm just shy of 100% sure it's because the UDP broadcast is being blocked on your computer somehow.

There is are a couple of free programs, Wireshark and Rawcap that can be used to see if the broadcast is being produced.

Here is a screenshot, from my own system showing the detected UDP broadcast:
broadcast2.jpg
broadcast2.jpg (88.09 KiB) Viewed 5562 times

Having that said, at this point, I think it might be a good idea for us to work on this via e-mail, and assuming we find a resolution one of us can post back here with it.

If you're ok with that, please just send me a note at info@push2run.com and we can carry on from there.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Running a card directly through command line

Post by RobLatour »

For anyone following this thread - the issue appears to be the UDP broadcast used by Push2Run to communicate between instances of the program is being blocked on the computer being tested with.

Push2Run has now been updated in a beta version to approach this differently, and it will be generally released (shortly) with this change included.
RobLatour
Site Admin
Posts: 1016
Joined: Mon Feb 19, 2018 11:43 am

Re: Running a card directly through command line

Post by RobLatour »

Version 3.7 was released yesterday with an update (as outlined above) to correct this issue.
Post Reply