Callerid Virtual Com port reading problem

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Callerid Virtual Com port reading problem

Post by Lagi Pittas » Wed Nov 23, 2016 10:48 pm

Hi

I purchased the CTI Comet USB CallerID Gizmo.

It adds a virtual com port to my machine that works fine using realterm (http://realterm.sourceforge.net/)

Try as I might with Livecode (went to bed 6am this morning) I cannot get the correct bytes/characters


I've run the program in the ide, standalone and on different machines - no joy.
Its not even close I have used the read from file with the number of characters and int1 and uint1 (same values)

If I Use until empty or eof the thing just goes nuts - no data at all.

Here is what I get with realterm in ascii
€...447X34X3X59X..11231759.
the Xs are replacements because that is my mobile number

the hex is
80 1A 02 0C 34 34 37 99 33 34 99 33 99 35 39 99 01 08 31 31 32 33 31 37 35 39 07
(the 99 are replacements for my real numbers)

the o2 is the marker that says the next byte holds the number of characters of the caller id ie OC is hex for the 12 numbers following the 01 says the following byte (08) are the number of bytes in the time and the last byte is the checksum

Livecode gives consistent bytes (not garbled) but the documentation says if the first byte is not 80H (128 decimal) then all bets are off, it isnt a callerid string.

In this case th first 2 bytes I always get are 0 and 27 decimal

and the rest are
69,10,40,80,64,8,49,69,18,26,18,10,18,2,18,8,8,38,83,83,38,26,45,65,26,66,42,74,42,122

Any ideas?

The one consistent thing is livecode - I have run it on 3 different phone lines as well - and the realterm works.


here is the salient code

Code: Select all

on getit
   wait 300 milliseconds  
   read from file gPort  for 2 int1
   put "First " & it  & cr after fld "lst"
   put it into gdat
   read from file gPort  for 30 int1
   put it &  " --- " & lnx  && the long time  &   CR after field "lst"
   put it after gdat

end getit
the lnx is just incremented every time i phone in.
gdat was for printing in the messagebox

btw with all the changes I made many times the field "lst" was not refreshed until i broke out of the loop using <ctrl .>

locking and unlocking cursor did nothing, putting waits of 3 seconds or more after opening and closing and reading the serial port did not update the field either.

Any ideas appreciated

Regards Lagi

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Callerid Virtual Com port reading problem

Post by capellan » Thu Nov 24, 2016 10:30 pm

Hi Lagi,

> Any Ideas?

Yes, Could you try your code with older versions of Livecode and MetaCard?
For example, these old versions http://www.canelasoftware.com/mc/

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Callerid Virtual Com port reading problem

Post by Lagi Pittas » Fri Nov 25, 2016 6:07 pm

Hi Alejandro,

From that I assume the thing is broken - never to be fixed on 6.7.xx.

I fixed my problem though, can't be arsed to install older versions and waste more time.

I Downloaded a competitor system that shall be nameless.

From Download install and modifying a tutorial was about 40 minutes. It worked in the IDE so I purchase the windows deployment version as it was only $99 - a no brainer really, as that's all I need for now.
I have to get it to talk to livecode either via text files or sockets ... but 40 minutes versus 4 late nights $99 is very cheap.

And I had to stop myself a few times typing put xxx instead of A = xxx :!:

Thanks for your suggestion , I will do it when I have a little time (ha!!) just for edification.

Regards Lagi

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: Callerid Virtual Com port reading problem

Post by capellan » Sat Nov 26, 2016 1:37 am

My educated guess is that features that are rarely or never used
are not updated... For example, all Display Postscript commands
(used in early Linux versions and Unix) do not exists anymore.

Almost the same fate happened to the image file formats
PBM, PGM, and PPM... but then I filed a bug report and
LiveCode team fixed the problem.


Al

Lagi Pittas
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 365
Joined: Mon Jun 10, 2013 1:32 pm

Re: Callerid Virtual Com port reading problem

Post by Lagi Pittas » Sat Nov 26, 2016 10:44 am

Hi

I've been using the com port not to read
But to send an single byte to open a cash draw so I assumed it works.

It might explain therefore why at the start when I tried to send bytes with timing Parameters it didn't work. I never thought it was my my tool that could. E the cause.

That was days wasted again. It would be nice to be told though.

Lagi

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”