<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.playfulexploration.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peter</id>
	<title>Playful Exploration - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.playfulexploration.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Peter"/>
	<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Special:Contributions/Peter"/>
	<updated>2026-11-19T23:29:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/InfluxDB_Setup&amp;diff=1110</id>
		<title>Projects/InfluxDB Setup</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/InfluxDB_Setup&amp;diff=1110"/>
		<updated>2019-05-23T04:34:58Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Objective ==&lt;br /&gt;
* Provide a Database for measurements&lt;br /&gt;
* Manage memory smartly:&lt;br /&gt;
** Allow for high sampling rates e.g. 4 values/second&lt;br /&gt;
** Short retention for high sampling rate data e.g. 1 hour&lt;br /&gt;
** Multiple levels of automatic down-sampling using aggregation with increasing retention time for each level&lt;br /&gt;
&lt;br /&gt;
== Retention and Down-Sampling ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! sample rate/aggregate !! retention !! # of values !! InfluxDB Retention and Continuous Query Setup&lt;br /&gt;
|-&lt;br /&gt;
| 0.25 seconds (raw data) || 1 hour || 14400 || &lt;br /&gt;
CREATE RETENTION POLICY &amp;quot;default&amp;quot; ON &amp;quot;weather&amp;quot; DURATION 1h REPLICATION 1 DEFAULT&lt;br /&gt;
|-&lt;br /&gt;
| 15 minutes || for ever || 345600 ||&lt;br /&gt;
CREATE RETENTION POLICY _15min ON weather DURATION INF REPLICATION 1&lt;br /&gt;
&lt;br /&gt;
CREATE CONTINUOUS QUERY CQ_15min ON weather BEGIN SELECT median(value) AS value INTO weather._15min.:MEASUREMENT FROM weather.&amp;quot;default&amp;quot;./^[a-z].*/ GROUP BY time(15m), * fill(none) END&lt;br /&gt;
&lt;br /&gt;
SELECT median(value) AS value INTO weather._15min.:MEASUREMENT FROM weather.&amp;quot;default&amp;quot;./^[a-z].*/ where time &amp;gt; now() - 1d GROUP BY time(15m), * fill(none)&lt;br /&gt;
|}&lt;br /&gt;
* 360000 measurement, 5.76MB at 16Byte per measurement&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=ESP8266/Lua_Codez&amp;diff=1101</id>
		<title>ESP8266/Lua Codez</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=ESP8266/Lua_Codez&amp;diff=1101"/>
		<updated>2019-05-06T03:35:09Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setup ==&lt;br /&gt;
=== Firmware Mods ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! source !! new !! old !! purpose&lt;br /&gt;
|-&lt;br /&gt;
| app/modules/mqtt.c&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define MQTT_BUF_SIZE 2048&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define MQTT_BUF_SIZE 1024&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| increase MQTT buffer size so that larger LUA scripts can be send&lt;br /&gt;
|-&lt;br /&gt;
| app/lua/luaconf.h &lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define LUA_MAXINPUT  2048&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define LUA_MAXINPUT  256&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| increase input buffer so that larger LUA scripts can be directly send to node.input(script) &lt;br /&gt;
|-&lt;br /&gt;
| app/include/user_modules.h&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define ...&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;//#define ...&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Enable all modules to be included&lt;br /&gt;
|-&lt;br /&gt;
| app/include/user_version.h&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define BUILD_DATE &amp;quot;playfulexploration.com build&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;#define BUILD_DATE &amp;quot;unspecified&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| A string that will be shown when LUA boots up (this ideally will also show all includes modules)&lt;br /&gt;
|-&lt;br /&gt;
| app/modules/wifi.c&lt;br /&gt;
| static int wifi_station_getconfig( lua_State* L )&lt;br /&gt;
&amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;lua_pushstring( L, &amp;quot;&amp;quot; );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| static int wifi_station_getconfig( lua_State* L )&lt;br /&gt;
&amp;lt;syntaxhighlight inline lang=&amp;quot;cpp&amp;quot;&amp;gt;lua_pushstring( L, sta_conf.password );&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| Disable the ability to read out the Wifi password&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Custom Lua Builds ===&lt;br /&gt;
https://www.playfulexploration.com/files/nodemcu-firmware/bin/&lt;br /&gt;
&lt;br /&gt;
=== Esp8266 Flashing Latest Dev builds ===&lt;br /&gt;
* Flashing latest [https://github.com/nodemcu/nodemcu-firmware/tree/dev NodeMCU Dev builds] with esptool requires additional &#039;-fm dio&#039; option.  Without it the chi will not boot after flashing e.g.: &amp;lt;syntaxhighlight inline lang=&amp;quot;bash&amp;quot;&amp;gt;esptool.py --port COM4 write_flash -fm dio 0x000000 &amp;quot;nodemcu_float_dev_20160603-0606.bin&amp;quot;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Latest Dev builds use baud rate 115200&lt;br /&gt;
&lt;br /&gt;
== Dump BME280 Pressure, Humidity and Temperature ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bme280.init(1,2)&lt;br /&gt;
tmr.alarm(1, 3000, 1, function()&lt;br /&gt;
    tmr.softwd(30)&lt;br /&gt;
    local h,t,b=bme280.humi(),bme280.temp(),bme280.baro()&lt;br /&gt;
    print(&#039;humi: &#039;..(h/1000)..&#039;%  temp: &#039;..(t/100)..&#039;C  baro: &#039;..b..&#039;PA  dewp: &#039;..(bme280.dewpoint(h,t)/100)..&#039;C&#039;)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Log BME280 with influx ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bme280.init(1,2)&lt;br /&gt;
host=&amp;quot;playfulexploration.com&amp;quot;&lt;br /&gt;
mac=wifi.ap.getmac&lt;br /&gt;
sendToInflux = function(c)&lt;br /&gt;
    local h,t,b=bme280.humi(),bme280.temp(),bme280.baro()&lt;br /&gt;
    local params=&amp;quot;baro,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(b/1000)&lt;br /&gt;
        ..&amp;quot;\ntemp,mac=&amp;quot;..mac()..&amp;quot; value=&amp;quot;..(t/100)&lt;br /&gt;
        ..&amp;quot;\nhumi,mac=&amp;quot;..mac()..&amp;quot; value=&amp;quot;..(h/1000)&lt;br /&gt;
        ..&amp;quot;\ndewp,mac=&amp;quot;..mac()..&amp;quot; value=&amp;quot;..(bme280.dewpoint(h,t)/100)&lt;br /&gt;
    local m=&amp;quot;POST /write?db=weather HTTP/1.1&amp;quot;&lt;br /&gt;
        ..&amp;quot;\r\nHost:&amp;quot;..host&lt;br /&gt;
        ..&amp;quot;\r\nContent-Length: &amp;quot;..params:len()&lt;br /&gt;
        ..&amp;quot;\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n&amp;quot;&lt;br /&gt;
        ..params&lt;br /&gt;
    --print(m)&lt;br /&gt;
    c:send(m)&lt;br /&gt;
end&lt;br /&gt;
trigger = nil&lt;br /&gt;
trigger = function(c)&lt;br /&gt;
    conn = net.createConnection(net.TCP, 0)&lt;br /&gt;
    conn:on(&amp;quot;connection&amp;quot;, sendToInflux)&lt;br /&gt;
    conn:on(&amp;quot;receive&amp;quot;, function(conn,m) conn:close() conn=nil print(m) tmr.alarm(0, 3000, 0, trigger) tmr.softwd(30) end)&lt;br /&gt;
    conn:connect(8086,host)&lt;br /&gt;
end&lt;br /&gt;
trigger()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same using NodeMCU&#039;s http module:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bme280.init(1,2)&lt;br /&gt;
trigger = nil &lt;br /&gt;
trigger = function(c)&lt;br /&gt;
    local h,t,b=bme280.humi(),bme280.temp(),bme280.baro()&lt;br /&gt;
    local params=&amp;quot;baro,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(b/10)&lt;br /&gt;
        ..&amp;quot;\ntemp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(t/100)&lt;br /&gt;
        ..&amp;quot;\nhumi,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(h/1000)&lt;br /&gt;
        ..&amp;quot;\ndewp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(bme280.dewpoint(h,t)/100)&lt;br /&gt;
    --print(params)&lt;br /&gt;
    http.post(&amp;quot;https://influxdb.playfulexploration.com/write?db=weather&amp;quot;, nil, params, function(code,body) print(body) tmr.alarm(0, 3000, 0, trigger) tmr.softwd(30) end)&lt;br /&gt;
end &lt;br /&gt;
trigger()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same using NodeMCU&#039;s deep sleep mode and 60 sec wake-up:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bme280.init(1,2)&lt;br /&gt;
local h,t,b=bme280.humi(),bme280.temp(),bme280.baro()&lt;br /&gt;
local params=&amp;quot;baro,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(b/10)&lt;br /&gt;
    ..&amp;quot;\ntemp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(t/100)&lt;br /&gt;
    ..&amp;quot;\nhumi,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(h/1000)&lt;br /&gt;
    ..&amp;quot;\ndewp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(bme280.dewpoint(h,t)/100)&lt;br /&gt;
--print(params)&lt;br /&gt;
http.post(&amp;quot;https://influxdb.playfulexploration.com/write?db=weather&amp;quot;, nil, params, function(code,body) rtctime.dsleep_aligned(60*1000000, 1*1000000, 4) end)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Log BMP085 and DHT22 with influx ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bmp085.init(6,5)&lt;br /&gt;
print( bmp085.pressure(), bmp085.temperature()/10, dht.read(7) )&lt;br /&gt;
&lt;br /&gt;
host=&amp;quot;playfulexploration.com&amp;quot;&lt;br /&gt;
mac=wifi.ap.getmac&lt;br /&gt;
sendToInflux = function(c)&lt;br /&gt;
    local s,t,h=dht.read(7)&lt;br /&gt;
    local b=bmp085.pressure()&lt;br /&gt;
    local params=&amp;quot;baro,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..b&lt;br /&gt;
        ..&amp;quot;\ndewp,mac=&amp;quot;..mac()..&amp;quot; value=&amp;quot;..(bme280.dewpoint(h*1000,t*100)/100)&lt;br /&gt;
    if s==0 then&lt;br /&gt;
        params=params..&amp;quot;\ntemp,mac=&amp;quot;..mac()..&amp;quot; value=&amp;quot;..t&lt;br /&gt;
            ..&amp;quot;\nhumi,mac=&amp;quot;..mac()..&amp;quot; value=&amp;quot;..h&lt;br /&gt;
    end&lt;br /&gt;
    local m=&amp;quot;POST /write?db=weather HTTP/1.1&amp;quot;&lt;br /&gt;
        ..&amp;quot;\r\nHost:&amp;quot;..host&lt;br /&gt;
        ..&amp;quot;\r\nContent-Length: &amp;quot;..params:len()&lt;br /&gt;
        ..&amp;quot;\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n&amp;quot;&lt;br /&gt;
        ..params&lt;br /&gt;
    --print(m)&lt;br /&gt;
    c:send(m)&lt;br /&gt;
end&lt;br /&gt;
trigger = nil&lt;br /&gt;
trigger = function(c)&lt;br /&gt;
    conn = net.createConnection(net.TCP, 0)&lt;br /&gt;
    conn:on(&amp;quot;connection&amp;quot;, sendToInflux)&lt;br /&gt;
    conn:on(&amp;quot;receive&amp;quot;, function(conn,m) conn:close() conn=nil print(m) tmr.alarm(0, 3000, 0, trigger) tmr.softwd(30) end)&lt;br /&gt;
    conn:connect(8086,host)&lt;br /&gt;
end&lt;br /&gt;
trigger()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same using NodeMCU&#039;s http module:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bmp085.init(6,5)&lt;br /&gt;
print( bmp085.pressure(), bmp085.temperature()/10, dht.read(7) )&lt;br /&gt;
&lt;br /&gt;
trigger = nil&lt;br /&gt;
trigger = function(c)&lt;br /&gt;
    local s,t,h=dht.read(7)&lt;br /&gt;
    local b=bmp085.pressure()&lt;br /&gt;
    local params=&amp;quot;baro,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..b&lt;br /&gt;
             ..&amp;quot;\ndewp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(bme280.dewpoint(h*1000,t*100)/100)&lt;br /&gt;
    if s==0 then&lt;br /&gt;
        params=params..&amp;quot;\ntemp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..t&lt;br /&gt;
                     ..&amp;quot;\nhumi,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..h&lt;br /&gt;
    end&lt;br /&gt;
    --print(params)&lt;br /&gt;
    http.post(&amp;quot;https://influxdb.playfulexploration.com/write?db=weather&amp;quot;, nil, params, function(code,body) print(body) tmr.alarm(0, 3000, 0, trigger) tmr.softwd(30) end)&lt;br /&gt;
end&lt;br /&gt;
trigger()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Same using NodeMCU&#039;s deep sleep mode and 60 sec wake-up:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bmp085.init(6,5)&lt;br /&gt;
--print( bmp085.pressure(), bmp085.temperature()/10, dht.read(7) )&lt;br /&gt;
&lt;br /&gt;
local s,t,h=dht.read(7)&lt;br /&gt;
local b=bmp085.pressure()&lt;br /&gt;
local params=&amp;quot;baro,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..b&lt;br /&gt;
         ..&amp;quot;\ndewp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..(bme280.dewpoint(h*1000,t*100)/100)&lt;br /&gt;
if s==0 then&lt;br /&gt;
    params=params..&amp;quot;\ntemp,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..t&lt;br /&gt;
                 ..&amp;quot;\nhumi,mac=&amp;quot;..wifi.ap.getmac()..&amp;quot; value=&amp;quot;..h&lt;br /&gt;
end&lt;br /&gt;
--print(params)&lt;br /&gt;
http.post(&amp;quot;https://influxdb.playfulexploration.com/write?db=weather&amp;quot;, nil, params, function(code,body) rtctime.dsleep_aligned(60*1000000, 1*1000000, 4) end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Mqtt_Commissioning&amp;diff=1099</id>
		<title>Mqtt Commissioning</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Mqtt_Commissioning&amp;diff=1099"/>
		<updated>2019-05-06T00:55:41Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Lua Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:ESP]]&lt;br /&gt;
== Sequence ==&lt;br /&gt;
A first draft, needs more work:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
actor Actor as &amp;quot;IOT Friend&amp;quot;&lt;br /&gt;
participant Mobile as &amp;quot;Mobile Device&amp;quot;&lt;br /&gt;
participant ESP&lt;br /&gt;
participant MqttBroker as &amp;quot;Mqtt Broker&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Actor --&amp;gt; ESP : power up&lt;br /&gt;
activate ESP&lt;br /&gt;
ESP -&amp;gt; ESP : start access point\ndefault setup:\n  ssid: AP[CHIPID]\n  pass: default\n  ip: 10.10.10.10&lt;br /&gt;
ESP -&amp;gt; ESP : start webserver&lt;br /&gt;
deactivate ESP&lt;br /&gt;
&lt;br /&gt;
Actor --&amp;gt; Mobile : connect the ESP&lt;br /&gt;
activate Mobile&lt;br /&gt;
Mobile -&amp;gt; ESP : connect wifi to AP[CHIPID]&lt;br /&gt;
activate ESP&lt;br /&gt;
Mobile -&amp;gt; ESP : connect to webserver 10.10.10.10&lt;br /&gt;
Mobile -&amp;gt; ESP : set home-wifi-ssid\nset home-wifi-pass\nset mqtt-borker\n[optional] change: time-server\n[optional] change: AP-ssid\n[optional] change: AP-pass&lt;br /&gt;
Mobile -&amp;gt; ESP : reboot&lt;br /&gt;
deactivate Mobile&lt;br /&gt;
ESP -&amp;gt; ESP : connect to home-wifi\nstart AP mode only if unsuccessful\n  or AP-button is hold down&lt;br /&gt;
ESP -&amp;gt; &amp;quot;ntp.org&amp;quot; : get internet time&lt;br /&gt;
ESP -&amp;gt; MqttBroker : connect&lt;br /&gt;
ESP -&amp;gt; MqttBroker : subscribe(topic=&#039;/node/config/[CHIPID]&#039;)\n(to retrieve configuration)&lt;br /&gt;
ESP -&amp;gt; MqttBroker : publish(\n  topic=&#039;/node/heartbeat/[CHIPID]&#039;,\n  message=&amp;quot;[TIMENOW]&amp;quot;\n  retain=true)\n(to signal its presents)&lt;br /&gt;
deactivate ESP&lt;br /&gt;
&lt;br /&gt;
Actor --&amp;gt; Mobile : connect to browser console&lt;br /&gt;
activate Mobile&lt;br /&gt;
Mobile -&amp;gt; MqttBroker : subscribe(topic=&#039;/node/heartbeat/+&#039;)\n  receives list of connected devices and last boot time&lt;br /&gt;
Mobile -&amp;gt; MqttBroker : subscribe(topic=&#039;/node/output/+&#039;)\n  receives console output from each device&lt;br /&gt;
&lt;br /&gt;
Actor --&amp;gt; Mobile : commission the ESP&lt;br /&gt;
Mobile -&amp;gt; MqttBroker : publish(\n  topic=&#039;/node/config/[CHIPID]&#039;,\n  message=&amp;quot;[Lua Program]&amp;quot;\n  retain=true)&lt;br /&gt;
deactivate Mobile&lt;br /&gt;
activate MqttBroker&lt;br /&gt;
MqttBroker -&amp;gt; ESP : mqtt-forward([Lua Program])&lt;br /&gt;
deactivate MqttBroker&lt;br /&gt;
activate ESP&lt;br /&gt;
ESP -&amp;gt; ESP : run the Lua Program&lt;br /&gt;
deactivate ESP&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Lua Code ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! file !! lua code !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| config.lua&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;lua&amp;quot; line&amp;gt;wifi.setmode(wifi.STATION)&lt;br /&gt;
wifi.sta.config(&amp;quot;YOUR-SSID&amp;quot;,&amp;quot;YOUR-PASSWORD&amp;quot;)&lt;br /&gt;
wifi.sta.connect()&lt;br /&gt;
MqttBroker = &#039;YOUR-MQTTBORKER&#039;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
| setup file, connects the esp to the router&lt;br /&gt;
|-&lt;br /&gt;
| init.lua&lt;br /&gt;
(part 1)&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;lua&amp;quot; line&amp;gt;print(&amp;quot;\n\nHold gpio0 low to stop boot&amp;quot;)&lt;br /&gt;
tmr.delay(1000000)&lt;br /&gt;
if gpio.read(3) == 0 then print(&amp;quot;...boot stopped&amp;quot;) return end&lt;br /&gt;
print(&amp;quot;...booting&amp;quot;, collectgarbage(&#039;count&#039;))&lt;br /&gt;
print(&#039;ready&#039;,collectgarbage(&#039;count&#039;))&lt;br /&gt;
&lt;br /&gt;
dofile(&#039;config.lc&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
| Startup code that allows stopping the boot by holding GPIO0 low.&lt;br /&gt;
|-&lt;br /&gt;
| init.lua&lt;br /&gt;
(part 2)&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;lua&amp;quot; line start=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
tmr.softwd(30)    -- restart if stall&lt;br /&gt;
&lt;br /&gt;
action = function()&lt;br /&gt;
  print(&amp;quot;Mqtt try connect&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  if m then m:close() m=nil collectgarbage() end&lt;br /&gt;
  m = mqtt.Client(&amp;quot;clientid&amp;quot;,-1)&lt;br /&gt;
  --m:lwt(&amp;quot;/node/lwt/&amp;quot;..wifi.ap.getmac(), &#039;&#039;..rtctime.get(),0,1)&lt;br /&gt;
  m:on(&amp;quot;offline&amp;quot;, function(con) print(&amp;quot;Mqtt offline&amp;quot;) end)&lt;br /&gt;
  m:on(&amp;quot;message&amp;quot;, function(conn, topic, data) tmr.softwd(30) print(&#039;Mqtt &amp;quot;&#039; .. topic .. &#039;&amp;quot;:&#039; ) if data ~= nil then print(data) node.input(data) end end)&lt;br /&gt;
  m:connect(MqttBroker, 1883, 0, function(conn)&lt;br /&gt;
    print(&amp;quot;Mqtt Connected&amp;quot;)&lt;br /&gt;
    m:subscribe(&amp;quot;/node/config/&amp;quot;..wifi.ap.getmac(), 0, function(conn) tmr.softwd(30) print(&amp;quot;Mqtt subscribes&amp;quot;) end)&lt;br /&gt;
    m:publish(&amp;quot;/node/heartbeat/&amp;quot;..wifi.ap.getmac(),&#039;&#039;..rtctime.get(),0,1, function(conn) print(&amp;quot;Mqtt heartbeat sent&amp;quot;) end)&lt;br /&gt;
  end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
try_sntp_sync = function()&lt;br /&gt;
  print(&#039;Try sntp.sync ...&#039;)&lt;br /&gt;
  sntp.sync(&#039;www.ntp.org&#039;, function(sec,usec,server) print(&#039;sntp.sync&#039;, sec, usec, server) end, function() print(&#039;Error: sntp.sync !&#039;) end)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
tmr.alarm(0, 2000, tmr.ALARM_SEMI, function()&lt;br /&gt;
  if rtctime.get()==0 then try_sntp_sync() tmr.start(0)&lt;br /&gt;
  else action() end&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
# Retrieves the accurate time from the time server&lt;br /&gt;
# Connects to Mqtt boker&lt;br /&gt;
# Subscribes topic &#039;/node/config/[MAC-ADDRESS]&#039; where it retrieves the instructions to execute&lt;br /&gt;
# Publishes it&#039;s current time to topic &#039;/node/heartbeat/[MAC-ADDRESS]&#039; to tell the broker it&#039;s booted up&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Commissioning ==&lt;br /&gt;
Commissioning is currently done from a Linux command line using mosquitto mqtt client.  The -t option defines the topic to subscribe to.  The &#039;#&#039; in the topic is a wildcard.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mosquitto_sub -t &amp;quot;/node/heartbeat/#&amp;quot; -v&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The response lists nodes that were ever booted up and their boot time in in Unix Epoch Time.  In this example one node with MAC 1a:fe:34:a0:e0:4d was booted at 1456378653 Epoch Time:&lt;br /&gt;
 /node/heartbeat/1a:fe:34:a0:e0:4d 1456378653&lt;br /&gt;
&lt;br /&gt;
Now having the MAC we can commission the device by sending lua code to the &#039;/node/config&#039; topic for the given MAC.  The -r option ensures the broker will retain this message, so the client will receive it&#039;s instructions automatically when rebooting:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mosquitto_pub -t &amp;quot;/node/config/1a:fe:34:a0:e0:4d&amp;quot; -r -m &amp;quot;pin=7 gpio.mode(pin, gpio.OUTPUT) local b=0 tmr.alarm(0, 500, 1, function() gpio.write(pin, b) if b==0 then b=1 else b=0 end end)&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The lua code uses a timer to toggle and LED every half a second: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
pin=7&lt;br /&gt;
gpio.mode(pin, gpio.OUTPUT)&lt;br /&gt;
local b=0&lt;br /&gt;
tmr.alarm(0, 500, 1, function()&lt;br /&gt;
  gpio.write(pin, b)&lt;br /&gt;
  if b==0 then b=1&lt;br /&gt;
  else b=0 end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== UART dump of the ESP  ==&lt;br /&gt;
 NodeMCU custom build by frightanic.com&lt;br /&gt;
         branch: master&lt;br /&gt;
         commit: c8037568571edb5c568c2f8231e4f8ce0683b883&lt;br /&gt;
         SSL: false&lt;br /&gt;
         modules: adc,bmp085,dht,enduser_setup,file,gpio,i2c,mqtt,net,node,pwm,rtctime,sntp,spi,tmr,uart,wifi,ws2812&lt;br /&gt;
  build  built on: 2016-02-07 06:45&lt;br /&gt;
  powered by Lua 5.1.4 on SDK 1.4.0&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 Hold gpio0 low to stop boot&lt;br /&gt;
 ...booting      8.6650390625&lt;br /&gt;
 ready   8.712890625&lt;br /&gt;
 Try sntp.sync ...&lt;br /&gt;
 sntp.sync       1456382295      344798  128.4.24.98&lt;br /&gt;
 Mqtt try connect&lt;br /&gt;
 Mqtt Connected&lt;br /&gt;
 Mqtt subscribes&lt;br /&gt;
 Mqtt &amp;quot;/node/config/1a:fe:34:a0:e0:4d&amp;quot;:&lt;br /&gt;
 pin=7 gpio.mode(pin, gpio.OUTPUT) local b=0 tmr.alarm(0, 500, 1, function() gpio.write(pin, b) if b==0 then b=1 else b=0 e&lt;br /&gt;
 Mqtt heartbeat sent&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/ESP8266_-_Pressure_(BMP085)_Temperature_Humidity_(DHT22))&amp;diff=1098</id>
		<title>Projects/ESP8266 - Pressure (BMP085) Temperature Humidity (DHT22))</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/ESP8266_-_Pressure_(BMP085)_Temperature_Humidity_(DHT22))&amp;diff=1098"/>
		<updated>2019-05-06T00:27:29Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:ESP]] [[category:Projects]] [[category:Weather]]&lt;br /&gt;
&lt;br /&gt;
Version 1 of the quick&#039;n-dirty weather station is online for the first 24 hours, running on a USB power stick, sending air pressure, temperature and humidity data from the balcony up directly to the VPS&#039;s influxdb.  No mptt, just simple http web requests.  Version 2 will need some enclosure to protect the electronic from the elements.&lt;br /&gt;
&lt;br /&gt;
Graphical output using Grafana: https://www.playfulexploration.com/grafana/dashboard/db/pressure-temperatur-humidity-5min-interval&lt;br /&gt;
&lt;br /&gt;
[[File:ESP8266 - Pressure Temperature Humidity.JPG|300px|right]]&lt;br /&gt;
= Features =&lt;br /&gt;
* AMS1117-3.3 Voltage Regulator&lt;br /&gt;
* Microcontroller ESP8266&lt;br /&gt;
* Firmware Lua NodeMCU&lt;br /&gt;
* Sensor driver build into the firmware&lt;br /&gt;
* DHT22 Temperature and Humidity Sensor, sensor specific single wire protocol&lt;br /&gt;
* BME280 Barometric Pressure Sensor, I2C&lt;br /&gt;
* CP2102 USB to UART Adapter&lt;br /&gt;
&lt;br /&gt;
= Http-Requests based Data Push to Influxdb =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! file !! lua code !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| config.lua&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;lua&amp;quot; line&amp;gt;wifi.setmode(wifi.STATION)&lt;br /&gt;
wifi.sta.config(&amp;quot;SSID&amp;quot;,&amp;quot;PASSWORD&amp;quot;)&lt;br /&gt;
wifi.sta.connect()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
| setup file, connects the esp to the router&lt;br /&gt;
|-&lt;br /&gt;
| init.lua&lt;br /&gt;
(part 1)&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;lua&amp;quot; line&amp;gt;print(&amp;quot;\n\nHold gpio0 low to stop boot&amp;quot;)&lt;br /&gt;
tmr.delay(1000000)&lt;br /&gt;
if gpio.read(3) == 0 then print(&amp;quot;...boot stopped&amp;quot;) return end&lt;br /&gt;
print(&amp;quot;...booting&amp;quot;, collectgarbage(&#039;count&#039;))&lt;br /&gt;
print(&#039;ready&#039;,collectgarbage(&#039;count&#039;))&lt;br /&gt;
&lt;br /&gt;
dofile(&#039;config.lc&#039;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
| Startup code that allows stopping the boot by holding GPIO0 low.&lt;br /&gt;
|-&lt;br /&gt;
| init.lua&lt;br /&gt;
(part 2)&lt;br /&gt;
| &amp;lt;source lang=&amp;quot;lua&amp;quot; line start=&amp;quot;10&amp;quot;&amp;gt;&lt;br /&gt;
-- restart if stall&lt;br /&gt;
tmr.softwd(30)&lt;br /&gt;
&lt;br /&gt;
--bmp085.init( dofile(&amp;quot;i2c_locate.lc&amp;quot;) )&lt;br /&gt;
bmp085.init( 6, 5 )&lt;br /&gt;
print( bmp085.pressure(), bmp085.temperature()/10, dht.read(7) )&lt;br /&gt;
&lt;br /&gt;
trigger = nil&lt;br /&gt;
conn = nil&lt;br /&gt;
pub = function(c)&lt;br /&gt;
   local d=&amp;quot;pa val=&amp;quot;..bmp085.pressure()&lt;br /&gt;
   local s,t,h=dht.read(7)&lt;br /&gt;
   if s==0 then d=d..&amp;quot;\ntemp val=&amp;quot;..t..&amp;quot;\nhumi val=&amp;quot;..h end&lt;br /&gt;
   local m=&amp;quot;POST /write?db=rocket HTTP/1.1\r\nContent-Length: &amp;quot;..d:len()..&amp;quot;\r\nContent-Type: application/x-www-form-urlencoded\r\n\r\n&amp;quot;..d&lt;br /&gt;
   print(m)&lt;br /&gt;
   c:send(m)&lt;br /&gt;
end&lt;br /&gt;
trigger = function(c)&lt;br /&gt;
  conn = net.createConnection(net.TCP, 0)&lt;br /&gt;
  conn:on(&amp;quot;connection&amp;quot;, pub)&lt;br /&gt;
  conn:on(&amp;quot;receive&amp;quot;, function(conn,m) conn:close() conn=nil print(m) tmr.alarm(0, 3000, 0, trigger) tmr.softwd(30) end)&lt;br /&gt;
  conn:connect(8086,&amp;quot;playfulexploration.com&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
trigger()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
| Net client connects to influxdb every 3 seconds and send data&lt;br /&gt;
The fully charged power stick last about 26 hours.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Weather Events =&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Event !! Graph&lt;br /&gt;
|-&lt;br /&gt;
| Hail Storm || [[File:20160331 weather event hail storm.jpg|600px]]&lt;br /&gt;
|-&lt;br /&gt;
| Rain Storm || [[File:20160604 weather event rain storm.PNG|600px]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Sensors&amp;diff=1097</id>
		<title>Sensors</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Sensors&amp;diff=1097"/>
		<updated>2019-05-06T00:26:50Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:R2a2]] [[category:Links]][[category:ESP]][[category:Rpi]]&lt;br /&gt;
== Low Cost Sensor Boards ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Sensor !! Interface !! Name !! Price !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| Temperature || I2C || [[http://www.nxp.com/documents/data_sheet/LM75A.pdf LM75A]] || $2&lt;br /&gt;
|-&lt;br /&gt;
| Pressure, Temperature || I2C || [https://www.adafruit.com/products/2652 BME280] BMP180 BMP085 || $3&lt;br /&gt;
|-&lt;br /&gt;
| Humidity, Temperature || I2C || [[https://www.silabs.com/Support%20Documents/TechnicalDocs/Si7021-A20.pdf Si7021]] || $3&lt;br /&gt;
|-&lt;br /&gt;
| Humidity, Temperature || Single Wire || DHT22 || $3&lt;br /&gt;
|-&lt;br /&gt;
| Temperature Pressure Humidity || I2C || BME280 || $8&lt;br /&gt;
|-&lt;br /&gt;
| Light Intensity || I2C || BH1750FVI || $2&lt;br /&gt;
|-&lt;br /&gt;
| Real Time Clock || I2C || DS1307 || $1&lt;br /&gt;
|-&lt;br /&gt;
| Magnetometer 3 axis || I2C || MAG3110 || $4&lt;br /&gt;
|-&lt;br /&gt;
| Accelerometer 3 axis || I2C || BMA180 || $8&lt;br /&gt;
|-&lt;br /&gt;
| Analog Digital Converter || I2C || ADS1115 || $3 || Can directly read 2 thermocouples at 16 bit resolution.&lt;br /&gt;
|-&lt;br /&gt;
| I/O Expander || I2C || PCF8574 || $3&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=File:Star-chart.svg&amp;diff=1095</id>
		<title>File:Star-chart.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=File:Star-chart.svg&amp;diff=1095"/>
		<updated>2018-11-02T05:43:21Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=This_Server&amp;diff=1094</id>
		<title>This Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=This_Server&amp;diff=1094"/>
		<updated>2018-11-01T00:07:46Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Bash commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:r2a2]]&lt;br /&gt;
== Installed Components ==&lt;br /&gt;
Click this link to get a SSL report of this server: https://www.ssllabs.com/ssltest/analyze.html?d=playfulexploration.com .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
cloud WEB {&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
package playfulexploration.com {&lt;br /&gt;
  component [Eth0]&lt;br /&gt;
  component [Nginx\nport: 443] as [Nginx]&lt;br /&gt;
  component [PHP-CGI\nport: 9000] as [PHP-CGI]&lt;br /&gt;
  component [MySQL Server\nport: 3306] as [MySQL]&lt;br /&gt;
  component [Tomcat Server\nport: 8888] as [Tomcat]&lt;br /&gt;
  component [NodeJS\nport: 8080] as [NodeJS]&lt;br /&gt;
  component [Grafana\nport:3000] as [Grafana] &amp;lt;&amp;lt;Charts&amp;gt;&amp;gt; [[/wiki/?title=Install/Grafana]]&lt;br /&gt;
&lt;br /&gt;
package &amp;quot;Email&amp;quot; {&lt;br /&gt;
  component [Postfix\nports: 25, 587, 993] as [Postfix] &amp;lt;&amp;lt;mail transfer agent&amp;gt;&amp;gt;&lt;br /&gt;
  component [Dovecot] as [Dovecot] &amp;lt;&amp;lt;mail server&amp;gt;&amp;gt;&lt;br /&gt;
  component [Postgray] as [Postgray] &amp;lt;&amp;lt;anti spam&amp;gt;&amp;gt;&lt;br /&gt;
  database Mailbox&lt;br /&gt;
}&lt;br /&gt;
package &amp;quot;IOT&amp;quot; {&lt;br /&gt;
  component [Mosquitto\nport: 1883 mqtt\nport: 8883 mqtt secure\nport: 9001 wss] as [Mosquitto] &amp;lt;&amp;lt;MQTT Broker&amp;gt;&amp;gt; [[/wiki/?title=Install/Mosquitto_Mqtt_Broker]]&lt;br /&gt;
  component [InfluxDB\nport:] as [InfluxDB] &amp;lt;&amp;lt;Time Series DB&amp;gt;&amp;gt; [[/wiki/?title=Install/InfluxDB]]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
package &amp;quot;MediaWiki Pack&amp;quot; {&lt;br /&gt;
  database MediaWiki_DB as &amp;quot;MediaWiki DB&amp;quot;&lt;br /&gt;
  [MediaWiki PHP] .. [MediaWiki PlantUML Extension]&lt;br /&gt;
}&lt;br /&gt;
[Eth0] .. [Nginx] : https&lt;br /&gt;
[Nginx] .. [PHP-CGI]&lt;br /&gt;
[Nginx] .. [Tomcat]&lt;br /&gt;
[Nginx] .. [MySQL]&lt;br /&gt;
[Nginx] .. [NodeJS]&lt;br /&gt;
[Nginx] .. [Grafana]&lt;br /&gt;
&lt;br /&gt;
[Eth0] .. [Postfix] : smtp\nimap&lt;br /&gt;
[Postfix] .. [Dovecot]&lt;br /&gt;
[Dovecot] .. Mailbox&lt;br /&gt;
[Postfix] .. [Postgray]&lt;br /&gt;
 &lt;br /&gt;
[PHP-CGI] .. [MediaWiki PHP]&lt;br /&gt;
[Tomcat] .. [PlantUML JAR]&lt;br /&gt;
[PlantUML JAR] .. [GraphWiz]&lt;br /&gt;
 &lt;br /&gt;
[MySQL] .. MediaWiki_DB&lt;br /&gt;
&lt;br /&gt;
[Eth0] .. [Mosquitto] : mqtt\nwss&lt;br /&gt;
[Eth0] .. [InfluxDB] : rest&lt;br /&gt;
}&lt;br /&gt;
WEB -- [Eth0]&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backup strategy ==&lt;br /&gt;
&lt;br /&gt;
=== Postulates ===&lt;br /&gt;
:* More important than having a very fancy backup mechanism is to have some backup mechanism&lt;br /&gt;
&lt;br /&gt;
=== States and Status ===&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
state &amp;quot;No backup exists&amp;quot; as State0 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt;&lt;br /&gt;
State0 : Status: Done&lt;br /&gt;
state &amp;quot;Strategy A: Simple ZIP&amp;quot; as StrategyA &amp;lt;&amp;lt;Done&amp;gt;&amp;gt; {&lt;br /&gt;
  state &amp;quot;Have a ZIP file with backup data&amp;quot; as StateA1 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt;&lt;br /&gt;
  StateA1 : Status: Done&lt;br /&gt;
  state &amp;quot;Have a download link to ZIP file&amp;quot; as StateA2 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt; [[/backup/]]&lt;br /&gt;
  StateA2 : Status: Done&lt;br /&gt;
  StateA1 --&amp;gt; StateA2&lt;br /&gt;
}&lt;br /&gt;
state &amp;quot;Strategy B: Better backup strategy using GIT&amp;quot; as StrategyB &amp;lt;&amp;lt;New&amp;gt;&amp;gt; {&lt;br /&gt;
  state &amp;quot;Step1 ?&amp;quot; as StateB1 &amp;lt;&amp;lt;New&amp;gt;&amp;gt;&lt;br /&gt;
  StateB1 : Status: Not started&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[*] --&amp;gt; State0&lt;br /&gt;
State0 --&amp;gt; StrategyA&lt;br /&gt;
State0 --&amp;gt; StrategyB&lt;br /&gt;
StrategyA --&amp;gt; [*]&lt;br /&gt;
StrategyB --&amp;gt; [*]&lt;br /&gt;
&lt;br /&gt;
skinparam state {&lt;br /&gt;
  BackgroundColor&amp;lt;&amp;lt;New&amp;gt;&amp;gt; White&lt;br /&gt;
  BackgroundColor&amp;lt;&amp;lt;Done&amp;gt;&amp;gt; LightGreen&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Strategy A: Simple ZIP ===&lt;br /&gt;
Using ssh:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
 # backup changes of files and folders&lt;br /&gt;
 #mkdir /backup&lt;br /&gt;
 rsync -av --relative /var/www/html/wiki/LocalSettings.php /var/www/html/wiki/extensions/ /var/www/html/wiki/htmlets/ /backup/mediawiki/&lt;br /&gt;
 # export the wikimedia database&lt;br /&gt;
 mysqldump -uroot --single-transaction --databases mediawiki &amp;gt;/backup/mediawiki/wiki_mysql_database.sql&lt;br /&gt;
 # zip it&lt;br /&gt;
 zipfile=&amp;quot;mediawiki_$(date +&#039;%Y%m%d-%H%M%S&#039;).zip&amp;quot;&lt;br /&gt;
 pushd /backup/; zip -r $zipfile mediawiki/*; popd&lt;br /&gt;
 echo &amp;quot;The latest backup is in /backup/$zipfile&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate to https://www.playfulexploration.com/backup and download the zip file.&lt;br /&gt;
&lt;br /&gt;
== Cost Structure ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Product !! Cost !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| || Virtual Private Server  || $6.99 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH]&lt;br /&gt;
* 1 vCore 2.4 GHz&lt;br /&gt;
* 4 GB RAM&lt;br /&gt;
* 20 GB SSD Local RAID 10&lt;br /&gt;
* 1 static IP, all ports open&lt;br /&gt;
* 100 Mbps Bandwidth&lt;br /&gt;
* Control Panel &lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Virtual Private Server  || $13.49 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH]&lt;br /&gt;
* 2 vCore 2.4 GHz&lt;br /&gt;
* 8 GB RAM&lt;br /&gt;
* 40 GB SSD Local RAID 10&lt;br /&gt;
* 1 static IP, all ports open&lt;br /&gt;
* 100 Mbps Bandwidth&lt;br /&gt;
* Control Panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || .COM Domain Name || $12 / year || [https://domains.google.com/registrar Google]&lt;br /&gt;
* domain privacy&lt;br /&gt;
* full control over all DNS records&lt;br /&gt;
* awesome control panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Software || $0 || all open source :]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After the VPS upgrade the RAM automatically increased but the disk size needed manual fixing requiring two steps ([https://www.lowendtalk.com/discussion/75353/anyone-know-how-to-fix-this-ovh-diskspace-issue#Comment_1538939 source]):&lt;br /&gt;
* Increase the partition to use the extra sectors added:&lt;br /&gt;
 fdisk /dev/vda&lt;br /&gt;
 &amp;gt; u&lt;br /&gt;
 &amp;gt; p&lt;br /&gt;
 (this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
 &amp;gt; d 1&lt;br /&gt;
 (this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
 &amp;gt; n&lt;br /&gt;
 (select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
 (partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
 (first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
 (and set last sector to the default value)&lt;br /&gt;
 &amp;gt; a&lt;br /&gt;
 (type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
 &amp;gt; w&lt;br /&gt;
 (this will write the new partitions and exit fdisk)&lt;br /&gt;
 shutdown -r 0&lt;br /&gt;
* Increase the filesystem size to use the extra partition space that&#039;s now available:&lt;br /&gt;
 (connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&lt;br /&gt;
== Bash commands ==&lt;br /&gt;
&lt;br /&gt;
Install a new extnsion (replace the *tar.gz path):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker exec -it playfulexploration_wiki bash&lt;br /&gt;
curl https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_31-6f55941.tar.gz | tar -xz -C /var/www/html/extensions&lt;br /&gt;
chown -R www-data:www-data /var/www/html/extensions&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Free disk space by trimming log file archives:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /var/log/* -name *.gz -type f -mtime +100 -exec rm {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Free disk space by dropping caches:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
free &amp;amp;&amp;amp; sync &amp;amp;&amp;amp; echo 3 &amp;gt; /proc/sys/vm/drop_caches &amp;amp;&amp;amp; free&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
See also: http://askubuntu.com/questions/5980/how-do-i-free-up-disk-space&lt;br /&gt;
&lt;br /&gt;
== Alternatives == &lt;br /&gt;
&lt;br /&gt;
* [https://www.kimsufi.com/us/en/ kimsufi dedicated server]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=This_Server&amp;diff=1093</id>
		<title>This Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=This_Server&amp;diff=1093"/>
		<updated>2018-10-31T23:57:26Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Free up disk space */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:r2a2]]&lt;br /&gt;
== Installed Components ==&lt;br /&gt;
Click this link to get a SSL report of this server: https://www.ssllabs.com/ssltest/analyze.html?d=playfulexploration.com .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
cloud WEB {&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
package playfulexploration.com {&lt;br /&gt;
  component [Eth0]&lt;br /&gt;
  component [Nginx\nport: 443] as [Nginx]&lt;br /&gt;
  component [PHP-CGI\nport: 9000] as [PHP-CGI]&lt;br /&gt;
  component [MySQL Server\nport: 3306] as [MySQL]&lt;br /&gt;
  component [Tomcat Server\nport: 8888] as [Tomcat]&lt;br /&gt;
  component [NodeJS\nport: 8080] as [NodeJS]&lt;br /&gt;
  component [Grafana\nport:3000] as [Grafana] &amp;lt;&amp;lt;Charts&amp;gt;&amp;gt; [[/wiki/?title=Install/Grafana]]&lt;br /&gt;
&lt;br /&gt;
package &amp;quot;Email&amp;quot; {&lt;br /&gt;
  component [Postfix\nports: 25, 587, 993] as [Postfix] &amp;lt;&amp;lt;mail transfer agent&amp;gt;&amp;gt;&lt;br /&gt;
  component [Dovecot] as [Dovecot] &amp;lt;&amp;lt;mail server&amp;gt;&amp;gt;&lt;br /&gt;
  component [Postgray] as [Postgray] &amp;lt;&amp;lt;anti spam&amp;gt;&amp;gt;&lt;br /&gt;
  database Mailbox&lt;br /&gt;
}&lt;br /&gt;
package &amp;quot;IOT&amp;quot; {&lt;br /&gt;
  component [Mosquitto\nport: 1883 mqtt\nport: 8883 mqtt secure\nport: 9001 wss] as [Mosquitto] &amp;lt;&amp;lt;MQTT Broker&amp;gt;&amp;gt; [[/wiki/?title=Install/Mosquitto_Mqtt_Broker]]&lt;br /&gt;
  component [InfluxDB\nport:] as [InfluxDB] &amp;lt;&amp;lt;Time Series DB&amp;gt;&amp;gt; [[/wiki/?title=Install/InfluxDB]]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
package &amp;quot;MediaWiki Pack&amp;quot; {&lt;br /&gt;
  database MediaWiki_DB as &amp;quot;MediaWiki DB&amp;quot;&lt;br /&gt;
  [MediaWiki PHP] .. [MediaWiki PlantUML Extension]&lt;br /&gt;
}&lt;br /&gt;
[Eth0] .. [Nginx] : https&lt;br /&gt;
[Nginx] .. [PHP-CGI]&lt;br /&gt;
[Nginx] .. [Tomcat]&lt;br /&gt;
[Nginx] .. [MySQL]&lt;br /&gt;
[Nginx] .. [NodeJS]&lt;br /&gt;
[Nginx] .. [Grafana]&lt;br /&gt;
&lt;br /&gt;
[Eth0] .. [Postfix] : smtp\nimap&lt;br /&gt;
[Postfix] .. [Dovecot]&lt;br /&gt;
[Dovecot] .. Mailbox&lt;br /&gt;
[Postfix] .. [Postgray]&lt;br /&gt;
 &lt;br /&gt;
[PHP-CGI] .. [MediaWiki PHP]&lt;br /&gt;
[Tomcat] .. [PlantUML JAR]&lt;br /&gt;
[PlantUML JAR] .. [GraphWiz]&lt;br /&gt;
 &lt;br /&gt;
[MySQL] .. MediaWiki_DB&lt;br /&gt;
&lt;br /&gt;
[Eth0] .. [Mosquitto] : mqtt\nwss&lt;br /&gt;
[Eth0] .. [InfluxDB] : rest&lt;br /&gt;
}&lt;br /&gt;
WEB -- [Eth0]&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backup strategy ==&lt;br /&gt;
&lt;br /&gt;
=== Postulates ===&lt;br /&gt;
:* More important than having a very fancy backup mechanism is to have some backup mechanism&lt;br /&gt;
&lt;br /&gt;
=== States and Status ===&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
state &amp;quot;No backup exists&amp;quot; as State0 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt;&lt;br /&gt;
State0 : Status: Done&lt;br /&gt;
state &amp;quot;Strategy A: Simple ZIP&amp;quot; as StrategyA &amp;lt;&amp;lt;Done&amp;gt;&amp;gt; {&lt;br /&gt;
  state &amp;quot;Have a ZIP file with backup data&amp;quot; as StateA1 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt;&lt;br /&gt;
  StateA1 : Status: Done&lt;br /&gt;
  state &amp;quot;Have a download link to ZIP file&amp;quot; as StateA2 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt; [[/backup/]]&lt;br /&gt;
  StateA2 : Status: Done&lt;br /&gt;
  StateA1 --&amp;gt; StateA2&lt;br /&gt;
}&lt;br /&gt;
state &amp;quot;Strategy B: Better backup strategy using GIT&amp;quot; as StrategyB &amp;lt;&amp;lt;New&amp;gt;&amp;gt; {&lt;br /&gt;
  state &amp;quot;Step1 ?&amp;quot; as StateB1 &amp;lt;&amp;lt;New&amp;gt;&amp;gt;&lt;br /&gt;
  StateB1 : Status: Not started&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[*] --&amp;gt; State0&lt;br /&gt;
State0 --&amp;gt; StrategyA&lt;br /&gt;
State0 --&amp;gt; StrategyB&lt;br /&gt;
StrategyA --&amp;gt; [*]&lt;br /&gt;
StrategyB --&amp;gt; [*]&lt;br /&gt;
&lt;br /&gt;
skinparam state {&lt;br /&gt;
  BackgroundColor&amp;lt;&amp;lt;New&amp;gt;&amp;gt; White&lt;br /&gt;
  BackgroundColor&amp;lt;&amp;lt;Done&amp;gt;&amp;gt; LightGreen&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Strategy A: Simple ZIP ===&lt;br /&gt;
Using ssh:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
 # backup changes of files and folders&lt;br /&gt;
 #mkdir /backup&lt;br /&gt;
 rsync -av --relative /var/www/html/wiki/LocalSettings.php /var/www/html/wiki/extensions/ /var/www/html/wiki/htmlets/ /backup/mediawiki/&lt;br /&gt;
 # export the wikimedia database&lt;br /&gt;
 mysqldump -uroot --single-transaction --databases mediawiki &amp;gt;/backup/mediawiki/wiki_mysql_database.sql&lt;br /&gt;
 # zip it&lt;br /&gt;
 zipfile=&amp;quot;mediawiki_$(date +&#039;%Y%m%d-%H%M%S&#039;).zip&amp;quot;&lt;br /&gt;
 pushd /backup/; zip -r $zipfile mediawiki/*; popd&lt;br /&gt;
 echo &amp;quot;The latest backup is in /backup/$zipfile&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate to https://www.playfulexploration.com/backup and download the zip file.&lt;br /&gt;
&lt;br /&gt;
== Cost Structure ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Product !! Cost !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| || Virtual Private Server  || $6.99 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH]&lt;br /&gt;
* 1 vCore 2.4 GHz&lt;br /&gt;
* 4 GB RAM&lt;br /&gt;
* 20 GB SSD Local RAID 10&lt;br /&gt;
* 1 static IP, all ports open&lt;br /&gt;
* 100 Mbps Bandwidth&lt;br /&gt;
* Control Panel &lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Virtual Private Server  || $13.49 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH]&lt;br /&gt;
* 2 vCore 2.4 GHz&lt;br /&gt;
* 8 GB RAM&lt;br /&gt;
* 40 GB SSD Local RAID 10&lt;br /&gt;
* 1 static IP, all ports open&lt;br /&gt;
* 100 Mbps Bandwidth&lt;br /&gt;
* Control Panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || .COM Domain Name || $12 / year || [https://domains.google.com/registrar Google]&lt;br /&gt;
* domain privacy&lt;br /&gt;
* full control over all DNS records&lt;br /&gt;
* awesome control panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Software || $0 || all open source :]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After the VPS upgrade the RAM automatically increased but the disk size needed manual fixing requiring two steps ([https://www.lowendtalk.com/discussion/75353/anyone-know-how-to-fix-this-ovh-diskspace-issue#Comment_1538939 source]):&lt;br /&gt;
* Increase the partition to use the extra sectors added:&lt;br /&gt;
 fdisk /dev/vda&lt;br /&gt;
 &amp;gt; u&lt;br /&gt;
 &amp;gt; p&lt;br /&gt;
 (this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
 &amp;gt; d 1&lt;br /&gt;
 (this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
 &amp;gt; n&lt;br /&gt;
 (select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
 (partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
 (first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
 (and set last sector to the default value)&lt;br /&gt;
 &amp;gt; a&lt;br /&gt;
 (type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
 &amp;gt; w&lt;br /&gt;
 (this will write the new partitions and exit fdisk)&lt;br /&gt;
 shutdown -r 0&lt;br /&gt;
* Increase the filesystem size to use the extra partition space that&#039;s now available:&lt;br /&gt;
 (connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&lt;br /&gt;
== Bash commands ==&lt;br /&gt;
&lt;br /&gt;
Install a new extnsion (replace the *tar.gz path):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
curl https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_31-6f55941.tar.gz | tar -xz -C /var/www/html/extensions&lt;br /&gt;
chown -R www-data:www-data /var/www/html/extensions&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Free disk space by trimming log file archives:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /var/log/* -name *.gz -type f -mtime +100 -exec rm {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Free disk space by dropping caches:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
free &amp;amp;&amp;amp; sync &amp;amp;&amp;amp; echo 3 &amp;gt; /proc/sys/vm/drop_caches &amp;amp;&amp;amp; free&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
See also: http://askubuntu.com/questions/5980/how-do-i-free-up-disk-space&lt;br /&gt;
&lt;br /&gt;
== Alternatives == &lt;br /&gt;
&lt;br /&gt;
* [https://www.kimsufi.com/us/en/ kimsufi dedicated server]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1092</id>
		<title>User:Peter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1092"/>
		<updated>2018-10-31T03:47:36Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* https://docs.google.com/document/d/1qoxrprVTuyt1lABAB6LtJ5ctovZwmF2_ENKoAYZrwL0&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Avatar&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| [https://wiki.playfulexploration.com/emailtest.php Click to test email]&lt;br /&gt;
| Click to send a test email to Peter&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:HTMLets#Usage HTMLets]&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:SyntaxHighlight#Usage Syntaxhighlight]&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash          &lt;br /&gt;
STR=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
echo $STR    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:PlantUML#Usage PlantUml]&lt;br /&gt;
| &amp;lt;uml&amp;gt;Bob -&amp;gt; Alice&amp;lt;/uml&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:VideoFlash#Usage VideoFlash]&lt;br /&gt;
| &amp;lt;videoflash&amp;gt;F2CIcyM6zcE|125|100&amp;lt;/videoflash&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:CategoryTree#Usage CategoryTree]&lt;br /&gt;
| &amp;lt;categorytree mode=&amp;quot;pages&amp;quot;&amp;gt;Projects&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1091</id>
		<title>User:Peter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1091"/>
		<updated>2018-10-22T05:26:19Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* https://docs.google.com/document/d/1qoxrprVTuyt1lABAB6LtJ5ctovZwmF2_ENKoAYZrwL0&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Avatar&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:HTMLets#Usage HTMLets]&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:SyntaxHighlight#Usage Syntaxhighlight]&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash          &lt;br /&gt;
STR=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
echo $STR    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:PlantUML#Usage PlantUml]&lt;br /&gt;
| &amp;lt;uml&amp;gt;Bob -&amp;gt; Alice&amp;lt;/uml&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:VideoFlash#Usage VideoFlash]&lt;br /&gt;
| &amp;lt;videoflash&amp;gt;F2CIcyM6zcE|125|100&amp;lt;/videoflash&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| [https://www.mediawiki.org/wiki/Extension:CategoryTree#Usage CategoryTree]&lt;br /&gt;
| &amp;lt;categorytree mode=&amp;quot;pages&amp;quot;&amp;gt;Projects&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Property:Owl:differentFrom&amp;diff=1090</id>
		<title>Property:Owl:differentFrom</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Property:Owl:differentFrom&amp;diff=1090"/>
		<updated>2018-10-22T02:25:16Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Imported from::owl:differentFrom]] &lt;br /&gt;
* [[Has property description::The property that determines that two given individuals are different.@en]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]] {{DISPLAYTITLE:owl:differentFrom}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Property:Foaf:homepage&amp;diff=1089</id>
		<title>Property:Foaf:homepage</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Property:Foaf:homepage&amp;diff=1089"/>
		<updated>2018-10-22T02:25:16Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Imported from::foaf:homepage]] &lt;br /&gt;
* [[Has property description::URL of the homepage of something, which is a general web resource.@en]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]] {{DISPLAYTITLE:foaf:homepage}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Property:Foaf:name&amp;diff=1088</id>
		<title>Property:Foaf:name</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Property:Foaf:name&amp;diff=1088"/>
		<updated>2018-10-22T02:25:16Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Imported from::foaf:name]] &lt;br /&gt;
* [[Has property description::A name for some thing or agent.@en]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]]{{DISPLAYTITLE:foaf:name}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Property:Foaf:knows&amp;diff=1087</id>
		<title>Property:Foaf:knows</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Property:Foaf:knows&amp;diff=1087"/>
		<updated>2018-10-22T02:25:16Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[Imported from::foaf:knows]] &lt;br /&gt;
* [[Has property description::A person known by this person (indicating some level of reciprocated interaction between the parties).@en]] &lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]] {{DISPLAYTITLE:foaf:knows}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=MediaWiki:Smw_import_owl&amp;diff=1086</id>
		<title>MediaWiki:Smw import owl</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=MediaWiki:Smw_import_owl&amp;diff=1086"/>
		<updated>2018-10-22T02:25:16Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.w3.org/2002/07/owl#|[http://www.w3.org/2002/07/owl Web Ontology Language (OWL)]&lt;br /&gt;
 AllDifferent|Category&lt;br /&gt;
 allValuesFrom|Type:Page&lt;br /&gt;
 AnnotationProperty|Category&lt;br /&gt;
 backwardCompatibleWith|Type:Page&lt;br /&gt;
 cardinality|Type:Number&lt;br /&gt;
 Class|Category&lt;br /&gt;
 comment|Type:Page&lt;br /&gt;
 complementOf|Type:Page&lt;br /&gt;
 DataRange|Category&lt;br /&gt;
 DatatypeProperty|Category&lt;br /&gt;
 DeprecatedClass|Category&lt;br /&gt;
 DeprecatedProperty|Category&lt;br /&gt;
 differentFrom|Type:Page&lt;br /&gt;
 disjointWith|Type:Page&lt;br /&gt;
 distinctMembers|Type:Page&lt;br /&gt;
 equivalentClass|Type:Page&lt;br /&gt;
 equivalentProperty|Type:Page&lt;br /&gt;
 FunctionalProperty|Category&lt;br /&gt;
 hasValue|Type:Page&lt;br /&gt;
 imports|Type:Page&lt;br /&gt;
 incompatibleWith|Type:Page&lt;br /&gt;
 intersectionOf|Type:Page&lt;br /&gt;
 InverseFunctionalProperty|Category&lt;br /&gt;
 inverseOf|Type:Page&lt;br /&gt;
 isDefinedBy|Type:Page&lt;br /&gt;
 label|Type:Page&lt;br /&gt;
 maxCardinality|Type:Number&lt;br /&gt;
 minCardinality|Type:Number&lt;br /&gt;
 Nothing|Category&lt;br /&gt;
 ObjectProperty|Category&lt;br /&gt;
 oneOf|Type:Page&lt;br /&gt;
 onProperty|Type:Page&lt;br /&gt;
 Ontology|Category&lt;br /&gt;
 OntologyProperty|Category&lt;br /&gt;
 owl|Type:Page&lt;br /&gt;
 priorVersion|Type:Page&lt;br /&gt;
 Restriction|Category&lt;br /&gt;
 sameAs|Type:Page&lt;br /&gt;
 seeAlso|Type:Page&lt;br /&gt;
 someValuesFrom|Type:Page&lt;br /&gt;
 SymmetricProperty|Category&lt;br /&gt;
 Thing|Category&lt;br /&gt;
 TransitiveProperty|Category&lt;br /&gt;
 unionOf|Type:Page&lt;br /&gt;
 versionInfo|Type:Page&lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=MediaWiki:Smw_import_foaf&amp;diff=1085</id>
		<title>MediaWiki:Smw import foaf</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=MediaWiki:Smw_import_foaf&amp;diff=1085"/>
		<updated>2018-10-22T02:25:15Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://xmlns.com/foaf/0.1/|[http://www.foaf-project.org/ Friend Of A Friend]&lt;br /&gt;
 name|Type:Text&lt;br /&gt;
 homepage|Type:URL&lt;br /&gt;
 mbox|Type:Email&lt;br /&gt;
 mbox_sha1sum|Type:Text&lt;br /&gt;
 depiction|Type:URL&lt;br /&gt;
 phone|Type:Text&lt;br /&gt;
 Person|Category&lt;br /&gt;
 Organization|Category&lt;br /&gt;
 knows|Type:Page&lt;br /&gt;
 member|Type:Page&lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=MediaWiki:Smw_import_skos&amp;diff=1084</id>
		<title>MediaWiki:Smw import skos</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=MediaWiki:Smw_import_skos&amp;diff=1084"/>
		<updated>2018-10-22T02:25:15Z</updated>

		<summary type="html">&lt;p&gt;Peter: Semantic MediaWiki default vocabulary import&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;http://www.w3.org/2004/02/skos/core#|[http://www.w3.org/TR/skos-reference/skos.rdf Simple Knowledge Organization System (SKOS)]&lt;br /&gt;
 altLabel|Type:Monolingual text&lt;br /&gt;
 broader|Type:Annotation URI&lt;br /&gt;
 broaderTransitive|Type:Annotation URI&lt;br /&gt;
 broadMatch|Type:Annotation URI&lt;br /&gt;
 changeNote|Type:Text&lt;br /&gt;
 closeMatch|Type:Annotation URI&lt;br /&gt;
 Collection|Class&lt;br /&gt;
 Concept|Class&lt;br /&gt;
 ConceptScheme|Class&lt;br /&gt;
 definition|Type:Text&lt;br /&gt;
 editorialNote|Type:Text&lt;br /&gt;
 exactMatch|Type:Annotation URI&lt;br /&gt;
 example|Type:Text&lt;br /&gt;
 hasTopConcept|Type:Page&lt;br /&gt;
 hiddenLabel|Type:String&lt;br /&gt;
 historyNote|Type:Text&lt;br /&gt;
 inScheme|Type:Page&lt;br /&gt;
 mappingRelation|Type:Page&lt;br /&gt;
 member|Type:Page&lt;br /&gt;
 memberList|Type:Page&lt;br /&gt;
 narrower|Type:Annotation URI&lt;br /&gt;
 narrowerTransitive|Type:Annotation URI&lt;br /&gt;
 narrowMatch|Type:Annotation URI&lt;br /&gt;
 notation|Type:Text&lt;br /&gt;
 note|Type:Text&lt;br /&gt;
 OrderedCollection|Class&lt;br /&gt;
 prefLabel|Type:String&lt;br /&gt;
 related|Type:Annotation URI&lt;br /&gt;
 relatedMatch|Type:Annotation URI&lt;br /&gt;
 scopeNote|Type:Text&lt;br /&gt;
 semanticRelation|Type:Page&lt;br /&gt;
 topConceptOf|Type:Page&lt;br /&gt;
&lt;br /&gt;
[[Category:Imported vocabulary]]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1083</id>
		<title>Projects/Mini Plotter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1083"/>
		<updated>2018-08-03T07:12:03Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* plot library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== STM32F103C_stepper.ino ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Notes !! Code !! Image&lt;br /&gt;
|-&lt;br /&gt;
| Main routines&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
#include &amp;lt;io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;plot.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/lang/api/analogwrite.html&lt;br /&gt;
HardwareTimer timer(3);&lt;br /&gt;
&lt;br /&gt;
int servo_min = map(1, 0, 20, 0, 65535);&lt;br /&gt;
int servo_max = map(2, 0, 20, 0, 65535);&lt;br /&gt;
&lt;br /&gt;
#define angle(deg) map(deg, 0, 180, servo_min, servo_max)&lt;br /&gt;
#define pen(on) (pwmWrite(PB0, angle(on ? 120 : 85)), delay(80))&lt;br /&gt;
&lt;br /&gt;
volatile int ww = 900;&lt;br /&gt;
volatile int w = ww;&lt;br /&gt;
&lt;br /&gt;
Plot plot(2);&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  Serial.print(&amp;quot;Hello!&amp;quot;);&lt;br /&gt;
  pinMode(PA0, OUTPUT);&lt;br /&gt;
  pinMode(PA1, OUTPUT);&lt;br /&gt;
  pinMode(PA2, OUTPUT);&lt;br /&gt;
  pinMode(PA3, OUTPUT);&lt;br /&gt;
  pinMode(PA4, OUTPUT);&lt;br /&gt;
  pinMode(PA5, OUTPUT);&lt;br /&gt;
  pinMode(PA6, OUTPUT);&lt;br /&gt;
  pinMode(PA7, OUTPUT);&lt;br /&gt;
  pinMode(PC13, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
  timer.setPeriod(20000);&lt;br /&gt;
  pinMode(PB0, PWM);&lt;br /&gt;
  pen(0);&lt;br /&gt;
&lt;br /&gt;
  for (int i = 5; i--;)&lt;br /&gt;
  {&lt;br /&gt;
    digitalWrite(PC13, 0);&lt;br /&gt;
    delay(200);&lt;br /&gt;
    digitalWrite(PC13, 1);&lt;br /&gt;
    delay(500);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 180; i++) { pwmWrite(PB0, angle(i)); delay(5000/180); }&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 5; i++) { pen(1); delay(1000); pen(0); delay(1000); }&lt;br /&gt;
&lt;br /&gt;
  plot.homing(ww);&lt;br /&gt;
  w = ww / 2;&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.zero();&lt;br /&gt;
  delay(1000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int ar[] = {20, 30, 40, 33};&lt;br /&gt;
const unsigned int sz = sizeof(ar) / sizeof(int);&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  if (loop3())   //&amp;lt;-- change the loop number to run different plottings&lt;br /&gt;
    return;&lt;br /&gt;
&lt;br /&gt;
  pen(0);&lt;br /&gt;
  plot.moveTo(ww / 2, ww / 2);&lt;br /&gt;
  plot.sleep();&lt;br /&gt;
  while (1)&lt;br /&gt;
    ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Square Spiral&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop1()&lt;br /&gt;
{&lt;br /&gt;
  sq0(w);&lt;br /&gt;
  w -= 40;&lt;br /&gt;
  return w &amp;gt; 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq0(int w)&lt;br /&gt;
{&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| https://youtu.be/ypERBG_X-Vs&lt;br /&gt;
|-&lt;br /&gt;
| Rotating Squares&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop2()&lt;br /&gt;
{&lt;br /&gt;
  sq1(w);&lt;br /&gt;
  sq2(w);&lt;br /&gt;
  w /= 2;&lt;br /&gt;
  return w &amp;gt; 10;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq1(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq2(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(0, -w);&lt;br /&gt;
  plot.moveTo(w, 0);&lt;br /&gt;
  plot.moveTo(0, w);&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hilbert Curve&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop3()&lt;br /&gt;
{&lt;br /&gt;
  // 1-1&lt;br /&gt;
  // 2-3&lt;br /&gt;
  // 3-7&lt;br /&gt;
  // 4-15&lt;br /&gt;
  // 5-31&lt;br /&gt;
  int r = 4;&lt;br /&gt;
  int x = 2 * w / ((1 &amp;lt;&amp;lt; r) - 1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  hilbert(r, x, 0);&lt;br /&gt;
&lt;br /&gt;
  return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void hilbert(int depth, int dx, int dy)&lt;br /&gt;
{&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dy, dx);&lt;br /&gt;
  plot.moveRel(dx, dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(dy, dx);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(-dx, -dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, -dy, -dx);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== plot library ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| plot.h&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// Author: Peter Hartmann&lt;br /&gt;
#ifndef PLOT_H_&lt;br /&gt;
#define PLOT_H_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;Arduino.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class Plot&lt;br /&gt;
{&lt;br /&gt;
  public:&lt;br /&gt;
    Plot(int slow);&lt;br /&gt;
    void zero();&lt;br /&gt;
    void sleep();&lt;br /&gt;
    void homing(int steps);&lt;br /&gt;
    void moveTo(int x1, int y1);&lt;br /&gt;
    void moveRel(int x, int y);&lt;br /&gt;
&lt;br /&gt;
  private:&lt;br /&gt;
    void step1(int sx, int sy);&lt;br /&gt;
    int stepper_map[8] = {11, 10, 14, 6, 7, 5, 13, 9};&lt;br /&gt;
    int slow = 2;&lt;br /&gt;
    int xx;&lt;br /&gt;
    int yy;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif /* PLOT_H_ */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| plot.cpp&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
// Author: Peter Hartmann&lt;br /&gt;
#include &amp;quot;plot.h&amp;quot;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot::Plot(int slow)&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;slow = slow;&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::sleep()&lt;br /&gt;
{&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = 0b11111111 &amp;lt;&amp;lt; 16;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::step1(int sx, int sy)&lt;br /&gt;
{&lt;br /&gt;
	xx += sx;&lt;br /&gt;
	yy += sy;&lt;br /&gt;
&lt;br /&gt;
	int op = stepper_map[yy &amp;amp; 7] &amp;lt;&amp;lt; 4 | stepper_map[xx &amp;amp; 7];&lt;br /&gt;
	// trun stepper off if not moving&lt;br /&gt;
	if (sx == 0)&lt;br /&gt;
		op |= 0b00001111;&lt;br /&gt;
	if (sy == 0)&lt;br /&gt;
		op |= 0b11110000;&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = (0b11111111 &amp;lt;&amp;lt; 16) | op;&lt;br /&gt;
	delay(slow);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::zero()&lt;br /&gt;
{&lt;br /&gt;
	xx = 0;&lt;br /&gt;
	yy = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::moveTo(int x1, int y1)&lt;br /&gt;
{&lt;br /&gt;
	int x0 = xx;&lt;br /&gt;
	int y0 = yy;&lt;br /&gt;
	int steep = abs(y1 - y0) &amp;gt; abs(x1 - x0);&lt;br /&gt;
	if (steep)&lt;br /&gt;
	{&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		y0 ^= x0;&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
		y1 ^= x1;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
	} //swap&lt;br /&gt;
	int deltax = abs(x1 - x0);&lt;br /&gt;
	int deltay = abs(y1 - y0);&lt;br /&gt;
	int error = deltax / 2;&lt;br /&gt;
&lt;br /&gt;
	int incX = x0 &amp;lt; x1 ? 1 : -1;&lt;br /&gt;
	int incY = y0 &amp;lt; y1 ? 1 : -1;&lt;br /&gt;
&lt;br /&gt;
	int goY = 0;&lt;br /&gt;
&lt;br /&gt;
	int x = deltax;&lt;br /&gt;
	while (x-- &amp;gt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		if (steep)&lt;br /&gt;
			step1(goY, incX);&lt;br /&gt;
		else&lt;br /&gt;
			step1(incX, goY);&lt;br /&gt;
		goY = 0;&lt;br /&gt;
&lt;br /&gt;
		error = error - deltay;&lt;br /&gt;
		if (error &amp;lt; 0)&lt;br /&gt;
		{&lt;br /&gt;
			goY = incY;&lt;br /&gt;
			error = error + deltax;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
void Plot::moveRel(int x, int y)&lt;br /&gt;
{&lt;br /&gt;
	moveTo(xx + x, yy + y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::homing(int steps)&lt;br /&gt;
{&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(-steps, -steps);&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(8, 8);&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1082</id>
		<title>Projects/Mini Plotter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1082"/>
		<updated>2018-08-03T07:09:38Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* plot library */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== STM32F103C_stepper.ino ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Notes !! Code !! Image&lt;br /&gt;
|-&lt;br /&gt;
| Main routines&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
#include &amp;lt;io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;plot.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/lang/api/analogwrite.html&lt;br /&gt;
HardwareTimer timer(3);&lt;br /&gt;
&lt;br /&gt;
int servo_min = map(1, 0, 20, 0, 65535);&lt;br /&gt;
int servo_max = map(2, 0, 20, 0, 65535);&lt;br /&gt;
&lt;br /&gt;
#define angle(deg) map(deg, 0, 180, servo_min, servo_max)&lt;br /&gt;
#define pen(on) (pwmWrite(PB0, angle(on ? 120 : 85)), delay(80))&lt;br /&gt;
&lt;br /&gt;
volatile int ww = 900;&lt;br /&gt;
volatile int w = ww;&lt;br /&gt;
&lt;br /&gt;
Plot plot(2);&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  Serial.print(&amp;quot;Hello!&amp;quot;);&lt;br /&gt;
  pinMode(PA0, OUTPUT);&lt;br /&gt;
  pinMode(PA1, OUTPUT);&lt;br /&gt;
  pinMode(PA2, OUTPUT);&lt;br /&gt;
  pinMode(PA3, OUTPUT);&lt;br /&gt;
  pinMode(PA4, OUTPUT);&lt;br /&gt;
  pinMode(PA5, OUTPUT);&lt;br /&gt;
  pinMode(PA6, OUTPUT);&lt;br /&gt;
  pinMode(PA7, OUTPUT);&lt;br /&gt;
  pinMode(PC13, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
  timer.setPeriod(20000);&lt;br /&gt;
  pinMode(PB0, PWM);&lt;br /&gt;
  pen(0);&lt;br /&gt;
&lt;br /&gt;
  for (int i = 5; i--;)&lt;br /&gt;
  {&lt;br /&gt;
    digitalWrite(PC13, 0);&lt;br /&gt;
    delay(200);&lt;br /&gt;
    digitalWrite(PC13, 1);&lt;br /&gt;
    delay(500);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 180; i++) { pwmWrite(PB0, angle(i)); delay(5000/180); }&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 5; i++) { pen(1); delay(1000); pen(0); delay(1000); }&lt;br /&gt;
&lt;br /&gt;
  plot.homing(ww);&lt;br /&gt;
  w = ww / 2;&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.zero();&lt;br /&gt;
  delay(1000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int ar[] = {20, 30, 40, 33};&lt;br /&gt;
const unsigned int sz = sizeof(ar) / sizeof(int);&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  if (loop3())   //&amp;lt;-- change the loop number to run different plottings&lt;br /&gt;
    return;&lt;br /&gt;
&lt;br /&gt;
  pen(0);&lt;br /&gt;
  plot.moveTo(ww / 2, ww / 2);&lt;br /&gt;
  plot.sleep();&lt;br /&gt;
  while (1)&lt;br /&gt;
    ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Square Spiral&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop1()&lt;br /&gt;
{&lt;br /&gt;
  sq0(w);&lt;br /&gt;
  w -= 40;&lt;br /&gt;
  return w &amp;gt; 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq0(int w)&lt;br /&gt;
{&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| https://youtu.be/ypERBG_X-Vs&lt;br /&gt;
|-&lt;br /&gt;
| Rotating Squares&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop2()&lt;br /&gt;
{&lt;br /&gt;
  sq1(w);&lt;br /&gt;
  sq2(w);&lt;br /&gt;
  w /= 2;&lt;br /&gt;
  return w &amp;gt; 10;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq1(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq2(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(0, -w);&lt;br /&gt;
  plot.moveTo(w, 0);&lt;br /&gt;
  plot.moveTo(0, w);&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hilbert Curve&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop3()&lt;br /&gt;
{&lt;br /&gt;
  // 1-1&lt;br /&gt;
  // 2-3&lt;br /&gt;
  // 3-7&lt;br /&gt;
  // 4-15&lt;br /&gt;
  // 5-31&lt;br /&gt;
  int r = 4;&lt;br /&gt;
  int x = 2 * w / ((1 &amp;lt;&amp;lt; r) - 1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  hilbert(r, x, 0);&lt;br /&gt;
&lt;br /&gt;
  return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void hilbert(int depth, int dx, int dy)&lt;br /&gt;
{&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dy, dx);&lt;br /&gt;
  plot.moveRel(dx, dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(dy, dx);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(-dx, -dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, -dy, -dx);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== plot library ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| plot.h&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#ifndef PLOT_H_&lt;br /&gt;
#define PLOT_H_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;Arduino.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class Plot&lt;br /&gt;
{&lt;br /&gt;
  public:&lt;br /&gt;
    Plot(int slow);&lt;br /&gt;
    void zero();&lt;br /&gt;
    void sleep();&lt;br /&gt;
    void homing(int steps);&lt;br /&gt;
    void moveTo(int x1, int y1);&lt;br /&gt;
    void moveRel(int x, int y);&lt;br /&gt;
&lt;br /&gt;
  private:&lt;br /&gt;
    void step1(int sx, int sy);&lt;br /&gt;
    int stepper_map[8] = {11, 10, 14, 6, 7, 5, 13, 9};&lt;br /&gt;
    int slow = 2;&lt;br /&gt;
    int xx;&lt;br /&gt;
    int yy;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif /* PLOT_H_ */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| plot.cpp&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;quot;plot.h&amp;quot;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot::Plot(int slow)&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;slow = slow;&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::sleep()&lt;br /&gt;
{&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = 0b11111111 &amp;lt;&amp;lt; 16;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::step1(int sx, int sy)&lt;br /&gt;
{&lt;br /&gt;
	xx += sx;&lt;br /&gt;
	yy += sy;&lt;br /&gt;
&lt;br /&gt;
	int op = stepper_map[yy &amp;amp; 7] &amp;lt;&amp;lt; 4 | stepper_map[xx &amp;amp; 7];&lt;br /&gt;
	// trun stepper off if not moving&lt;br /&gt;
	if (sx == 0)&lt;br /&gt;
		op |= 0b00001111;&lt;br /&gt;
	if (sy == 0)&lt;br /&gt;
		op |= 0b11110000;&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = (0b11111111 &amp;lt;&amp;lt; 16) | op;&lt;br /&gt;
	delay(slow);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::zero()&lt;br /&gt;
{&lt;br /&gt;
	xx = 0;&lt;br /&gt;
	yy = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::moveTo(int x1, int y1)&lt;br /&gt;
{&lt;br /&gt;
	int x0 = xx;&lt;br /&gt;
	int y0 = yy;&lt;br /&gt;
	int steep = abs(y1 - y0) &amp;gt; abs(x1 - x0);&lt;br /&gt;
	if (steep)&lt;br /&gt;
	{&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		y0 ^= x0;&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
		y1 ^= x1;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
	} //swap&lt;br /&gt;
	int deltax = abs(x1 - x0);&lt;br /&gt;
	int deltay = abs(y1 - y0);&lt;br /&gt;
	int error = deltax / 2;&lt;br /&gt;
&lt;br /&gt;
	int incX = x0 &amp;lt; x1 ? 1 : -1;&lt;br /&gt;
	int incY = y0 &amp;lt; y1 ? 1 : -1;&lt;br /&gt;
&lt;br /&gt;
	int goY = 0;&lt;br /&gt;
&lt;br /&gt;
	int x = deltax;&lt;br /&gt;
	while (x-- &amp;gt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		if (steep)&lt;br /&gt;
			step1(goY, incX);&lt;br /&gt;
		else&lt;br /&gt;
			step1(incX, goY);&lt;br /&gt;
		goY = 0;&lt;br /&gt;
&lt;br /&gt;
		error = error - deltay;&lt;br /&gt;
		if (error &amp;lt; 0)&lt;br /&gt;
		{&lt;br /&gt;
			goY = incY;&lt;br /&gt;
			error = error + deltax;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
void Plot::moveRel(int x, int y)&lt;br /&gt;
{&lt;br /&gt;
	moveTo(xx + x, yy + y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::homing(int steps)&lt;br /&gt;
{&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(-steps, -steps);&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(8, 8);&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1081</id>
		<title>Projects/Mini Plotter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1081"/>
		<updated>2018-08-03T07:08:41Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* STM32F103C_stepper.ino */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== STM32F103C_stepper.ino ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Notes !! Code !! Image&lt;br /&gt;
|-&lt;br /&gt;
| Main routines&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
#include &amp;lt;io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;plot.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/lang/api/analogwrite.html&lt;br /&gt;
HardwareTimer timer(3);&lt;br /&gt;
&lt;br /&gt;
int servo_min = map(1, 0, 20, 0, 65535);&lt;br /&gt;
int servo_max = map(2, 0, 20, 0, 65535);&lt;br /&gt;
&lt;br /&gt;
#define angle(deg) map(deg, 0, 180, servo_min, servo_max)&lt;br /&gt;
#define pen(on) (pwmWrite(PB0, angle(on ? 120 : 85)), delay(80))&lt;br /&gt;
&lt;br /&gt;
volatile int ww = 900;&lt;br /&gt;
volatile int w = ww;&lt;br /&gt;
&lt;br /&gt;
Plot plot(2);&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  Serial.print(&amp;quot;Hello!&amp;quot;);&lt;br /&gt;
  pinMode(PA0, OUTPUT);&lt;br /&gt;
  pinMode(PA1, OUTPUT);&lt;br /&gt;
  pinMode(PA2, OUTPUT);&lt;br /&gt;
  pinMode(PA3, OUTPUT);&lt;br /&gt;
  pinMode(PA4, OUTPUT);&lt;br /&gt;
  pinMode(PA5, OUTPUT);&lt;br /&gt;
  pinMode(PA6, OUTPUT);&lt;br /&gt;
  pinMode(PA7, OUTPUT);&lt;br /&gt;
  pinMode(PC13, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
  timer.setPeriod(20000);&lt;br /&gt;
  pinMode(PB0, PWM);&lt;br /&gt;
  pen(0);&lt;br /&gt;
&lt;br /&gt;
  for (int i = 5; i--;)&lt;br /&gt;
  {&lt;br /&gt;
    digitalWrite(PC13, 0);&lt;br /&gt;
    delay(200);&lt;br /&gt;
    digitalWrite(PC13, 1);&lt;br /&gt;
    delay(500);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 180; i++) { pwmWrite(PB0, angle(i)); delay(5000/180); }&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 5; i++) { pen(1); delay(1000); pen(0); delay(1000); }&lt;br /&gt;
&lt;br /&gt;
  plot.homing(ww);&lt;br /&gt;
  w = ww / 2;&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.zero();&lt;br /&gt;
  delay(1000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int ar[] = {20, 30, 40, 33};&lt;br /&gt;
const unsigned int sz = sizeof(ar) / sizeof(int);&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  if (loop3())   //&amp;lt;-- change the loop number to run different plottings&lt;br /&gt;
    return;&lt;br /&gt;
&lt;br /&gt;
  pen(0);&lt;br /&gt;
  plot.moveTo(ww / 2, ww / 2);&lt;br /&gt;
  plot.sleep();&lt;br /&gt;
  while (1)&lt;br /&gt;
    ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Square Spiral&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop1()&lt;br /&gt;
{&lt;br /&gt;
  sq0(w);&lt;br /&gt;
  w -= 40;&lt;br /&gt;
  return w &amp;gt; 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq0(int w)&lt;br /&gt;
{&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| https://youtu.be/ypERBG_X-Vs&lt;br /&gt;
|-&lt;br /&gt;
| Rotating Squares&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop2()&lt;br /&gt;
{&lt;br /&gt;
  sq1(w);&lt;br /&gt;
  sq2(w);&lt;br /&gt;
  w /= 2;&lt;br /&gt;
  return w &amp;gt; 10;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq1(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq2(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(0, -w);&lt;br /&gt;
  plot.moveTo(w, 0);&lt;br /&gt;
  plot.moveTo(0, w);&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hilbert Curve&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
bool loop3()&lt;br /&gt;
{&lt;br /&gt;
  // 1-1&lt;br /&gt;
  // 2-3&lt;br /&gt;
  // 3-7&lt;br /&gt;
  // 4-15&lt;br /&gt;
  // 5-31&lt;br /&gt;
  int r = 4;&lt;br /&gt;
  int x = 2 * w / ((1 &amp;lt;&amp;lt; r) - 1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  hilbert(r, x, 0);&lt;br /&gt;
&lt;br /&gt;
  return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void hilbert(int depth, int dx, int dy)&lt;br /&gt;
{&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dy, dx);&lt;br /&gt;
  plot.moveRel(dx, dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(dy, dx);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(-dx, -dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, -dy, -dx);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== plot library ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| plot.h&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
#ifndef PLOT_H_&lt;br /&gt;
#define PLOT_H_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;Arduino.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class Plot&lt;br /&gt;
{&lt;br /&gt;
  public:&lt;br /&gt;
    Plot(int slow);&lt;br /&gt;
    void zero();&lt;br /&gt;
    void sleep();&lt;br /&gt;
    void homing(int steps);&lt;br /&gt;
    void moveTo(int x1, int y1);&lt;br /&gt;
    void moveRel(int x, int y);&lt;br /&gt;
&lt;br /&gt;
  private:&lt;br /&gt;
    void step1(int sx, int sy);&lt;br /&gt;
    int stepper_map[8] = {11, 10, 14, 6, 7, 5, 13, 9};&lt;br /&gt;
    int slow = 2;&lt;br /&gt;
    int xx;&lt;br /&gt;
    int yy;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif /* PLOT_H_ */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| plot.cpp&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
#include &amp;quot;plot.h&amp;quot;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot::Plot(int slow)&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;slow = slow;&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::sleep()&lt;br /&gt;
{&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = 0b11111111 &amp;lt;&amp;lt; 16;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::step1(int sx, int sy)&lt;br /&gt;
{&lt;br /&gt;
	xx += sx;&lt;br /&gt;
	yy += sy;&lt;br /&gt;
&lt;br /&gt;
	int op = stepper_map[yy &amp;amp; 7] &amp;lt;&amp;lt; 4 | stepper_map[xx &amp;amp; 7];&lt;br /&gt;
	// trun stepper off if not moving&lt;br /&gt;
	if (sx == 0)&lt;br /&gt;
		op |= 0b00001111;&lt;br /&gt;
	if (sy == 0)&lt;br /&gt;
		op |= 0b11110000;&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = (0b11111111 &amp;lt;&amp;lt; 16) | op;&lt;br /&gt;
	delay(slow);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::zero()&lt;br /&gt;
{&lt;br /&gt;
	xx = 0;&lt;br /&gt;
	yy = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::moveTo(int x1, int y1)&lt;br /&gt;
{&lt;br /&gt;
	int x0 = xx;&lt;br /&gt;
	int y0 = yy;&lt;br /&gt;
	int steep = abs(y1 - y0) &amp;gt; abs(x1 - x0);&lt;br /&gt;
	if (steep)&lt;br /&gt;
	{&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		y0 ^= x0;&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
		y1 ^= x1;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
	} //swap&lt;br /&gt;
	int deltax = abs(x1 - x0);&lt;br /&gt;
	int deltay = abs(y1 - y0);&lt;br /&gt;
	int error = deltax / 2;&lt;br /&gt;
&lt;br /&gt;
	int incX = x0 &amp;lt; x1 ? 1 : -1;&lt;br /&gt;
	int incY = y0 &amp;lt; y1 ? 1 : -1;&lt;br /&gt;
&lt;br /&gt;
	int goY = 0;&lt;br /&gt;
&lt;br /&gt;
	int x = deltax;&lt;br /&gt;
	while (x-- &amp;gt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		if (steep)&lt;br /&gt;
			step1(goY, incX);&lt;br /&gt;
		else&lt;br /&gt;
			step1(incX, goY);&lt;br /&gt;
		goY = 0;&lt;br /&gt;
&lt;br /&gt;
		error = error - deltay;&lt;br /&gt;
		if (error &amp;lt; 0)&lt;br /&gt;
		{&lt;br /&gt;
			goY = incY;&lt;br /&gt;
			error = error + deltax;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
void Plot::moveRel(int x, int y)&lt;br /&gt;
{&lt;br /&gt;
	moveTo(xx + x, yy + y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::homing(int steps)&lt;br /&gt;
{&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(-steps, -steps);&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(8, 8);&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1080</id>
		<title>Projects/Mini Plotter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Mini_Plotter&amp;diff=1080"/>
		<updated>2018-08-03T07:06:34Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== STM32F103C_stepper.ino ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Notes !! Code !! Image&lt;br /&gt;
|-&lt;br /&gt;
| Main routines&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
#include &amp;lt;io.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;plot.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
//http://docs.leaflabs.com/static.leaflabs.com/pub/leaflabs/maple-docs/0.0.12/lang/api/analogwrite.html&lt;br /&gt;
HardwareTimer timer(3);&lt;br /&gt;
&lt;br /&gt;
int servo_min = map(1, 0, 20, 0, 65535);&lt;br /&gt;
int servo_max = map(2, 0, 20, 0, 65535);&lt;br /&gt;
&lt;br /&gt;
#define angle(deg) map(deg, 0, 180, servo_min, servo_max)&lt;br /&gt;
#define pen(on) (pwmWrite(PB0, angle(on ? 120 : 85)), delay(80))&lt;br /&gt;
&lt;br /&gt;
volatile int ww = 900;&lt;br /&gt;
volatile int w = ww;&lt;br /&gt;
&lt;br /&gt;
Plot plot(2);&lt;br /&gt;
&lt;br /&gt;
void setup()&lt;br /&gt;
{&lt;br /&gt;
  Serial.begin(9600);&lt;br /&gt;
  Serial.print(&amp;quot;Hello!&amp;quot;);&lt;br /&gt;
  pinMode(PA0, OUTPUT);&lt;br /&gt;
  pinMode(PA1, OUTPUT);&lt;br /&gt;
  pinMode(PA2, OUTPUT);&lt;br /&gt;
  pinMode(PA3, OUTPUT);&lt;br /&gt;
  pinMode(PA4, OUTPUT);&lt;br /&gt;
  pinMode(PA5, OUTPUT);&lt;br /&gt;
  pinMode(PA6, OUTPUT);&lt;br /&gt;
  pinMode(PA7, OUTPUT);&lt;br /&gt;
  pinMode(PC13, OUTPUT);&lt;br /&gt;
&lt;br /&gt;
  timer.setPeriod(20000);&lt;br /&gt;
  pinMode(PB0, PWM);&lt;br /&gt;
  pen(0);&lt;br /&gt;
&lt;br /&gt;
  for (int i = 5; i--;)&lt;br /&gt;
  {&lt;br /&gt;
    digitalWrite(PC13, 0);&lt;br /&gt;
    delay(200);&lt;br /&gt;
    digitalWrite(PC13, 1);&lt;br /&gt;
    delay(500);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 180; i++) { pwmWrite(PB0, angle(i)); delay(5000/180); }&lt;br /&gt;
  //for (int i = 0; i &amp;lt; 5; i++) { pen(1); delay(1000); pen(0); delay(1000); }&lt;br /&gt;
&lt;br /&gt;
  plot.homing(ww);&lt;br /&gt;
  w = ww / 2;&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.zero();&lt;br /&gt;
  delay(1000);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int ar[] = {20, 30, 40, 33};&lt;br /&gt;
const unsigned int sz = sizeof(ar) / sizeof(int);&lt;br /&gt;
&lt;br /&gt;
void loop()&lt;br /&gt;
{&lt;br /&gt;
  if (loop3())   //&amp;lt;-- change the loop number to run different plottings&lt;br /&gt;
    return;&lt;br /&gt;
&lt;br /&gt;
  pen(0);&lt;br /&gt;
  plot.moveTo(ww / 2, ww / 2);&lt;br /&gt;
  plot.sleep();&lt;br /&gt;
  while (1)&lt;br /&gt;
    ;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Square Spiral&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
bool loop1()&lt;br /&gt;
{&lt;br /&gt;
  sq0(w);&lt;br /&gt;
  w -= 40;&lt;br /&gt;
  return w &amp;gt; 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq0(int w)&lt;br /&gt;
{&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| https://youtu.be/ypERBG_X-Vs&lt;br /&gt;
|-&lt;br /&gt;
| Rotating Squares&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
bool loop2()&lt;br /&gt;
{&lt;br /&gt;
  sq1(w);&lt;br /&gt;
  sq2(w);&lt;br /&gt;
  w /= 2;&lt;br /&gt;
  return w &amp;gt; 10;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq1(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(-w, w);&lt;br /&gt;
  plot.moveTo(w, w);&lt;br /&gt;
  plot.moveTo(w, -w);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void sq2(int w)&lt;br /&gt;
{&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  plot.moveTo(0, -w);&lt;br /&gt;
  plot.moveTo(w, 0);&lt;br /&gt;
  plot.moveTo(0, w);&lt;br /&gt;
  plot.moveTo(-w, 0);&lt;br /&gt;
  pen(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Hilbert Curve&lt;br /&gt;
| &amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
bool loop3()&lt;br /&gt;
{&lt;br /&gt;
  // 1-1&lt;br /&gt;
  // 2-3&lt;br /&gt;
  // 3-7&lt;br /&gt;
  // 4-15&lt;br /&gt;
  // 5-31&lt;br /&gt;
  int r = 4;&lt;br /&gt;
  int x = 2 * w / ((1 &amp;lt;&amp;lt; r) - 1);&lt;br /&gt;
  plot.moveTo(-w, -w);&lt;br /&gt;
  pen(1);&lt;br /&gt;
  hilbert(r, x, 0);&lt;br /&gt;
&lt;br /&gt;
  return false;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void hilbert(int depth, int dx, int dy)&lt;br /&gt;
{&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dy, dx);&lt;br /&gt;
  plot.moveRel(dx, dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(dy, dx);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, dx, dy);&lt;br /&gt;
  plot.moveRel(-dx, -dy);&lt;br /&gt;
  if (depth &amp;gt; 1)&lt;br /&gt;
    hilbert(depth - 1, -dy, -dx);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== plot library ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
| plot.h&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
#ifndef PLOT_H_&lt;br /&gt;
#define PLOT_H_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;Arduino.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class Plot&lt;br /&gt;
{&lt;br /&gt;
  public:&lt;br /&gt;
    Plot(int slow);&lt;br /&gt;
    void zero();&lt;br /&gt;
    void sleep();&lt;br /&gt;
    void homing(int steps);&lt;br /&gt;
    void moveTo(int x1, int y1);&lt;br /&gt;
    void moveRel(int x, int y);&lt;br /&gt;
&lt;br /&gt;
  private:&lt;br /&gt;
    void step1(int sx, int sy);&lt;br /&gt;
    int stepper_map[8] = {11, 10, 14, 6, 7, 5, 13, 9};&lt;br /&gt;
    int slow = 2;&lt;br /&gt;
    int xx;&lt;br /&gt;
    int yy;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
#endif /* PLOT_H_ */&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| plot.cpp&lt;br /&gt;
| &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
#include &amp;quot;plot.h&amp;quot;&lt;br /&gt;
#include &amp;lt;Arduino.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Plot::Plot(int slow)&lt;br /&gt;
{&lt;br /&gt;
	this-&amp;gt;slow = slow;&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::sleep()&lt;br /&gt;
{&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = 0b11111111 &amp;lt;&amp;lt; 16;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::step1(int sx, int sy)&lt;br /&gt;
{&lt;br /&gt;
	xx += sx;&lt;br /&gt;
	yy += sy;&lt;br /&gt;
&lt;br /&gt;
	int op = stepper_map[yy &amp;amp; 7] &amp;lt;&amp;lt; 4 | stepper_map[xx &amp;amp; 7];&lt;br /&gt;
	// trun stepper off if not moving&lt;br /&gt;
	if (sx == 0)&lt;br /&gt;
		op |= 0b00001111;&lt;br /&gt;
	if (sy == 0)&lt;br /&gt;
		op |= 0b11110000;&lt;br /&gt;
	GPIOA-&amp;gt;regs-&amp;gt;BSRR = (0b11111111 &amp;lt;&amp;lt; 16) | op;&lt;br /&gt;
	delay(slow);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::zero()&lt;br /&gt;
{&lt;br /&gt;
	xx = 0;&lt;br /&gt;
	yy = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::moveTo(int x1, int y1)&lt;br /&gt;
{&lt;br /&gt;
	int x0 = xx;&lt;br /&gt;
	int y0 = yy;&lt;br /&gt;
	int steep = abs(y1 - y0) &amp;gt; abs(x1 - x0);&lt;br /&gt;
	if (steep)&lt;br /&gt;
	{&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		y0 ^= x0;&lt;br /&gt;
		x0 ^= y0;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
		y1 ^= x1;&lt;br /&gt;
		x1 ^= y1;&lt;br /&gt;
	} //swap&lt;br /&gt;
	int deltax = abs(x1 - x0);&lt;br /&gt;
	int deltay = abs(y1 - y0);&lt;br /&gt;
	int error = deltax / 2;&lt;br /&gt;
&lt;br /&gt;
	int incX = x0 &amp;lt; x1 ? 1 : -1;&lt;br /&gt;
	int incY = y0 &amp;lt; y1 ? 1 : -1;&lt;br /&gt;
&lt;br /&gt;
	int goY = 0;&lt;br /&gt;
&lt;br /&gt;
	int x = deltax;&lt;br /&gt;
	while (x-- &amp;gt; 0)&lt;br /&gt;
	{&lt;br /&gt;
		if (steep)&lt;br /&gt;
			step1(goY, incX);&lt;br /&gt;
		else&lt;br /&gt;
			step1(incX, goY);&lt;br /&gt;
		goY = 0;&lt;br /&gt;
&lt;br /&gt;
		error = error - deltay;&lt;br /&gt;
		if (error &amp;lt; 0)&lt;br /&gt;
		{&lt;br /&gt;
			goY = incY;&lt;br /&gt;
			error = error + deltax;&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
void Plot::moveRel(int x, int y)&lt;br /&gt;
{&lt;br /&gt;
	moveTo(xx + x, yy + y);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void Plot::homing(int steps)&lt;br /&gt;
{&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(-steps, -steps);&lt;br /&gt;
	zero();&lt;br /&gt;
	moveTo(8, 8);&lt;br /&gt;
	zero();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=This_Server&amp;diff=1075</id>
		<title>This Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=This_Server&amp;diff=1075"/>
		<updated>2017-02-12T07:21:59Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Free up disk space */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:r2a2]]&lt;br /&gt;
== Installed Components ==&lt;br /&gt;
Click this link to get a SSL report of this server: https://www.ssllabs.com/ssltest/analyze.html?d=playfulexploration.com .&lt;br /&gt;
&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
cloud WEB {&lt;br /&gt;
}&lt;br /&gt;
 &lt;br /&gt;
package playfulexploration.com {&lt;br /&gt;
  component [Eth0]&lt;br /&gt;
  component [Nginx\nport: 443] as [Nginx]&lt;br /&gt;
  component [PHP-CGI\nport: 9000] as [PHP-CGI]&lt;br /&gt;
  component [MySQL Server\nport: 3306] as [MySQL]&lt;br /&gt;
  component [Tomcat Server\nport: 8888] as [Tomcat]&lt;br /&gt;
  component [NodeJS\nport: 8080] as [NodeJS]&lt;br /&gt;
  component [Grafana\nport:3000] as [Grafana] &amp;lt;&amp;lt;Charts&amp;gt;&amp;gt; [[/wiki/?title=Install/Grafana]]&lt;br /&gt;
&lt;br /&gt;
package &amp;quot;Email&amp;quot; {&lt;br /&gt;
  component [Postfix\nports: 25, 587, 993] as [Postfix] &amp;lt;&amp;lt;mail transfer agent&amp;gt;&amp;gt;&lt;br /&gt;
  component [Dovecot] as [Dovecot] &amp;lt;&amp;lt;mail server&amp;gt;&amp;gt;&lt;br /&gt;
  component [Postgray] as [Postgray] &amp;lt;&amp;lt;anti spam&amp;gt;&amp;gt;&lt;br /&gt;
  database Mailbox&lt;br /&gt;
}&lt;br /&gt;
package &amp;quot;IOT&amp;quot; {&lt;br /&gt;
  component [Mosquitto\nport: 1883 mqtt\nport: 8883 mqtt secure\nport: 9001 wss] as [Mosquitto] &amp;lt;&amp;lt;MQTT Broker&amp;gt;&amp;gt; [[/wiki/?title=Install/Mosquitto_Mqtt_Broker]]&lt;br /&gt;
  component [InfluxDB\nport:] as [InfluxDB] &amp;lt;&amp;lt;Time Series DB&amp;gt;&amp;gt; [[/wiki/?title=Install/InfluxDB]]&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
package &amp;quot;MediaWiki Pack&amp;quot; {&lt;br /&gt;
  database MediaWiki_DB as &amp;quot;MediaWiki DB&amp;quot;&lt;br /&gt;
  [MediaWiki PHP] .. [MediaWiki PlantUML Extension]&lt;br /&gt;
}&lt;br /&gt;
[Eth0] .. [Nginx] : https&lt;br /&gt;
[Nginx] .. [PHP-CGI]&lt;br /&gt;
[Nginx] .. [Tomcat]&lt;br /&gt;
[Nginx] .. [MySQL]&lt;br /&gt;
[Nginx] .. [NodeJS]&lt;br /&gt;
[Nginx] .. [Grafana]&lt;br /&gt;
&lt;br /&gt;
[Eth0] .. [Postfix] : smtp\nimap&lt;br /&gt;
[Postfix] .. [Dovecot]&lt;br /&gt;
[Dovecot] .. Mailbox&lt;br /&gt;
[Postfix] .. [Postgray]&lt;br /&gt;
 &lt;br /&gt;
[PHP-CGI] .. [MediaWiki PHP]&lt;br /&gt;
[Tomcat] .. [PlantUML JAR]&lt;br /&gt;
[PlantUML JAR] .. [GraphWiz]&lt;br /&gt;
 &lt;br /&gt;
[MySQL] .. MediaWiki_DB&lt;br /&gt;
&lt;br /&gt;
[Eth0] .. [Mosquitto] : mqtt\nwss&lt;br /&gt;
[Eth0] .. [InfluxDB] : rest&lt;br /&gt;
}&lt;br /&gt;
WEB -- [Eth0]&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backup strategy ==&lt;br /&gt;
&lt;br /&gt;
=== Postulates ===&lt;br /&gt;
:* More important than having a very fancy backup mechanism is to have some backup mechanism&lt;br /&gt;
&lt;br /&gt;
=== States and Status ===&lt;br /&gt;
&amp;lt;uml&amp;gt;&lt;br /&gt;
state &amp;quot;No backup exists&amp;quot; as State0 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt;&lt;br /&gt;
State0 : Status: Done&lt;br /&gt;
state &amp;quot;Strategy A: Simple ZIP&amp;quot; as StrategyA &amp;lt;&amp;lt;Done&amp;gt;&amp;gt; {&lt;br /&gt;
  state &amp;quot;Have a ZIP file with backup data&amp;quot; as StateA1 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt;&lt;br /&gt;
  StateA1 : Status: Done&lt;br /&gt;
  state &amp;quot;Have a download link to ZIP file&amp;quot; as StateA2 &amp;lt;&amp;lt;Done&amp;gt;&amp;gt; [[/backup/]]&lt;br /&gt;
  StateA2 : Status: Done&lt;br /&gt;
  StateA1 --&amp;gt; StateA2&lt;br /&gt;
}&lt;br /&gt;
state &amp;quot;Strategy B: Better backup strategy using GIT&amp;quot; as StrategyB &amp;lt;&amp;lt;New&amp;gt;&amp;gt; {&lt;br /&gt;
  state &amp;quot;Step1 ?&amp;quot; as StateB1 &amp;lt;&amp;lt;New&amp;gt;&amp;gt;&lt;br /&gt;
  StateB1 : Status: Not started&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
[*] --&amp;gt; State0&lt;br /&gt;
State0 --&amp;gt; StrategyA&lt;br /&gt;
State0 --&amp;gt; StrategyB&lt;br /&gt;
StrategyA --&amp;gt; [*]&lt;br /&gt;
StrategyB --&amp;gt; [*]&lt;br /&gt;
&lt;br /&gt;
skinparam state {&lt;br /&gt;
  BackgroundColor&amp;lt;&amp;lt;New&amp;gt;&amp;gt; White&lt;br /&gt;
  BackgroundColor&amp;lt;&amp;lt;Done&amp;gt;&amp;gt; LightGreen&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/uml&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Strategy A: Simple ZIP ===&lt;br /&gt;
Using ssh:&lt;br /&gt;
&amp;lt;source lang=&#039;bash&#039;&amp;gt;&lt;br /&gt;
 # backup changes of files and folders&lt;br /&gt;
 #mkdir /backup&lt;br /&gt;
 rsync -av --relative /var/www/html/wiki/LocalSettings.php /var/www/html/wiki/extensions/ /var/www/html/wiki/htmlets/ /backup/mediawiki/&lt;br /&gt;
 # export the wikimedia database&lt;br /&gt;
 mysqldump -h localhost -u root --xml mediawiki &amp;gt;/backup/mediawiki/wiki_mysql_database.xml&lt;br /&gt;
 # zip it&lt;br /&gt;
 zipfile=&amp;quot;mediawiki_$(date +&#039;%Y%m%d-%H%M%S&#039;).zip&amp;quot;&lt;br /&gt;
 pushd /backup/; zip -r $zipfile mediawiki/*; popd&lt;br /&gt;
 echo &amp;quot;The latest backup is in /backup/$zipfile&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now navigate to https://www.playfulexploration.com/backup and download the zip file.&lt;br /&gt;
&lt;br /&gt;
== Cost Structure ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! !! Product !! Cost !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| || Virtual Private Server  || $6.99 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH]&lt;br /&gt;
* 1 vCore 2.4 GHz&lt;br /&gt;
* 4 GB RAM&lt;br /&gt;
* 20 GB SSD Local RAID 10&lt;br /&gt;
* 1 static IP, all ports open&lt;br /&gt;
* 100 Mbps Bandwidth&lt;br /&gt;
* Control Panel &lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Virtual Private Server  || $13.49 / month || [https://www.ovh.com/us/vps/vps-ssd.xml OVH]&lt;br /&gt;
* 2 vCore 2.4 GHz&lt;br /&gt;
* 8 GB RAM&lt;br /&gt;
* 40 GB SSD Local RAID 10&lt;br /&gt;
* 1 static IP, all ports open&lt;br /&gt;
* 100 Mbps Bandwidth&lt;br /&gt;
* Control Panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || .COM Domain Name || $12 / year || [https://domains.google.com/registrar Google]&lt;br /&gt;
* domain privacy&lt;br /&gt;
* full control over all DNS records&lt;br /&gt;
* awesome control panel&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt; || Software || $0 || all open source :]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After the VPS upgrade the RAM automatically increased but the disk size needed manual fixing requiring two steps ([https://www.lowendtalk.com/discussion/75353/anyone-know-how-to-fix-this-ovh-diskspace-issue#Comment_1538939 source]):&lt;br /&gt;
* Increase the partition to use the extra sectors added:&lt;br /&gt;
 fdisk /dev/vda&lt;br /&gt;
 &amp;gt; u&lt;br /&gt;
 &amp;gt; p&lt;br /&gt;
 (this will print all of the partitions, we will refer to the data later)&lt;br /&gt;
 &amp;gt; d 1&lt;br /&gt;
 (this will display &amp;quot;Selected partition 1&amp;quot; and delete the first partition)&lt;br /&gt;
 &amp;gt; n&lt;br /&gt;
 (select &amp;quot;p&amp;quot; for primary partition)&lt;br /&gt;
 (partition number should be 1, but make sure it matches the number displayed in print command)&lt;br /&gt;
 (first sector should be 2048, but make sure it matches the &amp;quot;Start&amp;quot; column displayed in print command)&lt;br /&gt;
 (and set last sector to the default value)&lt;br /&gt;
 &amp;gt; a&lt;br /&gt;
 (type &amp;quot;1&amp;quot; to make new first partition bootable)&lt;br /&gt;
 &amp;gt; w&lt;br /&gt;
 (this will write the new partitions and exit fdisk)&lt;br /&gt;
 shutdown -r 0&lt;br /&gt;
* Increase the filesystem size to use the extra partition space that&#039;s now available:&lt;br /&gt;
 (connect to VM after it reboots, if it has resized partition but not filesystem then run resize2fs)&lt;br /&gt;
&lt;br /&gt;
== Free up disk space ==&lt;br /&gt;
&lt;br /&gt;
Trim log file archives:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
find /var/log/* -name *.gz -type f -mtime +100 -exec rm {} \;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Drop caches:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
free &amp;amp;&amp;amp; sync &amp;amp;&amp;amp; echo 3 &amp;gt; /proc/sys/vm/drop_caches &amp;amp;&amp;amp; free&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
See also: http://askubuntu.com/questions/5980/how-do-i-free-up-disk-space&lt;br /&gt;
&lt;br /&gt;
== Alternatives == &lt;br /&gt;
&lt;br /&gt;
* [https://www.kimsufi.com/us/en/ kimsufi dedicated server]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Algorithms/Natural_Language_Processing&amp;diff=1074</id>
		<title>Algorithms/Natural Language Processing</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Algorithms/Natural_Language_Processing&amp;diff=1074"/>
		<updated>2017-02-07T14:29:38Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Speech Taggers (browser capable) ==&lt;br /&gt;
* [https://code.google.com/archive/p/jspos/ jspos] - a Javascript speech tagger (runs in a browser).&lt;br /&gt;
* [https://github.com/nlp-compromise/nlp_compromise/wiki nlp-compromise] - aims to make interpreting and manipulating written text as easy and straightforward as possible (runs in a browser).&lt;br /&gt;
&lt;br /&gt;
== High-end open source NLPs ==&lt;br /&gt;
* [http://corenlp.run/ Stanford CoreNLP] - a suite of core NLP tools.  See also [http://stanfordnlp.github.io/CoreNLP/ CoreNLP on git].&lt;br /&gt;
&lt;br /&gt;
== Needs Title ==&lt;br /&gt;
&lt;br /&gt;
* https://github.com/oxford-cs-deepnlp-2017/lectures/blob/master/README.md&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Rpi/File_System_Corruption_Prevention&amp;diff=1073</id>
		<title>Rpi/File System Corruption Prevention</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Rpi/File_System_Corruption_Prevention&amp;diff=1073"/>
		<updated>2017-01-30T07:41:24Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to mark the / and /boot partitions read-only ==&lt;br /&gt;
See: http://geraldnaveen.blogspot.com/2013/11/fixing-raspberry-pi-filesystem.html&lt;br /&gt;
&lt;br /&gt;
You could do this from Pi itself, or on a different machine. Just edit /etc/fstab and add &#039;ro&#039; in the flags as shown below:&lt;br /&gt;
&lt;br /&gt;
 /dev/mmcblk0p1  /boot       vfat    defaults,ro                0       2&lt;br /&gt;
 /dev/mmcblk0p2  /           ext4    defaults,ro,noatime        0       1&lt;br /&gt;
&lt;br /&gt;
Now reboot the Pi and it should boot with both these mount points in read-only mode. You could do a mount to verify, it should look something similar to this:&lt;br /&gt;
&lt;br /&gt;
 /dev/root on / type ext4 (ro,noatime,data=ordered)&lt;br /&gt;
 devtmpfs on /dev type devtmpfs (rw,relatime,size=216108k,nr_inodes=54027,mode=755)&lt;br /&gt;
 tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44876k,mode=755)&lt;br /&gt;
 tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)&lt;br /&gt;
 proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)&lt;br /&gt;
 sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)&lt;br /&gt;
 tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=89740k)&lt;br /&gt;
 devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)&lt;br /&gt;
 /dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022, dmask=0022, codepage=cp437, iocharset=ascii,shortname=mixed, errors=remount-ro)&lt;br /&gt;
 tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=89740k)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services (like apache2) might fail to start, because they can&#039;t write to disk. You might have to check individual services to figure out what they are trying to write and resolve it appropriately. For eg., apache2 writes log files /var/log/apache2. It is best to disable logging. If there is not too much logging, you could map the log folder to /tmp (tmpfs -- as shown in mount).&lt;br /&gt;
&lt;br /&gt;
== Super Cap Power Backup ==&lt;br /&gt;
Buckboost converters:&lt;br /&gt;
* http://ams.com/eng/layout/set/layer/Products/Power-Management/DC-DC-Boost-Converters/(l)/1&lt;br /&gt;
* http://electronicdesign.com/products/2-buck-boost-supercapacitor-charger-features-bidirectional-operation&lt;br /&gt;
* http://www.digikey.com/products/en/integrated-circuits-ics/pmic-voltage-regulators-dc-dc-switching-regulators/739?FV=204000d%2C204000f%2C2040813%2C2040815%2C2040840%2C2040845%2C2040848%2C2040007%2C2040060%2C1654000e%2C165400a1%2C16540012%2C16540137%2C16540021%2C16540028%2C16540038%2C16540051%2C16540057%2C1bcc0069%2C1bcc007c%2C1bcc00ad%2C1bcc00d0%2C1bcc00f5%2C1bcc0019%2C1bcc001c%2C1bcc0128%2C1bcc0020%2C1bcc0143%2C1bcc0153%2C1bcc015b%2C1bcc0023%2C1bcc0178%2C1bcc0186%2C1bcc0192%2C1bcc019a%2C1bcc019e%2C1bcc002b%2C1bcc0031%2C1bcc0032%2C1bcc01f8%2C1bcc0033%2C1bcc0038%2C1bcc0006%2C1f140000%2Cffe002e3%2C16fc00a2%2C16fc0040&amp;amp;mnonly=0&amp;amp;newproducts=0&amp;amp;ColumnSort=1000011&amp;amp;page=1&amp;amp;stock=0&amp;amp;pbfree=0&amp;amp;rohs=0&amp;amp;k=BUCK+BOOST+&amp;amp;quantity=&amp;amp;ptm=0&amp;amp;fid=0&amp;amp;pageSize=25&amp;amp;pkeyword=BUCK+BOOST+&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Rpi/File_System_Corruption_Prevention&amp;diff=1072</id>
		<title>Rpi/File System Corruption Prevention</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Rpi/File_System_Corruption_Prevention&amp;diff=1072"/>
		<updated>2017-01-29T00:08:04Z</updated>

		<summary type="html">&lt;p&gt;Peter: Created page with &amp;quot;== How to mark the / and /boot partitions read-only == See: http://geraldnaveen.blogspot.com/2013/11/fixing-raspberry-pi-filesystem.html  You could do this from Pi itself, or...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to mark the / and /boot partitions read-only ==&lt;br /&gt;
See: http://geraldnaveen.blogspot.com/2013/11/fixing-raspberry-pi-filesystem.html&lt;br /&gt;
&lt;br /&gt;
You could do this from Pi itself, or on a different machine. Just edit /etc/fstab and add &#039;ro&#039; in the flags as shown below:&lt;br /&gt;
&lt;br /&gt;
 /dev/mmcblk0p1  /boot       vfat    defaults,ro                0       2&lt;br /&gt;
 /dev/mmcblk0p2  /           ext4    defaults,ro,noatime        0       1&lt;br /&gt;
&lt;br /&gt;
Now reboot the Pi and it should boot with both these mount points in read-only mode. You could do a mount to verify, it should look something similar to this:&lt;br /&gt;
&lt;br /&gt;
 /dev/root on / type ext4 (ro,noatime,data=ordered)&lt;br /&gt;
 devtmpfs on /dev type devtmpfs (rw,relatime,size=216108k,nr_inodes=54027,mode=755)&lt;br /&gt;
 tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=44876k,mode=755)&lt;br /&gt;
 tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)&lt;br /&gt;
 proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)&lt;br /&gt;
 sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)&lt;br /&gt;
 tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=89740k)&lt;br /&gt;
 devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620)&lt;br /&gt;
 /dev/mmcblk0p1 on /boot type vfat (ro,relatime,fmask=0022, dmask=0022, codepage=cp437, iocharset=ascii,shortname=mixed, errors=remount-ro)&lt;br /&gt;
 tmpfs on /tmp type tmpfs (rw,nosuid,nodev,relatime,size=89740k)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Some services (like apache2) might fail to start, because they can&#039;t write to disk. You might have to check individual services to figure out what they are trying to write and resolve it appropriately. For eg., apache2 writes log files /var/log/apache2. It is best to disable logging. If there is not too much logging, you could map the log folder to /tmp (tmpfs -- as shown in mount).&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/DeepLearning_on_RPI&amp;diff=1070</id>
		<title>Projects/DeepLearning on RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/DeepLearning_on_RPI&amp;diff=1070"/>
		<updated>2017-01-28T21:36:11Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Rpi]]&lt;br /&gt;
== Inspiration ==&lt;br /&gt;
This [http://www.instructables.com/id/Machine-learning-with-Raspberry-Pi/?ALLSTEPS Instructable] shows how to use the RPI for image learning and image recognition.  ...got to do this eventually.&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/DeepLearning_on_RPI&amp;diff=1069</id>
		<title>Projects/DeepLearning on RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/DeepLearning_on_RPI&amp;diff=1069"/>
		<updated>2017-01-28T21:34:42Z</updated>

		<summary type="html">&lt;p&gt;Peter: Created page with &amp;quot;== Inspiration == This [http://www.instructables.com/id/Machine-learning-with-Raspberry-Pi/?ALLSTEPS Instructable] shows how to use the RPI for image learning and image recogn...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Inspiration ==&lt;br /&gt;
This [http://www.instructables.com/id/Machine-learning-with-Raspberry-Pi/?ALLSTEPS Instructable] shows how to use the RPI for image learning and image recognition.  ...got to do this eventually.&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Main_Page&amp;diff=1068</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Main_Page&amp;diff=1068"/>
		<updated>2017-01-28T21:30:07Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Round Rock Austin Automation ==&lt;br /&gt;
R2A2 is the shorthand name.   A group of interested electronics and mechanical makers sharing knowledge and interests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The number one rule of wiki editing is&#039;&#039;&#039; to &#039;&#039;&#039;be bold&#039;&#039;&#039;. Go ahead - make changes. Other people can correct any mistakes you make, so have confidence, and give it a try! There are all kinds of editing conventions, rules, and philosophies for the editing of wiki pages, but the &amp;quot;be bold&amp;quot; rule is the most important of these!&lt;br /&gt;
&lt;br /&gt;
[https://www.mediawiki.org/wiki/Help:Editing_pages Click for more general tips]&lt;br /&gt;
&lt;br /&gt;
== Wiki Tasks ==&lt;br /&gt;
{{#ask:&lt;br /&gt;
[[Todo Title::+]]&lt;br /&gt;
|?Todo Title=Title&lt;br /&gt;
|?Todo Kind=Kind&lt;br /&gt;
|?Todo Owner=Owner&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&amp;lt;categorytree mode=all&amp;gt;Root&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Link&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| [[Link Collection]]&lt;br /&gt;
| The ever growing collection of useful links&lt;br /&gt;
|-&lt;br /&gt;
| [[Home Network Configurations]]&lt;br /&gt;
| A collection of home network configurations we discussed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Pages Hierarchies ==&lt;br /&gt;
Pages names with slashes in their name create page hierarchies.&lt;br /&gt;
*[[Install]]&lt;br /&gt;
*[[Projects]]&lt;br /&gt;
*[[Rpi]]&lt;br /&gt;
&lt;br /&gt;
== Recent Changes ==&lt;br /&gt;
{{Special:RecentChanges}}&lt;br /&gt;
&lt;br /&gt;
== All Content ==&lt;br /&gt;
&lt;br /&gt;
{{Special:AllPages}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Main_Page&amp;diff=1067</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Main_Page&amp;diff=1067"/>
		<updated>2017-01-28T21:28:51Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* All Content */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Round Rock Austin Automation ==&lt;br /&gt;
R2A2 is the shorthand name.   A group of interested electronics and mechanical makers sharing knowledge and interests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The number one rule of wiki editing is&#039;&#039;&#039; to &#039;&#039;&#039;be bold&#039;&#039;&#039;. Go ahead - make changes. Other people can correct any mistakes you make, so have confidence, and give it a try! There are all kinds of editing conventions, rules, and philosophies for the editing of wiki pages, but the &amp;quot;be bold&amp;quot; rule is the most important of these!&lt;br /&gt;
&lt;br /&gt;
[https://www.mediawiki.org/wiki/Help:Editing_pages Click for more general tips]&lt;br /&gt;
&lt;br /&gt;
== Wiki Tasks ==&lt;br /&gt;
{{#ask:&lt;br /&gt;
[[Todo Title::+]]&lt;br /&gt;
|?Todo Title=Title&lt;br /&gt;
|?Todo Kind=Kind&lt;br /&gt;
|?Todo Owner=Owner&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Content ==&lt;br /&gt;
&amp;lt;categorytree mode=all&amp;gt;Root&amp;lt;/categorytree&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Link&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| [[Link Collection]]&lt;br /&gt;
| The ever growing collection of useful links&lt;br /&gt;
|-&lt;br /&gt;
| [[Home Network Configurations]]&lt;br /&gt;
| A collection of home network configurations we discussed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Recent Changes ==&lt;br /&gt;
{{Special:RecentChanges}}&lt;br /&gt;
&lt;br /&gt;
== Pages Hierarchies ==&lt;br /&gt;
Pages names with slashes in their name create page hierarchies.&lt;br /&gt;
*[[Install]]&lt;br /&gt;
*[[Projects]]&lt;br /&gt;
*[[Rpi]]&lt;br /&gt;
&lt;br /&gt;
== All Content ==&lt;br /&gt;
&lt;br /&gt;
{{Special:AllPages}}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/RPI_Satelite_Receiver&amp;diff=1055</id>
		<title>Projects/RPI Satelite Receiver</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/RPI_Satelite_Receiver&amp;diff=1055"/>
		<updated>2016-11-21T14:44:34Z</updated>

		<summary type="html">&lt;p&gt;Peter: Created page with &amp;quot;https://youtu.be/24HBmRKHULs&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;https://youtu.be/24HBmRKHULs&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=ESP8266/IDEs&amp;diff=1051</id>
		<title>ESP8266/IDEs</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=ESP8266/IDEs&amp;diff=1051"/>
		<updated>2016-10-30T20:13:01Z</updated>

		<summary type="html">&lt;p&gt;Peter: Created page with &amp;quot;category:ESP8266 :[http://chilipeppr.com/nodemcu Browser based IDE], connects to local web server that connect the web IDE to the serial port :[https://esp8266.ru/esplorer...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:ESP8266]]&lt;br /&gt;
:[http://chilipeppr.com/nodemcu Browser based IDE], connects to local web server that connect the web IDE to the serial port&lt;br /&gt;
:[https://esp8266.ru/esplorer/ ESPlorer]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Rpi/Docker&amp;diff=1050</id>
		<title>Rpi/Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Rpi/Docker&amp;diff=1050"/>
		<updated>2016-10-30T17:45:41Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Rpi]][[category:Docker]]&lt;br /&gt;
&lt;br /&gt;
:[https://docs.docker.com/engine/understanding-docker/ Understanding Docker]&lt;br /&gt;
:[https://medium.com/@ALGrendel/docker-weave-a-little-cloud-and-a-raspberry-pi-381f73a4376d#.fmcyq3c68 Docker and Weave - Network Interconnections]&lt;br /&gt;
&lt;br /&gt;
== Docker Installation ==&lt;br /&gt;
:[https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/ Install Docker]&lt;br /&gt;
:[http://blog.hypriot.com/post/docker-compose-nodejs-haproxy/#running-multiple-container-with-docker-compose:63a2807194fcdb5e829ff92f8506efa0 Install Docker Compose] - this let&#039;s you easier manage multiple containers that depend on each other&lt;br /&gt;
&lt;br /&gt;
== Docker Containers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Software !! Make a Container !! Ready to Use container&lt;br /&gt;
|-&lt;br /&gt;
| nginx || [https://www.digitalocean.com/community/tutorials/docker-explained-how-to-containerize-and-use-nginx-as-a-proxy Make an Nginx container] ||&lt;br /&gt;
|-&lt;br /&gt;
| influxdb || || [https://github.com/sbiermann/rpi-influxdb tutum/influxdb based container]&lt;br /&gt;
|-&lt;br /&gt;
| grafana || [https://github.com/lalyos/docker-rpi-grafana Make a grafana container that connects to influxdb] ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Install/Docker&amp;diff=1047</id>
		<title>Install/Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Install/Docker&amp;diff=1047"/>
		<updated>2016-10-15T21:05:28Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Rpi]][[category:Docker]]&lt;br /&gt;
&lt;br /&gt;
== Installation on Raspberian ==&lt;br /&gt;
Now simply:&lt;br /&gt;
 curl -sSL https://get.docker.com | sh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &#039;easiest&#039; installation for Raspberian (I did not not tested) is this one:&lt;br /&gt;
* https://resin.io/blog/docker-on-raspberry-pi-in-4-simple-steps/&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
 curl https://raw.githubusercontent.com/resin-io/docker-install-script/master/install.sh | sh&lt;br /&gt;
 docker -d &amp;amp;&lt;br /&gt;
 sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
 #now run a playground image:&lt;br /&gt;
 docker run -it --rm resin/rpi-raspbian /bin/bash&lt;br /&gt;
&lt;br /&gt;
== Installation on Debian or any other OS ==&lt;br /&gt;
* https://docs.docker.com/engine/installation/&lt;br /&gt;
&lt;br /&gt;
== Running your first Playground Docker container ==&lt;br /&gt;
 docker run -it --rm debian /bin/bash&lt;br /&gt;
&lt;br /&gt;
That&#039;s it!  It will span a new debian container and run the bash shell in the container (notice the funky shell prompt with the container ID 6a464fb7f678 in my case).  You can do here what ever you like without affecting the host.  When done playing simply type exit and the container will destroy itself as if it never happened.&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
 Unable to find image &#039;debian:latest&#039; locally&lt;br /&gt;
 latest: Pulling from library/debian&lt;br /&gt;
 5c90d4a2d1a8: Pull complete&lt;br /&gt;
 Digest: sha256:8b1fc3a7a55c42e3445155b2f8f40c55de5f8bc8012992b26b570530c4bded9e&lt;br /&gt;
 Status: Downloaded newer image for debian:latest&lt;br /&gt;
 &#039;&#039;&#039;root@6a464fb7f678:/#&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Quick command overview &lt;br /&gt;
* docker run : All docker commands start with &#039;docker&#039;.  &#039;run&#039; downloads the base image (if not already there) and spans a new instance (container) from that image&lt;br /&gt;
* -it: Is short to &amp;quot;-i -t&amp;quot; and runs the container in interactive mode so it will get the keyboard input.&lt;br /&gt;
* --rm : Destroys the container on exit.&lt;br /&gt;
* debian : Is the name of the image to download and run from the docker hub.  &#039;debian&#039; is a base Debian image with nothing pre-installed.&lt;br /&gt;
* /bin/bash : Is the command to run in the container i.e. run the bash shell.&lt;br /&gt;
&lt;br /&gt;
== Building a Container to keep ==&lt;br /&gt;
See also https://www.jamescoyle.net/how-to/1503-create-your-first-docker-container .&lt;br /&gt;
 docker run -it --name NAME_YOUR_CONTAINER debian /bin/bash&lt;br /&gt;
...&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Rpi/Build_Your_Own_Amazon_Echo_with_a_Raspberry_Pi&amp;diff=1045</id>
		<title>Rpi/Build Your Own Amazon Echo with a Raspberry Pi</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Rpi/Build_Your_Own_Amazon_Echo_with_a_Raspberry_Pi&amp;diff=1045"/>
		<updated>2016-10-14T05:05:40Z</updated>

		<summary type="html">&lt;p&gt;Peter: Created page with &amp;quot;* http://lifehacker.com/how-to-build-your-own-amazon-echo-with-a-raspberry-pi-1787726931&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* http://lifehacker.com/how-to-build-your-own-amazon-echo-with-a-raspberry-pi-1787726931&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Maker_Suppliers&amp;diff=1030</id>
		<title>Maker Suppliers</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Maker_Suppliers&amp;diff=1030"/>
		<updated>2016-09-17T15:46:05Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Maker Suppliers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Links]][[category:r2a2]]&lt;br /&gt;
&lt;br /&gt;
== Maker Suppliers ==&lt;br /&gt;
&lt;br /&gt;
:*[http://www.seeedstudio.com/depot/ Seeed Studio]&lt;br /&gt;
&lt;br /&gt;
:*[https://www.adafruit.com/  Adafruit]&lt;br /&gt;
&lt;br /&gt;
:*[http://www.mcmelectronics.com/ MCM Electronics]&lt;br /&gt;
&lt;br /&gt;
:*[https://www.sparkfun.com/ Sparkfun]&lt;br /&gt;
&lt;br /&gt;
:*[http://ameridroid.com/ Ameridroid]&lt;br /&gt;
&lt;br /&gt;
:*[http://ebay.com/ EBay]&lt;br /&gt;
&lt;br /&gt;
:*[http://mcmaster.com/ McMaster Carr]&lt;br /&gt;
&lt;br /&gt;
:*[http://www.banggood.com/ Banggood]&lt;br /&gt;
&lt;br /&gt;
:*[https://www.aliexpress.com Aliexpress]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=TED_Talks&amp;diff=1027</id>
		<title>TED Talks</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=TED_Talks&amp;diff=1027"/>
		<updated>2016-09-14T08:33:19Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Jennifer Kahn: [https://go.ted.com/CyGo Gene editing can now change an entire species -- forever]&lt;br /&gt;
* Don Tapscott: [https://go.ted.com/CyR6 How the blockchain is changing money and business]&lt;br /&gt;
* Neha Narula: [https://go.ted.com/CysL The future of money]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=TED_Talks&amp;diff=1026</id>
		<title>TED Talks</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=TED_Talks&amp;diff=1026"/>
		<updated>2016-09-12T05:25:52Z</updated>

		<summary type="html">&lt;p&gt;Peter: Created page with &amp;quot;* Jennifer Kahn: [https://go.ted.com/CyGo Gene editing can now change an entire species -- forever] * Don Tapscott: [https://go.ted.com/CyR6 How the blockchain is changing mon...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Jennifer Kahn: [https://go.ted.com/CyGo Gene editing can now change an entire species -- forever]&lt;br /&gt;
* Don Tapscott: [https://go.ted.com/CyR6 How the blockchain is changing money and business]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Meeting/2016-08-11&amp;diff=1025</id>
		<title>Meeting/2016-08-11</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Meeting/2016-08-11&amp;diff=1025"/>
		<updated>2016-09-12T05:06:11Z</updated>

		<summary type="html">&lt;p&gt;Peter: Peter moved page Meeting2016-08-11 to Meeting/2016-08-11 without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Peltier cooling [http://www.shop.customthermoelectric.com/07111-5L30-25CJ-Thermoelectric-Peltier-Module-07111-5L30-25CJ.htm;jsessionid=F4A73E7764561932976F50EE359BCD23.p3plqscsfapp004?gclid=Cj0KEQjwxLC9BRDb1dP8o7Op68IBEiQAwWggQJuqUWdie12CZe7lhzdxAFSTw9qr1ELi5YkqnRWBhLQaAieb8P8HAQ]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://uk.farnell.com/infomart-it-solutions/pem1305/module-poe-802-3af-5v-12-95w/dp/1902524?ost=1902524&amp;amp;selectedCategoryId=&amp;amp;categoryNameResp=All%2BCategories&amp;amp;searchView=table&amp;amp;iscrfnonsku=false POE for Pi]&lt;br /&gt;
&lt;br /&gt;
[https://www.raspberrypi.org/blog/pi-3-booting-part-ii-ethernet-all-the-awesome/   boot Pi over Ethernet]&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Talk:Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1022</id>
		<title>Talk:Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Talk:Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1022"/>
		<updated>2016-09-07T07:12:07Z</updated>

		<summary type="html">&lt;p&gt;Peter: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;do we need a parallel page to discuss security?   Things like when is SSL needed.  Is ssl still any good? etc&lt;br /&gt;
* Yeah this might be good!&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1021</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1021"/>
		<updated>2016-09-07T06:39:04Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Usage/Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/Docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-volumes rpi-volumes]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts a docker container with access to the volumes of all other containers allowing to manage their configuration and backups.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx in a docker container.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage/Steps ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Step !! Command&lt;br /&gt;
|-&lt;br /&gt;
| Install docker&lt;br /&gt;
| See [https://www.playfulexploration.com/wiki/index.php?title=Install/Docker#Installation_on_Raspberian Install Docker on the RPI.]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
curl https://raw.githubusercontent.com/resin-io/docker-install-script/master/install.sh | sh&lt;br /&gt;
docker -d &amp;amp;&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Spawn a docker network&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
docker network create nw&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Get rpi-docker from git&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/playfulexploration/rpi-docker.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Spawn nginx container&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-nginx&lt;br /&gt;
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify the nginx service responds.  The curl command gets the html text containing nginx welcome message: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
curl http://localhost&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Use a web-browser and navigate to your RPI.  Nginx should respond with an HTML page saying &#039;Welcome to nginx!&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| Spawn influxdb container&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-influxdb&lt;br /&gt;
docker run -d --name influxdb -h influxdb --net=nw -p 8083:8083 -p 8086:8086 -e PRE_CREATE_DB=&amp;quot;db1&amp;quot; playfulexploration/rpi-influxdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1020</id>
		<title>User:Peter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1020"/>
		<updated>2016-09-07T06:11:32Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* https://docs.google.com/document/d/1qoxrprVTuyt1lABAB6LtJ5ctovZwmF2_ENKoAYZrwL0&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Avatar&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash          &lt;br /&gt;
STR=&amp;quot;Hello World!&amp;quot;&lt;br /&gt;
echo $STR    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1019</id>
		<title>User:Peter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1019"/>
		<updated>2016-09-07T05:55:51Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* https://docs.google.com/document/d/1qoxrprVTuyt1lABAB6LtJ5ctovZwmF2_ENKoAYZrwL0&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Avatar&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
sfs&lt;br /&gt;
safas&lt;br /&gt;
fasd&lt;br /&gt;
fsdf&lt;br /&gt;
sdf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1018</id>
		<title>User:Peter</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=User:Peter&amp;diff=1018"/>
		<updated>2016-09-07T03:40:56Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Parameters */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Getting started ==&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings Configuration settings list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ MediaWiki FAQ]&lt;br /&gt;
* [https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce MediaWiki release mailing list]&lt;br /&gt;
* [//www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki for your language]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* https://docs.google.com/document/d/1qoxrprVTuyt1lABAB6LtJ5ctovZwmF2_ENKoAYZrwL0&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| Avatar&lt;br /&gt;
| &amp;lt;htmlet&amp;gt;somesvg&amp;lt;/htmlet&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash line=1&amp;gt;&lt;br /&gt;
sfs&lt;br /&gt;
safas&lt;br /&gt;
fasd&lt;br /&gt;
fsdf&lt;br /&gt;
sdf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1016</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1016"/>
		<updated>2016-09-05T18:09:07Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Usage/Steps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/Docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-volumes rpi-volumes]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts a docker container with access to the volumes of all other containers allowing to manage their configuration and backups.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx in a docker container.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage/Steps ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Step !! Command&lt;br /&gt;
|-&lt;br /&gt;
| Install docker&lt;br /&gt;
| See [https://www.playfulexploration.com/wiki/index.php?title=Install/Docker#Installation_on_Raspberian Install Docker on the RPI.]&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
curl https://raw.githubusercontent.com/resin-io/docker-install-script/master/install.sh | sh&lt;br /&gt;
docker -d &amp;amp;&lt;br /&gt;
sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Spawn a docker network&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker network create nw&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Get rpi-docker from git&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
git clone https://github.com/playfulexploration/rpi-docker.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Spawn nginx container&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-nginx&lt;br /&gt;
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Verify the nginx service responds.  The curl command gets the html text containing nginx welcome message: &lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
curl http://localhost&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Use a web-browser and navigate to your RPI.  Nginx should respond with an HTML page saying &#039;Welcome to nginx!&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| Spawn influxdb container&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx rpi-docker.git/rpi-influxdb&lt;br /&gt;
docker run -d --name influxdb -h influxdb --net=nw -p 8083:8083 -p 8086:8086 -e PRE_CREATE_DB=&amp;quot;db1&amp;quot; playfulexploration/rpi-influxdb&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1015</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1015"/>
		<updated>2016-09-05T06:19:41Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Docker Images and Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/Docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-volumes rpi-volumes]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts a docker container with access to the volumes of all other containers allowing to manage their configuration and backups.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx in a docker container.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage/Steps ==&lt;br /&gt;
=== Install Docker ===&lt;br /&gt;
[https://www.playfulexploration.com/wiki/index.php?title=Install/Docker#Installation_on_Raspberian Install Docker on the RPI.]&lt;br /&gt;
&lt;br /&gt;
=== Build and spawn: Nginx Container ===&lt;br /&gt;
Build docker image by referencing git, no need to clone first:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx https://github.com/playfulexploration/rpi-docker.git#master:rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a network named &#039;nw&#039; and run the the nginx container.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker network create nw&lt;br /&gt;
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use a web-browser and navigate to your RPI.  Nginx should respond with an HTML page saying &#039;Welcome to nginx!&#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
curl http://localhost&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Build and spawn: InfluxDB Container ===&lt;br /&gt;
&lt;br /&gt;
=== Other notes ===&lt;br /&gt;
Clone all:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
git clone https://github.com/playfulexploration/rpi-docker.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1014</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1014"/>
		<updated>2016-09-04T16:23:42Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/Docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx as docker service.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage/Steps ==&lt;br /&gt;
=== Install Docker ===&lt;br /&gt;
[https://www.playfulexploration.com/wiki/index.php?title=Install/Docker#Installation_on_Raspberian Install Docker on the RPI.]&lt;br /&gt;
&lt;br /&gt;
=== Build and spawn: Nginx Container ===&lt;br /&gt;
Build docker image by referencing git, no need to clone first:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx https://github.com/playfulexploration/rpi-docker.git#master:rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a network named &#039;nw&#039; and run the the nginx container.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker network create nw&lt;br /&gt;
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use a web-browser and navigate to your RPI.  Nginx should respond with an HTML page saying &#039;Welcome to nginx!&#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
curl http://localhost&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Build and spawn: InfluxDB Container ===&lt;br /&gt;
&lt;br /&gt;
=== Other notes ===&lt;br /&gt;
Clone all:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
git clone https://github.com/playfulexploration/rpi-docker.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1013</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1013"/>
		<updated>2016-09-04T06:33:01Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx as docker service.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage/Steps ==&lt;br /&gt;
=== Install Docker ===&lt;br /&gt;
[https://www.playfulexploration.com/wiki/index.php?title=Install/Docker#Installation_on_Raspberian Install Docker on the RPI.]&lt;br /&gt;
&lt;br /&gt;
=== Build and spawn: Nginx Container ===&lt;br /&gt;
Build docker image by referencing git, no need to clone first:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker build -t playfulexploration/rpi-nginx https://github.com/playfulexploration/rpi-docker.git#master:rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Create a network named &#039;nw&#039; and run the the nginx container.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
docker network create nw&lt;br /&gt;
docker run -d --restart=always --name nginx -h nginx --net=nw -p 80:80 -p 443:443 playfulexploration/rpi-nginx&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use a web-browser and navigate to your RPI.  Nginx should respond with an HTML page saying &#039;Welcome to nginx!&#039;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
curl http://localhost&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Build and spawn: InfluxDB Container ===&lt;br /&gt;
&lt;br /&gt;
=== Other notes ===&lt;br /&gt;
Clone all:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=bash&amp;gt;&lt;br /&gt;
git clone https://github.com/playfulexploration/rpi-docker.git&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Rpi/Docker&amp;diff=1012</id>
		<title>Rpi/Docker</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Rpi/Docker&amp;diff=1012"/>
		<updated>2016-09-04T05:45:25Z</updated>

		<summary type="html">&lt;p&gt;Peter: Peter moved page Rpi/docker to Rpi/Docker without leaving a redirect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[category:Rpi]][[category:Docker]]&lt;br /&gt;
&lt;br /&gt;
:[https://docs.docker.com/engine/understanding-docker/ Understanding Docker]&lt;br /&gt;
:[https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/  Raspberry Pi now has a docker install]!!!!&lt;br /&gt;
&lt;br /&gt;
== Docker Containers ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Software !! Make a Container !! Ready to Use container&lt;br /&gt;
|-&lt;br /&gt;
| nginx || [https://www.digitalocean.com/community/tutorials/docker-explained-how-to-containerize-and-use-nginx-as-a-proxy Make an Nginx container] ||&lt;br /&gt;
|-&lt;br /&gt;
| influxdb || || [https://github.com/sbiermann/rpi-influxdb tutum/influxdb based container]&lt;br /&gt;
|-&lt;br /&gt;
| grafana || [https://github.com/lalyos/docker-rpi-grafana Make a grafana container that connects to influxdb] ||&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1011</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1011"/>
		<updated>2016-09-04T05:31:48Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Docker Images and Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx as docker service.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
# Install Docker on the RPI&lt;br /&gt;
# ...&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
	<entry>
		<id>https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1010</id>
		<title>Projects/Docker based pluggable webservices for RPI</title>
		<link rel="alternate" type="text/html" href="https://wiki.playfulexploration.com/index.php?title=Projects/Docker_based_pluggable_webservices_for_RPI&amp;diff=1010"/>
		<updated>2016-09-04T05:30:20Z</updated>

		<summary type="html">&lt;p&gt;Peter: /* Docker Images and Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Rpi]][[Category:Projects]][[Category:Docker]]&lt;br /&gt;
== Goal ==&lt;br /&gt;
Create an extensible Nginx configuration for docker based pluggable webservices.&lt;br /&gt;
&lt;br /&gt;
Create docker based web services as needed for different projects&lt;br /&gt;
&lt;br /&gt;
Related links:&lt;br /&gt;
* [[Rpi/docker]]&lt;br /&gt;
&lt;br /&gt;
== Project Repositories ==&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| github || : || https://github.com/playfulexploration/rpi-docker || - || Dockerfiles used to create docker images&lt;br /&gt;
|-&lt;br /&gt;
| dockerhub || : || https://hub.docker.com/r/playfulexploration/rpi-docker/ || - || Docker images&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Docker Images and Status ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Dockerfile                   !! Status        !! Detail&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nginx rpi-nginx]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts nginx as docker service.  Still needs conf file.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-influxdb rpi-influxdb]&lt;br /&gt;
| In progress&lt;br /&gt;
| Starts influxdb as docker service.  Needs configuration for ease of use.&lt;br /&gt;
|-&lt;br /&gt;
| [https://github.com/playfulexploration/rpi-docker/tree/master/rpi-nlp rpi-nlp]&lt;br /&gt;
| On hold&lt;br /&gt;
| Starts Stanford&#039;s Natural Language Processor as Web Service.  Runs out of memory on RPI3.&lt;br /&gt;
|-&lt;br /&gt;
| rpi-grafana&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-mosquitto&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| rpi-nodered&lt;br /&gt;
| Not started&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| add more here...&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Peter</name></author>
	</entry>
</feed>