As you can tell, I have a problem with Gammu. I'm using Gammu to send SMS in conjunction with PRTG Network Monitor, which is used to monitor Networking Devices(i.e Servers, Switches, Routers, Firewalls) and whenever one of the important Services goes Down, PRTG executes some batchfiles I have created, which do Gammu calls to send SMS.
But, whenever one or more services goes down, some of the batchfiles don't get executed at all and I receive the followin error:
Error 102 Error opening device. Unknown, busy or no permissions.
I have seen many related topics to this problem, but I couldn't solve my problem through any of them.
I have configured logging for Gammu, so that everything gets logged whatever happens. I have two errors that are showing up in these logs:
[System error - CreateFile in serial_open, 32, "The process cannot access the file because it is being used by another process. "] [System error - SetCommState in serial_close, 6, "The handle is invalid. "]
I have a question about the first error "The process cannot access the file because it is being used by another process.". Which file is it talking about, Gammu or my batchfile?
Here is an example of how I setup my batchfiles:
cd c:\Program Files (x86)\Gammu\bin
Rem User1
gammu sendsms TEXT 0123456789 -text "%*" -report
Rem User2
gammu sendsms TEXT 0123456789 -text "%*" -report
I tried the timeout mechanism before executing the gammu sendsms, but it didn't work at all. Do you guys have any solutions on how I can make the execution wait, until other processes are finished, so that I don't get that message?
Here is the gammuconfig:
[gammu]
device = com4:
connection = at115200
logfile = gammulog
logformat = errors
[gammu1]
device = com3:
connection = at115200
logfile = gammulog
logformat = errors
thank you in advance.