<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>arduino &#8211; Squix &#8211; TechBlog</title>
	<atom:link href="https://blog.squix.org/tag/arduino/feed" rel="self" type="application/rss+xml" />
	<link>https://blog.squix.org</link>
	<description></description>
	<lastBuildDate>Thu, 09 Dec 2021 08:13:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.8</generator>
<site xmlns="com-wordpress:feed-additions:1">121913304</site>	<item>
		<title>ESP8266/Arduino: processing huge JSON objects directly on the ESP</title>
		<link>https://blog.squix.org/2015/10/esp8266arduino-processing-huge-json.html</link>
					<comments>https://blog.squix.org/2015/10/esp8266arduino-processing-huge-json.html#comments</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Sun, 25 Oct 2015 12:20:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[event driven parser]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[streaming parser]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2015/10/25/esp8266arduino-processing-huge-json/</guid>

					<description><![CDATA[For a while now I wanted to improve my weather station project by adding more sources of information that can be displayed. But these sources I had in mind either used SSL (https) or delivered huge JSON responses. SSL is not yet supported on the ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2015/10/esp8266arduino-processing-huge-json.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
For a while now I wanted to improve my weather station project by adding more sources of information that can be displayed. But these sources I had in mind either used SSL (https) or delivered huge JSON responses. SSL is not yet supported on the ESP8266/Arduino platform (and from what I hear also broken on Nodemcu/Lua). Big JSON objects are a problem because all the existing libraries I tried are DOM based which consumes a lot of memory since they keep the whole JSON object in memory (at least once).</p>
<p>So I decided to tackle one problem at a time and looked at the big JSON object issue first. If you want to parse big documents you can either build a representation of the object in memory (DOM) or you can write a event based parser. This means that your parser is processing the document as it comes in as a stream, character by character and that it will notify you with different event types once portions of the document were parsed successfully. This is very helpful since you don&#8217;t have to keep the whole &nbsp;document in memory and you can even start parsing the stream almost immediately. You might be familiar with the SAX parser for XML which also follows this concept.</p>
<p>This concept is very useful on devices with little memory as the ESP8266. Looking for a start I found such a stream based <a href="https://github.com/squix78/jsonstreamingparser" target="_blank">JSON parser written in PHP</a> and decided to port it to C++.</p>
<p>The result looks very promising: I wrote a little example program for the ESP8266 which downloads a sample JSON object of 1MB size. In the sketch I&#8217;m only interested in one of the 5000 sub-objects and print it out as soon as I see it. During processing I print out the heap size with ESP.getFreeHeap() and the available heap size remains stable at around 32KB!</p>
<p>If you like to try it out you can find the library here:&nbsp;<a href="https://github.com/squix78/json-streaming-parser">https://github.com/squix78/json-streaming-parser</a>. In theory it should work for any Arduino target device but I only tested it with the ESP8266.</p>
<p>Happy hacking!</p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2015/10/esp8266arduino-processing-huge-json.html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">26</post-id>	</item>
		<item>
		<title>ESP8266/Arduino: Playing around with the upcoming filesystem feature</title>
		<link>https://blog.squix.org/2015/08/esp8266arduino-playing-around-with.html</link>
					<comments>https://blog.squix.org/2015/08/esp8266arduino-playing-around-with.html#comments</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Sun, 16 Aug 2015 14:08:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[Filesystem]]></category>
		<category><![CDATA[SPIFFS]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2015/08/16/esp8266arduino-playing-around-wi/</guid>

					<description><![CDATA[I recently stumbled on a feature that hopefully soon will be integrated into the stable release of the ESP8266/Arduino environment: a file system interface. Low-Level: EEPROM Up until now and currently your best bet for data persistence in the stable release you could use the ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2015/08/esp8266arduino-playing-around-with.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;">I recently stumbled on a feature that hopefully soon will be integrated into the stable release of the ESP8266/Arduino environment: a file system interface.</p>
<h3 style="text-align: left;">Low-Level: EEPROM</h3>
<p>Up until now and currently your best bet for data persistence in the stable release you could use the EEPROM interface to write and read your data so it would be available between reboots of the device. This persistence interface is pretty low-level: you have to define the range of the memory you want to use and then it&#8217;s all on you how to organize this stream of bytes. Of course, you could write yourself some code to write and read the data in a more accessible way but this is cumbersome and error-prone. Especially if the stored data has different formats, lets say one part is a JSON object and the next is HTML you have to create a table of content (TOC) and keep track of the sizes and start points of these blocks.</p>
<h3 style="text-align: left;">New: SPIFFS</h3>
<p>But why re-invent the wheel? This organization of all the single blocks in a TOC is generally called a file system and the team around the ESP8266/Arduino environment is currently integrating the SPIFFS into their development branch. SPIFFS stands for SPI flash file system and is especially targeted for embedded devices such as the ESP8266. According to the <a href="https://github.com/pellepl/spiffs" target="_blank">Github page</a> of the SPIFFS project the file system has the following features:</p>
<ul style="text-align: left;">
<li> Specifically designed for low ram usage</li>
<li> Uses statically sized ram buffers, independent of number of files</li>
<li> Posix-like api: open, close, read, write, seek, stat, etc</li>
<li> Implements static wear leveling</li>
<li> Built in file system consistency checks</li>
</ul>
<p>There are also a few limitations but hey, what do you expect from anything especially targeted for small and embedded devices?</p>
<div> [the_ad_placement id=&#8221;inpostplacement&#8221;]</div>
<h3 style="text-align: left;">Hands-on</h3>
<div>I couldn&#8217;t resist and wanted to try out this new feature. As a preparation you&#8217;ll have to install the staging version of the ESP8266/Arduino environment (as the time of writing &#8211; 2015-08-16 the stable version does not include this feature yet). To do that follow the instructions on the following link and use the reference to the staging version instead of stable: <a href="https://github.com/esp8266/Arduino#available-versions">https://github.com/esp8266/Arduino#available-versions</a></div>
<div></div>
<div>Once you have done that you should be able to run the following code:</div>
<div></div>
<div>
<div>
<pre class="brush:cpp;">#include "FS.h"

void setup() {
  Serial.begin(115200);

  // always use this to "mount" the filesystem
  bool result = SPIFFS.begin();
  Serial.println("SPIFFS opened: " + result);

  // this opens the file "f.txt" in read-mode
  File f = SPIFFS.open("/f.txt", "r");
  
  if (!f) {
    Serial.println("File doesn't exist yet. Creating it");

    // open the file in write mode
    File f = SPIFFS.open("/f.txt", "w");
    if (!f) {
      Serial.println("file creation failed");
    }
    // now write two lines in key/value style with  end-of-line characters
    f.println("ssid=abc");
    f.println("password=123455secret");
  } else {
    // we could open the file
    while(f.available()) {
      //Lets read line by line from the file
      String line = f.readStringUntil('n');
      Serial.println(line);
    }

  }
  file.close();
}

void loop() {
  // nothing to do for now, this is just a simple test

}
</pre>
<p>You can also find the example here:<br />
<a href="https://github.com/squix78/esp8266-projects/tree/master/arduino-ide/filesystem-example">https://github.com/squix78/esp8266-projects/tree/master/arduino-ide/filesystem-example</a></p>
<h3 style="text-align: left;">Explanation</h3>
<div>The above code tries first to open a file called f.txt. If this succeeds it will read from it line by line and print the result to the serial console. If it cannot open the file it probably doesn&#8217;t exist yet. The code will then create the file and fill it with some imaginary key/value pairs, one pair per line.</div>
<div></div>
<h3 style="text-align: left;">Summary</h3>
<p>While other ESP8266 firmwares (NodeMCU, smart.js and frankenstein) already come with a filesystem it is great to see that the Arduino/ESP8266 environment soon will be blessed with this important feature. It is easy to apply and a huge improvement over the very low-level EEPROM persistence interface. Directories let you structure your files and you can freely create new files, delete or rename them.<br />
Compared to the NodeMCU firmware you have worry how you can get the files onto the device. If you want to run a web server you cannot just transfer the html, css and js files from your PC to the ESP8266. There is no interface for such an operation yet. But you could store them on another webserver and store/update them in flash when the device connects to WiFi.</p>
</div>
</div>
<p>&nbsp;</p>
<h3 style="text-align: left;">Documentation</h3>
<div>
<ul style="text-align: left;">
<li><a href="http://arduino.esp8266.com/versions/1.6.5-1044-g170995a/doc/reference.html#file-system">http://arduino.esp8266.com/versions/1.6.5-1044-g170995a/doc/reference.html#file-system</a></li>
</ul>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2015/08/esp8266arduino-playing-around-with.html/feed</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">30</post-id>	</item>
		<item>
		<title>ESP8266/Arduino: MAX7219 8&#215;8 Led Matrix Library</title>
		<link>https://blog.squix.org/2015/04/esp8266arduino-max7219-8x8-led-matrix.html</link>
					<comments>https://blog.squix.org/2015/04/esp8266arduino-max7219-8x8-led-matrix.html#comments</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Thu, 16 Apr 2015 17:05:00 +0000</pubDate>
				<category><![CDATA[ESP8266 Peripherals]]></category>
		<category><![CDATA[8x8 Matrix]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[ESP8266/Arduino]]></category>
		<category><![CDATA[MAX7219]]></category>
		<category><![CDATA[SPI]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2015/04/16/esp8266arduino-max7219-8x8-led-matrix/</guid>

					<description><![CDATA[Twice a year the company I work for (Netcetera) organizes a retreat for programmers, usually in the mountains. In the Spring issue this year we went to a resort in a beautiful mountain region. Inspired by the wonderful landscape I managed to write a library ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2015/04/esp8266arduino-max7219-8x8-led-matrix.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;">
<div dir="ltr" style="text-align: left;">Twice a year the company I work for (<a href="http://netcetera.com/" target="_blank" rel="noopener">Netcetera</a>) organizes a retreat for programmers, usually in the mountains. In the Spring issue this year we went to a resort in a beautiful mountain region. Inspired by the wonderful landscape I managed to write a library for the recently published Arduino IDE for ESP8266 which allows you to manipulate pixels and write animated text on 8&#215;8 led matrices with a MAX7219 driver.<a href="http://www.banggood.com/2Pcs-MAX7219-Dot-Matrix-MCU-LED-Display-Control-Module-Kit-For-Arduino-p-945280.html?p=0P21061109440201501M" target="_blank" rel="noopener">These boards</a> (affiliate link) only cost a bit more than $2/piece and you can connect several of them by daisy chaining one with the next. This allows you to create wonderful led bar on the cheap: lets say you buy 10 of them plus an ESP8266 and mount them on a piece of card board you&#8217;ll have a wonderful remote programmable eye catcher for shop display for less than $30!</p>
<p>Not being fluent anymore in C/C++ I had to get used again to the hard work of managing memory, dealing with a weird String object (yes, even weirder than the String object in Java;-)) and some other pitfalls for a 10+ years Java programmer.</p>
<p>But I finally managed it and here you can see the result:</p>
</div>
<p><iframe src="https://www.youtube.com/embed/SyQ0gtkVfAc" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p>Connect the Modules like this:</p>
<table>
<thead>
<tr>
<th>Led Matrix</th>
<th>ESP8266</th>
</tr>
</thead>
<tbody>
<tr>
<td>VCC</td>
<td>+3.3V</td>
</tr>
<tr>
<td>GND</td>
<td>GND</td>
</tr>
<tr>
<td>DIN</td>
<td>GPIO13 (HSPID)</td>
</tr>
<tr>
<td>CS</td>
<td>Choose free GPIO, e.g. GPIO2</td>
</tr>
<tr>
<td>CLK</td>
<td>GPIO14 (HSPICLK)</td>
</tr>
</tbody>
</table>
<p>Here you&#8217;ll find the library:<br />
<a href="https://github.com/squix78/MAX7219LedMatrix">https://github.com/squix78/MAX7219LedMatrix</a></p>
<p>Please note:</p>
<ul style="text-align: left;">
<li>this library is made for the ESP8266 and might or might not work for &#8220;normal&#8221; Arduino boards.</li>
<li>I had to patch the Mac OS X release with the SPI folder from Github. In other words there wasn&#8217;t an up-to-date release for Mac OS X (and maybe for the other platforms as well) and the SPI.h/SPI.cpp wouldn&#8217;t compile</li>
</ul>
<p>&nbsp;</p>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2015/04/esp8266arduino-max7219-8x8-led-matrix.html/feed</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">58</post-id>	</item>
		<item>
		<title>ESP8266, Arduino, Raspberry Pi: introduction to IoT hardware</title>
		<link>https://blog.squix.org/2015/02/esp8266-arduino-raspberry-pi.html</link>
					<comments>https://blog.squix.org/2015/02/esp8266-arduino-raspberry-pi.html#respond</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Wed, 04 Feb 2015 19:04:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[MCU]]></category>
		<category><![CDATA[NodeLua]]></category>
		<category><![CDATA[nodemcu]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2015/02/04/esp8266-arduino-raspberry-pi/</guid>

					<description><![CDATA[Checkout my presentation about IoT:]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
Checkout my presentation about IoT:</div>
<p><iframe allowfullscreen="true" frameborder="0" height="299" mozallowfullscreen="true" src="https://docs.google.com/presentation/d/1Dp2ZiS9hMW2IZ4QjOqh2KG1dxMzs3dTAJH_Yu3rsiyA/embed?start=true&amp;loop=true&amp;delayms=5000" webkitallowfullscreen="true" width="480"></iframe></div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2015/02/esp8266-arduino-raspberry-pi.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">65</post-id>	</item>
		<item>
		<title>ESP8266: Using a seeeduino to talk to the ESP8266 module directly</title>
		<link>https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html</link>
					<comments>https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html#respond</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Sat, 06 Dec 2014 13:00:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[ESP8266]]></category>
		<category><![CDATA[FTDI]]></category>
		<category><![CDATA[low cost wifi shield]]></category>
		<category><![CDATA[seeeduino]]></category>
		<category><![CDATA[serial-to-usb adapter]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2014/12/06/esp8266-using-seeeduino-to-talk-to/</guid>

					<description><![CDATA[I recently received two of these shiny new Wifi modules from China and had to test them out. In many posts around the web they say you should use a serial-to-usb adapter to send some AT commands to the module and set it up with ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
I recently received two of these shiny new Wifi modules from China and had to test them out. In many posts around the web they say you should use a serial-to-usb adapter to send some AT commands to the module and set it up with your local access point. My problem was: I didn&#8217;t have such an adapter, or so I thought. It turns out you can use some types of Arduino&#8217;s for the job just fine. I had a Seeeduino V3.0 laying around and that piece of hardware really has a few features built in that I wasn&#8217;t aware of before. This is a short explanation on how to setup the Seeeduino to talk to the ESP8266:</p>
<ol style="text-align: left;">
<li>Upload the following sketch to your Seeeduino:
<pre>void setup()
{
pinMode(0,INPUT);
pinMode(1,INPUT);
}
void loop()
{
}
</pre>
</li>
<li>Open the serial console of the Arduino IDE and set the baudrate to 115200</li>
<li>Now wire the ESP to your arduino:<br />
<img data-recalc-dims="1" decoding="async" border="0" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2014/12/ESP8266_pinout-1.png?w=730&#038;ssl=1" /></p>
<table border="1">
<thead>
<tr>
<td>ESP8266</td>
<td>Seeeduino</td>
</tr>
</thead>
<tbody>
<tr>
<td>GND</td>
<td>GND</td>
</tr>
<tr>
<td>VCC+CH_PD</td>
<td>V3.3</td>
</tr>
<tr>
<td>URXD</td>
<td>RX (pin 1)</td>
</tr>
<tr>
<td>UTXD</td>
<td>TX (pin 2)</td>
</tr>
</tbody>
</table>
</li>
<li>Now send some AT commands for testing (bold is the request, light comments and response):
<pre><b>AT</b>
OK
<b>AT+RST         </b>// resets the module<b>
</b> ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
[..]
csum 0xbd
<b>AT+CWLAP       </b>// lists all access points <b>    </b>
+CWLAP:(0,"",0)
+CWLAP:(3,"ap1",-90)
+CWLAP:(0,"ap2",-87)
<b>AT+CWJAP="ap1","mypwd"     </b>// join access point ap1 with password mypwd
OK
<b>AT+CWJAP? </b>    // show connected access point
+CWJAP:"ap1"
</pre>
</li>
</ol>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2014/12/esp8266-using-seeeduino-to-talk-to.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">76</post-id>	</item>
		<item>
		<title>DevDuino Sensor Node &#8211; Part 1 &#8211; Programming the DevDuino</title>
		<link>https://blog.squix.org/2014/07/devduino-sensor-node-part-1-programming.html</link>
					<comments>https://blog.squix.org/2014/07/devduino-sensor-node-part-1-programming.html#comments</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Tue, 01 Jul 2014 17:27:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[devduino]]></category>
		<category><![CDATA[ISP programmer]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2014/07/01/devduino-sensor-node-part-1-programming/</guid>

					<description><![CDATA[It took me far too long to get this working, but I finally did it: a small Arduino compatible board called &#8220;DevDuino&#8221; running on a CR2032 cell battery is sending temperature and battery voltage over the air to another Arduino board which records it. Sounds ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2014/07/devduino-sensor-node-part-1-programming.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
It took me far too long to get this working, but I finally did it: a small Arduino compatible board called &#8220;DevDuino&#8221; running on a CR2032 cell battery is sending temperature and battery voltage over the air to another Arduino board which records it. Sounds easy, doesn&#8217;t it? Well, it depends&#8230;:</p>
<ul style="text-align: left;">
<li>which Arduino are you using?</li>
<li>how good is the documentation of the DevDuino?</li>
<li>what wires do you have available?</li>
<li>Do you have a ISP programmer for the DevDuino?</li>
</ul>
<div>
Looking back I learned a lot about electronics but it also cost me a lot of time and maybe this blog post can save you some. But first things first.&nbsp;</div>
<h2 style="text-align: left;">
Programming the DevDuino</h2>
<div>
A while back I ordered the DevDuino V1.2 from Seeedstudio and I was very excited when it arrived. Maybe I should have read the (probably with Google Translate) translated Wiki page <a href="http://www.seeedstudio.com/wiki/DevDuino_Sensor_Node_V1.2_(ATmega_328)">here</a>&nbsp;to realize that I needed something to program the DevDuino. One way is using an In-System-Programmer (or short ISP) which can be a dedicated tool or a simple Arduino board. I checked out my Arduino box and found a Duemilanove compatible board and a Leonardo compatible board. I decided to use the Leonardo as ISP which was the first mistake: the Leonardo has some specialties which you have to be aware of or you will waste a lot of time. To turn a regular Arduino board into an ISP you&#8217;ll have to upload a special sketch to it, then swith all the settings to the board you want to program and pick &#8220;Arduino as ISP&#8221; from the programmer menu. Then you&#8217;ll have to connect the target platform with your ISP-Arduino, which might require some female-female jumpers. To upload a sketch to your target platform (like the DevDuino in my case) you hold down Shift while pressing the &#8220;Upload&#8221; button in the Arduino IDE. <a href="http://arduino.cc/en/Tutorial/ArduinoISP">This page</a>&nbsp;describes the process for &#8220;regular&#8221; Arduino boards pretty well. If you happen to use a Leonardo as ISP, then <a href="http://www.freetronics.com/pages/using-arduino-compatible-boards-as-external-programmers#.U5S8CZSSztZ">this page</a> might help you. In short: you&#8217;ll have to adapt the sketch you upload to your ISP by changing some pin definitions which are different for the Leonardo.</div>
<div>
The wiring might also be different:</div>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;">
<tbody>
<tr>
<td style="text-align: center;"><a href="https://i0.wp.com/blog.squix.org/wp-content/uploads/2014/07/leonardoAsISP.png?ssl=1" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img data-recalc-dims="1" fetchpriority="high" decoding="async" border="0" src="https://i0.wp.com/blog.squix.org/wp-content/uploads/2014/07/leonardoAsISP.png?resize=320%2C205&#038;ssl=1" height="205" width="320" /></a></td>
</tr>
<tr>
<td class="tr-caption" style="text-align: center;">Source:&nbsp;<a href="http://www.freetronics.com/pages/using-arduino-compatible-boards-as-external-programmers#.U5S8CZSSztZ">Freetronics</a></p>
<div class="separator" style="clear: both; text-align: center;">
</div>
</td>
</tr>
</tbody>
</table>
<p>So now you can send sketches to your DevDuino! If you want to save battery lifetime you can (and possibly should) adapt the settings for your target board. The <a href="http://www.seeedstudio.com/wiki/DevDuino_Sensor_Node_V1.2_(ATmega_328)">DevDuino Wiki</a>&nbsp;suggests to add the following lines to your boards.txt (on Mac OS X this might be here:&nbsp;</p>
<p></p>
<div class="p1">
/Applications/Arduino.app/Contents/Resources/Java/hardware/arduino/boards.txt):</p>
</div>
<pre>s328o1.name=Sensor328p (int1MHz, 1.8V)

s328o1.upload.protocol=arduino
s328o1.upload.maximum_size=30720
s328o1.upload.speed=19200

s328o1.bootloader.low_fuses=0x62
s328o1.bootloader.high_fuses=0xda
s328o1.bootloader.extended_fuses=0x06
s328o1.bootloader.path=atmega

s328o1.bootloader.file=ATmegaBOOT_168_atmega328_pro_8MHz.hex

#s328o8.bootloader.file=ATmegaBOOT_168_atmega328.hex

s328o1.bootloader.unlock_bits=0x3F
s328o1.bootloader.lock_bits=0x0F

s328o1.build.mcu=atmega328p
s328o1.build.f_cpu=1000000L
s328o1.build.core=arduino
s328o1.build.variant=standard
</pre>
<div class="p1">
</div>
<p>Then close the IDE and re-open it. Under Tools &gt; Boards you can find now a board called &#8220;Sensor328p (int1MHz, 1.8V)&#8221;. Select it. I believe you have to update the bootloader on the DevDuino</p>
<div>
</div>
<p>Now lets test the DevDuino with a minimal sketch:</p>
<pre>int led = 9;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}
</pre>
<p>
which will make the built-in LED blink on the DevDuino. To upload this sketch to the DevDuino make sure it is attached correctly to be programmed as shown above. Switch to the correct programmer on Tools &gt; Programmer &gt; Arduino as ISP (or similar, if you use a special board like Leonardo). Then select File &gt; Upload using Programmer or hold the Shift key while pressing the Upload button of your sketch. After the status turns to &#8220;Done Uploading..&#8221; the LED on the DevDuino should start blinking&#8230;</p>
<p>This was part 1 of the DevDuino tutorial. Part 2 will go into more details&#8230;</p>
<p>
Links:</p>
<ul style="text-align: left;">
<li><a href="http://arduino.cc/en/Tutorial/ArduinoISP">How to use Arduino as ISP</a></li>
<li><a href="http://letsmakerobots.com/content/integers-floats-arrays-structs-arduino">How to send dataobjects over the air</a>&nbsp;and <a href="http://www.bajdi.com/sending-structs-with-nrf24l01-modules-and-the-rf24-library/">this</a></li>
<li><a href="http://www.seeedstudio.com/wiki/DevDuino_Sensor_Node_V1.2_(ATmega_328)">DevDuino Wiki Page</a></li>
<li><a href="http://arduinoexamples.wordpress.com/2012/11/11/nrf24l01-com-arduino-leonardo-nrf24l01-with-arduino-leonardo/">How to link Leonardo with nrf24l01</a></li>
<li><a href="http://www.freetronics.com/pages/using-arduino-compatible-boards-as-external-programmers#.U5NT7ZSSztY">How to use Leonardo as ISP programmer</a></li>
<li><a href="http://maniacbug.wordpress.com/2011/11/02/getting-started-rf24/">RF24 examples</a></li>
<li><a href="http://www.mysensors.org/build/components">RF24 based sensor network</a></li>
<li><a href="http://www.seeedstudio.com/wiki/Grove-_Temperature_and_Humidity_Sensor">Grove Humidity Sensor</a></li>
</ul>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2014/07/devduino-sensor-node-part-1-programming.html/feed</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">77</post-id>	</item>
		<item>
		<title>Turn on/off USB Power on TL-MR3020 running OpenWrt to restart Arduino</title>
		<link>https://blog.squix.org/2013/09/turn-onoff-usb-power-on-tl-mr3020.html</link>
					<comments>https://blog.squix.org/2013/09/turn-onoff-usb-power-on-tl-mr3020.html#respond</comments>
		
		<dc:creator><![CDATA[Daniel Eichhorn]]></dc:creator>
		<pubDate>Wed, 18 Sep 2013 06:28:00 +0000</pubDate>
				<category><![CDATA[Common]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[low cost wifi shield]]></category>
		<category><![CDATA[TL-MR3020]]></category>
		<guid isPermaLink="false">http://blog.squix.org/2013/09/18/turn-onoff-usb-power-on-tl-mr3020/</guid>

					<description><![CDATA[In a later blog post I will describe how I am using a TL-MR3020 router as low-cost wifi shield for my Arduino to transmit sensor data over wifi. In this post I just want to show how you can script a restart of the arduino ... <p><a class="read-more btn btn-secondary" href="https://blog.squix.org/2013/09/turn-onoff-usb-power-on-tl-mr3020.html">Read More</a></p>]]></description>
										<content:encoded><![CDATA[<div dir="ltr" style="text-align: left;" trbidi="on">
In a later blog post I will describe how I am using a TL-MR3020 router as low-cost wifi shield for my Arduino to transmit sensor data over wifi. In this post I just want to show how you can script a restart of the arduino by powering off the USB port that the Arduino is connected to. In need this because sometimes the arduino does not send anymore data to the ttyUSB0 device. So as a workaround I&#8217;m restarting the Arduino from time to time by cron job.</p>
<pre class="prettyprint">
#!/bin/sh
echo 0 > /sys/class/gpio/gpio8/value
echo 1 > /sys/class/gpio/gpio8/value
echo "$(date)" >> /tmp/restart.log
</pre>
<p></div>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.squix.org/2013/09/turn-onoff-usb-power-on-tl-mr3020.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">86</post-id>	</item>
	</channel>
</rss>
