LiveCode Serial Problems - will they ever be fixed?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

LiveCode Serial Problems - will they ever be fixed?

Post by andrewferguson » Wed Mar 23, 2016 5:46 pm

Hi all,

I encountered this issue before when I tried to write a LiveCode app to interface to an Arduino. LiveCode constantly crashed, refused to open the driver, etc... I eventually solved the issue by downgrading to LiveCode 6.

Unfortunately, I'm now on a 64-bit GNU/Linux computer, and LiveCode 6 doesn't run on 64-bit GNU/Linux.

What I need to do is have read / write support for a simple serial device. I had hoped this would be easy. It's not.

The eventual program will be cross platform, but for now I'm just trying to get it to work in *both* LiveCode 7 and 8, on GNU/Linux. The serial device appears as '/dev/ttyACM0', and data can be transmitted received using a text editor! Open the text editor to see what was last received, save some text into the file to transmit. LiveCode does not work with this. It can write data, but it cannot read it. It just returns empty. Opening the /dev/ttyACM0 file in a text editor shows that the data has been sent (and subsequently clears the buffer that should have been cleared when LiveCode read the data).

Can anyone advise for a simple, cross-platform method of serial? Python can do this easily (I've tried it), but I do want to stay with LiveCode, even for a bit longer...
Thanks,
Andrew

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9580
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: LiveCode Serial Problems - will they ever be fixed?

Post by dunbarx » Wed Mar 23, 2016 6:48 pm

Andrew.

I use a gadget (USB Service Plus, by Boenig and Kallenbach) to interface LC with the real world, but did not know there was a way to do so with Arduino. Is there a framework for this?

Craig Newman

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: LiveCode Serial Problems - will they ever be fixed?

Post by andrewferguson » Wed Mar 23, 2016 7:57 pm

Not a framework as such, just the Arduino serial printing data which can then be received from LiveCode through "open driver..." command.

I've found a solution. I don't particularly like it (and I'm not looking forward to working with an alternative for Windows), but I can just use the shell() command with 'cat' and 'echo' to read / write serial data.

It makes me think, though, that serial is one of the areas that LiveCode seriously underperforms. I'm dreaming I know, but once the LC team have some free time, a new serial library would be nice... (like the new socket / sound / vector libraries that are coming).

AxWald
Posts: 578
Joined: Thu Mar 06, 2014 2:57 pm

Re: LiveCode Serial Problems - will they ever be fixed?

Post by AxWald » Thu Mar 24, 2016 1:05 pm

Hi,
andrewferguson wrote:Unfortunately, I'm now on a 64-bit GNU/Linux computer, and LiveCode 6 doesn't run on 64-bit GNU/Linux.
Oooops? I know it's off topic, but I got the latest 6.* STABLE running on 64-bit Solus. Only - it doesn't display any fonts yet, like shown here by Richmond.

Seems all that's lacking is 32-bit libpango, and it isn't available for Solus :/
Maybe your distribution has it, or you can make yourself a package?

Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7215
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: LiveCode Serial Problems - will they ever be fixed?

Post by jacque » Thu Mar 24, 2016 3:59 pm

You can do the same thing as your text editor does by using "open file" instead instead of "open driver". Then just treat the com port as a file, and read and write to it. See "open file" in the dictionary.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

andrewferguson
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 184
Joined: Wed Apr 10, 2013 5:09 pm

Re: LiveCode Serial Problems - will they ever be fixed?

Post by andrewferguson » Sun Mar 27, 2016 10:26 pm

Hi Jacque,

Thanks for the advice, but for some reason that didn't work (no idea why, opening the file for write and writing data to the device worked fine...). Anyway, now the device is refusing to send any data to the /dev/ttyACM0 file - just my luck! I can still receive data through 'screen /dev/ttyACM0 115200', but not through the file!

But that's not a LiveCode issue, so I shouldn't go around moaning here...

All the best,
Andrew

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: LiveCode Serial Problems - will they ever be fixed?

Post by richmond62 » Mon Mar 28, 2016 6:28 am

6.7.10 runs superbly on Xubuntu 15.10 64 bit.

Mind you: why bother, when there's "7", and, in due course "8" ?

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: LiveCode Serial Problems - will they ever be fixed?

Post by mwieder » Wed Mar 30, 2016 5:32 am

LC 6.7 does indeed run on 64-bit linux. You have to install the ia32lib libraries first (or later) in order to run any 32-bit binary.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: LiveCode Serial Problems - will they ever be fixed?

Post by FourthWorld » Thu Jul 25, 2019 5:04 pm

FWIW this serial bug has been fixed in LC 9.5rc1:
https://quality.livecode.com/show_bug.cgi?id=12315
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply

Return to “Talking LiveCode”