Javascript redirect when device has restarted

Over the past few months I have been building a sensor device with a embedded webserver for configuration and reporting. When a user saves a configuration to the device the device needs to be restarted before the changes come in to effect.

While the device is restarting the webserver is unreachable and the users get a blank page or 404 pages, this is bad for the users. So I created this simple script to check to see if the device has been restarted correctly then redirect the users to the correct page. This script uses JQuery

Script: Redirect on reboot

<script type="text/javascript">
		function UrlExists(url) {
			var http = new XMLHttpRequest();
			http.open('HEAD', url, false);
			http.send();
			return http.status!=404;
		}

		var checkCount = 0 ; 

		function CheckServerUp(){
			checkCount++; 
			$('#status').text('Checking. ' + checkCount ) ;			
			if( checkCount > 30 ) {
				$('#Error').html('The device is taking a long time to reboot, <a href="/refresh2.htm">Click here to continue</a>' + checkCount ) ;
			}

			if( UrlExists( "refresh2.htm" ) ) {
				$('#status').text('Device running, redirecting...') ; 
				window.location.replace( "/refresh2.htm" );				
			}
		};

		$(document).ready(function(){
			setInterval( "CheckServerUp()", 1000 );			
		});
	</script>

 

Burning man 2011 placement confirmed – DIVORCE & 7:30, Rites Of Passage

We just got our camp placement for burning man (Rites Of Passage) this year. Divorce and 7:30. If your coming, (and why wouldn’t you be) stop by and check out Retrofrolic - The place of pink pain and pleasure.

We also get to know what the street names are for this year. They also seemed to have added an extra 15mins to each side of the rings. (3:15, 9:15)

  • Esplanade
  • Anniversary
  • Birthday
  • Coming Out
  • Divorce
  • Engagement
  • Funeral
  • Graduation
  • Hajj
  • Initiation
  • Journey
  • Kindergarten
  • Liminal

Abluestar.com privacy statment

I record as much information as I possiably can from all my users, all the time, and I keep it for as long as I want to. I will sell it to anyone who asks and give it to anyone who puts a lawyers paper under my nose.

* NOTE: This only applies to Abluestar.com. My other sites I got out of my way to remove personal information that I don’t need so I won’t be subpoenaed for the info. Having my web server seized would definitively cause downtime. *

You should expect every other site to do the same. Privacy Icons are a way to inform users about how there information will be used on your site.

This means that your data is collected and used in ways that go beyond what is necessary for the interaction. For example, in addition to collecting your address to ship you a pair of shoes you just bought (which is an intended use of your address), the web site might also sell your address to data aggregators who sell it to junk mail companies.

This means that a website is collecting data about you and selling or trading it with another organization, government, or person. An example of this is where a shopping website collects data about your shopping preferences, frugality, and ip address and sells that info to data aggregators or to other e-commerce sites directly.

This means that a site either shares the data it has about you with marketing or advertising companies or allows those companies to collect info about you while on its site.

These organizations might provide your data to a government that asks for it without following the legally required process. They might just send a letter or make a phone call to the company to ask for your data.

 

InkPop.com, Are spammers and a security risk for their users. DONT USE THEM. They suck

They are spammers

I got this email 6 times this week as they spammed all my different magazines searching for SEO link backs. There is a few things that piss me off about this email.

  1. They say that they really like my website, yet they send the same carbon copy email to all my magazines making me think that they never even visited my site before contact us.
  2. A smiley face emoticon in what I guess you where trying to pass off as a semi-professional pitch? What are you twelve?
  3. I hate spammers and this is email is spam. I go out of my way to make it as hard (posts like this) and expensive as possible for spammers like this to operate.
  4. We have a system set up for sponsorship that would let them get a link on the site to their site. The correct way to advertise on a magazine, but that costs money and supports our magazine and they want it for free.

After I got this email I emailed them back telling them what I thought of them. Then copied and pasted the email on to their contact us page as well as their forms.

They are a security risk for you and your children

I had to sign up to their forms before I was able to make a new posts. I used a random password because I didn’t trust them. After I signed up I got an email with my password as plain text. That means two things;

  1. They are storing YOUR password as plain text in their database. This is really bad and there is no need for it. If their web servers are compromised then the hackers will have access to your password and personal information that they can use to try and attack other sites you are registered with. See this post for more information A perfect example of why you should use the same password on different websites.
  2. They are sending YOUR password as plain text in emails. Snooping wireless traffic is easy, Snooping for words like passwords in text makes it even easier to get peoples passwords. Anyone that is listening to your connection while they foolishly send this email, now has access to your account and your password. If you use that password in more then one place they can guess at other places you are registered at and login as you.

They don’t protect your privacy, your passwords, and put you at risk.
InkPop.com is dangerous.

There initial email

I’m Jett. I really like your site, and you’re linked to a lot on other writing/book blogs. I work for Harper Collins and more specifically InkPop.com. The site just re-launched a week ago and we’re really excited about the new look and new features. HPC editors are still reviewing submitted works in our kick-ass contests, but what’s new is the fresh badge system we have to promote individual profiles.

It’s definitely still a YA/Teen writing site, but we like to think our audience is pretty diverse, and most of all, passionate. I’m writing to you to see if you’d perhaps consider writing a blurb/mention about the new digs? We care about young writers continuing to write their best work, and HPC is devoted to producing the kind of books its readers want to read most. The editors of the site are super responsive and take all complaints/concerns into consideration. Considering the hodgepodge pack of writing communities available today, InkPop is a much-needed refresher.

Thanks so much for hearing me out. Take care.

:)

-Jett

Spin Art – Vancouver Mini Maker Faire 2011

I build the first version of my giant spin art back in may after reading build instructions in Make magazine Volume 25.

It work okay but had a few problems. It was direct drive driven and I was worried about burning out the motor. It was scary fast and got unstable as it speeds up.

Three days before Maker Faire I decide to rebuild it. First thing I did was make a new box out of lumber one that I could mount the motor underneath. Then used two pully and a belt to reduce the speed of the motor. I mounted a sheet of thick foam board on top of the center pully. It was much lighter then the wooden board I was using before making it much more stable and safer. I used some plastic fencing, duck tape and paper as a splash guard so people wouldn’t get covered in paint as it spins. The plastic fence worked but looked ugly.

Things to change for next year.

  • More paper – I purchased 100 sheets of poster board that I cut in half (good quality). As well as a book of painting craft paper with 160 sheets (No as good). For a total of 360 sheets of paper. I was completely out of paper, and things that I could use as paper by noon of the 2nd day. This was good thing as well because it gave me a chance to wonder around the Faire and see what everyone else was making.
  • Safety Fence – Three kids fell in to the spin art box! No one was hurt but they did get covered with paint. The plastic splash fence that I used as a splash guard couldn’t hold the weight of a child as they reached in to the center to  pore paint on to the board.
  • Ugly Splash fence – The thing looked ugly from the outside. It could have easily been fixed up by putting spin art paints all round the outside of the splash fence.
  • An assistant – Very important, It was almost impossible to go to the bathroom with a line of children waitting patiently for their turn. I also was trying to get a photo of every child with their spin art but it was impossible while operating the box at the same time.
  • A time laps from above – It would have been really interesting to watch the entire thing from a camera mounted above the box doing a time laps with a picture once every 5 secs.

 

 

RGB LED POV Globe – Status update and mechanical issues

This project has somewhat hit a road block and with 12 days left before Maker Faire I’m starting to panic. This leaves me with ~4 good working days left. Here is my current stats.

Editor and Simulator

At burning man 2010 I saw the Illuminatrix made by Ben Delarre. A RGB LED color grid that was programmable from a JavaScript editor that he made. I was impressed when I saw it at burning man and contacted him early after I started this project to see if I could use his editor for my project. Not only did he let me use the editor but he said that he would change it so it would work specifically with my globe project. A week later and I had my own HBD5000 page on his website with an editor, simulator and a few example animations. Amazing Ben Delarre is awesome.

Example animations:
Click the images to see a simulation.

Please generate your own animations with the editor. We need more animations!

Software

Software is basically done, I’m still having problems steaming frames at full speed over bluetooth, but half frame rate is works great. On the Arduino Mega I can buffer ~19 full color frames and the Arduino uno I can buffer ~10 full frames. As I am displaying the frames to the users I can stream in new frames over bluetooth. The whole system works pretty well and with so little time left I probably won’t be changing it anytime soon.

The Mechanical

The first wheel I made was a 6 foot monstrosity of bent tube stock. While I was doing my testing it was a little unbalanced and bent under the stress. As soon as it bent even a little the problem got exasperated and by the time I was able to shut it down the whole ring was bent out of shape and unrecoverable. It was an expensive and time consuming mistake. Luckily I was not running it at full speed or it could have sheared off its hinge and hurt someone as it flew though the air.

At this point I decided to shrink my project down from a 6 foot tall ring to the biggest bicycle rim that I could find. The bicycle rim is already sturdy enforced with the spokes, light and balanced. The project is smaller but much safer.

I drilled some holes in the rim for wires to run though and buffered the LEDs with expanding foam. Its not pretty but it works surprisingly well.

Next I secured the Led boards, wires and the controller boards to the spokes of the bicycle rim. These components will be spinning at great speeds so I took extra care to make sure that they won’t be going anywhere.

Next I attached the bolts to a tuning fork like mount that Arthur Hazleden a fellow Vancouver Hackspace member made for me.

Next I made a box out of wood with two pillows bolted to a center brace. A pillow is ball baring mount that should let the center shaft spin freely while saying in position.

In this video/pictures you can see the LEDs lit up. I used a C Camp to keep the wheel from falling over. Ignore the voices in the background they are from the scary ally behind Vancouver Hackspace.

Power

I used a standard computer power supply to power all the LEDs and electronics on the wheel. This works really well and I suggest it for anyone that is powering large amounts of LEDs. The power supply comes with both 5v and 3.3v rails. A common computer power supply also filters and smooths out the current before passing it on to the LEDs.

There is a simple trick for turning on a PC’s power supply without a PC. Basically you need to short the green {PS_ON} pin with any of the black wires {COM} on the power supply.

I am using a 3 connection slip ring to transfer power from the stationary base and power supply to the rotating wheel. There are lots of industrial slip rings available online but they are pretty expensive. You can make your own slip ring but with something so important to this project I decided to buy one.

Safety at Maker Faire

Because of my previous mishap with the larger ring, and because the ring is spinning so fast the good people at Vancouver mini Maker Faire had valid concerns about the safety of this project. The code name of this project probably didn’t help much either. HBD5000 = Hippy Ball of Death 5000.

I decided to encase the spinning parts of my project with Polyethylene terephthalate aka PET-G or better known as the stuff that pop bottles are made from. Its has a few good properties that plexi glass doesn’t. Its easy to mode in to shape, it bends and warps instead of shattering, and most importantly its cheap.

They also connected me with Farrell Segall who has successfully created a few different POV projects that he plans to bring to Vancouver Maker faire this year. We met up at the Vancouver Hackspace and he showed me his impressive POV projects as well as some other very interesting projects that he is working on. He suggested that I make a mount at the top of the POV with a pillow so that the Ring won’t be able to wobble too much. Great idea!

With the top mount and the PET-G even if this project does spin honorably out of control it shouldn’t hurt anyone.

Issues

  • The bluetooh receiver broke while I was mounting it to the Arduino board. Ordered another one and it should be here 2 days before Maker Faire. If it does not get here in time I will pre program the POV with a single image and use that to demo it.
  • I have no welding skills and i’m reliant on others to do the welds that I need for this project.
  • I have burnt out two used motors testing this project. I have purchased a bran new motor for Maker faire but if it burns out on site I will not be able to replace it.
  • Spinning speed, there is a controversy on what speed I should spin the ring at. Its safer at slower speeds but I will get less frame rate. The POV is not spinning yet so I can not test it at different speeds.

Whats left to do

  • Add the top mount for safety
  • Add the PET-G container for safety
  • Get it spinning
  • Mount the power supply
  • Add the slip ring to transfer power to the wheel.

 

 

 

 

 

Netburner http weird errors – Daily WTF

Daily WTF

I got these weird errors while attempting to compile a Netburner project with NbEclipse. The project included the HTTP driver as well as some custom generated pages. After bashing my head against the wall for an hour I figure out what caused these errors. Because the HTTP driver has been loaded you are required to have a file in the /http/index.html folder to get NbEclipse to compile.

C:\dev\nburn\lib\NetBurner.a(httpinternal.o): In function `BaseDoHead’:
C:\release\nburn\system/httpinternal.cpp:431: undefined reference to `default_page’
C:\dev\nburn\lib\NetBurner.a(httpinternal.o): In function `BaseDoGet’:
C:\release\nburn\system/httpinternal.cpp:395: undefined reference to `default_page’
C:\dev\nburn\lib\NetBurner.a(htmldecomp.o): In function `SendHtml(int, char*, int, char const*)’:
C:\release\nburn\system/htmldecomp.cpp:176: undefined reference to `html_table’
C:\release\nburn\system/htmldecomp.cpp:180: undefined reference to `html_table’
C:\dev\nburn\lib\NetBurner.a(htmldecomp.o): In function `GetRecordFromName(char*)’:
C:\release\nburn\system/htmldecomp.cpp:88: undefined reference to `file_record’
C:\dev\nburn\lib\NetBurner.a(htmldecomp.o): In function `SendHtml(int, char*, int, char const*)’:
C:\release\nburn\system/htmldecomp.cpp:143: undefined reference to `DoHtmlFunction(int, char const*, unsigned short)’
C:\dev\nburn\lib\NetBurner.a(htmldecomp.o): In function `GetRecordFromName(char*)’:
C:\release\nburn\system/htmldecomp.cpp:86: undefined reference to `n_file_record’
C:\release\nburn\system/htmldecomp.cpp:95: undefined reference to `file_record’
C:\release\nburn\system/htmldecomp.cpp:86: undefined reference to `file_record’
C:\release\nburn\system/htmldecomp.cpp:95: undefined reference to `file_record’

RGB LED POV Globe – LED test

This is a video of me testing 5x OctoBrite CYANEA boards connected in series to an Arduino powered by a common computer power supply. Currently I wire wrapped the boards together but I will be soldering 2pin screw terminals in to the end of each of the boards in the finale version. I am using the default test code from Macetech to change these LEDs.

Software = Done
Electronics = Done
Mechanical = Started…

RGB LED POV Globe – Software

I been travailing a lot the past few weeks making it hard to work on the mechanics of this project and with only 50 days left till Maker Faire I am running short on time. Travailing doesn’t prevent me from working on the software side of things though but it make it hard to test it. I have created this testing board to use while I finish the mechanics parts.

I created a base class (CFrameBase) for the frame animation then inherited from it for the algorithmic generated animations (test patterns, ect…). I also created a frame buffer class that inherited from CFrameBase that is basically just a big memory block that you can load via the serial port.

Next I added a blue tooth module so I could load the configurations over wireless via serial. Currently the serial can’t keep up with the data rate needed to do even modest frame fate. I will probably end up loading the entire animation in to memory before I start to display it. The draw back of this is that I will only be able to show 19 frames of animation at any given time.

Next I added a Triple Axis Accelerometer (ADXL345) and a Gyro (LPR530AL Dual 300), these will help determining the position of the ring as it spins around its axis. I have tested each of these parts on its own but without the mechanics I can do real world tests. I’m adding in software to manually correct for the motors speed as well just in case.

This source code is still a work in progress but functionally its working.

HBDOS_[2011-05-16_220511]

RGB LED POV Globe

  1. RGB LED POV Globe – Research
  2. RGB LED POV Globe – Research LED
  3. RGB LED POV Globe – Parts shopping
  4. RGB LED POV Globe – Research other peoples projects.
  5. RGB LED POV Globe – Software

 

 

Status update May 12, 2011

I have been busy the last few weeks as projects ramp up and we get closer to Maker Faire and the weather gets nicer around Vancouver. Its getting harder to makes these status updates as I would rather be making something or going outside and enjoying the sunshine and now Appa (A black kitty) won’t let me use my laptop without jumping up on my lap.

  • Giant Spin art box. I built this a few weeks ago and it work great but after playing around with it for a few hours the motor burned out. I guess that’s what I get for buying it from a scrap yard. Currently searching for another motor for this project. I will probably get it from an old washer and dryer or something.
  • I went as Mario to the Maker Faire per party fundraiser. I had grand plans on making a cardboard EL wire samurai suit but after 4 hours of working on the chest plate I knew I could never finish it in time. I had a flight in the morning so I couldn’t stay very long and missed the tail end of the party.

    Picture by Peter Holmes.
  • Just got back from a trip to Washington DC. While I was there I spent a few days at the Smithsonian Institution and was blown away by the size of it. I spent a good 4 hours at the National Air and Space Museum where I met and talked with the creators of the TJ3Sat project. They built a homemade satellite using a Arduino for its main processor. They have a full write up on their website about their project. Very interesting. While in Washington I also stopped by HacDC the WashingtonDC hacker space as in every hackspace I have visited lots of interesting people doing interesting things.
  • As the weather gets nicer I been doing more Wheat pasting around the city, mostly in East Vancouver. I learned a lot from my previous attempts and this time its been going a lot smother. Still a lot to learn about speed and where to put them so they don’t get destroyed by weather or shop owners.
  • RGB POV LED Globe. This project can consumed most of my free time over the last few weeks and I will do a full project update in another post. Here are some pictures.

 

Giant spin art – Maker Faire 2011 Vancouver

I wanted to create a very simple project for Maker Faire Vancouver that I could do in a weekend and something that people could take home with them as a memento.

I read about the Giant spin art box in a Make magazine Volume 25. It seemed simple enough and I could spray paint the Maker Faire logo with a stencil.

The build was pretty simple. I found a AC washing machine motor at a local junk yard that had a max speed of 1700 RPM. I created a mount for the motor to sit in so that it wouldn’t shake around too much then attached a flat board to the top of the motor with some screws. The whole process took about 3 hours.