You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Rick Companje 924285b51e update version information and releasenotes to stable 6 years ago
.settings Merge branch 'develop' 9 years ago
extra Include logrotate (+deps) in openwrt diffconfig. 7 years ago
src update version information and releasenotes to stable 6 years ago
test Integrate new release scripts with firmware. 9 years ago
.buildpath Initial checkin of Doodle3D WiFi-box project. Files in src directory belong in /usr/share/lua/autowifi on the device and needs several symlinks as described in the readme. 10 years ago
.gitignore Add doxify.sh to generate HTML code documentation using ldoc; update documentation in several utility files. 10 years ago
.project Add openwrt diffconfig files (referenced from online wiki); change eclipse project name to match repository name. 9 years ago
Config.in Update Makefile and Config.in to handle/describe new www directory and API test interface properly. 10 years ago
LICENSE.txt Add license + copyright info on external software. 9 years ago
Makefile copy print-fetch script to install dir 6 years ago
NOTICE.txt Update openwrt diffconfig to allow 802.11 driver to override regulatory domain stored in eeprom. 9 years ago
README.md Merge branch 'develop' 7 years ago
ReleaseNotes.md update version information and releasenotes to stable 6 years ago
config.ld Add LDoc configuration and slightly extend doxify.sh. 10 years ago
doxify.sh Add LDoc configuration and slightly extend doxify.sh. 10 years ago
license-spec.lua Update comment on possible log targets. 7 years ago
post-install.sh post install update to config for changes in 0.10.10 6 years ago
post-remove.sh Properly start and stop signin.sh on package installation and removal. 10 years ago
pre-remove.sh Properly start and stop signin.sh on package installation and removal. 10 years ago

README.md

WiFi box OpenWRT firmware package

General documentation can be found on the wiki: http://doodle3d.com/help/wiki. Source code documentation can be generated, see below.

Documentation

The script 'doxify.sh' generates HTML documentation of the source code in the directory 'docs'. Make sure the 'ldoc' program is installed on your machine and the LDOC variable in the script points there.

On OSX, this can be accomplished by installing it through luarocks (run sudo luarocks install ldoc). Luarocks can be installed using MacPorts. After installing that, the command would be sudo port install luarocks.

Command line interface

The Doodle3D API can be called using a terminal:

d3dapi p=/network/scan r=GET

Where the p parameter is the module you want to call and r is the method. Post request can be send using the same method:

d3dapi p=/printer/print r=POST

Parameters: TODO

Debugging Lua

Syntax errors in Lua can lead to tricky issues since they might only surface when the faulty code is actually being run.

One countermeasure for this is to use pcall instead of regular calls in many cases. To let the error 'happen' (which in turn gives information in the form of stack traces), tell the code to use regular calls by setting 'M.DEBUG_PCALLS' to 'true' in conf_defaults.lua.

Additionally, when the pcall setting is not enough, a second way of debugging is to take uhttpd out of the loop and invoke the Lua code from command-line. To do this, set 'M.DEBUG_API' to 'true' in conf_defaults.lua. Then invoke the API using the command d3dapi p=/mod/func r=POST where p= is followed by the API path and r= followed by either 'GET' or 'POST'.

Note that because stack traces are sent to stderr, this script redirects output streams to a separate log file: /tmp/wifibox.stdout.log; apart from these traces, the file should not contain any data.

Finally, the CGI gateway of uhttpd also uses this script, so the API can also be used to obtain stack traces by calling it as <wifibox-ip>/cgi-bin/d3dapi/<endpoint> (note the extra cgi-bin).