Check if device is still active

Added by lucase 4 months ago

Dear support,

I'm trying to implement requirement that application is going to check after specified interval if connection to device (phone, modem) is still active.
For example if bluetooth phone is connected and someone takes phone and walk away outside bluetooth range application will still be in a "connected mode".
Is there a way to ping device?

Kind regards,
Lucas


Replies (40)

RE: Check if device is still active - Added by lucase 4 months ago

ps. nothing unusual in logs.

2012.07.14-05.44.38: Sending: ATZ
2012.07.14-05.44.38: Response: ATZ<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.38: Found echo in response
2012.07.14-05.44.38: Sending: ATE0
2012.07.14-05.44.39: Response: ATE0<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.39: Found echo in response
2012.07.14-05.44.39: Sending: AT+CPIN?
2012.07.14-05.44.39: Response: <cr><lf>+CPIN: READY<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.39: Sending: ATE0
2012.07.14-05.44.39: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.44.39: Sending: AT+COPS=0,2
2012.07.14-05.44.40: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.44.40: Sending: ATE0
2012.07.14-05.44.40: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.44.40: Sending: AT+CMEE=1
2012.07.14-05.44.40: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.44.40: Sending: AT+CPMS?
2012.07.14-05.44.41: Response: <cr><lf>+CPMS: "ME",2,23,"ME",2,23,"ME",2,23<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.41: Sending: AT+CMGF=0
2012.07.14-05.44.41: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.44.41: Sending: AT+CNMI=0,0,0,0,0
2012.07.14-05.44.41: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.44.41: Ending Async ConnectedEventHandler call
2012.07.14-05.44.41: Sending: AT+CSCA?
2012.07.14-05.44.42: Response: <cr><lf>+CSCA: "+48601000310",145<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.42: Sending: AT+CPMS="ME","ME","ME" 
2012.07.14-05.44.42: Response: <cr><lf>+CPMS: 2,23,2,23,2,23<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.42: Sending: AT+CSCS=?
2012.07.14-05.44.42: Response: <cr><lf>+CSCS: ("IRA","GSM","UCS2")<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.44.42: Sending: AT+CNUM
2012.07.14-05.44.43: Response: <cr><lf>+CNUM: "Numer wlasny","669187015",129<cr><lf><cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.22: Sending: ATZ
2012.07.14-05.47.22: Response: ATZ<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.22: Found echo in response
2012.07.14-05.47.22: Sending: ATE0
2012.07.14-05.47.23: Response: ATE0<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.23: Found echo in response
2012.07.14-05.47.23: Sending: AT+CPIN?
2012.07.14-05.47.23: Response: <cr><lf>+CPIN: READY<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.23: Sending: ATE0
2012.07.14-05.47.23: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.47.23: Sending: AT+COPS=0,2
2012.07.14-05.47.24: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.47.24: Sending: ATE0
2012.07.14-05.47.24: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.47.24: Sending: AT+CMEE=1
2012.07.14-05.47.24: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.47.24: Sending: AT+CPMS?
2012.07.14-05.47.25: Response: <cr><lf>+CPMS: "ME",2,23,"ME",2,23,"ME",2,23<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.25: Sending: AT+CMGF=0
2012.07.14-05.47.25: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.47.25: Sending: AT+CNMI=0,0,0,0,0
2012.07.14-05.47.25: Response: <cr><lf>OK<cr><lf>
2012.07.14-05.47.25: Ending Async ConnectedEventHandler call
2012.07.14-05.47.25: Sending: AT+CSCA?
2012.07.14-05.47.26: Response: <cr><lf>+CSCA: "+48601000310",145<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.26: Sending: AT+CPMS="ME","ME","ME" 
2012.07.14-05.47.26: Response: <cr><lf>+CPMS: 2,23,2,23,2,23<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.26: Sending: AT+CSCS=?
2012.07.14-05.47.26: Response: <cr><lf>+CSCS: ("IRA","GSM","UCS2")<cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.47.26: Sending: AT+CNUM
2012.07.14-05.47.26: Response: <cr><lf>+CNUM: "Numer wlasny","XXX",129<cr><lf><cr><lf><cr><lf>OK<cr><lf>
2012.07.14-05.49.25: Sending watch dog message
2012.07.14-05.49.25: Sending: AT
2012.07.14-05.49.26: Response: <cr><lf>OK<cr><lf>

RE: Check if device is still active - Added by lucase 4 months ago

I've installed eltima serial port monitor software. In attachment you will find outcome.

com5port.html (113.6 kB)

com5portDump.html (10 kB)

com5portLine.html (202.6 kB)

RE: Check if device is still active - Added by admin 4 months ago

Hi,

Try to see if the attached patch helps.

Checked "Safe Connect" and "Safe Disconnect" in the Settings tab before you connect to the modem.

Thanks
Regards
admin

RE: Check if device is still active - Added by lucase 4 months ago

Hello,

this is a major progress. When I check safe connect / safe disconnect checkbox I'm able to reconnect!
I've done some test and when I'm doing only connect + hardware off without disconnect I'm getting an error: The requested resource is in use.
I can live with that, so thank you for a great job.

Does it going to be released in official channel?

Kind regards,
Lucas.

RE: Check if device is still active - Added by admin 4 months ago

Yes. This will be included in the next patch.

Thanks
Regards
admin

RE: Check if device is still active - Added by lucase 4 months ago

Hello,

could you please tell me when is it going to be possible to download patched version?

Kind regards,
Lucas

RE: Check if device is still active - Added by admin 4 months ago

Hi,

We will only release it early August. Meanwhile, you can use the patch attached with this thread, just do

config.SafeConnect = true;
config.SafeDisconnect = true;

when you are connecting to the modem.

Thanks
Regards
admin

RE: Check if device is still active - Added by lucase 4 months ago

Hello,

ok, I will stick to the patch, but could you please provide also 64 bit version?

Regards,
Lucas

RE: Check if device is still active - Added by admin 4 months ago

Hi,

Attached is the x64 version.

Thanks
Regards
admin

RE: Check if device is still active - Added by lucase 3 months ago

Hello,

since last patch and release 1.6.1.0 I've done tests and it seems that there is an error with functionality "safe connect/disconnect".
I'm using bluetooth handset instead of build/USB modem. When I'm using "safe connection" phone messages are:
1. Connected to "computer name"
2. Disconnected from "computer name"
3. Connected to "computer name"
This all in one sequence after connect button.

When I'm not using "safe connection" all I get is first point:
1. Connected to "computer name"

Unfortunately for bluetooth ports 1.2.3. sequence isn't so stable. Could you please check why connection is working like that?

RE: Check if device is still active - Added by admin 3 months ago

Hi,

Can you show me the log file that has 1, 2 and 3?

Is this only happening for bluetooth device?

Thanks
Regards
admin

RE: Check if device is still active - Added by lucase 3 months ago

Hello,

it's strange, but log from my previous post is for 1.2.3. sequence. I've tried that connection on several computers with WIN7, VISTA and always the same sequence.
I was wondering how to monitor connection with usb modem but there is no modem display to check that.
Bluetooth logs from port monitoring software is in attachment called: bluetooth conn.zip.

mylog_201208.log - messaging toolkit logs (5.4 kB)

RE: Check if device is still active - Added by lucase 3 months ago

Hello,

it's strange but attached to the previous post logs are for 1.2.3. sequence.
Logs from different monitoring software are in: bluetooth conn.zip (related logs from toolkit can be found in mylog 201208).

Unfortunately directly connected usb modem doesn't give any additional information in order to check if connection sequence is 1.2.3 or just 1.
I've used additional software in order to get any logs for usb modem - usb modem.zip.

Please look at connection sequence in bluetooth conn.zip

[08/08/2012 09:46:35]
33 IRP_MJ_CLOSE - Close a COM port (COM19)
    STATUS_SUCCESS
-----------------------------------------------------------------------------------------------------------
[08/08/2012 09:46:36]
36 IRP_MJ_CREATE - Opens a COM port (COM19)
    STATUS_ACCESS_DENIED
-----------------------------------------------------------------------------------------------------------
[08/08/2012 09:46:40]
37 IRP_MJ_CREATE - Opens a COM port (COM19)
    STATUS_SUCCESS

Regards,
Lucas

mylog_201208.log - messaging toolkit logs (7.1 kB)

bluetooth conn.zip (10.6 kB)

usb modem.zip (9.8 kB)

RE: Check if device is still active - Added by admin 3 months ago

Hi,

The safe disconnect fixes some issues as mentioned at http://zachsaw.blogspot.com/2010/07/net-serialport-woes.html

The CreateFile function should be the one causing additional event.

In our scenario, if you don't encounter the issue as mentioned in the blog post, can you use only the SafeDisconnect feature?

Thanks
Regards
admin

RE: Check if device is still active - Added by lucase 3 months ago

Hello,

some extensive tests and it seems that safe disconnect checked is enough to get it working. Thanks again for a great job!

Regards,
Lucas

« Previous 1 2 (26-40/40)