0
0
mirror of https://github.com/Doodle3D/doodle3d-firmware.git synced 2024-09-16 16:50:07 +02:00

Remove all content and replace with a link to the actual wiki.

Wouter R 2013-07-10 14:46:43 +02:00
parent 64b49bc4b4
commit 9ab5c7491d
15 changed files with 1 additions and 305 deletions

@ -1 +0,0 @@
(functionality breakdown / milestones)

@ -1 +0,0 @@
(repo, wiki, general resources like openwrt website etc.)

@ -1,25 +0,0 @@
# Outline of the WifiBox project
*TO ADD*: (openwrt-based, components:luacgi(+uci)+www-iface+init.d)
Consider this a sketch, including some ideas which might never end up in the final application.
* Printer driver interface
Perhaps using the idea of printer/protocol/firmware families can reduce code duplication
* _for each printer_: implementation of the interface (leaving room for elaborate code, e.g. an S3G implementation)
* Web interface
* Doodle3D interface
... (suggestions: drawing+shaping interface, management of previous drawings, sharing with other users, etc.)
* gcode/s3g/... upload interface as well as manual command execution
* Printing interface (track progress etc.)
* Called from Doodle3D interface, direct file upload and manual command execution
* Administration interface (wifi config, printer settings, miscellaneous like for instance usbip)
* Interface to fetch and upload models from/to services like thingiverse
* Automatic wifi setup
* Self-update mechanism
* Anything else...?
## Init script logic
When the device boots, the init script tries to find any known network. If one is found, it will connect to it, otherwise it switches to AP mode.
IT might be necessary to create a lockfile to prevent accidental reruns (when could this happen?). In this case a mechanism would also be needed to remove the file on shutdown and detect a stale lockfile (e.g. after unclean reboot).

@ -1,16 +0,0 @@
## Update mechanism
__TODO__: make this document intelligable
_Idea_: could the ipkg tool play a major part here? just releasing a new ipkg at the feed url then would be enough. just need a way to rollback..but ipkg can probably take care of that too
- create a rigid versioning system
- server-side script to report available versions (scans directory and reports back versions available in xml/json/plain)
- reported versions translate to archives and checksums (e.g. ?.tar.gz and ?.md5sum)
- all code must be contained within one directory, symlinks to place 'hooks' within the system
- updating should not only install/overwrite new files or symlinks but also remove old ones
- updater keeps at least the last-known-good version to rollback to
- the updater is part of the system; in case it gets broken accidentally there should be a command-line option (e.g. through fail-safe) to restore a previous version (or immediately fetch a new debugged one)
- (!) a fallback webupdater in case of booting trouble might be good to have
- create deploy script (included in release package; should probably work incrementally?)

@ -1,17 +0,0 @@
# Creating an OpenWrt package
In order to include the wifibox code in an OpenWrt image and have it deployed automatically, it must be available as a package. This could also prove useful with regard to auto-updating the code since ipkg can handle downloading, checksumming and upgrading automatically.
The basic requirements for this are the presence of a Makefile for the OpenWrt build system to read, a feed to discover the package and a publicly available download source for the package itself.
## Resources
* [Overview of the build system](http://www.ccs.neu.edu/home/noubir/Courses/CS6710/S12/material/OpenWrt_Dev_Tutorial.pdf)
* [Creating feeds (OpenWrt website)](http://wiki.openwrt.org/doc/devel/feeds)
* [Creating packages (OpenWrt website)](http://wiki.openwrt.org/doc/devel/packages)
* [Plain cross-compilation (OpenWrt website)](http://wiki.openwrt.org/doc/devel/crosscompile)
* http://hype-free.blogspot.nl/2009/04/compiling-software-for-openwrt-and.html
* [Hello world tutorial](http://manoftoday.wordpress.com/2007/10/11/writing-and-compiling-a-simple-program-for-openwrt/)
* http://vivekian2.wordpress.com/2007/03/28/building-your-own-package-for-openwrt/
* (site does not load) http://hanez.org/openwrt-building-software-packages.html
* https://forum.openwrt.org/viewtopic.php?id=10117
* [Another example Makefile](https://forum.openwrt.org/viewtopic.php?id=9951)

@ -1,23 +0,0 @@
# Web interfaces for viewing/sending Gcode
## To be reviewed
...
## Probably not
- R2C2_WebInterface
node.js
- WebRap
python no deps
- pronterweb
python no deps
## Discarded (too large, unusable interface, unsupported)
node.js -> no mips big endian
python -> only 200 k left on device...almost no room for dependencies
- BotQueue
- OctoPrint
python many deps (not all supported out of the box by openwrt)
- Printrun
- Repetier-Server
- printerface

@ -1,25 +0,0 @@
# Firmware variants
* Sprinter
* Marlin (forked from Sprinter)
g-code and m-code
* Jetty (forked from Marlin?)
* Sailfish / G3firmware
s3g
Uses s3g/x3g which requires substantial recoding of g-code. Several implementations:
- https://github.com/makerbot/ReplicatorG (java)
- https://github.com/makerbot/s3g (python)
- https://github.com/cbiffle/s3g-toolkit (C++, attempts to convert s3g files into s3g command streams)
* Repetier
Supports regular g-code as well as a binary encoded variant which can be translated directly.
---
http://www.reprap.org/wiki/List_of_Firmware
sprinter <- marlin <- jetty
marlin vs sprinter: https://github.com/ErikZalm/Marlin (extra gcodes)
sailfish (s3g?)
sprinter
repetier
binair+gcode (https://github.com/repetier/Repetier-Firmware/blob/master/Repetier/repetier%20communication%20protocol.txt)

@ -1,6 +0,0 @@
# Miscellaneous notes
- [source code of iwinfo (old revision)](https://dev.openwrt.org/browser/trunk/package/iwinfo/src/iwinfo_lua.c?rev=29403)
- [Press4Connect](https://github.com/nutbolt/press4connect/tree/master/files/p4config)
- Used [urlcode.lua](from https://github.com/keplerproject/cgilua/blob/master/src/cgilua/urlcode.lua) for decoding URLs

@ -1,29 +0,0 @@
# Analyzing uhttpd crashes
__TODO__: describe when this happens (sometimes in portal mode and always when webroot does not exist?).
- First, enable debug support in the binary by modifying package/network/services/uhttpd/Makefile: add `TARGET_CFLAGS += -ggdb3 -O0` below `TARGET_LDFLAGS`.
- Next, enable building the toolchain (we need a gdb which understands mips images).
- Make sure symbol stripping is disabled (under Global build settings) and check that other settings are correct as well (e.g. core dumps and process debugging enabled).
- After updating with the new firmware, enable core dumps by running `ulimit -c unlimited`.
- Stop uhttpd (`/etc/init.d/uhttpd stop`).
- Run it yourself: `uhttpd -f -p 80 -h /www`.
- Do something to make it crash and voila.
- After copying the file over to the host computer, open it in gdb with this command: `<gdb-executable> uhttpd <core-file>`.
The gdb executable can be found under the `staging_dir/toolchain/<target-spec>/bin` directory.
## Some handy gdb commands
From [here](http://stackoverflow.com/questions/5115613/core-dump-file-analysis).
- bt (backtrace)
- frame n (select stack frame n)
- info locals (display variables)
- list (display code)
- print v
Note that remote debugging is also supported: http://wiki.openwrt.org/doc/devel/gdb.
## Further notes
- The connected issue: <<issue 3>>
- [posts about uhttpd on openwrt](https://dev.openwrt.org/search?q=uhttpd)

@ -1,58 +0,0 @@
Set up OpenWRT on OSX
---------------------
Building was relatively easy in my case (Snow Leopard), but this might differ depending on OS/versions/etc. The guide I followed (roughly) is <http://thismachinechills.blogspot.nl/2013/02/installing-macports-with-openwrt.html>. I got along fine with only following these steps+notes:
- Install required macports dependencies...for me, Xcode's gcc worked just fine...so maybe that step can be left out.
- However, the longer list of ports just below must be installed or you will get missing dependencies during 'make prereq'.
- Create a case-sensitive HFS+ sparse image (10GB will do nicely).
- Fetch openwrt through svn and update feeds (aka packages).
- If you'd like all packages available for building in 'make menuconfig', run: 'scripts/feeds install -a'.
- build! (e2fsprogs worked fine for me but I'm not using Lion so...?)
Further notes:
- deselect everything but SquashFS under 'Target images' (e.g. jffs2 is not needed)
- under 'Target profile', for the TP-Link box, only select your specific model (scroll way down)
- I think luci must be enabled in menuconfig (under 'Luci'->Collections...)
- when flashing a new image, the sysupgrade one will do fine except the very first time (according to openwrt docs)
- enabling some drivers can only be done by modifying the kernel? (make kernelconfig)
- keep track of packages and features (de)selected in menuconfig (or modify by hand...)
- prefix path with macports path: 'export PATH=/opt/local/bin:$PATH'
- If the make system keeps complaining about outdated svn repo/executable versions, this seems not to be a problem
- wr703n reverse engineered <http://dangerousprototypes.com/2012/10/10/reverse-engineering-layout-of-tp-link-tl-wr703n-802-11n-router/>
- To get the new image on a device, follow this guide <http://wiki.openwrt.org/doc/howto/generic.sysupgrade> after getting the image on the device (copy it to /tmp). A warning 'Error fixing up TRX header' seems quite harmless.
- In case you end up with a broken ssh session, don't forget you can quit ssh by typing '~.' (on an empty line so hit enter before to be sure).
Various guides / links
======================
- WR703N openWRT setup: <http://wiki.xinchejian.com/wiki/Install_OpenWRT_on_TPlink_WR703N>
- WR703N wlan config: <http://companje.nl/doku.php?id=/openwrt>
- (osx cross-compile) <http://www.hsmm-mesh.org/hsmm-mesh-forums/view-postlist/forum-1-general/topic-12-building-openwrt-on-os-x.html>
- (osx cross-compile) <https://forum.openwrt.org/viewtopic.php?id=34676>
- (cross compile eigen code) <http://wiki.openwrt.org/doc/devel/crosscompile>
- (cross compile eigen code) <http://hype-free.blogspot.nl/2009/04/compiling-software-for-openwrt-and.html>
- (eclipse setup) <http://downloads.openwrt.org/docs/eclipse.pdf>
- Hardware extension (2 more USB ports) <http://www.kean.com.au/oshw/WR703N/>
- Mouse support (not a solution to the USB1 issue) <http://santiago-saldana.blogspot.nl/2010/01/mouse-working-in-openwrt.html>
- (GENERAL) run make using CPU idle time only, found here: http://wiki.openwrt.org/doc/howto/build
$ ionice -c 3 nice -n19 make -j 2
Build environment
=================
A script (possibly buggy) to set appropiate variables for cross-compiling openwrt code for the tp-link wr703n router. It assumes your image is called 'openWRT-build-fs-10GB'.
Source the script to modify current shell environment (using regular execution runs it in a temporary subshell).
cat<<EOF>set-openwrt-build-env
#!/bin/sh
export PATH=/opt/local/bin:$PATH:/Volumes/openWRT-build-fs-10GB/trunk/staging_dir/toolchain- mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin
export STAGING_DIR=/Volumes/openWRT-build-fs-10GB/trunk/staging_dir
export CC=mips-openwrt-linux-uclibc-gcc
export LD=mips-openwrt-linux-uclibc-ld
#this is used to pass to configure --target
export TGT_MIPS=mips-openwrt-linux-uclibc
EOF

@ -1,51 +0,0 @@
# Building OpenWrt for the WifiBox
__TODO__: add steps to clone openwrt, install required software, create an image (on OSX) and fetch package feeds
This page describes how to build an OpenWrt image for the WifiBox as well as additional steps to get it up and running.
_Note_: After changing enabled packages and building, make sure the image has been created (check the timestamp). If not, the contents were probably too large to fit on the device.
Luci and Python (even mini) are notable for causing this.
## 1. Adding a custom feed for the wifibox package
This has only been tested on OSX. The feed source will eventually be replaced with an online one.
- In the trunk directory, run `cp feeds.conf.default feeds.conf`
- Create a feed directory somewhere (e.g. /Users/me/wrt-wifibox-feed) and clone the WifiBox code into it as a subdirectory called `wifibox`
- Add this line to `feeds.conf`: `src-link wifibox /Users/me/wrt-wifibox-feed`
- Install the feeds' packages by running: `./scripts/feeds update wifibox; ./scripts/feeds install -a -p wifibox`
- While in the menuconfig in the next section, enable the wifibox package (listed under Miscellaneous).
## 2. Configuration changes
- set target system ar7xxx/ar9xxx
- set target profile to TP-Link MR3020 or WR703N
- disable all target images except squashfs
- enable 'Build the OpenWrt SDK' (or just toolchain?) in case you want to include your own packages
- enable Base System/wireless-tools (Utilities/iwinfo not needed unless cmdline tool is needed)
- (_ignore_) enable Languages/Lua/lua
- (_ignore_) enable Libraries/libuci-lua
- (_ignore_) Languages/Lua/libiwinfo-lua
- (_ignore this one, it crashes uhttpd_) enable Network/Web Servers&Proxies/uhttpd-mod-lua and follow this: http://wiki.openwrt.org/doc/uci/uhttpd#embedded.lua
- disable Network/ppp and Network/ppp/ppp-mod-pppoe
- (Global build settings) disable kernel symbol table, debug info and sysrq support
- (Global build settings) disable ipv6
### 2.1 Extra changes (optional)
- enable LuCI/Collections/luci if you want it
- enable LuCI/Themes/luci-theme-bootstrap if you like
- enable Languages/Python/python-mini if you want Python
- enable uhttpd debug messages (Network/Web Servers\/Proxies)
## 3. Further notes on setting up an unconfigured device
- it might be necessary to remove the host key from .ssh/known_hosts to prevent an ssh error
- it might be handy to add a host entry to `.ssh/config` so you don't need to use an account name and can use a hostname instead of IP
- set password to have the device switch from telnet to ssh
- upload `.ssh/id_rsa.pub` to `/etc/dropbear/authorized_keys` for public key authorization
- change the wired IP to something not very common to avoid collisions (e.g. 192.168.5.1/24)
- upload files under <<file extra/wifibox-restore-files master>> to the device
- deploy contents of src directory to /usr/share/lua/autowifi (create the directory first with mkdir -p)
- check the <<file src/README master>> in the src directory for final setup steps

14
Home.md

@ -1,13 +1 @@
# The Doodle3D WifiBox Wiki
This contains notes previously kept in several local files. Keeping notes here is more maintainable and integrates nicely with the issue tracker as well as the repository.
## Milestones
A number of milestones have been created in the issue tracker. Bitbucket sorts them alphanumerically (kind of) so internal milestones are prefixed with '0_', release versions with higher numbers and anything else without any prefix. 'IP' stands for 'Internal Progress'.
- (0_IP_1) First development milestone, implementation of basic supporting functionality.
- (0_IP_2) Second development milestone, same as 0_IP_1 but in a larger scope.
- (0_IP_n) Nth development milestone, at some point one has to be defined at which all core functionality is present and working reasonably well.
- (1.0) First release version.
- (Later) Indeterminate, but nonetheless worthwhile implementing at some point.
The Doodle3D WiFiBox wiki can be found here: <http://www.doodle3d.com/wiki>.

@ -1,40 +0,0 @@
## Table of contents
1. The Doodle3D Wifibox
1.1 Introduction
1.2 Planning overview
1.3 Resources
2. Firmware
[2.1 Overview](2.-Firmware/2.1-Overview.md)
2.2 RESTful API
3. Research
3.1 Outline for self-update functionality
3.2 Notes on packaging the code
3.3 3D printing related
3.3.1 Webinterfaces for sending/viewing gcode
3.3.2 Various firmware implementations
4. Everything else
4.1 Miscellaneous notes
4.2 Analyzing uhttpd crashes
A1 Building OpenWrt
A2 Preparing OpenWrt for Wifibox
## ---old---
[Building OpenWrt](wiki/BuildOpenwrt)
[Analyzing uhttpd crashes](wiki/UhttpdCrash)
[Outline for self-update functionality](wiki/SelfUpdater)
[Miscellaneous notes](wiki/MiscNotes)
[An outline of the project structure](wiki/ProjectOutline)
[Webinterfaces for sending/viewing gcode](wiki/GcodeSenders)
[Various firmware implementations](wiki/Firmwares)
[Notes on packaging the code](wiki/Packaging)
## ---aanpassen---