Wavecom announced that easy scripting of its Q26 and WMP series is now publicly available, in alpha delivery:
This release is performed in a new way for Wavecom: open source (MIT license), with primary support from a dedicated Wiki (wavecom.com/lua/wiki/tiki-index.php) and from this forum. This dramatically simplified delivery process is expected to bring many advantages, one of them being a stronger open AT Developers community. We’ll do our bets to support Open AT Lua users through the wiki and the forum. Since you have the sources and the rights to do so, we encourage you to hack in the library as much as you want, and to contribute your improvements back to the community (although the MIT license doesn’t force you to, unlike GPL would).
I have been following the Open AT Forum for quite some time, and I believe that many problems described here find a fast and easy solution through Open AT Lua. I encourage you to give it a try. Among the stuff you might like:
- as opposed to AT commands, you not only send individual commands but whole programs. Plus, Lua code is human readable. For instance, opening the GPRS bearer and fetching the Google homepage would simply be:
wip.bearer_client("GPRS", { apn = 'orange-mib',
pin = 1234,
login = 'mportail',
password = 'mib' })
x=wip.client_create ("www.google.com", 80)
x:write ("GET / HTTP/1.0\r\n\r\n")
print(x:read())
x:close()
And you can simply type it in a telnet shell, no need for a compile/download/reboot cycle.
- multiple threads and blocking I/Os: no more mandatory state machines and callbacks to handle network events. This example, fetching a file from an FTP server from raw TCP into variable ‘data’, without relying on WIP FTP, should give an idea of how much simpler we’re talking about:
x, y = wip.tcp_client ("192.168.1.5", 21), nil
z = wip.tcp_server (1024, function(client) y=client; z:close() end)
if not y then z:wait "accept" end
x:write "USER anonymous\r\n"
x:write "PASS lua@wavecom.com\r\n"
x:write "PORT 192,168,1,4,4,0\r\n"
x:write "RETR data.txt\r\n"
data = y:read "*a"
x:write "QUIT\r\n"
y:close()
x:close()
You’ll also find in the samples a 100-ish lines web server, extensions giving it AJAX capabilities, RSS feeds, an FTP server, rerouting of AT commands from a TCP/IP connection, etc.
-
as opposed to C development, no more save/compile/download/reboot/fetch-traces cycle: you type “l’foobar.lua’” in a telnet shell running on the wireless microprocessor, and it downloads the source file from the FTP server runnning on your PC, compiles it, and runs it. Without rebooting. At any time, you can inspect and modify global variables, sockets, bearers, threads, all this through TCP/IP. If you’re not satisfied, change a couple of lines, re-type “l()”, see if you’ve fixed your issue. When you’re satisfied by your program, just type “save’foobar’” and your function is committed in flash memory.
-
most important, Lua is designed to interact perfectly with C code: legacy code in C and stuff that require C’s realtime performances can be integrated with Lua seamlessly, so you keep the best of both worlds.
So in short:
- if you’re using a Q26 or WMP based solution, have a look at Open AT Lua, it might help you with many of your issues.
- if you have difficulties with it, ask in this section, we’ll do our best to help you.
- don’t hesitate to annotate/improve/change the wiki, it’s yours!