Wednesday, 23 September 2009

GPS with a CVGI-B07 on Eeebuntu

Introduction

This is not part of my travel diaries, but it is part of my preparation of going to India. I know it is not the greenest thing to do, but I am planning on buying a light motorcycle to get about in India with, which in my opinion, having in the past rented a Yamaha RX 100 in Goa, is probably the most enjoyable way of travelling off the tourist trail.  Because I want to avoid the major roads, the chance of me getting lost is probably quite high. So having a GPS system for locating myself as either a last resort or to check that I haven't missed a vital turning, to me sounds like more fun than it is to be ashamed of. In rural India it can be very difficult to ask for directions because often the people are no better at helping me read my map than I am pronouncing a town's name. I probably mentioned in my previous post that I bought an eeepc so that I can jump at the possibility of performing data analysis during my volunteer experiences. So this post is both a record for myself how I set up the GPS, and particularly I hope it will be useful to anyone trawling the internet looking for the solutions to the same problems that I faced.

I still don't know when I am going to India, but it probably will be mid October now. I am still waiting to here if my corrections to my thesis are sufficient, but am about to take the risk of printing it off anyway and leaving it at uni for someone hand in for me.

Apparatus
  • Asus eeepc 1000HD - my netbook
  • Eeebuntu base 3.0 - my Linux operating system
  • CVGI-B07 USB GPS dongle (was the cheapest I could find - £22 incl. p&p from ebay)
  • GMapCatcher - allows you to download Google maps for offline viewing. Also incorporates a GPS marker.
  • python - runs GMapCatcher
  • gpsd - translates the gibberish from the dongle into coords for GMapCatcher
Method
  • Install python and gpsd. I already had python installed and I installed gpsd 2.38 through the Synaptic Package Manager.
  • Download GMapCather and unpack in a suitable place.
  • enter   tail -f /var/log/messages    into a terminal
  • Go outside if you are not already and make sure you have an unobstructed view of the sky.
  • Attach GPS dongle which will flash for some time while it locates satellites.
  • Then look at the text printed to the terminal when you plucgged in the device. Hopefully you have the PL2303 driver and it says sometime like mine: 
Sep 22 23:12:00 onyx kernel: [22297.432119] usb 2-1: new full speed USB device using uhci_hcd and address 17
Sep 22 23:12:00 onyx kernel: [22297.592456] usb 2-1: configuration #1 chosen from 1 choice

Sep 22 23:12:00 onyx kernel: [22297.597554] pl2303 2-1:1.0: pl2303 converter detected

Sep 22 23:12:00 onyx kernel: [22297.615352] usb 2-1: pl2303 converter now attached to ttyUSB0
  • Close tail with Ctrl C and enter   gpsd -bnN -D4 /dev/ttyUSB0   where the last part is taken from the port that was printed earlier - see above in red. Warning: Don't miss out the -b option for the CVGI-BO7 dongle - I'll explain below. Hopefully plenty of exciting gibberish will fly past your eyes and you might even catch a glimpse of some text saying that it has locked onto a Satellite.
  • To make more sense of all gibberish you might like to open xgps, which should have installed with gpsd. xgps will show you a graphical display of the number of locked in sats. Empty circles are not locked in. Red spots are week and green strong signals and yellow in the middle the Signal to Noise Ratio (SNR) is also listed for each satellite.
  • If you have a lock onto three or more satellites start maps.py in the GMapsCatcher folder, select Marker Centre from the GPS drop down menu that only appears when gpsd is correctly installed and running and zoom in and you should be taken to your current location. Oh, did I forget to tell you that you should have run GMapsCatcher before so that you can view the maps offline when you are outside?

Problems

Hopefully you'll have none, but if you do, here are the problems I encountered and how I solved or got around them.

- GPS does not lock onto Satellites.
  • Did you go outside? I never bothered but it does help particularly for first lock-in.
  • It seems to help to not plug the USB dongle directly into the computer but to the end of an extension USB cable.
  • I had the impression that installing/running roadnav or some navigation software once was needed to configure my CVGI-BO7 dongle as on a Windows, Mac and Linux computer it only would work once I had run such software. gpsd can't configure the dongle with the -b option set (I'll explain below). Roadnav only had a debian file for an older version of ubuntu but it still worked for me.
- You didn't listen and ran gpsd without the -b option? I wish I had been told myself! I thought I had bricked my dongle! When I sent the command the dongle light went out and when I next plugged it in the light would stay on and not flash or write anything to the serial port. It no longer could pass for Christmas decoration. The problem is that gpsd tries to optimise the device which obviously does not like it. Luckily there is a solution.
  • I found out that the CVGI-B07 GPS dongle uses a SiRF star III chip and that the company, SiRF, has a tool that you can download to configure their chips. You can download it from this link.  You want the demo tool, not the firmware. Install this on a Windoze PC and enter your dongle on the PC - after of course you have installed the PL2303 chip driver, which hopefully came with your dongle.
  • Open SiRFDemo and select your appropriate port. You can find the port number by clicking Start, right click on My Computer -> Properties, select the Hardware tab, Device Manager, expand Ports (COM & LPT) and you should see the port number there. You can remove the dongle and put it back in to make sure you have the right one.
  • Select the Baud Rate. 4800 worked for me and click the confirm button on that window. The main program should now load.
  • Click the little button that says "Connect to Data Source" when you hover your mouse over it. It should start doing stuff now.
  • Now select   |Action > Initialize Data Source. A window popped up for me at this point asking which software the chip was using. I chose the default one which was first in the list and which I found on this page but I can't remember which it was now - either GSW or GSC. On the next window I selected the option to reset and clicked send. After a few moments the dongle starting flashing again. Hurray! If you don't dare reseting it you probably can wait a week or a month or two until the internal rechargable battery runs down and the memory is cleared.
  • You can find some detailed instructions for using SiRFDemo here.
  • Using the -b option next time with gpsd prevents gpsd writing to the dongle. With the debug level set at -D2 occasionally psd complains, but it still does its job.
- Why do the markers in GMapCatcher look naf?
  • I had to hard code the path to the images  - eg replacing filename = os.path.join('images', 'marker_gps.png') with filename = os.path.join('/home/cjreeve/GMapCatcher/images', 'marker_gps.png') in the file mapGPS.py, mapMark.py, and mapPixbuf.py located in src in the GMapsCatcher directory. The problem was that the program otherwise looks for the folder images where ever you start the program and I use the Cairo Dock to start it and who knows which directory it looks in then...
  • The pin image that points to your markers (if you set any) looked too big for my liking so I scaled it down with some image editing software (The Gimp) but maintained the pixel size dimentions of the image.
Conclusion

That's pretty much it. I would currently recommend the CVGI-BO7 dongle, but this might change if it breaks as soon as I need it. I'll let you know. From my garden it locks onto 8 satellites (with SNRs between 25 and 43) in less than a minute after a days non use. It looks nice but is not branded and does not come with very helpful instructions. It comes with the Prolific 2303 Windows and Mac OS X drivers which work, but only has some old Redhat drivers for Linux. Ubuntu seems to ship with the driver so I had no problem - it just took me some time to realise. Let me know, anyone, if you found any of this information useful.






CVGI-B07 Manufacturer Specifications
  • Primary Function: GPS receiver USB dongle
  • Tracks up to 20 satellites.
  • Receiver: L1, C/A code
  • Max update rate: 1 HZ
  • Acquisition time
    • Reacquisition: 0.1 sec average
      Hot start: 1 sec.
      Warm start: 38 sec.
      Cold start: 42 sec.
  • Position Accuracy
      Non DGPS (Differential GPS)
        Position: 5-25 meter CEP without SA
        Velocity: 0.1 meters/second, without SA
        Time: 1 microsecond synchronized GPS time
      DGPS (Differential GPS)
        Position: 1 to 5 meters
        Velocity: 0.05 meters/second
      EGNOS/WAAS/Beacon
        Position
          < 2.2 meters, horizontal 95% of time
          < 5 meters vertical 95% of time
  • Dynamic Conditions:
      Altitude: 18,000 meters (60,000 feet ) max
      Velocity 515 meters (700 knots) / second max
      Acceleration: 4 G, max
      Jerk: 20 meters/second, max
  • Antenna Type: Built in Patch Antenna
  • Minimum signal tracked: -159dBm
  • Dimensions: 74 x 25 x 14 mm
  • Operating temperature: -40 to +80
  • Storage temperature: -45 to +100
  • Operating humidity: 5% to 95% No condensing.
  • Power consumption: < 80mA at 4.5- 5.5V input
  • Protocol and interface
      NMEA output protocol: V.2.2
        Baud rate: 4800 bps
        Data bit: 8
        Parity: N
        Stop bit: 1
      Interface: USB port
  • Color: Blue
  • Manufacturer Ref: ZMZP1KZL0U

Product Notes

  • **This model is compatible with most brands of GPS software - however hardware specific software such as Garmin may not run on this unit. the manufacturer provides the GPS-enabled hardware only, not the software. No warranty or customer support regarding GPS software. Any software installation you undertake should be performed or supervised by a professional.

Package Contents

  • Model CVGI-B07 GPS Receiver USB Adapter
  • CD (English user guide; drivers for Mac, Linux, and Windows operating systems; GPS testing software)
  • USB cable
  • Display/storage box

Friday, 17 July 2009

My new blog: The Adventures of Superdoc

Hi, I have started this blog in anticipation of my travels to see how I might keep people posted - if they so wish. I must admit, despite the name of my blog, I am not a doctor yet, as I have not yet submitted the final copy of my thesis or attended graduation. I have, however, passed my viva so I hope that soon - sometime probably in January - I shall be worthy of the title Superdoc. 

By January I expect I'll be too far away to attend my graduation. I am not sure exactly where, but my current best plan is to head back to the fascinating land of India. My main goals while I am away are to volunteer and be of some use to someone and to learn more about what fascinating things there are to learn about - other than physics. Some of the things that currently interest me are all aspects of sustainable living that is sensitive to the environment and to animals. Because I don't want to entirely lose all of my analysis skills I am hoping at some point in my travels to help out with the analysis of a conservation project or something. For this purpose, and because I expect I shall be in a few places more than I will be travelling, I'll be bringing a nice wee eee pc with mee running eeebuntu

A good place to start my travels I thought would be Auroville, which is an experimental community of about 2000 people and growing, trying to do just that: live sustainably. There are some aspects of it that sound strange to me as an outsider, but there seems there is so much I can learn. The plan is to volunteer in the mornings planting trees as part of a reforestation project and then explore Auroville and hopefully I'll be able to get involved in some research project there. One of my long running interests are in alternative energy and efficiency, which is probably the sort of area I'll end up looking for a job. Thus I'll be particularly interest in the energy solutions they have and are implementing.


I'll paste more details below of the conservation project, the replanting of Sadhana Forest, in case anyone is interested in joining me. Also, if anyone can recommend any volunteer jobs that are affordable on a shoe string - I would be most grateful.


Chris.



--------------------------------------------------------------------------

Sadhana Forest


Our main project is the reforestation of 70 acres of severely eroded land.  We are working to re-create the Tropical Dry Evergreen Forest indigenous to our area.  This forest type is found only in Southern India and Sri Lanka and provides a rare biological richness due to its very high species abundance (over 1000 species of trees, shrubbery, and liana).  The Tropical Dry Evergreen Forest is now close to total extinction as only 0.01% survives. This is a last moment effort to keep this very rich and beautiful Forest on earth.

 

As part of our reforestation effort we are also working on water conservation and soil management.

 

Below is a brief overview of our activities since we started Sadhana Forest in December 2003.  This overview covers the almost five years from December 19th 2003 (the day we moved into Sadhana Forest which was then totally barren land) to December 9th 2008:

 

Indigenous Tree Planting:

 

We planted more than 20,500 Tropical Dry Evergreen Forest plants of 150 different indigenous species, and are constantly mulching and caring for them. 

 

Survival rate in average is between 80% - 90%.  Survival rate does not fall below 70% even on the most degraded soil

 

Water table recharge and conservation:

 

More than 7 kilometers of trenches have been dug and eight earth dams have been built, altogether storing more than 50,000 cubic meters of rain water. 

 

As a result of this work underground water level has risen by 6 meters from an average of 26 feet deep during 2003 (before Sadhana Forest was started) to an average of 6 feet during 2007 after four years of intensive water conservation work.

 

Outreach and Education:

 

A very warm friendship has developed between us and the villagers around. We work together to regenerate and protect our area. The project is very frequently visited by local people, especially kids. Every visitor is welcome and gets an explanation of the project and its value to the environment.

 

More than 1,600 volunteers, interns, and students from India and around the world have lived and worked in Sadhana Forest for periods of 2 weeks to 24 months. Accommodation in Sadhana Forest is always free.

 

Hundreds of children from the surrounding villages and from Auroville have planted TDEF trees. 

 

Over 50 kids are regularly caring for the trees they planted on a weekly or bi-weekly basis.

 

Twenty Ecological Living workshops were given as part of the Auroville Winter Integral Studies Program. Totally more than 600 people attended these workshops:

http://www.auroville.info/WISP/17_aviram.htm

 

The second Van Utsav (Indian Forest Festival) was hosted in March 2006, with attendance of over 100 people from all over India:

 http://www.auroville.org/journals&media/avtoday/April_2006/sadhana_forest.htm During the festival lots of relevant update environmental information and skills were exchanged between the participants.

 

A group of students from Plymouth State University, New Hampshire stayed in Sadhana Forest with their professor in January 2008 and their experiences are described at:

http://www.plymouth.edu/magazine/2008/spring/sustainability.html

 

More than 4 thousand people have visited Sadhana Forest for a few hours and received a basic introduction to our work.

 

In June 2008, we started the Eco-Film Club. Every Friday we host 20-80 guests for a free environment film screen, tour of the project, and free vegan dinner.

 

 

Sustainable Infrastructure:

 

Sustainable infrastructure was installed that can host local and international volunteers.

 

All structures are built from local natural materials.  A solar system, dry composting toilets, and a grey water system have been installed. Water infrastructure has been built that enables to water trees on 30% of the land.

 

Our experience with volunteers has been very positive. Volunteers from all over the world create here a dynamic community atmosphere. Living and sharing in a communal atmosphere brings us in harmony with nature and ourselves. One of our volunteers put it very nicely in her letter to us when she left, "May there be many forests to grow people".

 

We are happy to welcome volunteers here any time of the year and always have plenty of space for them. We are fully committed to accept everyone that wishes to volunteer here and help recreate the forest. You do not need to let us know the date of your arrival unless you wish to do so. Please simply plan your trip so that you arrive to Sadhana Forest on any day Monday to Friday before noon.

 

Accommodation for volunteers is in exchange for a 20 hour work week, 4 hours a day, 5 days a week.

 

Other free facilities for volunteers include a small swimming pool, free 24/7 unlimited access to the internet with your own laptop, a small collection of books, daily yoga class, the use of several bicycles, and a playground for children.

 

Volunteers mainly plant, mulch and water trees, work in our little vegan-organic vegetable garden, maintain the community area, and spend time with the community kids.

 

We appreciate creativity and initiative and welcome any ideas you may have to improve our project and our community.

 

We practice an eco-friendly way of life including veganism, alternative construction, solar energy, biodegradable toiletries, and compost toilets.

 

Sadhana Forest is a nonprofit ecological project that does not generate any income.  Therefore we unfortunately cannot afford to provide free food for volunteers.  We have communal vegan 100% organic meals. We all equally share the cost of the food ingredients we purchase.  The total cost of food per person (including 3 meals a day) is 150 Indian Rupees per day (about $3 US).  In the future, when we grow our own food, we hope to pay less. Everyone takes turns organizing and cooking the meals and washing the dishes.  Depending on the number of people here at a given time, each meal has one or more cooks, plus help from whomever is around. 

 

Upon completion of 3 months of volunteering you will not have to contribute any more for your food.

 

Sadhana Forest is a 100% vegan environment, so we ask volunteers not to bring or eat any non-vegan food in the forest.  A vegan is a person who avoids the use of any animal products for nourishment or for any other purpose.  Vegans do not eat meat, fish, eggs, dairy (milk) products, honey, or any other animal products. Our primary motivation to be vegans is to reduce animal suffering.

 

We expect volunteers not to use drugs and alcohol during their entire stay at Sadhana Forest, whether inside or outside of Sadhana Forest. 

 

There is a cigarette smoking corner just outside the forest's main entrance.

 

Please bring the following with you (for your convenience we are mentioning the local prices of the items in the nearby town of Pondicherry, so you can decide whether to buy them at home or locally):

 

1. A mosquito net (preferably rectangular shape and not round). Local price in Pondicherry is 150 Rupees (Approx. 3 US Dollars).

 

2. A torch (flashlight) preferably with rechargeable batteries.  Local price in Pondicherry is 50 Rupees (approx. 1 Dollar) and extra for batteries.

 

3. Ecological biodegradable toiletries: soap, laundry detergent, toothpaste, and shampoo. Local price in Pondicherry is 120 Rupees (Approx. 3 US Dollar) for a sufficient supply of all toiletries for two weeks. We buy ecological biodegradable toiletries in bulk for 80 Rupees, and you can get them from us at the same price of 80 Rupees (Approx. 2 US Dollars) instead of 120.

 

The minimum stay is 2 weeks, though many volunteers stay for a few months or more. From January 1st to March 1st the minimum stay will be 4 weeks.

 

We are also very interested in longer term volunteers/interns staying with us for a period of three months or longer.

 

We are part of the international community of Auroville, 6 km north of Pondicherry, in Tamil Nadu, South East India.

 

Auroville offers a wealth of courses, classes, workshops and treatments in many areas of interest, including yoga, meditation, tai-chi, shiatsu, watsu (water shiatsu), free dance and many other kinds of alternative healing therapies.

 

For more information on Auroville please visit http://www.auroville.org

 

Our volunteers have found that the most convenient visa arrangement for visiting India is a "Tourist Visa". In the "object/purpose of journey" our volunteers suggested to fill in: "Tourism".

 

The cheapest and easiest way to reach Sadhana Forest from Pondicherry is to get a bus from Pondicherry to Tindivanam or to Sedarapet, and get off at a village named Morattandi (about 4 km drive from Pondicherry). Please phone us from Morattandi to pick you up. You can also take an autorickshaw from Pondicherry to Morattandi (maximum price 120 Rupees). 

 

The nearest international airport is Chennai. If this is your first time in India and you are arriving directly from Chennai airport to Sadhana Forest it may be easier for you to take a taxi to Sadhana Forest. Taxi reservations may be made online with Auroville Transport Service at: http://www.aurovilletransport.com/airport.htm or with Unity Transport Service by email at uts[et]auroville.org.in (cost approx 1500 Rupees), or you could organize it at the airport and the cost will be approx 2000 Rupees. The main disadvantage of finding your own taxi at the airport is that the driver is unlikely to know the way here. In this case phone us on the way and we will direct you here.

 

Please plan your schedule so that you reach Sadhana Forest any day Monday to Friday before 12 o'clock noon.

 

Our telephone numbers are 2677682 or 2677683 or 2902655 or 6532461.  If you phone us from anywhere else in India (with the exception of Pondicherry) you need to dial 0413 before the number.

 

If you have any other questions please feel free to write to us at aviram[et]auroville.org.in or phone us at the numbers listed above.

 

Please circulate this information to anyone else you feel may be interested in interning or volunteering at Sadhana Forest.  It would be especially helpful for us if you would forward this email to any individuals that would be potential long term interns/volunteers.

 

Sadhana Forest, Auroville, Tamil Nadu, India