Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Serialization of CQC SMS Serial Interface Driver
In that case I wouldn't set the time to 20 seconds. Set it to something more reasonable and log an error if it fails to complete in that time. WaitFieldValue returns a status you can use in an If statement. So If it works, write the next message. Else, log an error and end the action. That would just be cleaner.
Dean Roddey
Explorans limites defectum
Thanks. Reason I am waiting 20 seconds is because I have numerous triggered events and some scheduled events that send out SMS messages.

Ideally, one would send the SMS driver a message and it would queue it and then send it. An SMS message queue.
That could be done, it was just too much to do by eye at the moment. And of course we can't just let those messages queue up without limit, so even then there would have to be a busy flag (or it just returns an error when you try to send another because too many are backed up.)
Dean Roddey
Explorans limites defectum
(08-24-2019, 06:54 PM)Dean Roddey Wrote: Use the Devices::WaitFieldValue (I think that's it.) It allows you to wait on a field to reach a value, or time out. That way you don't have to wait any longer than actually required.

Hey Dean. for Some reason the WaitFieldValue is not working even though running a test in action editor says it's working.

Setup in Action Editor:
[Image: Screen-Shot-2019-09-11-at-08-45-57.jpg]

Running a test:
[Image: Screen-Shot-2019-09-11-at-08-45-12.jpg]
End result is "Success" but I only receive the first message, not the second one:
[Image: Screen-Shot-2019-09-11-at-08-45-20.jpg]

I never receive the second text message even though the above notes "Success." The only thing that does work is placing a System:Tongueause(5000) in between each message sent. Then I actually receive both text messages.

[Image: Screen-Shot-2019-09-11-at-09-04-20.jpg]

SMS Messaging is at the core of my automation system and I'd really like to find out how to resolve this.
So a single SMS has a character limit of 160 characters. If you send more than 160 characters, those messages are transmitted by a process called concatenation that splits up the message into smaller parts, which are sent as individual SMS messages and recombined on the recipient's handset.

This may explain the amount of time needed to send some messages, however, the WaitFieldValue should account for this, no? That is, if the modem is not done sending a long message, then the WaitFieldValue should wait the prescribed time before moving onward.
Oh, one thing I didn't probably get right is that I need to reset the field upon the next write to the send message field. I'm probably not, so it's not making you wait and hence failing. Always a risk doing these things by eye. Let me do that and I'll post you another driver pack to try.
Dean Roddey
Explorans limites defectum
Oh, wait, this is all meaningless. I wasn't thinking straight. You write to the field. The driver does a call right there and sends the message. It doesn't return until the message it sent. So there's no point in having a busy field in this sort of scheme. You won't come back from the field write until the message is sent. A busy field would only be useful in an async/queued type of scheme. So that was sort of a brain failure on my part.

So that must mean that either the time limit isn't in the actual sending of the message, but some inter-message limit imposed by the target service, which we'd have to know in order to deal with. Or, there's something else that has to be done to wait for the message to be sent completely, which I have no idea about.

If you look in the logs, are seeing errors from the driver about trying to send messages? I.e. is the send to the SMS server failing because it's timing out, or is the send working, but the SMS server is maybe rejecting it in a way that we aren't seeing.

It would be worth setting up a simple button on a test template to do a send of two messages in a row. Flush the logs, hit the button, and see what happens both do you get an error back, and does anything show up in the logs. That would help us know where to look to move forward.
Dean Roddey
Explorans limites defectum
So, I made up 4 buttons and then pushed them all sequentially and then a single button that sent 4 sequential messages.

[Image: Screen-Shot-2019-09-11-at-18-32-53.jpg]

Individual button action:
[Image: Screen-Shot-2019-09-11-at-18-33-26.jpg]
Single button sending all texts.
[Image: Screen-Shot-2019-09-11-at-18-35-05.jpg]
Pushing the individual buttons (Test1, Test2, etc.) all messages were sent although if I could click on them fast enough, not all messages are sent.

Pushing the single button (Test1234) that sent all messages.. Not all messages were sent.
If you didn't see any errors in the logs, or get any error popups from the actions invoked, then it has to be some limit that the server is imposing, and it's just rejecting the messages (or the modem thinging we are talking to maybe is imposing it.) If so, we may need to remember the last time we sent one, and use that to prevent the next one from being sent within some minimum time.

If you start putting sleeps between the events on the four message one, maybe starting at 10 seconds, and start cranking it down at second at a time, at what point does the work/not-work crossover happen?
Dean Roddey
Explorans limites defectum
(09-11-2019, 03:44 PM)Dean Roddey Wrote: If you start putting sleeps between the events on the four message one, maybe starting at 10 seconds, and start cranking it down at second at a time, at what point does the work/not-work crossover happen?

5000 milliseconds pauses in between messages does the trick. Problem is that I have several triggered events that send SMS message. So, in each triggered event, I need a way to ensure that when it sends, that the message will not get dropped because some other triggered event it sending a different message.

Possibly Related Threads…
Thread Author Replies Views Last Post
  TTS Driver Error kblagron 7 768 03-03-2023, 01:05 AM
Last Post: kblagron
  Admin Interface Help Doesn't Work alexismtz13 1 647 04-28-2022, 01:14 PM
Last Post: Dean Roddey
  Driver for Amazon 4k Stick Darrie 3 898 01-15-2022, 02:21 PM
Last Post: znelbok
  CQSL Interface Driver connects but no control NightLight 3 950 10-26-2021, 01:12 PM
Last Post: NightLight
  6.0.0 Interface Viewer - Action Trace Mark Stega 1 864 03-09-2021, 06:39 PM
Last Post: Dean Roddey
  Cannot Bind Interface to 80 gReatAutomation 1 1,161 11-05-2020, 04:18 PM
Last Post: Dean Roddey
  ClickPLC driver now failing after upgrade znelbok 2 1,280 09-21-2020, 10:48 PM
Last Post: znelbok
  Pentair driver tom 5 2,436 08-02-2020, 11:29 PM
Last Post: kblagron
  Marantz receiver driver (IP) dlmorgan999 6 2,496 05-15-2020, 03:32 PM
Last Post: dlmorgan999
  Variables Driver Client gReatAutomation 4 2,039 04-25-2020, 12:46 PM
Last Post: gReatAutomation

Forum Jump:

Users browsing this thread: 1 Guest(s)