Through the years I have helped my friends and family sort out their Macs whenever problems arose. Honestly it hasn't been often. I always tell people, if you get a Mac I'll help you with whatever problems you encounter but if you buy a windows machine you're on your own. A tribute to how easy they are to get to do what you want that I'm rarely forced to make good on the promise ;) Recently I've been helping my sister rebuild a corrupted iPhoto library and try to figure out whats wrong with all that. Doing it via "type this, click that and read me message" sort of phone support would have been impossible and caused probably a family schism due to yelling, screen sharing is the best option. But she's in another state.
In an ancient world so old as to be mostly myth and legend there was "timbuktu" which I used a lot in those heady days alas it is no longer around.
In the only slightly less distant past there was "share my desktop" a great little VNC server that you could run as a regular app, double click and it was on and I could connect and help quit the app and it was off and no danger of leaving a service running in the background on their machines open to the internet.
Eventually Apple added VNC support directly to the system. But this doesn't really solve the problem because I'd have had to walk her through configuring her router to pass through the ports for it and setup NAT to the proper mac which would have a dynamic address so it would eventually stop working and so I've have to setup either a DHCP reservation or a static IP for that machine and then run a dyndns or no-ip.com client so as to be able to find her IP or teach her how to read it off the router config page or something. Far too much work.
iChat still supports screen sharing, but only through AIM accounts, not through iMessage accounts. Which seems a terrible step backwards. I still can't quite believe there isn't a way to make this work, but I couldn't figure it out.
But now we have Back To My Mac, which isn't really all that hyped by Apple. It provides an IPv6 tunnel into our machines that we can access via our iCloud ID's. But it's not really setup to connect to other peoples machines at all, only to your own. Having had so much trouble with calendars and such and iCloud in the beginning the very last thing I was going to do was sign my computer out of my own iCloud account and into hers, I am a little shaky even thinking about what that would do to our photo streams and iTunes ID's and email and calendaring... yikes.
Luckily, you can just create another user temporarily to play with! I walked her through turning on and sining into iCloud on her machine. Then in the sharing panel you have to turn on both screen sharing AND file sharing even if you're not going to share files because that is the finder interface to screen sharing. (yes, you can probably use the command line to get the IPv6 dns name of the machine and use that directly into the VNC connection dialog, but you try walking a non-computer oriented family member through the command line commands to do this, no thank you ;)
I then created a temporary user on my own mac, signed into iCloud with her ID and there, right in my sidebar was her shared drive. Click it and "share screen" was available right there in the finder and I was able to sort it out.
Not exactly seamless for helping your family and friends as they still need to share more of their passwords with you than you should need to, but no software installs necessary, no external sites, no configuring the router for NAT over the phone. All in all back to my mac is a win, they need more features but it's really an awesome hidden selling point for your Mac. If you're not using it you should be!
DIY projects of woodworking, home automation, electronics and software development for the Macintosh.
Tuesday, April 9, 2013
Wednesday, March 20, 2013
Arduino Thermostat part 1
We took a very close lightning hit here a month ago. I didn't lose anything plugged into the wall, I have good surge protection on each electric panel, but I lost several things connected to long serial cables including my very fancy RS485 serial thermostat from HAI. I've replaced the other components and added surge protection to their long serial lines to prevent future problems from induced current but I've decided to roll my own thermostat.
I've been supporting communicating thermostats in XTension for some years now. There are 4 models that I've implemented the protocols to and there are more lined up should they ever choose to document what those protocols are. (and if you have one, or have a favorite you think should be supported please let me know) so it's not like I have a lack of good thermostats laying around here that I could install. But I'm drawn to dangerous DIY like this.
I've decided that it should not do very much in the thermostat at all. Since it's going to be connected to XTension through an xBee radio link I really have no need of schedules or setbacks or anything, I can do that all in the logic of the computer. Since I've basically disabled that functionality of every thermostat I've ever installed and just run it from the computer anyway it seems like a lot of added complexity in them that I never use. I've been using those xBee radios for some time in lots of projects around the house and they are just awesome. XTension lets you control their pins, or read their analog inputs or use their remote serial ports for just about anything.
This device I"m making wont be a one size fits all for everyone, but then anybody considering doing this should have some info on what they are doing since getting this wrong could potentially ruin your house in the form of frozen pipes or destroy thousands of dollars worth of compressors in your AC or worse. So I'm not going to sell a kit or anything, but it's been interesting me for some time.
Here's the power board completed. It has the connections for the thermostat wiring, 3 solid state relays and the half wave bridge rectifier and smoothing capacitor to make the DC prior to feeding it into the arduino power supply. Since the furnace here is simple, only single stage only 3 are necessary. The fan relay, call for heat and call for cooling.
I debated how to switch the lines to the furnace. I could have used cheap relays, but they use not insignificant power that can cause heating inside the case and false readings (but you can get around this like more commercial thermostats do by putting the relays at the top of the case and the sensor at the bottom and using the heat to create a chimney effect of room air past the sensor making it read actually better) but it can also cause problems with voltage fluctuations causing false readings from analog temp sensors and other things. (this wont be a problem since I've decided to go with a digital temp sensor) Plus you can hear them click and that is just so last decade... The problem is that you're switching AC power, so just a single mosfet isn't going to work. You can use 2 wired in opposite directions to do it or an SCR or any number of other ways, but these SSR's are not expensive (I think I paid around $5 each for them from allelectronics.com) and I had them around. Additionally they provide complete isolation between the logic and the current being switched.
The capacitor is overkill by 3 or 4 times, but it's what I had around and it mostly fit on the board there. There are 2 diodes on the board wired in series. I used what I had, those are fancy fast acting low voltage drop schottky diodes which are totally overkill for this power supply too, but I had a bunch of them left over from switching LED power supply experiments. They are rated for an amp of power which is good, but only for 20 volts, so 2 in series are necessary to safely rectify the 24v from the furnace. I used a simple half wave bridge here because the output from a full wave bridge would have been more DC voltage than the switching regulator I've ordered for the arduino side is rated for on input.
Apart from just following good coding practices when I start writing the code, and making it as simple as possible I will be implementing a ping and response system between this and XTension so I can tell if it goes away or gets hung up. I've done a lot of smaller projects with Arduinos and I know they can run for extended periods without problems. Even so, this being a one off project I need a way to reset the thing automatically if it goes down. My first thought was to use one of the many unused pins on the xBee connected through a transistor to the arduinos reset pin. Then I can reset it from the XTension computer if I lose the ping. Though I am beginning to think a local circuit with some timer or capacitor that needs to be regularly restarted by a pulse from the arduino and will cause a reset if it doesn't get that pulse might be good too. A kind of local watchdog timer too. We shall see what happens.
Shortly I'll be connecting this board to the power from the furnace and measuring the output and making sure that all works even though there is no control logic yet.
Today I'll be putting together the arduino and hopefully the fancy temp/humidity sensor I ordered will arrive and I can begin that side of the project.
I've been supporting communicating thermostats in XTension for some years now. There are 4 models that I've implemented the protocols to and there are more lined up should they ever choose to document what those protocols are. (and if you have one, or have a favorite you think should be supported please let me know) so it's not like I have a lack of good thermostats laying around here that I could install. But I'm drawn to dangerous DIY like this.
I've decided that it should not do very much in the thermostat at all. Since it's going to be connected to XTension through an xBee radio link I really have no need of schedules or setbacks or anything, I can do that all in the logic of the computer. Since I've basically disabled that functionality of every thermostat I've ever installed and just run it from the computer anyway it seems like a lot of added complexity in them that I never use. I've been using those xBee radios for some time in lots of projects around the house and they are just awesome. XTension lets you control their pins, or read their analog inputs or use their remote serial ports for just about anything.
This device I"m making wont be a one size fits all for everyone, but then anybody considering doing this should have some info on what they are doing since getting this wrong could potentially ruin your house in the form of frozen pipes or destroy thousands of dollars worth of compressors in your AC or worse. So I'm not going to sell a kit or anything, but it's been interesting me for some time.
Here's the power board completed. It has the connections for the thermostat wiring, 3 solid state relays and the half wave bridge rectifier and smoothing capacitor to make the DC prior to feeding it into the arduino power supply. Since the furnace here is simple, only single stage only 3 are necessary. The fan relay, call for heat and call for cooling.
I debated how to switch the lines to the furnace. I could have used cheap relays, but they use not insignificant power that can cause heating inside the case and false readings (but you can get around this like more commercial thermostats do by putting the relays at the top of the case and the sensor at the bottom and using the heat to create a chimney effect of room air past the sensor making it read actually better) but it can also cause problems with voltage fluctuations causing false readings from analog temp sensors and other things. (this wont be a problem since I've decided to go with a digital temp sensor) Plus you can hear them click and that is just so last decade... The problem is that you're switching AC power, so just a single mosfet isn't going to work. You can use 2 wired in opposite directions to do it or an SCR or any number of other ways, but these SSR's are not expensive (I think I paid around $5 each for them from allelectronics.com) and I had them around. Additionally they provide complete isolation between the logic and the current being switched.
The capacitor is overkill by 3 or 4 times, but it's what I had around and it mostly fit on the board there. There are 2 diodes on the board wired in series. I used what I had, those are fancy fast acting low voltage drop schottky diodes which are totally overkill for this power supply too, but I had a bunch of them left over from switching LED power supply experiments. They are rated for an amp of power which is good, but only for 20 volts, so 2 in series are necessary to safely rectify the 24v from the furnace. I used a simple half wave bridge here because the output from a full wave bridge would have been more DC voltage than the switching regulator I've ordered for the arduino side is rated for on input.
Apart from just following good coding practices when I start writing the code, and making it as simple as possible I will be implementing a ping and response system between this and XTension so I can tell if it goes away or gets hung up. I've done a lot of smaller projects with Arduinos and I know they can run for extended periods without problems. Even so, this being a one off project I need a way to reset the thing automatically if it goes down. My first thought was to use one of the many unused pins on the xBee connected through a transistor to the arduinos reset pin. Then I can reset it from the XTension computer if I lose the ping. Though I am beginning to think a local circuit with some timer or capacitor that needs to be regularly restarted by a pulse from the arduino and will cause a reset if it doesn't get that pulse might be good too. A kind of local watchdog timer too. We shall see what happens.
Shortly I'll be connecting this board to the power from the furnace and measuring the output and making sure that all works even though there is no control logic yet.
Today I'll be putting together the arduino and hopefully the fancy temp/humidity sensor I ordered will arrive and I can begin that side of the project.
Sunday, February 10, 2013
WD My Passport 2TB drive
I purchased a very reasonably priced Western Digital My Passport 2TB drive the other day. I thought I'd be terribly clever and extract the drive and implant it into my laptop. WD outsmarted me though and have the USB3 interface on the drives interface card. It's not just an SATA drive with an adaptor. So back into it's case it went and I just relocated portions of my iTunes library to it rather than increasing my laptops size.
The case came apart easily enough though. Yielded without incident or any tab breakage to my selection of spudgers. It snapped back together just like new after sharing it's interface secrets.
Even though I wasn't able to get it into my laptop I am still happy with this. The fact that there is no extra card in there for the interface means that the case is as tiny as possible. The speed of the disk is also impressive for an external, even compared to the other USB3 drive I've got which is a seagate free agent goflex. Which I also like since the sata interface is a separate dongle and you can pop it onto any sata desktop drive. (though there are no provisions for external power so you can't connect it to a full sized drive.)
Tuesday, December 25, 2012
Drawers
I have too much stuff in my office. Or, perhaps my office is too small and serves too many functions. The solution to either seems to be better storage and drawers are just an excellent use of space. I built my large wrap around desk/table almost 10 years ago but it relies on shelves above it for storage and I was tired of boxes of unorganized stuff under it. It was time to build some drawers. Then there was the impending trip to Chicago for a week to pack up my father for a long distance move which provided the perfect excuse to ignore upcoming responsibilities and embark on a large wood working project.
I did look for pre-made or pre-fab solutions, but they were all either very expensive or very awful. The way the supports for my desk work means that the drawer either has to be shallow to avoid some middle supports or it has to be short to avoid the same. So my drawers would have to have a lower part that was deep and then an upper part to sit on top of that which was shallower to clear the supports. It would consist of 2 cases, a large one with 3' wide by 2' deep drawers that would come up to within 6" or so of the desk surface where it would have otherwise hit the middle supports under the desk. And then a smaller cabinet that is the same width, but only 14" deep to clear that same support.
Given the impending time crunch I originally started out thinking I would half-ass it quickly. This led me to build the cabinets from half in plywood, which was OK, but also led me to decide to skip any fancy jointery on the corners which I regretted later. Since the top of the cabinets will never be visible I opted for butt joints with the sides coming up flush to the top since they would be visible. The plywood edge of the sides would never be visible on the top or bottom so it wouldn't matter. Except that now after I made something nice I will always know it's there.
The smaller cabinet would have 2 smaller drawers. This is just sanded plywood after a coat of mahogany gel stain. I decided to do a fancy face for it with some Lyptus wood that I had bought a long time ago and have been just letting slowly warp in the garage. A little plaining brought it back to spec
for this. I was really surprised how beautiful the lyptus was with a coat of nothing more than linseed oil!
Something I forgot was that you can't build a drawer that is almost the same height as your case. You have to be able to tip the drawer in in order to get the wheels of the drawer slide in. So if you're using that type of drawer slide you need to make them short enough to get in. I fixed this in the larger case drawers by building shorter drawers but there are also more expensive drawer slides that dont require you to do this, but I was using what I already had. These drawers are now in permanently and cannot be removed...
If I had known the Lyptus was that pretty I'd probably have used it for something before now ;) It matches the stained cabinet very well. The rest of the face frame was fairly straight forward and I attached it to the cabinet with biscuits.
I pre-stained everything before putting it on since the cabinets were getting a totally different finish than the face frame. Lyptus is a hard wood, but works very nice. It sands up and finishes beautifully but the grain will raise like crazy if you get it wet. Since I had pre-finished it I just cleaned up any glue squeeze out with dry towels since I wasn't concerned about the glue keeping the oil from soaking in.
The larger cabinet was more work, but again I didn't do any fancy jointery on the corners. I did route some dados into the sides to hold supports between each drawer front and back which make it very steady and strong. Originally I had wanted to do a full piece in each spot, but that would have required a 3rd sheet of plywood and it would have weighed a ton. It's heavy enough the way it is so I just ran 4 inch strips front and back to attach the face frame to and for strength.
The horizontal ones I just clamped with blue painters tape and it worked very well. I've already put the drawer fronts on the smaller cabinet here. I left a generous quarter inch difference in the left/right/top/bottom dimensions for those to make it easier to align. I probably could have done it with less of a gap if I had started out being more careful for the size of the cabinets.
And mounted the drawers! Some adjustment and they all worked fine with enough clearance to get them in and out. Again half inch sanded plywood boxes with a quarter inch luan plywood bottom. Nothing fancy and no fancy jointery here either. I did screw the joints though and use an 1/8th roundover bit on the top of them all the way around.
Here just test fitting the pieces for the drawer fronts to get the size exactly right before giving them a coat of linseed oil. I almost wished it didn't need any hardware at all it's so pretty. Mounting the drawer faces I also didn't do anything fancy. I drilled holes into the front of the drawers that were much larger than the screw I would use to attach the drawer front. And then drilled a smaller hole into the same place on the back of the drawer front taking into account the extra 8th of an inch overhang on each side. A little thinking here and I got it almost exactly right. The larger hole in the drawer and a washer on the screw made adjusting them if not easy, at least possible.
If I ever make another one I would do a couple of things differently. Some rabbit joints on the cabinets would make it stronger and just make me happier. They wouldn't have added but an hour to the overall project time either. I somehow did the face frame different on the top small cabinet vs the bottom. On the top one I did the horizontal pieces coming all the way across and the bottom one it's the verticals that run straight through. They should both be done the same way. I really wanted to get every inch of space out of the thing so I designed it without any kind of foot or bottom. I should have given up 2" and put some feet on it just to raise the bottom drawer up out of the carpet. None of these things detracts from how happy I am with it but live and learn for the next project!
I did look for pre-made or pre-fab solutions, but they were all either very expensive or very awful. The way the supports for my desk work means that the drawer either has to be shallow to avoid some middle supports or it has to be short to avoid the same. So my drawers would have to have a lower part that was deep and then an upper part to sit on top of that which was shallower to clear the supports. It would consist of 2 cases, a large one with 3' wide by 2' deep drawers that would come up to within 6" or so of the desk surface where it would have otherwise hit the middle supports under the desk. And then a smaller cabinet that is the same width, but only 14" deep to clear that same support.
Given the impending time crunch I originally started out thinking I would half-ass it quickly. This led me to build the cabinets from half in plywood, which was OK, but also led me to decide to skip any fancy jointery on the corners which I regretted later. Since the top of the cabinets will never be visible I opted for butt joints with the sides coming up flush to the top since they would be visible. The plywood edge of the sides would never be visible on the top or bottom so it wouldn't matter. Except that now after I made something nice I will always know it's there.
The smaller cabinet would have 2 smaller drawers. This is just sanded plywood after a coat of mahogany gel stain. I decided to do a fancy face for it with some Lyptus wood that I had bought a long time ago and have been just letting slowly warp in the garage. A little plaining brought it back to spec
for this. I was really surprised how beautiful the lyptus was with a coat of nothing more than linseed oil!
Something I forgot was that you can't build a drawer that is almost the same height as your case. You have to be able to tip the drawer in in order to get the wheels of the drawer slide in. So if you're using that type of drawer slide you need to make them short enough to get in. I fixed this in the larger case drawers by building shorter drawers but there are also more expensive drawer slides that dont require you to do this, but I was using what I already had. These drawers are now in permanently and cannot be removed...
I pre-stained everything before putting it on since the cabinets were getting a totally different finish than the face frame. Lyptus is a hard wood, but works very nice. It sands up and finishes beautifully but the grain will raise like crazy if you get it wet. Since I had pre-finished it I just cleaned up any glue squeeze out with dry towels since I wasn't concerned about the glue keeping the oil from soaking in.
The larger cabinet was more work, but again I didn't do any fancy jointery on the corners. I did route some dados into the sides to hold supports between each drawer front and back which make it very steady and strong. Originally I had wanted to do a full piece in each spot, but that would have required a 3rd sheet of plywood and it would have weighed a ton. It's heavy enough the way it is so I just ran 4 inch strips front and back to attach the face frame to and for strength.
here's the left side of the face frame being clamped into position. The biscuits did a good job of keeping it from being pulled out of alignment but I probably still should have put every other clamp on the outside of the cabinet rather than all pulling from the same side. Though it worked fine the potential was there to glue it on crooked. You can see the biscuits for the horizontal pieces there already cut into the crossmembers.
And mounted the drawers! Some adjustment and they all worked fine with enough clearance to get them in and out. Again half inch sanded plywood boxes with a quarter inch luan plywood bottom. Nothing fancy and no fancy jointery here either. I did screw the joints though and use an 1/8th roundover bit on the top of them all the way around.
Here just test fitting the pieces for the drawer fronts to get the size exactly right before giving them a coat of linseed oil. I almost wished it didn't need any hardware at all it's so pretty. Mounting the drawer faces I also didn't do anything fancy. I drilled holes into the front of the drawers that were much larger than the screw I would use to attach the drawer front. And then drilled a smaller hole into the same place on the back of the drawer front taking into account the extra 8th of an inch overhang on each side. A little thinking here and I got it almost exactly right. The larger hole in the drawer and a washer on the screw made adjusting them if not easy, at least possible.
And then finally as finished. Haven't put the backs on in this picture yet, but I absolutely love how it turned out. A weeks projects working just a couple of hours a day and now I have it sitting next to me in the office making me happy and allowing me to have a little actual surface space to work on again! Every so often a woodworking project is necessary to keep the brain alive no matter how much other work is being expected of you ;)
If I ever make another one I would do a couple of things differently. Some rabbit joints on the cabinets would make it stronger and just make me happier. They wouldn't have added but an hour to the overall project time either. I somehow did the face frame different on the top small cabinet vs the bottom. On the top one I did the horizontal pieces coming all the way across and the bottom one it's the verticals that run straight through. They should both be done the same way. I really wanted to get every inch of space out of the thing so I designed it without any kind of foot or bottom. I should have given up 2" and put some feet on it just to raise the bottom drawer up out of the carpet. None of these things detracts from how happy I am with it but live and learn for the next project!
Monday, November 5, 2012
batch moving iCal events from one calendar to another with AppleScript
What with all the iOS devices and the cloud and all I thought I would finally sort out the mess which is our iCal calendars around here and put them all on the cloud so that everyone could have read/write access and everything would be shiny and new and wonderful. That took a little more work than it should have, iCal is currently my least favorite of all Apple's software. Searching on the internet though I see I'm not the only one who has had these problems so I document my solution for anyone who might benefit from it.
I had the calendars hosed on just a webDav directory on my own server but this did not allow read/write access for all family members subscribed. I wanted to move them to my iCloud account and then resubscribe everyone (well, technically my wife is the only other member of everyone ;) my first thought was to just export them through iCal to my disk as .ics files and then re-import them into new calendars created on iCloud.
This did not work. I got the following modal error message which had to be dismissed for EVERY SINGLE event in the file before I could get back to normal.
Access to "some event" in "the new calendar name" in account "name of my account" is not permitted. The server responded: "403" to operation CalDAVWriteEntityQueuableOperation.
This is not particularly helpful and the buttons are not really very apple like or helpful either. After signing out and back in again and recreating my iCloud account I was able to get ONE calendar to import without errors, and then they returned. Thats an old event, so I thought perhaps it was just complaining that events too far in the past weren't allowed to be imported. So I created manually a small ICS file to test with that only had future events in it, but that failed too.
I resorted to applescript. The dictionary has both a duplicate and a move command one or the other should be able to copy or move the events in the calendars I wanted to change. I can change the events from one to the other one at a time by just changing the "calendar" in the popup for the event. That worked fine, so it was allowing me to add things to the calendar, it just didn't like importing it. Or, as it turned out the duplicate or move command. Both of those tries resulted in the same error and total failure. Finally I resorted to the make new event command which requires a bit more work because I had to create the record of all the old properties one bit at a time. And since it will happily return "no value" or "undefined" for properties that aren't set for that event, but it will not accept those as properties for a new event you have to check to make sure each property exists before adding it to the new record. I did not attempt to preserver attendees or other event properties not in the list below so I dont know how to do that. But with this script you can move all the events from one calendar to another without errors from iCal even where an import fails. I suspect it may have something to do with including the unique ID in the export file. Possibly you cannot specify the UID of a new event, or possibly it really means unique, and not just unique within each individual calendar and that is what is causing the error. I left the UID out of the script below but I did not test with trying to include it.
It is not fast, it takes some time for each event to be created, so be patient.
Or you can download the script as a script editor file: icalmover.zip
Let me know if thats of any help to anyone, thanks.
I had the calendars hosed on just a webDav directory on my own server but this did not allow read/write access for all family members subscribed. I wanted to move them to my iCloud account and then resubscribe everyone (well, technically my wife is the only other member of everyone ;) my first thought was to just export them through iCal to my disk as .ics files and then re-import them into new calendars created on iCloud.
This did not work. I got the following modal error message which had to be dismissed for EVERY SINGLE event in the file before I could get back to normal.
Access to "some event" in "the new calendar name" in account "name of my account" is not permitted. The server responded: "403" to operation CalDAVWriteEntityQueuableOperation.
This is not particularly helpful and the buttons are not really very apple like or helpful either. After signing out and back in again and recreating my iCloud account I was able to get ONE calendar to import without errors, and then they returned. Thats an old event, so I thought perhaps it was just complaining that events too far in the past weren't allowed to be imported. So I created manually a small ICS file to test with that only had future events in it, but that failed too.
I resorted to applescript. The dictionary has both a duplicate and a move command one or the other should be able to copy or move the events in the calendars I wanted to change. I can change the events from one to the other one at a time by just changing the "calendar" in the popup for the event. That worked fine, so it was allowing me to add things to the calendar, it just didn't like importing it. Or, as it turned out the duplicate or move command. Both of those tries resulted in the same error and total failure. Finally I resorted to the make new event command which requires a bit more work because I had to create the record of all the old properties one bit at a time. And since it will happily return "no value" or "undefined" for properties that aren't set for that event, but it will not accept those as properties for a new event you have to check to make sure each property exists before adding it to the new record. I did not attempt to preserver attendees or other event properties not in the list below so I dont know how to do that. But with this script you can move all the events from one calendar to another without errors from iCal even where an import fails. I suspect it may have something to do with including the unique ID in the export file. Possibly you cannot specify the UID of a new event, or possibly it really means unique, and not just unique within each individual calendar and that is what is causing the error. I left the UID out of the script below but I did not test with trying to include it.
It is not fast, it takes some time for each event to be created, so be patient.
tell application "Calendar"
--Script to move events from one iCal calendar to another
--James Sentman james@sentman.com 11/4/2012
--
-- I found myself unable to import ical calendars that I had exported from another
-- server. I would get an error from the iCal server for each and every event.
-- I have no idea why, it may be just duplicate UID's or something.
-- The "duplicate" command and the "move" command both of which I tried
-- failed with the same error, but I was able to create a new one with the
-- info gotten from the old calendar. But that wasn't so easy either as not
-- all events have all information and it would not except "no value" answers
-- so I had to add the if exists portion to build the record for the new event.
-- I did not attempt to move things like attendees or other elements of the event
-- just the data you see below.
--
-- INSTRUCTIONS: change the name of these next 2 variables. MyOldCal is
-- the calendar you want to move events FROM and MyNewCal is the name of the
-- calendar that they will be newly created in.
set MyOldCal to calendar "SCDS"
set MyNewCal to calendar "SCDS iCloud"
-- find out how many events we have to create
-- for some reason I would get an error when it reached "count"
-- which generally means that while the count tells you how many records
-- referencing them by index begins at 0 instead of 1, so start at 0
-- and subtract one.
set EventCount to (count of events in MyOldCal) - 1
repeat with i from 0 to EventCount
--get a reference to the old event in the old calendar
set WorkEvent to event i of MyOldCal
--since the work record with the info is appended instead
--of created fresh each time in one step it is necessary to clear
--it out each time through the loop.
set WorkRecord to {}
--checking if the various properties exist or not
--stops an error later if one property was undefined
--it will happily return no value for one of them without
--an error, but it will not then accept that in the make
--statement below. So we only add them to the record
--if they are actually there.
if exists description of WorkEvent then
set TheDescription to description of WorkEvent
set WorkRecord to WorkRecord & {description:TheDescription}
end if
if exists start date of WorkEvent then
set TheStartDate to start date of WorkEvent
set WorkRecord to WorkRecord & {start date:TheStartDate}
end if
if exists end date of WorkEvent then
set TheEndDate to end date of WorkEvent
set WorkRecord to WorkRecord & {end date:TheEndDate}
end if
if exists allday event of WorkEvent then
set TheAllDay to allday event of WorkEvent
set WorkRecord to WorkRecord & {allday event:TheAllDay}
end if
if exists recurrence of WorkEvent then
set TheRecurrence to recurrence of WorkEvent
set WorkRecord to WorkRecord & {recurrence:TheRecurrence}
end if
if exists sequence of WorkEvent then
set TheSequence to sequence of WorkEvent
set WorkRecord to WorkRecord & {sequence:TheSequence}
end if
if exists stamp date of WorkEvent then
set TheStampDate to stamp date of WorkEvent
set WorkRecord to WorkRecord & {stamp date:TheStampDate}
end if
if exists excluded dates of WorkEvent then
set TheExcludedDates to excluded dates of WorkEvent
set WorkRecord to WorkRecord & {excluded dates:TheExcludedDates}
end if
if exists status of WorkEvent then
set TheStatus to status of WorkEvent
set WorkRecord to WorkRecord & {status:TheStatus}
end if
if exists summary of WorkEvent then
set TheSummary to summary of WorkEvent
set WorkRecord to WorkRecord & {summary:TheSummary}
end if
if exists location of WorkEvent then
set TheLocation to location of WorkEvent
set WorkRecord to WorkRecord & {location:TheLocation}
end if
--you can try copying the UID also
--but it occurred to me that this may be the whole problem
--as a UID should be unique, and it would not be so
--if you had tried to create an event and specifying it at the time
--so I commented this out and iCal will happily make a new UID for the
--new event as it should.
--if exists uid of WorkEvent then
-- set TheUID to uid of WorkEvent
-- copy {uid:TheUID} to the end of WorkRecord
--end if
if exists url of WorkEvent then
set TheURL to url of WorkEvent
set WorkRecord to WorkRecord & {url:TheURL}
end if
--and lastly actually make the new event with the old data.
make new event at MyNewCal with properties WorkRecord
end repeat
return EventCount & " events moved"
end tell
Let me know if thats of any help to anyone, thanks.
Sunday, September 23, 2012
Makerbot Acceleration Settings
The other day Makerbot announced the Replicator 2, obsoleting my wonderful replicator model. My initial buyers remorse at no longer owning the most current model quickly faded as I realized that it had a better case but was not much different otherwise. They do advertise getting a .1mm slice resolution with it though and others have posted getting that with the original replicator. I'd never tried going that fine but I think I have a better understanding of some of the internal settings now that I have sorted it out.
I've been rather frustrated with it lately, my prints have had too many gaps and globs and been quite messy. It turns out this was a function of the "acceleration" in the 5.5 firmware update. Acceleration doesn't mean actually going faster, it means that over the course of a fraction of a second the steppers were accelerated up to or down to the new speed rather than slamming from 0 to full speed and back again in a single step. The problem is that the extruder steppers are controlled this way too. Here's an example printed of the "MakerBolt" thing that comes with the new slicing software as an example. I sliced it in replicatorG rather than the new "makerware" as I couldn't get that to work properly yet. The settings for slicing were the non-accelerated speed with 0 shells and 100% infill. The one on the left was printed with the onboard preferences of acceleration turned on and set to their shipping defaults.
I've been rather frustrated with it lately, my prints have had too many gaps and globs and been quite messy. It turns out this was a function of the "acceleration" in the 5.5 firmware update. Acceleration doesn't mean actually going faster, it means that over the course of a fraction of a second the steppers were accelerated up to or down to the new speed rather than slamming from 0 to full speed and back again in a single step. The problem is that the extruder steppers are controlled this way too. Here's an example printed of the "MakerBolt" thing that comes with the new slicing software as an example. I sliced it in replicatorG rather than the new "makerware" as I couldn't get that to work properly yet. The settings for slicing were the non-accelerated speed with 0 shells and 100% infill. The one on the left was printed with the onboard preferences of acceleration turned on and set to their shipping defaults.
You can clearly see the print quality is lousy. Lots of drop outs. The one on the right was printed with the onboard acceleration turned totally off and it's a ting of beauty. The quality of my prints really did take a hit with the 5.5 firmware update that added acceleration! The 2 bolts above were printed from the exact same GCode, the only change was turning off the onboard acceleration in the replicator.
The problem is that you cannot print fast without the acceleration turned on, the steppers can't change speed that quickly and will skip steps and ruin the prints. I have read elsewhere that changing all the acceleration settings to 1000 mm/s/s in the left hand column fixed others problems, it did not fix this for me. It was better but still had dropouts. The defaults have 3000 mm/s/s as the acceleration for the "a" and "b" channels which I believe are the 2 extruders, this was much higher than the default acceleration for the movement steppers. It makes sense for the extruders to stop later and start faster than the movement ones to get the plastic flowing, but these numbers caused gaps at startup and blobs at stop (or possibly vice verse it's hard to tell) the numbers I finally settled on were this:
1000 mm/s/s for the axis steppers and 1250 mm/s/s for the extruder motors. This resulted in a print that was 95% as good when printed at the default slow speed as the completely unaccelerated model, and probably 85% as good when printed at full "accelerated" speed. The accuracy of the print at high speed isn't as good, but there were no dropouts or globs of plastic left behind. The bolt doesn't move as freely at high speed as low, so for technical pieces I'll be printing with the slicer speed turned down, but for less critically sized pieces I can now print accelerated with acceleration on and get very nice prints, even at .1mm resolution. Have a look again at that right hand bolt in the picture above, it's a thing of beauty!
(watch out for semantic confusion between the onboard Acceleration which just controls how quickly the steppers come up to the new speed and the slicing accelerated defaults which control how quickly they move overall as they print the model. It's quite possible to have one turned on but not the other)
Monday, September 3, 2012
crank powered airplane to crank powered flashlight
Ben has been throughly enjoying his "Kid Galaxy Dyna Flyer Air Streak" airplane. It runs an amazingly long time on just a few moments of cranking up the launcher thing.
Unfortunately being made of foam it's lifetime was limited and we finally busted the little wires that run through the middle of the prop. Rather than just toss it we had to take it apart to scavange for reusable parts. I knew it had to be a super capacitor in there and indeed it was. 2.7 volt 7 farad. The motor we salavaged for some future project, but the charger and capacitor we kept together and added a multi-chip warm white power LED that I got off ebay a long time ago. I was using these for outdoor lighting long time ago but they didn't really last in that application, or I was overpowering them, so I had a bunch in the toolbox. There is a tiny board in there that shuts off the motor till it leaves the launcher, but we didn't use that, just soldered directly to the capacitor. The voltage is close enough that I didn't bother with a resistor or anything.
The charger is really quite powerful, about 7 seconds of cranking will run the LED at decent flashlight level for about a minute and a half with many more minutes at diminishing candle and then "find me" levels.
And of course you can shoot it across the room too as it's still on the sled that used to launch the airplane.
I haven't played with any of this new generation of super capacitors before, but they are certainly going to be useful! You couldn't use a battery in this kind of thing, it wouldn't work at all. I see now that there are a bunch of different versions of this toy, they aren't expensive and it was definitely fun. I'm not sure how we managed not to lose it into a pond or up on a roof or tree while we had it, and when it does inevitably crash and burn like all toy airplanes must, you can salvage the really cool super cap out of the inside!
Unfortunately being made of foam it's lifetime was limited and we finally busted the little wires that run through the middle of the prop. Rather than just toss it we had to take it apart to scavange for reusable parts. I knew it had to be a super capacitor in there and indeed it was. 2.7 volt 7 farad. The motor we salavaged for some future project, but the charger and capacitor we kept together and added a multi-chip warm white power LED that I got off ebay a long time ago. I was using these for outdoor lighting long time ago but they didn't really last in that application, or I was overpowering them, so I had a bunch in the toolbox. There is a tiny board in there that shuts off the motor till it leaves the launcher, but we didn't use that, just soldered directly to the capacitor. The voltage is close enough that I didn't bother with a resistor or anything.
The charger is really quite powerful, about 7 seconds of cranking will run the LED at decent flashlight level for about a minute and a half with many more minutes at diminishing candle and then "find me" levels.
And of course you can shoot it across the room too as it's still on the sled that used to launch the airplane.
I haven't played with any of this new generation of super capacitors before, but they are certainly going to be useful! You couldn't use a battery in this kind of thing, it wouldn't work at all. I see now that there are a bunch of different versions of this toy, they aren't expensive and it was definitely fun. I'm not sure how we managed not to lose it into a pond or up on a roof or tree while we had it, and when it does inevitably crash and burn like all toy airplanes must, you can salvage the really cool super cap out of the inside!
Subscribe to:
Posts (Atom)