Gps issues

November 2, 2014 by · Leave a Comment
Filed under: Communications, Development, Linux 

Been working for a few days with three different GPS modules (different builds etc) and I’m getting the same problem with all of them. They are pretty much giving out complete garbage at all settings. At 9600 bps 8n1 it gives out patterns at least. Just unreadable. I thought it might be ubx protocol but probably not.

I feel like I’m doing something really stupid but I can’t figure it out. Serial port problem? What else could be wrong?

Saleae16 Logic16 100M 16 Channel Logic Analyzer

June 7, 2014 by · Leave a Comment
Filed under: Development, Hardware, Linux, Robots, Ubuntu 

I got a clone of the Saleae16 Logic16 100M 16 Channel Logic Analyzer a few days ago to test some of the arduino stuff I’ve been working on for the last few months.

I was at first really annoyed because the software simply refused to work, I tried it on 4 different computers, ubuntu 13.10 64bit, Windows 7 32bit and 64 bit and same error for all of them, logic too slow for speed, try reducing blah something. My searches came up with very little info.

So in the end I found the sigrok package and compiled myself (old version in Ubuntu lacked saleae support) and was pleasantly surprised! It works and actually seemed to be an OK package! There are a few things to do before that which wasn’t obvious, you need to extract firmware from the Saleae software suite and so on for example. Also there are a few bugs in the graphical interface that I found so far. I’ll try to get them reported ASAP and possibly do some work on them. I’ll get back to this topic a bit later as it wasn’t completely obvious how to get it running at all points, for now however, it works;).

Raspberry Pi + 2x Arduino Nano V3.0

March 19, 2014 by · Leave a Comment
Filed under: Development, General, Hardware, Linux, Robots 

Quick update, during my evenings I’ve been working with one of the Raspberry Pi’s I won on a local contest a few months ago, and it’s generally derailed into some kind of “let’s put as much stuff on it as possible”, meaning that I currently got my Raspberry Pi hooked up with:

  • Slice of Pi
  • Adafruit PWM driver
  • Raspicam on a simple pitch/yaw servo gimbal that me and my 1,5 year old put together in 10 minutes. Controlled via PWM.
  • MPU9150 sparkfun breakout board
  • 2 Arduino Nano V3.0

The two Arduino Nanos have split functionality, where one will provide me with data that needs to be gathered frequently, and the other is used for slow processes such as reading out 1-wire temp sensors etc.

The first nano will have the following functions hooked up to it:

  • 3x HC-SR04 ultrasound distance sensors
  • Voltage measurement 0-20V circuit
  • Control of 2 relays
  • 3x line tracking sensors
  • Reed switch
  • 2x motor controls via L298P chip

The second nano has the following hooked up to it:

  • MPX2200GP pressure sensor (will use something else soon’ish)
  • 2x 1-wire DS18B20 temperature sensors.
  • Others?

The general idea was to move timing critical stuff off the raspberry to the Nano and let the first one deal with quick sensor readouts, while the second Nano is dropped off with relatively slow sensors (DS18B20 takes very long time to read out for example). The two nanos will talk to the Raspberry via SPI I think, or possibly serial ports, but this is less likely as it would either require me to use one USB serial driver and the raspberry UART or get a 2 port USB hub of some kind and talk via USB UART’s.

arduino-hookup

I’ve meanwhile also played around with Eagle CAD for the first time in my life, making some electrical drawings of the hookups. I’m considering making a PCB layout of everything when I get there, not sure if there is any interest in this out there except for “the lols”. The image is still very raw and missing a lot of stuff that I know needs to be added at some point.

During christmas I spent some time making opencv haar cascade training on clementine detection and generally fooling around with it. I think I’m leaning towards making a robot (chassi on the way) which will travel around in the room looking for objects… I guess some of the sensors are a little overboard for this, but it’s all fun and games while it’s not work… 😉

Small project (continuous rotation servo)

March 19, 2014 by · Leave a Comment
Filed under: Development, Robots 

For a very long time I’ve been a little bit obsessed with continuously rotating servos and searched quite a bit for them online, but never finding any cheap servos available.

Probably just me being a lousy google user, but anyways, I started looking up some mods the other day and today I finally spent 2 hours to modify some old crappy servos to see how it works and… to my suprise, it actually works, even though I used lousy 5% 1/8W resistors (recommended 0.1%) and having my 1,5 year old kid sitting in my lap while doing most of the modifications.

As always when it comes to adafruit, I highly recommend their tutorial http://learn.adafruit.com/modifying-servos-for-continuous-rotation/overview.

1 hour Raspberry pi camera controller

February 14, 2014 by · Leave a Comment
Filed under: Development, Linux, Robots 

image

Kids really chew into your spare time. I got some time the other day to have some fun with a Raspberry pi, raspicam, Adafruit pwm servo driver, 2 servos, double sided tape, tape and cardboard. In 60 minutes I managed to make the “thing” in the video. OK, some stuff was pre-assembled :-).

Also, I’ve just finished setting the construction up running on Battery power. 2x zippy compact 3300mah 4s (14,4v nominal LiPo) in parallel via a 5v 5A bec powering both the servos and the Raspberry hardware. Running everything including servos for 4 hours , my measurement is that I’ve used less than 10% of the battery capacity.

The servos are currently controlled using up, down, left and right keys and the application is just a modified example from Adafruit. However, it should be very easy to integrate with either the mpu 9150 breakout unit I’ve also installed and make a simple gimbal of sorts.

But first I’m planning to test integrating the code with the opencv haar object recognition stuff I did during the Christmas holidays, for example track clementines.

Raspicam and OpenCV instructions

December 21, 2013 by · Leave a Comment
Filed under: Development, Hardware, Linux, Robots 

I have previously gotten the opencv and python bindings to work via the 2.3 opencv system and facial recognition did work, but the system is bugged out and I could only get 64x64px image size.

I followed these instructions to get the raspicam to work with opencv and simplecv

http://tothinkornottothink.com/post/59305587476/raspberry-pi-simplecv-opencv-raspicam-csi-camera

However, there where some minor details wrong with it so here is a short list of the updates to the installation instructions on that page.

I noticed a few problems as I saw it with the above instructions, or possibly I didn’t read the instructions well enough. That said, very good info! Thank you!

Here are the issues I had:

The opencv_2.4.5.sh script pulls in libopencv-dev which in turn pulls in the entire libopencv2.3 from raspbian repositories, which in turn meant that simplecv was still using libopencv2.3.

apt-get remove libopencv-core2.3

Once that is removed, python-opencv is also removed and simplecv will not even run anymore. Adding the following will add the path to where the python cv bindings are.

export PYTHONPATH=/usr/local/lib/python2.7/site-packages/

And finally, the LD_PRELOAD to actually use the correct uv4l libraries.

export LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so

Once this is done, you should no longer get the munmap errors etc, and large resolution should work:

SimpleCV:1> cam = Camera(0, {“width”:640, “height”:480})

SimpleCV:2> cam.live()

etc.

Mirabox dist-upgrade causes system to deadlock/hang on bootup

May 22, 2013 by · 2 Comments
Filed under: Development, General, Linux 

I think there’s something bad going on between GlobalScales patches in the rootfs images they have for download for the mirabox when doing an apt-get dist-upgrade to the latest version of debian. This causes a complete lockup during boot of the device (network seems to work, but ssh and services are not started in time, and the console is completely locked up). There is pretty much nothing that works in this state, and I’ve found no way to skip ahead and get a login prompt.

I tried booting to Single user mode, but this is not possible because GlobalScale make pretty much everything start in rcS.d. I’m stuck in the same position as in a normal boot as described above, nothing possible to do.

Finally I resorted to using init=/bin/bash and managed to locate the issue down to the S07mountall.sh and/or the S08mountall-bootclean.sh. It seems S07mountall.sh will mount everything from fstab, which also seems to mount “something” on /dev, causing all dev entries to go missing, and hence several different things will just not boot. rm -rf’ing the S07mountall.sh and S08mountall-bootclean.sh script seems to have fixed the issue for me. However,  I’ve severely remade the whole rc.d structure since I think it’s a really bad idea to start so much services in rcS.d as it will block single user mode and kind of against the design philosophy of the init system. This rework may have made the situation better or worse, I’m not completely sure.

If anyone is willing to go more in depth I’d be happy to go into the details with them on what I found.

As for the Mirabox, I think it’s a good device so far, but this is my second GlobalScale device (had a Guruplug Server Plus for almost 2 years as my home server). There are a few things that nags at me so far though:

The file system is having the same issues as the Guruplug Server Plus, strange scripts running at strange times in the bootup procedure (for example, all the stuff that’s gone into the rcS.d directory), the rc.local script calling the /root/init_setup.sh script which in turn is loading a bunch of binary blob drivers and so on and so forth. The device as it is looks really well engineered, but the software is really butchered because of these strange setups. Putting in some good time to create a good integration with Debian (since that’s what they are using anyways) would help insanely much. Also, documenting the reflashing processes and so forth could also be very much helpful.

Reflashing GlobalScale Mirabox filesystem

May 22, 2013 by · 2 Comments
Filed under: Development, Hardware, Linux 

I just worked my way through reflashing the mirabox and figured I’d post some instructions on how to do it. I’ve used the descriptions from this http://www.newit.co.uk/forum/index.php?topic=3880.0 post but found it to be lacking a few steps that could be construed as obvious… perhaps. Especially the use of ubifs is quite new to me, even though the commands are quite straight forward I got snagged up a bit in understanding how it works.

I’ve used the following rescue disk image:

https://docs.google.com/file/d/0B0imSF-34b8dZEc0SFo3N1Fzb0E/edit

And this rootfs image:

http://code.google.com/p/mirabox/downloads/list

Download and install the rescue disk on a microSD card:

  1. fdisk the microSD, create on FAT16 partition of 100mb size, the rest of the device as EXT3.
  2. Unpack the rescue disk
  3. Copy the mirabox file to the FAT16 partition
  4. Extract the rootfs.tgz file to the EXT3 partition.
  5. sync and umount the microSD card
  6. Connect a USB flash device to the computer
  7. Extract the rootfs image downloaded above
  8. Copy the rootfs to the USB flash device.
  9. Disconnect USB device.
  10. Connect micro-sd with mirabox kernel and rootfs to mirabox
  11. Plug in the mirabox to a computer via USB.
  12. Start the mirabox
  13. Hit a key at uboot
  14. >> set bootcmd ‘usb start; fatload usb 1 0x6400000 mirabox; bootm 0x6400000’
  15. >> set bootargs ‘console=ttyS0,115200 root=/dev/sdb2 rootwait’
  16. >> boot
  17. login as root password nosoup4u
  18. connect USB disk with rootfs on it to mirabox
  19. # cd /media/usbX where the rootfs img is located
  20. # ubiformat /dev/mtd2 –flash-image=rootfs-debian6.0-gti-mirabox-v5-0-1-120924.img
  21. # sync
  22. # reboot
  23. disconnect USB disk and remove devices.
  24. login to your hopefully working new filesystem using root/nosoup4u credentials.

 

FMEA of Door and conclusions

October 13, 2011 by · Leave a Comment
Filed under: Development, General, Management 
If Cavemen had done an FMEA of the door when it was invented, this would possibly be the outcome.
Item Potential Failure mode Potential Effects of failure Severity Rating Potential Causes Occurence rating
Open door Person behind door gets door in face  – Broken neck
– Death
– Bleeding nose
5-6  – Two persons trying to pass the same door
– Door placed to open into corridor
– -“- onto esplanade
– Badly placed painting on back of door
4
Open door Hidden vicious monster on other side  – Death
– Loss of limb
– Loss of head
10  – Door opens into wilderness
– Glass not yet invented, so other side of door can not be inspected
4
Close door Limbs get stuck between door and doorway  – Loss of limb
– Broken fingers/toes
– broken nails
– Bloodshed
7  – Person is angry and slams door shut
– Annoying salesman sticks foot into door
– Forgot person behind you
5
Run through door Other side opens into chasm
Other side opens up on multistory building
Other side opens up into ocean
 – Falling off high cliff
– Death
– Drowning
– Bludgeoning
– Cuts and bruises
10  – Earth activity causes earthquake and resulting chasm on other side of door
– Balcony fell down
– Global warming caused ocean to rise
– Person was in a rush, running through the door, falling off.
2

Conclusion

If the cavemen would have been engineers, they would never have invented the door, or at least not used it.

Finding the Zone.

February 10, 2011 by · 1 Comment
Filed under: Development, General, Personal 

Several years ago at one of my first jobs, right smack at the end of the dot-com boom over here, we had a dartboard. What good is a dartboard you ask? I don’t know, we also had a pinball machine, but I never quite liked it as much as the dartboard. I’d take short breaks from answering phone calls and e-mail or problematic pieces of text to throw a few darts. Personally, it gave me one thing however, I learnt to shut out everything else and find my Zone, you know the one where you’re at your most efficient, solving problems, kicking off e-mail and answering calls in a furious flurry.

For me, I focus on the bulls-eye of the dartboard, relax all muscles in my head, letting my scalp feel like a smashed egg running down from the skull. It feels like my head gets lighter and all pressure on my brain dissipates. Nothing else exists but bulls-eye. Ears are shut off, and all focus is on bulls-eye, nothing else distracts my eyes. At this point I’m there, and ready to hit bulls-eye. It’s simple, it’s fast, and it works. Under extreme pressure and stress, it sometimes takes closing my eyes to get the process started, but almost always I reach the “Zone” within a minute or so.

After the few darts, I’d get my headphones on and listen to music, work my hardest to shut everything else out and maintain the Zone for as long as possible. Reaching it takes concentration and loosing the concentration is always easily lost. Getting back on your train of thought on a complex problem after loosing it is hard work, often taking 15-30 minutes. I absolutely hate having that elusive thread of clarity vanish into thin air due to someone breaking Zone or loosing the almost ready to implement solution to a particularly bothersome problem.

My wife knitted me a pair of special fingerless gloves, ending just before the first knuckle on my ringfinger. I use them while coding or otherwise writing at the computer, to keep my hands warm, just to be able to maintain the Zone for that bit longer, not having to bother about getting cold hands. Cozy, to say the least, but people look funny at me for using them so it’s not often I use them at work. Also, I like to wall myself in as I’m easily distracted by movements and foreign objects. Open office space is complete devastation on these trips into the Zone, where people talk, walk around, gesticulate, strange things happening on other peoples screens, and so forth. I barely ever manage to stay in the Zone for more than 45 minutes or so. On that note, open office planning must have been among the most stupid things ever invented, short term savings at huge cost in productivity.

So, that is how I reach my Zone. Do you have a Zone, and how do you reach it? How do you maintain it from collapsing?

« Previous PageNext Page »