Deepwire's Blog

Tag: Electronics

Resurrection.

by on Sep.18, 2012, under Electronics, Programming

It fell to the wayside a long time ago, but it never truly died.  I of course mean the robot/electronics type thing I was building based on a Netduino.  Unfortunately the XBee WiFi Module didn’t prove to be the solution to giving it WiFi connectivity back last year.  I’m sure it’s a perfectly good piece of hardware, but unfortunately I was never able to configure it correctly, even using 2 different USB adapters.  The software was temperamental, and would often lose connectivity with the XBee.

Some recent Googling of the problem again however turned up different results.  A simple search for ‘Netduino WiFi’ turned up a post on their forums from late August, indicating the WiFly might be the solution (http://forums.netduino.com/index.php?/topic/5218-netduino-wifi/)!  Luckily for me it is available as an XBee Module, and I already had the XBee Shield.

This proved to be a dream to set up and get working!  I simply plugged it in, followed some simple instructions (http://www.tinkerfailure.com/2012/02/setting-up-the-wifly-rn-xv & http://www.newspinrobotics.com/index.php/blog/getting-a-wi-fly-module-up-and-running) and was connected directly to an Ad-Hoc network it created.  From there I was able to connect it to my home WiFi network, and get all the settings correct so I could send UDP packets to my Netduino as planned.  No messing.  No hassle.  It just worked.

My problem then came when I updated the Netduino firmware to version 4.2, and the .NET Micro Framework SDK to version 4.2.  The update of both went absolutely fine.  But when it was complete I found I could no longer compile and run my simple motor driver test code.  First of all I have to make sure there was a Reference added to ‘SecretLabs.NETMF.Hardware.PWM’ (the old one) as the updated .NET Micro Framework included new PWM functionality.  This also meant adding ‘SecretLabs.NETMF.Hardware.PWM’ in place of PWM where the 4 motors are defined.  This meant it still correctly used the ‘old’ PWM functions.  But it wasn’t the full fix.

The code would compile and run, but the motors would not move.  Using debugging, I traced the main problem to an error in the motor driver code where the value for the PWM pulse period is calculated.  In my original code, I used a very large number without any trouble here.

 uint period = (uint)(1000000000D / (double)freq); 

But this now caused an exception, and stopped the program from running, so the motors would not turn.  I reduced this value from ’1000000000D’ to only ’1000D’ and found it worked.  I still had full control of the motors, including speed and direction.  So if you are using this Motor Shield Driver, and update your Netduino firmware and .NET Micro Framework, please also update this value.  You may find other values work too, but I can confirm ’1000D’ works.

Now I’ve resurrected this, and have achieved the bare minimum I originally set out for, I will continue.  I will hopefully think up other things to add to it, or things I want it to do.  I’m also going to build the hardware into something more presentable than it currently is.  Although it is never going to be a Sphero.

Leave a Comment :, more...

The Year That Stuff Happened.

by on Dec.31, 2011, under Electronics, Random, Work

Ok, so it’s the end of the year, and I still haven’t finished building my (rather simple) robot.  The current hurdle I’ve not been able to clear involves configuring the XBee Wi-Fi Module.  I have tried both the XBee Explorer Dongle and XBee Explorer USB from Sparkfun, without success.  I have tested both on multiple machines, and get the same problems.

The X-CTU software used to configure the XBee modules has trouble seeing that the XBee module is connected.  I am sometimes able to read the current settings from the XBee, or even write changes to it, but not reliably.  It may be something to do with the USB to Serial (RS232) converter that is built in to both boards.  Therefore I still haven’t been able to configure in a way that will work how I need it too.  If I can’t get it working, I may get the official XBee USB Interface Board from Digi, and try again.

Work, is of course, still work.  I go there every day, do what I need to do, and leave as soon as possible.  My plan for 2012 is to move on to better things, be that another, more fulfilling job, postgraduate education, or something else.  The thought of being stuck in the same hole this time next year is far too depressing.  I’m sure all of you will agree, writing ‘software’ using VBA in Microsoft Word and Excel is something no one should have to suffer!

To that end, I’ve been getting involved in more things outside of work, so there is actually something interesting in my life to stop work from finishing me off.  I have signed up as a mentor for Young Rewired State, after attending the 2011 Final.  I may also look at the other things Rewired State has to offer.  I have already met some cool people through there, and we’ve come up with an idea for a project to hack together.  I’m not sure I’ll be able to contribute much, as work has killed off most of the useful stuff I once knew, from Uni and before, but it’ll be fun to try.

So it’s onwards into 2012.  If 2011 was ‘The Year Stuff Happened’, hopefully 2012 for me will have an equally good tag line.  Perhaps ‘The Year I Resurrected my Career’ or ‘The Year I Rose Out of the Gutter’.  Either way, if I’m still stuck in the same place this time next year, in the same depressing dead end job, you’ll know I’ve failed.  But for now, time to polish my C.V. (if that’s possible), update my website and profiles, and order some Moo cards!

1 Comment :, , more...

Binary.

by on Nov.11, 2011, under App Development, Electronics, Programming

So I definitely don’t think I’m interested in game development.  I’ve made no progress on the idea I had for a Windows Phone 7 game since August.  I got so far, but just lost interest when it came to implementing all the mechanics that would make it a playable game.  The core idea behind it is actually more generic, and is something I still plan to use in an app in the near future, just it won’t be a game.  The plan to develop it in to a game was more to kill time before I could progress my other idea, but it just didn’t grab me.

I’ve also not made progress on the Netduino based project I started, also back in August.  There was a reason behind this, and the now abandoned game was meant to fill the wait.

My project calls for wireless connectivity, ideally to a Windows Phone 7 device.  Due to poor implementation on the part of Microsoft, I was unable to use Bluetooth (with a BlueSMiRF module I had already purchased!).  For whatever reason, Microsoft have not included the Serial Port Profile (SPP), so I could not connect the phone to the BlueSMiRF module.

My next option was to use WiFi.  But there are not many options for giving the Netduino WiFi connectivity.  Fortunately, in July I read an article on Engadget detailing a newly developed XBee Wifi Module from Digi.  Previously their modules had implemented Zigbee, a proprietary standard, which would not work with a Windows Phone 7 (or any phone for that matter).

This new XBee WiFi module, with the standard XBee form factor and pin out, was perfect!  It communicates using the UART, over the same pins as the XBee Zigbee modules.  The XBee Arduino Shield from SparkFun would work perfectly (in theory), as the Netduino UART pins are the same as on the Arduino.  All I needed to do was wait for them to go on sale, and get one.

This took a while, but I eventually tracked down the only place in the UK currently selling them, 2001 Electronic Components.  I purchased the XBee 802.11b/g/n WiFi Module with PCB Antenna, and it arrived this week.  I will now connect this to my Netduino using the XBee shield and test it.  When I can send data between the Netduino and my computer (or Windows Phone 7), I will post the results (and maybe some code). Then it’s time to finish building, and reveal more of what I’ve been working on!

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!