There’s a project that I’ve been thinking about for a while (more on this in the coming weeks hopefully) which I think will be pretty interesting. I’ve finally started spending some actual time on it and it’s going to need a whack of GPIO pins and Internet connectivity. Since I found one of the famous Linksys WRT54GL routers lying around and I still have an extra Ardweeny, I figured: why not connect them and make a frankenbox? I’m documenting it here mostly so I can refer back and remember what I did.
I’ve used DD-WRT and Tomato in the past, but not OpenWRT. DD-WRT seems to be falling behind though and OpenWRT seems more easily customized. I don’t need a web UI or anything fancy for this project so I gave OpenWRT a try.
Installing OpenWRT when you’ve already loaded Tomato (I think the same would be true if you had DD-WRT) is trivial. It was a simple matter of downloading the firmware image and installing using the built-in firmware update tools. In Tomato this is through their web interface. So I went to openwrt.org and downloaded the latest firmware (Attitude Adjustment (12.09)), flashed it to the device and it booted right up. I changed the networking config to put the wireless into ‘sta’ mode and changed the encryption type to ‘psk2+tkip+ccmp’ since that’s what I needed for my network. Filling in that and the wireless SSID and key allowed me to connect to the network with little effort.
What I realized soon though is that this firmware image is pretty porky and there was a ton of crap installed by default that I didn’t need. A firewall, a web interface, PPP and a bunch of other stuff. I spent some time removing all this extra stuff but then realized that even deleting all the non-essential stuff I wasn’t going to have much room left. And more importantly I wasn’t going to have enough room left to install the other packages I’m likely to need. So I needed more space.
Searching around I found that many people have used the available GPIO on these routers and attached SD cards. For example (in no particular order):
Since I was going to be hacking a serial port into this thing anyway (to talk to the Ardweeny) it seemed adding an SD card wasn’t too bad an idea. This way I’d have more space for data storage if I need it.
I read through a few different posts (including the ones above) on how to go about this then got to work. I opened the case, soldered the leads, confirmed it still worked and then loaded the mmc-gpio driver. It didn’t work. The kernel couldn’t detect the card. So I spent some more time digging and wondered if I’d melted something inside the micro-SD adapter I was using. So I broke that open (I’ve got a few of these lying around so no big loss) and everything looked ok. Somewhat unsurprisingly these things have nothing inside that’s going to melt other than the plastic:
After soldering in another one I started looking at the software.
It seems that the “latest” version that I chose is actually a very new kernel and many people have been having problems with SD cards on newer kernels. I decided that since most of the examples I could find of people getting this working were from a while ago and I probably don’t need any of the features of the newer firmware for my use-case, I should just downgrade to a known-working version instead of working through what might or might not be broken in the latest version.
I chose to download the “Kamikaze” (8.09.2) version and used the command:
mtd -r write /tmp/openwrt-brcm-2.4-squashfs.trx linux
to update the firmware. This worked without hitches and soon I was logged back into the router reapplying the same wireless/networking config I had before.
When I went to load the driver this time, I found that the driver was not available through opkg, but I was able to use the mmc-v1.3.4-gpio2.tgz one at wiki.openwrt.org (local copy) which I found through the www.isnull.com.ar link above. That driver loaded right away and saw the SD card.
I added the /etc/init.d/mmc with the following contents:
echo 0xb8 > /proc/diag/gpiomask
mkdir -p /opt
mount /dev/mmc/disc0/part1 /opt
note: I originally had 0x9c in the /proc/diag/gpiomask as is used on many sites. When I did that I kept seeing:
show up multiple times in the process list whenever I accessed the SD card and the “Cisco button” LEDs weren’t working when accessing the SD card. It seems based on my limited understanding that this means I’m using GPIO 5 instead of GPIO 2 even though the WRT54GL is supposed to be the other way around. When I made the change to 0xb8 the hotplug-call processes went away and the LEDs worked when accessing the SD card.
I’ve setup the sd card as an alternate dest in /etc/opkg.conf and installed python and a few other packages there. Much more than would have fit on this thing otherwise. Since I’m using FAT32 on the microSD card, I need to manually create the symlinks in /usr/* but this isn’t so hard and means that if I need to I can take the card out and copy files to it from any other machine.
Anyway, now that I’ve got everything I need for now installed on the router I’m going to move on to some other parts of the project which I hope to also document eventually.
The machine that this blog was hosted on is being retired and it was time for yet another move. Instead of setting up another VM somewhere, installing nginx and git and keys and all the other stuff that I’ve done many times now, I decided to do the even more cloudy thing and move to Github Pages. This seems like a good choice as I’ve been quite happy with everything else github has to offer. Plus it’s free!
Since I was already using Jekyll, it wasn’t a huge leap, but I made a few other changes at the same time which required some additional work that I didn’t initially anticipate doing. It seems like these will help me in the log run to diagnose / avoid problems. Specifically:
- switched to markdown from textile (converted all old content)
- had to disable custom extensions and come up with alternatives
- installed the latest version of jekyll (0.11.2) locally for testing (I was on on 0.5.7 before)
Since I had to convert a lot of the posts and do previewing to ensure the formatting matched the old site after the conversion, I noticed a few things about the content here.
It’s interesting that to this point I’ve made 60 posts (including this one), 52 of which were in 2010. My record since then is pretty bad. I also noticed a few things that I said I’d follow up on but have not yet. I’m not going to make any promises that I’m going to start blogging regularly again, but I do think that while I was trying to blog about my various projects I managed to make more time for the projects too. So perhaps I should use this as a motivator for me to work on stuff. We’ll see how that goes.
If you’re seeing this post at all, you’re seeing it being served from Github. I didn’t push this post to the old server.
Wow. I had been thinking that my last post was in January and I really should make a new one soon… Then when I finally got around to looking, it was even longer ago than that. In between we had Christmas and started a whole new year. We had Valentines Day and now it’s already more than halfway through March!
My reprap is now at least partially functional. I’ve built and rebuilt many of its parts multiple times now. It seems like I’m constantly taking 2 steps forward and 1.9 steps back, but I have definitely learned a lot about what I’m doing that will help me improve things in the future.
The todo list I included at the end of my last post that I needed to do before I could print, I have actually had done for a while. In fact I’ve done and redone several of them multiple times.
The good news is that I have actually been able to print a few things. Mostly I’ve tried to print the same part repeatedly after making some tweaks. It’s supposed to be a 20mm x 20mm x 10mm solid block, but in my case the first print kinda turned out like abstract art:
I adjusted the print settings and broke the y-axis platform and fixed it and broke the x-axis platform and meanwhile printed these further iterations:
by the last one you can see that it’s actually starting to look like what you’d expect. I realized that the reason it’s rectangular and not square is that the x-axis was not working quite right. I had calibrated it, but the travel distance was not actually stable. My theory was that the problem was related to the printed pulleys I had not been accurate enough. Doing some reading around it seemed a lot of people are recommending GT2 pulleys and belts, so I decided I should get a set of those so I can see how much that helps. I’ll talk about that in another post. Sneak preview: It helped!
I’ve had a number of problems and unforeseen changes I decided to make throughout which I might write about in more detail in the future. These include:
- y-axis coming unglued
- y-axis becoming crooked
- fixing crooked y-axis the wrong way
- finally fixing crooked y-axis the right way
- y-axis belt tension problems
- z-axis crashing into the build plate causing x-axis breakage
- z-axis crashing into the top of the machine
- mounting heated bed
- warped bed #1 attempt to fix with silicone sheet
- warped bed #2 attempt to fix with more silicone sheet and different bulldog clips
- warped bed #3 attempt to fix by drilling glass
- warped bed #4 attempt to fix with screws on corners (of now-broken glass)
- warped bed #5 raising the bed to finally make things a bit better
- plastic leaking between the PTFE tube and brass barrel of the extruder
- y-axis bushings binding on steel rods
- adding diode to RAMPS for powering Arduino from PSU
- adding a fan to the extruder
- updating + configuring the firmware
- upgrading to GT2 belt / pulleys
- building a spool holder/mount for the filament
- building a platform for the machine to deal with wildly non-level desk
And all my work recently on this has been to try to get everything calibrated better so I can make nice prints. I plan to try to go back and write about some of these while also posting new progress as well. Hopefully the combination will get things here back up-to-date and keep it that way.
It’s been a long time since my last post already. It seems like I’m always making the same excuse that I’ve been busy at work, but you never run out of things that need to be done with complex software. Despite the fact that I’ve spent most of my time working, I have found some time to make forward progress on my RepRap. As you can see from the menu, I’ve also added a RepRap page for people who only want to look at RepRap posts and not the rest of my ramblings.
At this point I’ve completed the mounting of the steppers for all axes. You can see what it looked like after I completed that here:
an astute observer will see that there are 2 steppers that control the z-axis, these will be run in parallel. Then there is one stepper for each of the x and y axis. These are belt driven and move the extruder and build platform respectively.
Here’s a close-up of the stepper that drives the x-axis:
once I got all the axis put together, I moved on to the extruder + hot-end.
It is really overwhelming to look at the available information on hot-ends and extruders. There are so many variations and combinations that I really didn’t know what to do. So I ended up just basically picking some parts, reading through a few things and putting them together. Hopefully this works! The hot end is basically going to be a block of aluminum screwed onto a brass insert which itself is screwed into a PTFE (teflon) barrel. I drilled the PTFE by hand holding the drill bit in my hand and turning the part and the bit opposite directions. I was able to get much more control this way as I have no drill press nor even an accurate drill. I then drilled two holes in the sides so that it can be attached to the extruder, it looks like this:
This piece goes into the extruder which was quite a complicated bit to put together. This is what it looked like part-way through construction:
And this is what it looks like now with the PFTE barrel also attached:
I’ve manually pushed some filament into the extruder and rotated the gears and it pulled through. Hopefully it works well when powered up.
Speaking of power, the next step after getting most of the extruder put together and mounted is wiring everything up. I decided I wanted to do something special with the power switch as I had a red missile-launch style switch cover that I’d bought previously. I hooked it up like this:
with a dual-color red-green LED. When the machine is connected to the power supply but the power supply is in standby (switch is off) the LED is red. When you flip the switch the power supply turns on and the LED turns green. This seemed like it should be very simple but turned out to be one of the more complicated things I’ve done on this build so far. I did learn some things along the way though about using transistors and NOR gates, so this was worth while. And now it works.
The final bit I’ll include in this update is a bit about the endstops I’m building. I chose optical endstops because again it wasn’t clear to me yet why I’d choose one over the other and the optical ones seemed cooler. The purpose of these is to signal the controller when the build plate has travelled the maximum distance in one direction. Eventually I might want 6 of these but it seems like most people use 3, so that’s what I’m going to start with too. These came in kit form so I’ve got to solder them. Here’s one complete and one not yet started:
And that’s all the pictures I’ve got for this update.
Things that I’ve still got to do before I can get printing include:
- finishing the other 2 end-stops
- finishing wiring everything up
- finish the build platform
- mount the endstops
- mount the resistor and thermistor in the aluminum block and test that out
- calibrate the axes
- figure out how I’m going to spool the filament into the extruder
- figure out how to use the software
That sounds like a lot of work. Hopefully I’ll have time for an update again before Christmas.
2011-10-07 » Spain!
I just recently got back from Spain. It’s hard to summarize our whole epic 6-day trip in a blog post, but it was also exciting enough that I want to write something about it. I’m sure I’ve already forgotten places (just going from memory and Google searches, not bothering to look elsewhere) we went and I’m not going to spend too much time describing everything. I might update this post from time to time as I remember stuff. My wife and I went there for Pedro’s wedding. Before the wedding, we traveled through the 3 largest cities in Spain in descending order by population. We went first to Madrid.
Madrid is a pretty big place. We took the Aeropuerto Express to Atocha which went pretty smoothly and was quite a bit cheaper than a cab ride would have been. When we got to Atocha however we had a bit of trouble finding our way to the hotel. We had a couple maps, but unfortunately it turned out the Google Map was wrong. It also took us quite a while to get used to the fact that street names can change from one block to the next. Because of that, it’s not always easy to figure out how to get somewhere when you just have the name of the street you’re going to. The good thing about getting lost though is that we saw lots of interesting buildings and stuff on the way that we probably wouldn’t have seen otherwise.
After we finally got to our hotel and checked in, we went out and walked around to a bunch of places in Madrid. We went to:
We also went to some place that had a bunch of drinks and tapas type food after walking around all over the place and had a bunch of tasty stuff. This is where I first tried the acorn fed Iberian ham.
Overall Madrid felt like a big city, but in Spain, with lots of people around speaking Spanish. It was relatively clean and there’s lots of interesting stuff to see.
Barcelona was about 3 hours by train from Madrid. After we got there, we were able to take the local metro system all over Barcelona. We rode the metro most of the places (except the bus we got on which was the wrong one) we went in Barcelona and it was cheap and pretty efficient. I’d definitely recommend it.
In Barcelona we saw:
While Barcelona was nice, it felt kind of touristy to me. I think I’d go back because the Sagrada Familia was so impressive, but Barcelona was not #1 on my list.
The train to Valencia from Barcelona took about 3 hours and was pretty nice as we got to see the ocean, some small port towns and some countryside. When we got to Valencia we checked in to the hotel and then walked around to:
I really liked Valencia. It seemed to have a really nice atmosphere and I’d like to go back. Like everywhere else there’s lots of old stuff, but there is also a really big park that used to be a river that I’d like to spend more time exploring next time. Valencia seems like a really good place to go for a walk.
In Murcia we saw:
- Pedro! (and several other fellow “Joyeurs” and spouses)
- Pedro’s wedding! (It was pretty nice ceremony)
- The reception after Pedro’s wedding! (Also great, tasty food + drinks, lots of Pedro’s family)
- The Cathedral (Which I was told by Pedro’s brother-in-law is the only thing worth seeing in Murcia)
I think I’d like to go back to Murcia again despite the fact that I was told there’s not much to see. Just seeing the old buildings and stuff was pretty cool and the area around the Cathedral was pretty nice. We had a really good time at the wedding and reception and enjoyed the experience.
Thanks for inviting us Pedro!
We went back to Madrid the day after the wedding and got in late to Madrid. We walked around Atocha a bit and saw the garden but then went to our hotel near the airport. In the morning we had to get up early to go to the airport to come home. It was great being in Spain, but I also missed my kids! So it was nice to get home and see them again. Hopefully someday we’ll be able to all go to Spain together!
- I never really thought about how much of a desert Spain is. It’s really bare all the places we saw away from the coast.
- Spanish kings (and knights) used to be really small dudes.
- The national sport seems to be smoking, and people are always practicing.
- There are not really any houses anywhere near city as far as I can tell. Everything is apartments.
- Food + drinks were much cheaper than I expected.
- Portion sizes at cafe’s and restaurants were also bigger than I expected.
- Iberian ham seems to be the most popular food in Spain. (and it’s really tasty)
- Canada customs also loves Iberian ham. They stole ours after wasting our time. I bet they enjoyed it!
- Several places, beer was cheaper than water.
- Remember to carry 50 Euro-cent coins for the toilet.
- The metro system in Barcelona is a great way to get around.
- It’s hard to find WiFi in Spain, except at McDonalds. (which also sells beer!)
- If you’re used to having the Internet in your pocket, you’ll miss it when you don’t.
- Lots of cathedrals.
- Muslims and Christians repeatedly took over different parts of Spain and burned each others stuff down, replacing it with their own.
- All traffic signs, signals and markings are optional in Spain.
- If the line for X-raying your bag is taking too long, it’s ok to give up and walk around it and just get on the train.
- Entering Europe is way less painful than entering Canada. Even for Canadians.
- Don’t choose seats in row 1 or 2 on a Renfe train unless you know the people in the other. 1a and 2a face each other for example.
- Gaudi was pretty cool.
- I’m not much of a fan of Picasso’s paintings.
- A backpack is the best way to carry your stuff, if you have to carry stuff.
- It’s important to blow stuff up and shoot rockets at a Spanish wedding.
- If you’re on a train in Spain you should talk loudly and constantly on your phone.
- Everything’s made of dirt, rocks or some combination: concrete, clay tiles, bricks, etc.
- It seems like it’s pretty normal to be out late on weekdays, and pretty quiet out before ~10am.
- If you’re not a fan of shopping, being in Spain doesn’t make it much better.
We really enjoyed our trip to Spain and this trip has encouraged us to want to go back to see more of Europe as well. Especially more hams and cheeses.