Changes RSS

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== TEMPDude ====== - **Project to create an easy-to-deploy Ethernet enabled temperature sensor**. ===== Concept ===== Most reasonably-priced solutions for network enabled, computerized temperature logging involves connecting a simple temperature sensor directly to a computer, most commonly to a serial port. To centralize temperature logging, software is used on the computer to either read multiple such sensors attached to the computer, or read one or more locally attached sensors, and sending the data off to a central server of some kind. Porblems with this approach is that a complete computer is needed at each location where temperatures are to be logged, and most commonly at least two levels of software are deployed; the sensor reading part, and the logging server. The alternative to this approach is to use industry- or datacenter-grade temperature logging systems. This commonly involves a device that sensors are connected to, that in turn is connected to an Ethernet. These solutions are normally SNMP based, thus they are normally polled for data, and only transmit data when a preset alarm condition is triggered. The transmit of data is the commonly sent as an SNMP trap and/or an email alert. Problems with this approach may include: a normal household internet connection is typically behind a NAT that has its global IP assigned using DHCP, and such it will be troublesome to poll a device from a central logging service using SNMP. The devices are also typically not what can be called reasonably priced. What I want to accomplish is a solution where a central logging service is set us as the only user-installed software component, and fairly low-priced Ethernet-enabled temperature logging devices are deployed onto a DHCP-enabled network, where they immediately start reading attached temperature sensors, and actively sending the logged data to the logging service. ==== Feature outline ==== The following are set as feature-goals: * deployment of device as easy as plugging into power and DHCP-enabled ethernet * each should be able to monitor/read one to four (or eight) connected sensors * each device should have a cost below $75 * well documented set-up and configuration * cross-platform toolkit for setting up * cross-platform logging server (service) * no, or few, NAT issues (port forwarding may be needed on the server-side) * based on "reference architecture" components * lightweight data storage; RRD or SQLite most probable. ===== System architecture ===== After looking around at various embedded hardware platforms that give a combination of Ethernet connectivity and general purpose I/O, the following options were what I came up with: * Embedded computer platform, e.g. Gumstix, PC104 or simmilar. Previously I have developed a gumstick based device that does the same job, but that came at a hefty price: ~$180 per node. Looking at embedded computer alternatives, this is still pretty much the case. * Ethernet-to-RS232 device. This approach cut the cost, but I was unable to find a device that would provide enough features without becoming bulky, and also becoming a custom job * Arduino-based. There exists solutions that make the Arduino series of devices ethernet enabled. These allow a reference architecture basis for the project, but does not cut the cost low enough. * Microhip PIC TCP/IP stack based. The [[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2505&param=en535724|Microchip TCP/IP stack]] is indeed a reference arhitecture, and there also exists reference implementations of the hardware. Striking "gold" with this approach, I fould that Olimex has development boards that implements the architecture and the stack, at a cost well below my "high-water" price-mark. So the hardware platform that I have selected for this project, is the Microchip reference architecture for their TCP/IP stack, implemented in the first iteration on [[http://www.olimex.com/dev/|Olimex]] PIC-*WEB series devices. {{ notater:pic-mini-web.jpg?200 }} The software platform is to be based on the Microchip TCP/IP stack on the device. The first edition of the server-side software will be a simple TCP server written for GNU/Linux. ==== System configuration operation ==== The following are ideas on how the device should operate in regard to configuration. Device-server communication is commented in a separate section.. If the device is unconfigured, it should use a MAC-address stored in program memory, and stop in an IP gleaning phase. Setting the IP-address of the device using an ARP directed PING should set the device ready for base configuration, where the device starts listening on a given TCP port (4919 decimal , 0x1337 hex). === Hardware configuration process === The device should support reprogramming of default IP-address and MAC address, and this should be possible using a network connection. The method for doing this has not yet been implemented, but previous ideas have been scrapped due to complexity. === Normal boot === On a configured boot, the device will read its MAC address data from EEPROM. It will then attempt DHCP configuration of IP address. After DHCP configuration is complete, the device will start reading connected sensors, and sending data to the IP address and port configured in EEPROM using LEMP1, documented separately. The device will also respond to ICMP PING. === Configuration after normal boot === === Configuration tool === ===== Development roadmap ===== This section will be updated as I get more experience with the tools used, and as I decide on how to progress. Se below for progress... * **done** Get hardware * PIC-MINI-WEB http://www.sparkfun.com/commerce/product_info.php?products_id=7829 * PIC-PG1 http://www.sparkfun.com/commerce/product_info.php?products_id=9 * PIC-ICSP http://www.sparkfun.com/commerce/product_info.php?products_id=8108 * Microlab IDC2 http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 * DS18B20 tempsensor http://www.sparkfun.com/commerce/product_info.php?products_id=245 * **done** Get development software for the Microchip-side of development * Microchip MPLAB IDE http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 * compilers from Microchip. * **done** Get fammiliar with hardware and development platform * **done** Reprogram the device with stock program- and flash content * Remove unwanted components from program. Test programming of stripped code. * Add DHCP client. Program device and verify DHCP operation. * Add simple TCP client, program and verify * Verify that reload of stock software works * Figure out how to read/write EEPROM, store and retrieve data on EEPROM * Verify that reload of stock software works * Add TCP Server component that accepts connection, reads data and terminates. * Implement 0x37 configuration * Implement IP Gleaning * Implement IP Gleaning, 0x13 and 0x37 operation * Implement reset-on-switch * Implement 0x2342 operation * Implement simple TCP client app sending dummy data * Add heartbeat LED * Implement reading of a single attached temperature sensor * Implement reading of multiple sensors ===== Progress =====