-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDIRECTIONS
131 lines (94 loc) · 3.7 KB
/
DIRECTIONS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#=======================
Overview
#=======================
1. Customize and install OpenWRT router operating system on your router
2. Build coffeed/coffeec packages and install on the router
3. Build and install hardware (not included in these instructions)
#=======================
BUILD OPENWRT for your router
#=======================
It has to be a specific revision of OpenWRT because we need to apply a kernel patch
1.
svn checkout https://svn.openwrt.org/openwrt/trunk@30950 trunk
This will create a folder called "trunk". This is the OpenWRT build system that will allow you to create a firmware to install on your router as well as build the different packages (coffeed and coffeec).
2.
Then you have to move the attached kernel patch in CoffeedHardware to this directory:
#Place the patch
980-drivers_pwm.patch
openwrt/target/linux/generic/patches-2.6.37/980-drivers_pwm.patch
Once installed you will be able to enable the pwm kernel driver
3.
You then need to go into that folder and do a "make kernel_menuconfig" and add specific kernel plugins for
kmod-i2c-gpio
kmod-i2c-gpio-custom
kmod-pwm-gpio-custom
kmod-pwm-gpio
4.
Run "make menuconfig" to make sure the packages above are then included as well as:
libstdcpp
5. You can then customize whatever else you want and then make the firmware by saying "make". You may want to check out the OpenWRT docs for other things you might want to hook up.
#=======================
Install OpenWRT on your device
#=======================
1.
You should check out the documentation about OpenWRT for this. I did it over serial connection but that was a limitation of the hardware I was using. I put it in here in the case you're using LaFonera or a Meraki Mini. But there's no warranty on these instructions.
2.
REDBOOT configure
fconfig -l
fconfig bootp_my_ip 192.168.1.1
fconfig bootp_my_ip_mask 255.255.255.0
fconfig bootp_my_gateway_ip 192.168.1.11
fconfig bootp_server_ip 192.168.1.11
fconfig console_baud_rate 9600
fconfig boot_script_data
check_mac
fis load -d linux
exec
3.
REDBOOT install Openwrt
//KERNEL
load -r -b %{FREEMEMLO} -m http -h 192.168.1.64 /openwrt-atheros-vmlinux.gz
fis init
fis create -r 0x80041000 -e 0x80041000 linux
//SQUASHFS
load -r -b %{FREEMEMLO} -m http -h 192.168.1.64 /openwrt-atheros-root.squashfs
fis create rootfs
#=======================
Build coffeed/coffeec
#=======================
1. If you have coffeec and coffeed in the same directory as "trunk" you need to make links
ln -s <coffeed folder> <the trunk dir>/package
So something like
ln -s /projects/coffeed_folder/coffeed /projects/coffeed_folder/trunk/package/
2. Issue the build command while inside the trunk folder.
make package/coffeed/compile V=99
#=======================
Install coffeed/coffeec
#=======================
You can replace coffeed with coffeec in this
1. Send the package to your router via scp
scp bin/atheros/packages/coffeed_2.1-1_atheros.ipk [email protected]:/tmp
2. Login to router and install package
opkg install /tmp/coffeed_2.1-1_atheros.ipk
#=======================
Configure COFFEED
#=======================
edit the file /etc/config/coffeed and change any settings
Start stop with
/etc/init.d/coffeed start
/etc/init.d/coffeed stop
You can also trying to run coffeed --help and you will get some info too
#=======================
Using COFFEEC
#=======================
Make the PID active
/usr/bin/coffeec -c active=1
Make the PID inactive
/usr/bin/coffeec -c active=0
Crontab script to turn it on or off
40 7 * * 0,6 /usr/bin/coffeec -c active=1
00 14 * * 0,6 /usr/bin/coffeec -c active=0
Connect to a remote coffeed server
coffeec -a IPADDRESS -p PORT -c COMMAND
You can also run coffeec --help and you will get some info too