Wednesday, 5 August 2015

Bick Copter 1.0 - Failure to launch

So as mentioned in my previous post, in this post I will cover my first attempt to build the Raspberry Pi based Quad Copter. So in my first attempt I managed to burn my Pi on day 1. You should never connect power over pins and USB at the same time. I learned it the hard way. So after my second Pi arrived I've started by turning LEDs on and off (this his where everyone who has no knowledge in electronics should start). So I was feeling pretty good by then and I tackled the motor controller.

Using code samples form Adafruit I've managed to get my PWM/Servo Driver up and running pretty quickly and soon I was spinning my motors up and down. 
Then came accelerometer and the gyro. I've manager to get the accelerometer working but gyro data didn't make sense. I've tried reading the data sheet and using my own code to read the sensor data. I've also tried porting Adruino code to Raspberry, but somehow I couldn't get the gyro working. Now thinking back, I think it might have been something as simple as missing rad/s to deg/s conversion. 
Nonetheless I tried to get my quad flying without sensors or flight controller of any kind. Needless to say, it's a terrible idea. Shredded my first set of rotors and parked the project indefinitely.

In the next post I'll cover my current quadcopter status and perhaps will post a video or two.

Got the LEDs nice and blinking. Motors spinning. Gyro no worky. Crashed. Project - on hold

Happy Hacking!

Tuesday, 4 August 2015

BrickCopter 2.0

So I've had this idea a while ago to build a Quad Copter using Raspberry Pi. I bough all the hardware and started hacking on it. Having next to no knowledge in electronics this was quite a challenge. It was fun at first, but after facing several problems it became more than I could chew. I lost the interest in the project and retired it to basement. Now, about two years after initial effort, armed with new knowledge and fresh energy, I decided to dust off my blog, pick up the project and make the damn thing fly.
This will most likely result in a series of blog posts on fighting different problems I encounter. The whole point behind the blogs will be again, to help someone who finds himself/herself (let's face it the IT industry has changed a lot in last 5 years) having same or similar issues. There seems to be fairly little info on building custom flight controller, most people use AdruPilot or something else readily available.
So firstly I'll list of the hardware I acquired for the project (back in the day):
  • Raspberry Pi Model B Started kit from Adafruit
  • 16 Channel PWM/Servo driver from Adafruit
  • 4x Turnigy Plush 25A Speed Controller
  • 4x NTM Prop Drive Series 28-26A 1200kv
  • AltIMU-10 Gyro, Accelerometer, Compass, and Altimeter (L3GD20, LSM303DLHC, and LPS331AP Carrier) from Pololu (discontinued)
  • Q450 Glass Fiber Quadcopter Frame 450mm
  • Turnigy nano-tech A-SPEC 2200mah 4S 65~130C Lipo Pack
  • TURNIGY MEGA 400W V2 Lithium Polymer Battery Charger 
  • 30A eFuel Switching Power Supply
  • USB wifi adapter
  • Mini soldering station
  • Digital multimeter
So as you see it's a fair bit of quite expensive hardware, thats one of the reasons why I want to finish this project.

I'll be posting bits and pieces of the code and will open source the project when it's finished. Or then I give up, which ever comes first. Currently all the code is in my private GitHub repo. The code is a  mess so I don't feel like sharing it publicly, but could to so upon request.

In the next post I'll cover how far I came in my first effort and the status of the current.

Tried to build Quad Copter using Raspberry Pi. Failed. New effort. Will make the world a better place.

Happy Hacking!

Friday, 29 October 2010

Calculating magnet link using Ruby

It took me a couple of days to get this right even though it's really simple. The problem was that I didn't notice Some clients require Base32 of info_hash in magnet link specs. I'm hoping this will save at least a couple of hours for someone.

content = BEncode.load(file)
info_bencoded = content['info'].bencode
info_hash = Digest::SHA1.digest(info_bencoded)
info_hash32 = Base32.encode(info_hash)
info_hash32_escaped = URI.encode(info_hash32)
puts "magnet:?xt=urn:btih:#{info_hash32_escaped}"

This code requires bencode and base32 gems.

Tuesday, 6 January 2009

Buildix 2.1 on Ubuntu 8.10 (Interpid Ibex)

On Ubuntu 8.10 Buildix 2.1 install fails with
subprocess post-installation script returned error exit status 10
But it can be hacked to work. The following steps need to be made:

- Add buildix to you app sources just like its shown here
- Run apt-get install buildix and wait for install to fail
- Open /var/lib/dpkg/info/buildix.postinst in our favorite editor and comment out there lines
# Get the port that Mingle is using
. /usr/share/debconf/confmodule
db_get mingle/port

ed -s /etc/apache2/sites-available/buildix << END

- Change a2enmod mod_python to a2enmod python
- Download trac extract archive then copy folder contrib to /usr/share/doc/trac/ and folder cgi-bin to /usr/share/trac/
in /usr/share/doc/trac/contrib run gzip trac-pre-commit-hook
- Run aptitude install buildix again this time it should finish properly.
- Navigate your browser to http://localhost/
- Login with username:buildix password:buildix, open config
- Uncheck enabled checkbox under Mingle options, click save.

Buildix 2.1 doesn't play well with Track 0.11 so you need to modify /usr/share/buildix/lib/buildix/modules/ Find line
_execCmd("trac-admin " + trac + " initenv " + name + " sqlite:db/trac.db svn " + repo + " /usr/share/trac/templates",
"Error creating Trac Project: ")
and change it to
_execCmd("trac-admin " + trac + " initenv " + name + " sqlite:db/trac.db svn " + repo,
"Error creating Trac Project: ")

and comment out this line
_execCmd("trac-admin " + trac + " permission add anonymous CRUISECONTROL_VIEW", "Error enabling Trac-CC")

restart apache
/etc/init.d/apache2 restart

Buildix should work properly. Have fun :)

Friday, 12 December 2008

Package Load Failure Microsoft.VisualStudio.Xaml

Few days ago all of the sudden VisualSudio 2008 popped out this error message "Package Load Failure Microsoft.VisualStudio.Xaml blah blah yes/no" I didn't pay much attention to it (because it was yes/no message box and in that case i always click yes :)) After that Visual Studio didn't load 2 of 5 C# projects in my solution complaining that project type is not supported by current installation. Of course i was baffled because I din't connect error message to this problem right away. Apparently by clicking Yes I've disabled Visual Studio package (because it failed to load obviously). OK, no problem devenv /reset will fix this right? Wrong! Visual Studio tries to load Microsoft.VisualStudio.Xaml but fails for no apparent reason. I've googled up bunch of "fixes" for this problem but none of devenv switches or even Visual Studio Repair works. So this is what worked for me:

Uninstall Visual Studio
Install Visual Studio
Apply Visual Studio SP1

I hope this helps.


Tuesday, 4 November 2008

Did you hear?

Visual Studio 2010 CTP is out!!! Can't wait to check it out!

Friday, 17 October 2008

My fist Open Source Project - OfficePackage

Today I've started my first Open Source project!!! The project is called OfficePackage and it can be found here It's my project exactly, it's based on ExcelPackage. OfficePackage goal is to create a library for creating/editing OOXML (aka Office 2007) documents from .NET. At his point OfficePackage has limited implementation of creating/editing Excel 2007 documents. Anyone willing to contribute please drop me an email. Cheers!