2011 Spinneret Web Server design contest entry; JHA
Jeffa
Posts: 80
Note: I changed the name of this project to nerdDoro see this thread for final spin source code as well as examples of accessing nerdDoro from a Wordpress widget and MS Windows phone 7 as well as a .net console application for database persistence and an asp.net MVC w/jQuery display of the data over time. http://forums.parallax.com/showthread.php?133459-nerdDoro-Spinneret-design-contest-entry-submission -jeffa @jhalbrecht www.rodaw.com
JHA [just|jiffy|?] Home Automation. A play on initials/words of my name Jeffrey H. Albrecht
JHA will be an implementation of ePhidgetY replacing a Phidget controller and Linux box with a Spinneret web server and environmental sensors such as the Parallax Sensirion Temperature/Humidity Sensor #28018and/or LM34 temperature sensors. Possibly others.
ePhidgetY is a Windows Phone 7 application that I wrote during xapfest. It reads an XML file to display current and summary environmental data. ePhidgetY allows configuration of the URL for reading the XML such that any application writing to its XML format can display environmental data from that url.
ePhidgetY is a Phidget controller, temperature and lightsensor and LCD that displays the current inside and outside temperature, time and date. It runs on a Linux box running Fedora core 13 (hence its host name Saturn) and records this data every sixty seconds. Its been quite a learning experience starting with the Phidget, (BEFORE I WAS AWARE OF PARALLAX), controller. Learning to manipulate the LCD and read the sensor using c++. Then enhancing the program to write to MySQL. To make SQL queries with PHP and send that data via JSON to a web page using the jQuery flot plugin to display temperature over time. The latest was to write an XML file with summary data for the windows phone application ePhidgetY.
A feature of JHA may be the ability to continue logging to the MySQL db and use the SD card as a backup in the event of a loss of connectivity.
The phidget controller and display in a Glad refrigrator storage container.
Windows Phone 7 ePhidgetY screen
References:
www.xapfest.com
http://www.xapfest.com/apps/details/ephidgety
http://www.jeffa.org/~jeffa/ePhidgetY/(takes a moment to load ) Might view better in Chrome or Firefox. I am in theprocess of moving this to http://appdevpro.com/ePhidgetY.aspx
http://code.google.com/p/flot/
JHA [just|jiffy|?] Home Automation. A play on initials/words of my name Jeffrey H. Albrecht
JHA will be an implementation of ePhidgetY replacing a Phidget controller and Linux box with a Spinneret web server and environmental sensors such as the Parallax Sensirion Temperature/Humidity Sensor #28018and/or LM34 temperature sensors. Possibly others.
ePhidgetY is a Windows Phone 7 application that I wrote during xapfest. It reads an XML file to display current and summary environmental data. ePhidgetY allows configuration of the URL for reading the XML such that any application writing to its XML format can display environmental data from that url.
ePhidgetY is a Phidget controller, temperature and lightsensor and LCD that displays the current inside and outside temperature, time and date. It runs on a Linux box running Fedora core 13 (hence its host name Saturn) and records this data every sixty seconds. Its been quite a learning experience starting with the Phidget, (BEFORE I WAS AWARE OF PARALLAX), controller. Learning to manipulate the LCD and read the sensor using c++. Then enhancing the program to write to MySQL. To make SQL queries with PHP and send that data via JSON to a web page using the jQuery flot plugin to display temperature over time. The latest was to write an XML file with summary data for the windows phone application ePhidgetY.
A feature of JHA may be the ability to continue logging to the MySQL db and use the SD card as a backup in the event of a loss of connectivity.
The phidget controller and display in a Glad refrigrator storage container.
Windows Phone 7 ePhidgetY screen
References:
www.xapfest.com
http://www.xapfest.com/apps/details/ephidgety
http://www.jeffa.org/~jeffa/ePhidgetY/(takes a moment to load ) Might view better in Chrome or Firefox. I am in theprocess of moving this to http://appdevpro.com/ePhidgetY.aspx
http://code.google.com/p/flot/
Comments
3.3V Regulator
Prop Plug
Propeller Backpack
Prototyping Daughterboard
Sensirion Temperature/Humidity Sensor
Spinneret Web Server
c ya... - jeffa
And look, there's a giant bug in the hardware already! :-)
"The final factor is professionalism, which accounts for 25% of the final score. We will be reading through all of the project reports and forums posts, as well as viewing all of the pictures, videos, and files associated with the entries. It is important for us that everything is presented in a professional, easy to follow format, so it plays a significant role in the final score."
Have I already blown the: "professionalism" by my diary like entries as I entered the contest, ordered parts and made offhand fun remarks such as refering to the spider on the spinneret "... there's a giant bug in the hardware ..." when I received the parts and saw the Spinneret for the first time?
Or will it be be obvious or noted in the text when I have specific contributions, and that my final submission project report is the criteria in this regard?
c ya... - jeffa
If we thought comments like yours about the "giant bug in the hardware" were unprofessional, we wouldn't have printed a giant spider on the bottom of the Spinneret Web Server.
David Carrier
Parallax Inc.
I designed, assembled and blogged on a way to power up my Spinneret using what I call: "Power over other Pairs" Here is a details view.
and here it is buttoned up. I have approximatley fifty feet of cat5 between the two ends that are shown here in one picture.
A wall wart feeds one end, and a small circuit in a low profile box regulates and filters to 5VDC.
Using the: "W5100_Web_Page_Demo_indirect.spin" I got a jHelloWorld loaded from the Spinneret.
What next? I think I'll try the NTP thread.
Then I added a 4 line serial LCD display and have that functioning too. I switched the way I power the Spinneret so I could use J6 to drive the LCD with a servo cable. I'm now powering through J1 pin 2 and 12.
The wall wart I was using claimed it was 9v but was more like 12v. The regulator I was using to produce 5v was overheating and once I added the LCD it dropped out several times. I found another wall wart that claimed 6.5v it's working well enough to continue development until I get to a store to pick up a more optimum 7.5vdc unit. Currently I'm supplying 4.5vdc to the Spinneret and the LCD.
I also added a few more entries to my Spinneret Resources blog.
The Sensirion and web server are calling.
c ya... - jeffa
Today I soldered up the Proto-DB to support Vin, and the Sensirion temperature / humidity sensor for my Spinneret project.
Note in this picture the Spinneret with Proto-DB board and sensor perched ontop of a clock thermometer. You can also see a PST displaying data read from the Sensirion using the SensirionDemo_full.spin object. Im using A24/A25 onthe Spinneret. The thermometer indicates 79.2 while the sensor data displayedis 84 degrees. Seems reasonable.
It appears that only the '1 slow, hiRes measurement' is returning valid results.
Added XML output for dateTime and temperature to use in my wp7 application. The XML looks like this:
[HTML]
<nerdDoroData xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<currentTemperature0>86.9</currentTemperature0>
<currentMeasuredTime>2011-07-15T16:50:45</currentMeasuredTime>
</nerdDoroData>[/HTML]
I extend the s-35390A_GBSbuild_02_09_2011.spin to additionaly return a shorter string for use on the LCD.
I created this code to get a datetime for the xml (see above output) I'm reading in a .net wp7 application.
Some to do items
- check sensirion code. Appears inaccurate relative to actual temperature swings in it's measured environment
- Enclosure
- Start the project documentation
- It's only working on one socket
- Clean up the HTML from the 'working' to something more organized and self documenting
Lovin' the Spinneret! Can't believe how fun it still is to click the LED button and watch the usr led toggle on and off! :-)nerdDoro is available at https://github.com/jhalbrecht/nerdDoro
I changed the code from to
the XML is all better now.
Regarding the temperature readings, I put an extension cable on the Spinneret to move the Proto-DB away from the Spinneret. I also tweaked the temperature conversion coefficients. And in reviewing the SHT11 Sensirion data sheet I'm now satisified the results are acceptable.
If you havent used fiddler check it out at: http://www.fiddler2.com/fiddler2/ Its a very handy freeware tool for debugging web applications. Ive been making use of the HEX dump to fix my server response.
I tried hitting your site a few times the last couple of days but I keep getting an "Unable to connect" message; Win XP, Firefox. Is the site up or are you working on it?
What's your experience with stability / relability?
This morning my code is running. The LCD is being updated with current time and temperature. I haven't accessed nerdDoro for many hours yet it is unresponsive to http requests. I can ping it.
Netstat shows Scratching my head right now. I've really hammered on it from multiple clients and hosts with it responding. Then I let it idle for hours and this.
I'm thinking about creating a debug object in a COG to print to the PST whenever a wiznet status register changes. Anyone have a code snippet like that?
I'm thinking I should look at why the TCP connections to .108, my main win 7 64bit notebook, are established and not droping.
Any ides / suggestions?
Source code to nerdDoro: https://github.com/jhalbrecht/nerdDoro
http://www.agaverobotics.com/spinneret/source/
You can find the bare bones project in my Spinneret Project entry. The pages are being rendered from the Spinneret.
http://spinneret.servebeer.com:5000/source/httpserv.zip
Striped out a bunch of test code. Lot's of unused HTML and js.
Added utility function button to set the RTC from SNTP. Eventualy I should set the RTC from NTP once a day or week. For now I want to watch the drift.
Added the timer object rather than the rtc alarm as it has display capabilities built in as well as some other handy features.
Added a check on the usr push button to restart the timer object.I had planed to use a Memsic 2125 dual-axis accelerometer but couldn't find one in my sensor bin. Don't think I'll have time to implement that before the deadline. I would have just shaken the clock to set the timer rather than the push button.
Added code to check when the minutes were equal to 25 for a Pomodoro. Actually I've been testing it with 1 minute. I might use the HTML utility page to set the timer length. I had planed to have it do a 10 minute timer for one type of shake, and a 25 minute pomodoro for another shake. Useful in the kitchen for a cookie timer. Once I hit the programed interval I flash the LCD backlight on and off. After codding the LCD pizzo I noticed that my LCD is an 'E' revision apparently without the speaker. I wonder if I can add the pizzo to an 'E' model ?? I let the timer continue to count up after the 25 minute Pomodoro.
nerdDoro seems stable tonight. I've left it runing after hitting it hard from several ips and browsers. It's available as jeffa.org:90 the xml is at http://jeffa.org:90/xml Hope it's still answering requests when I wake up. 'night.
Source updated https://github.com/jhalbrecht/nerdDoro