Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iOS App for WebRIVA - CTC CQC
#71
(03-31-2018, 04:11 AM)lcrowhurst Wrote:
(03-31-2018, 02:07 AM)znelbok Wrote: So is this using the Listening TCP trigger driver to work with the new functionality - if s what port is being used.  The port being used by the WebRIVA server can't be used.

What is the line termination CR, LF or both?

Sorry I haven't got a CQC so hopefully Im answering this correctly.

But yes the listening TCP driver, I don't know what port it uses , but in the setting for CTC CQC under the Today widget section you can set the port that is used by CQC.

I add a \n (LF) to any text entered.

i missed the Today section in settings - so that all makes it easy now.  I'll do some testing with it later tonight
Mykel Koblenz
Illawarra Smart Home
Reply
#72
OK, First comments

The driver want to connect to the port and if the server i.e. iOS is not listening then there is no connection and the driver will not connect. Only when you go to the widgets does iOS create the port and the driver then connects.

When you press one of the buttons to train the driver you can see that CQC has seen the data in the log files, but you can not re-send the command again by pressing the button again - it needs to be sent three times to train the driver and it appears that the iOS widget will not allow the command to be sent more than once - Please check if this is an app restriction or apple restriction.

Once the widget is closed off and you return back to the home screen the driver drops back to not connected because the connection is not persistent.
Mykel Koblenz
Illawarra Smart Home
Reply
#73
I didn't think about that. So maybe the HTTP one would have been a better idea, since in that case the iOS program would be the client and the driver is the listening server. It would be pretty easy to convert it to that form. The only thing in the program that would need to change is that it would issue an HTTP GET instead of a sending a raw text value over a socket. Parameter would be sent as URL query parameters. The names don't matter, so ?v1=x&v2=y and so forth.
Dean Roddey
Software Geek Extraordinaire
Reply
#74
"The driver want to connect to the port and if the server i.e. iOS is not listening then there is no connection and the driver will not connect. Only when you go to the widgets does iOS create the port and the driver then connects."

Sorry I was under the impression that the CQC acted as the server . I havent got a CQC, so wrote some code for the Wiser that i originally created the app for, so that is acted as the server. When you press a button on the Widget it creates a connection , sends the command and closes the connection.

“When you press one of the buttons to train the driver you can see that CQC has seen the data in the log files, but you can not re-send the command again by pressing the button again - it needs to be sent three times to train the driver and it appears that the iOS widget will not allow the command to be sent more than once - Please check if this is an app restriction or apple restriction.”

The Button in the widget should be able to send the  command s as many times as you need, to the “CBus Wiser” I can send as many times as I like


“Once the widget is closed off and you return back to the home screen the driver drops back to not connected because the connection is not persistent.”

The connection is only created once a button is pressed


“I didn't think about that. So maybe the HTTP one would have been a better idea, since in that case the iOS program would be the client and the driver is the listening server. It would be pretty easy to convert it to that form. The only thing in the program that would need to change is that it would issue an HTTP GET instead of a sending a raw text value over a socket. Parameter would be sent as URL query parameters. The names don't matter, so ?v1=x&v2=y and so forth”

As answered above, yes the iOS is the the client. I i change the code to issue a HTTP Get , can you give a couple of examples of the Url (address and parameters) I would need to send. Im guessing the parameters can still be entered in the Button send box.

Can the CQC Trigger driver act as /be altered to act as a server?
Reply
#75
As a rule the trigger drivers don't act as servers for security reasons. They will only connect to things that they know they should connect to. But I was a bit brain friend when I wrote that last night. The HTTP one of course has the driver as the server. And there is also a listening version of the generic trigger driver. So as long as they use that one, then, yeh, your application would be the client connecting to it.

I guess when the client disconnects, the driver consider's that it has 'gone offline'. It was mostly written I guess with the scenario in mind where the other side was some sort of other server or device that would always be there. But it shouldn't really consider the client not being connected as an offline condition since they could be mobile devices that come and go.

I'll take a look at that, but in the meantime, you are good as you are, so ignore the above.
Dean Roddey
Software Geek Extraordinaire
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)