Arduino Server

From Combustory
(Difference between revisions)
Jump to: navigation, search
Line 31: Line 31:
 
* download TinyCore-current.iso
 
* download TinyCore-current.iso
 
* mount TinyCore-current.iso
 
* mount TinyCore-current.iso
 +
<pre>sudo mkdir /mnt/tmp
 +
sudo mount tinycore.iso /mnt/tmp -o loop,ro
 +
cp /mnt/tmp/boot/bzImage /mnt/tmp/boot/tinycore.gz /tmp
 +
sudo umount /mnt/tmp</pre>
 
* copy entire contents of the iso to a tftboot directory
 
* copy entire contents of the iso to a tftboot directory
 
* copy core.gz to a development dir
 
* copy core.gz to a development dir
Line 40: Line 44:
 
** example of default boot properties and file
 
** example of default boot properties and file
 
** example of how to set up the .lst files to load expansion modules
 
** example of how to set up the .lst files to load expansion modules
 +
<pre>
 +
wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/dropbear.tcz
 +
wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/dropbear.tcz.md5.txt
 +
</pre>
 
** introduce the TinyCore [http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes boot codes] and provide your example
 
** introduce the TinyCore [http://distro.ibiblio.org/tinycorelinux/faq.html#bootcodes boot codes] and provide your example
 
* log into the booted computer and test/verify the configuration and update image and reboot if needed
 
* log into the booted computer and test/verify the configuration and update image and reboot if needed

Revision as of 00:16, 29 October 2012

Contents

Summary

In determining a method to create a distributed sensor network I decided to test the idea of taking some old hardware to use it as a remote server to communicate with Arduinos. The basic idea is to have a server that communicates with the Arduinos and sends the data to a central monitoring process over the network. As long as you have a network connection to the server, you can add as many Arduinos as the server can handle to monitor or control whatever it is you are trying to accomplish.The motivation for this investigation revolved around Energy Management, therefore, I may have some references that apply to that subject to use as examples.

This article is not meant to be a step by step procedure, simply because there are many variables in each of our situations. Mainly this is a guide to how to accomplish the task with a conceptual basis that will lead you to discover some solutions that are needed for your application. It is more of a framework with some details and references.

Software

The Arduino Server will be focused on Linux. I guess it is possible to consider windows, but I have not been able to find the same capabilities easily and I am not sure it is even worth investigating, given the ease and flexibility of linux in this application. The central monitoring computers can be any OS that is capable of communicating to network TCP ports or file transfer, which is pretty much anything.

Assumptions

If you do not fully understand these topics below, this article will still be helpful for learning the capabilities of computers. Finding out computing techniques is half the battle to finding solutions. You can always learn the skills later and things will eventually fall in place.

  • You are familiar with the Linux command line
  • You understand basic text file configuration methods
  • You are familiar with serial communications in Linux
  • You are able to manipulate computer BIOS settings
  • You understand how to configure booting from HD,USB,CD,PXE
  • You understand sudo, su, chroot commands

Server

The idea is that you are able to find any old server that you may have laying around and put it to use and save you money or buy one cheap just to help you learn as a low cost education. The hardware requirements are very little, you should be fine as long as you have about 256k in memory. It may be possible to have less, but that is where I decided to draw the line. The processor is mostly irrelevant, because just about any processor you have laying around will most likely be able to manage the light load we are creating. I will not be testing it, but it may be possible to go as far back as a 386. The hardware configuration that I am using is a 1.2MHz pentium with 256k in memory, which actually works very well even in full GUI mode. You should also be able to find this type of computer laying around in many junk piles at a computer swap.

Operating System

After a significant search and years of playing around with small linux distributions, I have fallen on upon Tiny Core Linux. It is amazing. With this distribution you can breath life into old computers you thought were long useless. It has a full GUI and is quite capable of many tasks. With a quick download you can be up and running in no time. What really sealed the deal for me was the fact that I could change all the characteristics of this OS with ease and quickly. After fiddling around with many other linux distros for hours or even days, I was making progress with Tiny Core literally in minutes. I'm completely sold on this idea and while many have created small distributions, this concept is masterful in my eyes and far better than any other that I have tried.

Boot Methods

With Tiny Core you have these boot options: HD,CD,USB,PXE. I am focusing on PXE (Network Booting), because to me this is the best way to manage old computers that tend to die. I can pretty much find any old computer with net boot capability and just plug it in and off we go with very little work. The CD and USB are similar in this capability, but not nearly as fast on booting up. The HD being the least flexible of all options, but may not be too bad if you use an IDE or SATA to SD converter, which I have not tried yet, but they look interesting.

Configuration

PXE Setup

Development Environment

  • download TinyCore-current.iso
  • mount TinyCore-current.iso
sudo mkdir /mnt/tmp
sudo mount tinycore.iso /mnt/tmp -o loop,ro
cp /mnt/tmp/boot/bzImage /mnt/tmp/boot/tinycore.gz /tmp
sudo umount /mnt/tmp
  • copy entire contents of the iso to a tftboot directory
  • copy core.gz to a development dir
  • extract core.gz
  • modify/add files/dirs in the development dir (use chroot commands for setting passwords and other system level settings)
  • pack up the new core and move it to the PXE boot dir (show script for doing this)

Booting Process

  • modify PXE boot settings to boot with your new root image.
    • example of default boot properties and file
    • example of how to set up the .lst files to load expansion modules
 wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/dropbear.tcz
 wget http://distro.ibiblio.org/tinycorelinux/4.x/x86/tcz/dropbear.tcz.md5.txt
    • introduce the TinyCore boot codes and provide your example
  • log into the booted computer and test/verify the configuration and update image and reboot if needed

Operation

  • Create scripts to transfer Arduino to interface with TCP port using nc command
  • Create scripts to connect to the port on the Arduino Server and collect data
  • Discuss security and ssh
  • Discuss file transfer methods
  • Discuss cron jobs and set up
  • This section will end up being a wide scope with many ideas presented and possibly referenced
Personal tools
Sponsers
Your Ad Here
Your Ad Here