www.8devices.com
|
|
|
Page 1 of 1
|
[ 6 posts ] |
|
serial communication in lua
Author |
Message |
tijntje
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 |
|
|
David
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 |
|
|
tijntje
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 |
|
|
ynezz
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 |
|
|
tijntje
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 |
|
|
ynezz
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 |
|
|
|
Page 1 of 1
|
[ 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
|
|