[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4694: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4695: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4696: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
8devices Community - View topic - serial communication in lua
www.8devices.com
View unanswered posts | View active topics It is currently 23 Apr 2024, 19:30



Reply to topic  [ 6 posts ] 
 serial communication in lua 
Author Message

Joined: 17 Apr 2012, 19:24
Posts: 4
i'm trying to communicate between the carambola module and a xbee radio.
They are connected by a serial connection.

The preferred language is python, but due to the size of the flashrom i will switch to lua.

I did soms tests on a raspberry pi with the luars232 library, this library is not available on carambola. It needs to be crosscompiled.

Is there example code available for serial communication in lua? Or does someone has experience with xbee and carambola?


01 Oct 2012, 09:16
Profile
User avatar

Joined: 16 Dec 2011, 14:44
Posts: 105
Location: The Netherlands
You do not need a library to communicate with RS232. The serial ports are available as files you can read to/from: /dev/ttyS0 and /dev/ttyS1

Have a look here on how to do that: http://www.hackinglab.org/lua/luasource.html

_________________
| |


01 Oct 2012, 11:06
Profile

Joined: 17 Apr 2012, 19:24
Posts: 4
Are you pointing to the upper part of the page, or to the examples with the RS232 LUA extension which uses the EZ24Lib?

How do you deal with baudrate, RTS/CTS, interrupts, breaks when you connect through the file-system?

I really need more low level functions to control the serial port.
One of the requirements is to bootload the xbee module, to do this you have to send break characters, toggle baudrates, ...


02 Oct 2012, 12:55
Profile

Joined: 13 Apr 2012, 10:49
Posts: 15
If it helps you, there's luars232 package for OpenWRT (not upstream yet):

https://github.com/ynezz/openwrt/commit ... 1cc8627194


09 Oct 2012, 08:03
Profile

Joined: 17 Apr 2012, 19:24
Posts: 4
@ynezz:

I get following error when I want to compile the librs232 package:


cc1: error: unrecognized command line option "-Wno-unused-but-set-variable"
make[6]: *** [luars232.lo] Error 1
make[6]: Leaving directory `/home/martijn/openwrt/dragino/build_dir/target-mips_uClibc-0.9.30.1/librs232-1.0.3/bindings/lua'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/home/martijn/openwrt/dragino/build_dir/target-mips_uClibc-0.9.30.1/librs232-1.0.3/bindings'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/martijn/openwrt/dragino/build_dir/target-mips_uClibc-0.9.30.1/librs232-1.0.3'
make[3]: *** [/home/martijn/openwrt/dragino/build_dir/target-mips_uClibc-0.9.30.1/librs232-1.0.3/.built] Error 2
make[3]: Leaving directory `/home/martijn/openwrt/dragino/package/librs232'
make[2]: *** [package/librs232/compile] Error 2
make[2]: Leaving directory `/home/martijn/openwrt/dragino'
make[1]: *** [/home/martijn/openwrt/dragino/staging_dir/target-mips_uClibc-0.9.30.1/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/martijn/openwrt/dragino'
make: *** [world] Error 2


14 Oct 2012, 09:58
Profile

Joined: 13 Apr 2012, 10:49
Posts: 15
It's probably, because you're using older compiler/OpenWRT. Remove '-Wno-unused-but-set-variable' from this line[1] and try again. Meanwhile, I'll work on some better solution.

1. https://github.com/ynezz/librs232/blob/ ... ile.am#L10


26 Oct 2012, 06:48
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 6 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.