Re: How start with LUA scripting
Postby fft » Thu Nov 06, 2008 4:56 pm
what part didn’t you understand?
Why a lot of the standard examples just do not work including this
lua_interactive thing…
Using:
Fastrack supreme : 20
Development kit R73
Windows XP(SP3)
SuSE linux 11
After a lot of hacking, I DID manage to get a C example application running using
visual C+6.0 as the development system - this method ALMOST works…
The code uses the RTC,SMS and GPIO to sense the state of GPIO 21&25
and send SMS messages. Quite a bit of the Wavecom GPIO stuff appears not to
work, but hacked around that. Not very enouraging though…
The way to get started is to:
- first, of course, downlowd lua_interactive on the WMP devkit!
On the face of it, seems quite reasonable this…
If one uses the wavecom ‘wizard’ as instructed to build lua_interactive example
for 1MB+ and uploads it on to a fastrack supreme : 20 (R73) then
nothing happens on giving AT+WOPEN=1.
The wavecom still responds to terminal commands, so the uploaded
application has just not run at all…
If the build is done for 256K instead, then one gets
rjp@pctop:~> serialterm.py
�����[LUAW][MEM] reserving 101 KB for Lua mempools
[LUAW][MEM] Reserving 2600 bytes out of 104160 for 8-blocks pool
[LUAW][MEM] Reserving 5160 bytes out of 101560 for 16-blocks pool
[LUAW][MEM] Reserving 19320 bytes out of 96400 for 20-blocks pool
[LUAW][MEM] Reserving 23160 bytes out of 77080 for 24-blocks pool
[LUAW][MEM] Reserving 9000 bytes out of 53920 for 28-blocks pool
[LUAW][MEM] Reserving 20560 bytes out of 44920 for 32-blocks pool
[LUAW][MEM] Reserving 24360 bytes out of 24360 for 76-blocks pool
[LUAW][MEM] memory pools ready
[LUAW] load library base…uses 3246 bytes
[LUAW] load library table…uses 756 bytes
[LUAW] load library string…uses 1030 bytes
[LUAW] load library package…uses 1753 bytes
[LUAW] load library debug…uses 1396 bytes
[LUAW] load library strict…uses 2074 bytes
[LUAW] load library scheduling…uses 11945 bytes
[LUAW] load library timer…uses 569 bytes
[LUAW] load library options…uses 1376 bytes
[LUAW] load library channels…uses 13415 bytes
[LUAW] load library bearers…uses 5249 bytes
[LUAW] load library tcp…uses 4253 bytes
[LUAW] load library flash_read…uses 2486 bytes
[LUAW] load library flash_write…uses 6110 bytes
[LUAW] load library rawflash…uses 1273 bytes
[LUAW] load library shell…uses 13385 bytes
[LUAW] load library misc…uses 979 bytes
[LUAW] load library bootload…uses 6570 bytes
[LUAW] load library ad…uses 2320 bytes
[LUAW] load library at…uses 9822 bytes
[LUAW] load library mem…uses 1344 bytes
[LUAW] load library print…uses 3296 bytes
[LUAW] load library sms…uses 45 bytes
[LUAW] RUN [thread 0x180ed22c]
[LUAW] Starting telnet server
[WIP] new TCPSERVER 0x180eef0c
[UART1]: open: → DISCONNECTED
[UART1]: PPP start: → PPP CONNECTING
[UART1]: startsrv: → CONNECTING
After which, the serial terminal connection is gone.
The first time this happened, I wired the boot pin on the connecter to ground
and used the DWLWIN application to dump the standard firmware back in
thinking that something must have gone wrong with the build/install.
After repeating everything and getting the same result again, I then assumed
that UART1 had been ‘grabbed’…
I tried the (documented) procedure for PPP connection from windows (XP:SP3 )-but
without much confidence. Justified. Failed to connect.
Used pppd under linux to try and get a connect that way.
After some tinkering, managed to get the connect attempt past
the PAP challenge
[This is (presumably) one of the reasons that the windows connect is
failing, but I don’t know where all that stuff is hidden on windows,
so probably easier to use linux…]
but now unable to stop the wavecom from
disconnecting. I does not appear to behave like a normal
dial-up modem as there seems to be no ‘chat’ dialogue.
set up and lauch an IP connection between the PC and the module, over the UART/Com ports link (UART1 by default).
This part is a bit painful, as windows has a cumbersome support for PPP over serial cables.
Dead right… I could put it stronger than that.
Just follow carefully the indications in the appropriate manual appendix.
Naahh- something seriously wrong here. At a guess, being blocked by some kind
of security measure, but can’t see what.
Here is the pppd stuff that (appears to) get as far as the dial attempt…
Quite a bit of this is guesswork - but no choice really without any
clear information to go on.
rjp@pctop:~> sudo bin/wavecom_pppd.sh setup
wavecom pppd added to /etc/ppp/peers/wavecom_linux
/dev/ttyS0 115200 crtscts noauth debug nodeflate
local 192.168.1.100:192.168.1.4
connect ‘/usr/sbin/chat -v -f /etc/ppp/wavecom_chat’
wavecom chat added to /etc/ppp/wavecom_chat
ABORT “ERROR”
ABORT “ALARM”
“name:” “^Uwipuser”
“word:” “\q123456”
“ispts” “\q^Uppp”
rjp@pctop:~> sudo bin/wavecom_pppd.sh start
Starting pppd …
Connect script failed
pppd code: 8
rjp@pctop:~> tail /var/log/messages
Mar 23 10:55:51 pctop sudo: rjp : TTY=pts/1 ; PWD=/home/rjp ; USER=root ; COMMAND=bin/wavecom_pppd.sh setup
Mar 23 10:55:59 pctop sudo: rjp : TTY=pts/1 ; PWD=/home/rjp ; USER=root ; COMMAND=bin/wavecom_pppd.sh start
Mar 23 10:55:59 pctop pppd[4566]: pppd 2.4.4 started by rjp, uid 0
Mar 23 10:55:59 pctop chat[4567]: abort on (ERROR)
Mar 23 10:55:59 pctop chat[4567]: abort on (ALARM)
Mar 23 10:55:59 pctop chat[4567]: expect (name:)
Mar 23 10:56:44 pctop chat[4567]: alarm
Mar 23 10:56:44 pctop chat[4567]: Failed
Mar 23 10:56:44 pctop pppd[4566]: Connect script failed
Mar 23 10:56:44 pctop pppd[4566]: Exit.
Frig to ‘get past’ PAP challenge.
rjp@pctop:~> sudo cat /etc/ppp/pap-secrets
Secrets for authentication using PAP
client server secret IP addresses
localhost * 123456
That’s about it for now.
Any ideas anyone? Judging by the rest of the stuff in this forum, someone HAS
managed to get LUA to connect/run. Question is how did they do it?