8devices Community https://www.8devices.com/community/ |
|
serial communication in lua https://www.8devices.com/community/viewtopic.php?f=1&t=218 |
Page 1 of 1 |
Author: | tijntje [ 01 Oct 2012, 09:16 ] |
Post subject: | serial communication in lua |
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? |
Author: | David [ 01 Oct 2012, 11:06 ] |
Post subject: | Re: serial communication in lua |
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 |
Author: | tijntje [ 02 Oct 2012, 12:55 ] |
Post subject: | Re: serial communication in lua |
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, ... |
Author: | ynezz [ 09 Oct 2012, 08:03 ] |
Post subject: | Re: serial communication in lua |
If it helps you, there's luars232 package for OpenWRT (not upstream yet): https://github.com/ynezz/openwrt/commit ... 1cc8627194 |
Author: | tijntje [ 14 Oct 2012, 09:58 ] |
Post subject: | Re: serial communication in lua |
@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 |
Author: | ynezz [ 26 Oct 2012, 06:48 ] |
Post subject: | Re: serial communication in lua |
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 |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |