How to tell if a OrbBasic program is running - sphero-api

Is there a way to see if there is currently a OrbBasic program running on Sphero. I'm working on an app for cats and I want to check whether a orbbasic program is running when i start my app.

There is currently no API call to determine if there is a program running. If you just need to make sure a program is running, I suggest sending an abort call and then send down the program you want to run.

Related

Start/stop process in embedded linux

I have my own embedded Linux system on PocketBeagle board. I have developed a simple gpio application in C that issues an on/off command to one of the pins of the connectors of the board. The application is called gpio_aa6 and located at /root.
The first challenge was to find a way to launch my application automatically after booting the board. I found two ways to do that; the first was to add an entry to etc/rcS directory. This entry is a simple script file that launches my application. The second way was to edit /etc/inittab file and add an entry to that file (::respawn:/root/gpio_aa6). In both these ways my application was launched successfully: but I am still not sure if this is the right way to launch my application automatically.
Then I came to the second challenge, how can I stop my running application, as the respawn re-launches the application if it's terminated?
I am communicating with the board in two ways; via a serial communication (using screen terminal) and via web sever (root#192.168.42.2). I have tried to use Ctrl+C, Ctrl+Z, Ctrl+\, but couldn't stop the program from being continue running. Then I used command "killall" with killsignals -9 or -15, it seems that the program is interrupted but it's launched again directly after that.
My application is to run infinitely, but I need to stop it sometimes to update it and re-launch it again.
Is there any suggestion how to overcome this problem?
Thanks.
Both solutions you have used are correct. I personally prefer the option of adding an init script to /etc/init.d though.
I believe the behavior that you observe that you apparently can't kill the program is because you are starting your program from inittab, with the respawn keyword, which precisely tells the init program to restart your application when it exits. If you actually check the PID of your application, you will see that it changes everytime you kill it.
Therefore, I would recommend you to use an init script instead, with which you can implement start and stop actions. See ./package/lldpd/S60lldpd for a basic example in Buildroot.

How to continue running a python program in the background

I'm writing a Python 3 program in Windows and I would like to be able to continue running the program in the background (not in the taskbar) to gather information.
I was able to create it as a service, but I need admin privileges to run and it stops immediately!
It sounds to me like what you want is to make your program a Windows service. There's a bunch of good information in this other question: Is it possible to run a Python script as a service in Windows? If possible, how?

Observing and running a program when another program is ran

Lets say I have One.exe and Two.exe. I would like to have a script that will run Two.exe as soon as One.exe is ran and finished loading.
Now, I was wondering what is the better way to do it:
have a script that will be started along with Windows and just sit
quietly in the background, listening for when One.exe will get
started and loaded.
Somehow attach a script to One.exe, so when it runs, the script runs
Two.exe
some other ideas that I don't have yet.
I haven't done any batch scripts yet, so I wanted get into the right way so I know what to search and read about.
Is my idea possible to get realized at all?
Add a simple delay after one.exe is launched with ping or timeout commands.

Perform an action when a program starts

Let's say I wanted to run a batch file when a specific EXE is started. Are there any hooks for this in the Win32 API?
I'm using VCL with Delphi, but general info on this would be nice as well.
The program is supposed to run in the background, and, when the user starts an application, the program detects this, checks whether the application matches the criteria and runs the associated batch file if so.
Have you tried to use the Create Process Function of Delphi?
Here is a small link that it can guide you for the process:
http://snipplr.com/view/59064/using-createprocess-to-execute-programs/

Application to watch what an executable does?

I need to find out exactly what files/directories a Lua program uses so I can try to only pack what it needs into a ZIP file, and come up with a simple way to deploy this script.
I used SysInternals' Process Monitor, but I'm surprised by the small amount of information it returned while it watched the program (For Lua users out there, it's wsapi.exe, which is the launcher for the light-weight Xavante web server).
Does someone know of a good Windows application that can completely monitor what a program does, eg. something like a live version of the venerable PCMag's InCtrl5.
Thank you.
Process monitor will catch everything. If it's not catching the action then it must be happening in a different process. Try filtering based on the files you expect to be used rather than the process you expect it to happen in.

Resources