meshprog failure on Fedora 13/14

While using meshprog on recent distributions of Fedora (13 or 14), I found two issues:

1. One issue is related to gpsd daemon trying to grab the device based on USB-UART converter (e.g. FT232 or cp210x). This is discussed in my earlier post at

Meshprog – USB device opening failure on Fedora 11/12

2. Second issue is related to blocking read used in meshprog code. I found that by making the USB device read non-blocking, it starts to work fine. I am not sure if this is the right way to do it. Here are the specific details:

Go near line 115 in meshprog.c file and change the line to open USB device in non-blocking mode:
// f = open(devicename,O_RDWR);
f = open(devicename,O_RDWR|O_NONBLOCK);

After recompilation, it seems to work fine. I have informed the author of the code.

Updated step-by-step wheat grass growing and juicing

This post is based on nearly 2 months of experience and some of the information here is updated, compared to my earlier two posts on the topic:

Let me try to put rest of the information in the form of FAQ!

  1. How much time it takes to grow what grass for juicing? – It takes about 6-7 days to grow to about 6 inches, when it should be harvested for juicing. This depends on climatic conditions and so on.
  2. How to organize this so that I can get juice every day? – What is important is to have this juice fresh. Ideally it should be consumed within 20 minutes of juicing.  So what is best,  is to have seven containers in which to grow this. It should be sowed every day in a different one so that after six to seven days, you start to get fresh grass every day. Once you harvest from one container, you can reuse that and continue doing that. It is also possible to reuse the same plant once or twice more.
  3. What should be the size of container? – I am now using rectangular plastic tray as shown here. Each tray can produce enough to serve 2-3 persons  every day. I have purchased 12 of these so that I have a few spares to handle other needs (e.g covering tray during germination phase, letting soil air for 3-4 days to prepare soil for reuse etc.). I have also purchased two bigger trays to store soil in them. Smaller tray cost me Rs 40 each and bigger Rs 80 each. To organize them, I bought a 4 -self steel rack in Rs 700.
  4. What should be the depth of the soil in the pot? – One to two inch depth is enough. So one could have more shallow pot. My plastic tray are about 2 inch in height.
  5. Should tray have holes at bottom? – I did not have holes in the tray at first. As it was rainy season, I found some time water had accumulated and was difficult to drain it off and affected the plants  I have now been drilling hole to take care of this. With holes in the tray, I put paper at the bottom of the tray before putting soil. This way only water would drain out and not let soil fall through holes and make the place dirtier.
  6. What soil to add ? – One can add good gardening soil. First time I went to local nursery and asked them to fill it in the pots and had some extra too. While buying the larger pots, I got it filled with the persons selling the pot itself. Soil should not be soggy and should not stick together. One can spread it to dry faster before using it. One should add compost fertilizer before sowing. It has been suggested to not use any chemical fertilizers or pesticides etc. However I have found it very useful to add an organic fertilizer  – “bio-field”. I got it in local nursery. See this in my earlier blog here.
  7. Which wheat to use? – I bought it from local grocery shop. They did not have any choice, so used whatever they had. If there is choice, one can use bigger grains.
  8. What quantity of seeds should be used? – I use about 9-10 table spoons for the one tray. But you can adjust as per your experience, this is just initial guess. Amount should be enough to cover the soil fully with seeds without overlapping as shown below:
  9. What preparation to do before sowing? – Wash and soak wheat for about 12 hours or overnight. Then tie it in thick damp cloth for another 8-10 hours. In Indian warm weather, you should see wheat sprouting by this time. Once it has sprouted a little, it is ready to be sowed.
  10. How to sow? – Prepare soil by adding 50% compost to soil first time and mix it nicely. I like to thinly spread  6-7 tablespoon of “bio-field” on top of the soil.  Now I spread the wheat in single layer touching each other so that it is as dense as possible without overlapping(see the picture above). It is suggested to spread a very thin layer of soil on the top of this but I leave it  exposed and have found better result. Now spray very small amount of water to just make it damp. I use a water spray to make this uniform. More water can be bad here. Cover the pot with damp newspaper sheets so that damp environment is maintained inside. If it  is too hot, cover with a plastic sheet or some other thing to keep the seeds in damp environment. Respray twice in a day or so to keep it damp based on climate. Once you see little sprouts coming out, you can start to expose it to fresh air. Direct strong sunlight for long time may not be good for plants in early stage.
  11. When it is ready to be harvested ? – Keep spraying water every morning and evening and plants should keep growing. Once it has reached a height of 6 inch or so, it is ready to be harvested. See the growth day by day here:
  12. How to harvest? – I use a pair of scissors with long enough blade to cut the wheat grass about half inch to an inch above soil . I bought a sturdy  all metal scissors with stainless steel blades. One with iron blades gets rusted and may not be good. I got one with brass handle and stainless steel in Rs 325. Cheap ones with plastic handle do not last long.
  13. How to Juice? – Wash the grass properly and juice it in spice grinder by adding little water. It would become like a paste in this and now one can strain it through a thin cloth to get juice out of the pulp. It is suggested to use a low RPM machine to do this to keep temperature low during this. Higher temperature destroys  some beneficial enzymes.  One could use other means of extracting juice as well. I could not find a low RPM machine in India, but they are available abroad though expensive. I am using normal spice grinder for the time being. However I ordered a hand juicer from eBay (India) for something that looks like this. It was not sturdy enough for this purpose and handle broke. I am still looking for one in India. (one below that is on Amazon.com) :
  14. How to drink? – It is best taken in morning on empty stomach. It is suggested to not gulp it down at once but consume it slowly as if you are eating it.
  15. What to do after harvesting? – One can reuse the plant couple of times more after which it starts to get little harder. I am still experimenting with this but found it essential to add “bio-field” to reuse the plant second time. More than 3 times may not give you much juice.
  16. Can I freeze grass? – One can keep it upto 2-3 days in freeze but Juice should be consumed within 20-30 minutes of making it.
  17. What to do if I see Moud formation? – Some time you may see a bluish-white formation like shown in the picture below. This happens in humid condition and specially if seeds remain ungerminated due to poor soil condition. It is a good idea to air the seeds for some time in the early stage when weather is very humid. One can harvest the wheatgrass above mold and use it.

There is lot of material on the web and you can go through it. I am a learner and not an expert! I am sharing this since many want to try it too and may find information useful.

Update on growing Wheat Grass and Juicing

(Please read more recent version first at https://ranjan.in?p=74)

Since I posted last on this topic, I have gained more knowledge and it is about time to write on this again. I would itemize them to make it easier to read:

  • Reusing Soil – I found that when I used soil first time, wheat grew nicely. But I started to see failed growth when I tried to reuse the soil. It was most likely due to my zero knowledge about gardening. Finally I could figure it out with the help of friends and nursery. After harvesting first time, one needs to add some nutrients to the soil since with limited soil in pot (or tray), it needs to be supplemented. In my local nursery they gave a product called “BioField”, which is produced in Baroda. I was asked to add about 7-8 table spoons to soil every 7 days. So now after harvesting I sprinkle few spoons of BioField+compost and plant regrows healthy and fast. After harvesting three times, I remove the plant and let the soil air for 3-4 days to allow it to gain capacity through nitrogen fixation. Here is the image of the packet of 1 Kg of BioField, which costs Rs 60. They seem to have larger package of 50 Kg only, which is little too large to handle. Would have been nice to have 5 Kg packets as well. I am not sure how wide is their distribution channel but you may be able to find something similar in your local nursery:
  • Organizing pots(or trays) – In the early stage, I purchased round pots and then bigger rectangular pots. However slowly I started filling up balcony space and in no time I started to hear complains! Then I bought plastic trays (I got 10 of them at Rs 40 each). I also purchased a steel rack with 4 shelves to organize the trays as shown in the image below:
  • Now I find it very easy to handle the tray as they are much lighter and can be organized nicely as well as moved around, if needed. I plan to buy couple of big trays to let the used soil air in them. I also use the tray to cover the germinating seeds in earlier stage.

  • Juicer – I am yet to find the right kind of wheat juicer. I got one from eBay(they never claimed it to be for wheat juice but I took a chance) but it is too fragile for juicing wheat grass. I provided details to the vendor and also some Chinese company details He said that once he is able to locate a supplier, he would be in touch with me. Meat-mincers are capable of juicing wheat grass as well but one needs to have some mechanism to collect juice. If any one finds the right one in India, please inform!

Reliance/TATA Broadband data card on Linux

I am going to collect my past postings and new findings related to using Reliance/TATA Broadband card on Linux here. Here is a posting of mine from rimweb.in in Nov 2009:

“I have tested two Reliance Broadband card on offer right now for connectivity on Linux. I have tested this on Fedora 11 and it uses Linux 2.6.29 Kernel.

1. Huawei 1261 card – Works right away – once you insert it, it gets recognized as a USB device connected to one of the ports as a serial device. You can use normal RConnect package for Linux with slight modification for device name to make it work. On older version of Linux kernel, this may get recognized as a storage device and one may have to use usb_modeswitch to put it into modem mode.

2. LG LXU 800 – For this card, I had to insert usbserial module with vendor and device number as follows to get it to work.

login as root and run

#modprobe -r usbserial
#modprobe usbserial vendor=0xeab product=0x9357

Now insert the device and look at the /var/log/messages file or use “dmesg” command to see, if it gets attached to a serial device.”

yesterday I again had to try using a new Broadband Data Card from Reliance. It is from ZTE (Probably ZTE 2726). If you insert this in USB drive, you get the following message from Kernel on FC11 running Kernel 2.6.32:
=====
Aug 27 17:05:00 ranjan kernel: usb 2-2: new full speed USB device using uhci_hcd and address 4
Aug 27 17:05:01 ranjan kernel: usb 2-2: New USB device found, idVendor=19d2, idProduct=fff5
Aug 27 17:05:01 ranjan kernel: usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Aug 27 17:05:01 ranjan kernel: usb 2-2: Product: USB Storage
Aug 27 17:05:01 ranjan kernel: usb 2-2: Manufacturer: ZTE, Incorporated
Aug 27 17:05:01 ranjan kernel: usb 2-2: SerialNumber: 000000000002
Aug 27 17:05:01 ranjan kernel: usb 2-2: configuration #1 chosen from 1 choice
Aug 27 17:05:01 ranjan kernel: scsi13 : SCSI emulation for USB Mass Storage devices
Aug 27 17:05:06 ranjan kernel: scsi 13:0:0:0: CD-ROM ZTE USB Storage FFF1 2.31 PQ: 0 ANSI: 2
Aug 27 17:05:06 ranjan kernel: sr1: scsi-1 drive
Aug 27 17:05:06 ranjan kernel: sr 13:0:0:0: Attached scsi generic sg2 type 5
Aug 27 17:05:07 ranjan kernel: sr1: CDROM (ioctl) error, command: Xpwrite, Read disk info 51 00 00 00 00 00 00 00 02 00
Aug 27 17:05:07 ranjan kernel: sr: Sense Key : Hardware Error [current]
=====

The way to get this to work is to use usb_modeswitch available at

http://www.draisberghof.de/usb_modeswitch/

usb_modeswitch is not much easier to use and comes with support for large number of USB data modem having mass storage built in. Unlike earlier version of this, here you just need to install software package and its data package and it works all by itself:

Download

(1) http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-1.1.4.tar.bz2 (or its newerversion, if available)
(2) http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-data-20100826.tar.bz2 (or newer version)

Install these after extracting by using “make install” command. You have to make sure that you have ‘tcl’ package installed. You have to also make sure, you have libusb-devel package or its equivalent installed for successful installation. Once you install, your device would get detected as a DATA Modem and you can use it to connect to Internet.

Growing Wheat Grass and Juicing

(Please read updated version first at https://ranjan.in?p=74 )

Recently I came across benefits of drinking wheat grass juice and I was amazed with what nature has in store. I searched extensively (as usual!) on net and went through lot of material to understand the complication of growing it. In USA lot of support from commercial entity is available to support those, who want to grow it. There are kits available and supplies along with various tools are available to make it easy. I thought I would still write out my experiences in trying to grow and giving other people a hope that one can do it without much problem in India as well. I am very lazy person and If I can do it, so can you!

Some one may ask why wheat grass is so special. It turns out that it is not so very different from many other grasses. For example, maize or barley grass are also quite good and so are many others. However among them what grass juice is more beneficial. I would not want to go into those details since there is plenty of material available on net.

Let me try to put rest of the information in form of FAQ!

  1. How much time it takes to grow what grass for juicing? – It takes about 6-7 days to grow to about 6 inches, when it should be harvested for juicing. This depends on climatic conditions and so on.
  2. How to organize this so that I can get juice every day? – What is important is to have this juice fresh. Ideally it should be consumed within 20 minutes of juicing.  So what is best is to have seven containers in which to grow this. It should be sowed every day in a different one so that after six to seven days, you start to get fresh grass every day. Once you harvest from one container, you can reuse that and continue doing that. It is also possible to reuse the same plant once or twice more.
  3. What should be the size of container? – For one person the round pot here seems sufficient, whereas the larger rectangular one is sufficient for three persons(see my comments in the next Blog on this).
    Pots for one person
  4. What should be depth of soil in the pot? – One to two inch depth is enough. So one could have more shallow pot. My larger rectangular pots are better that way.
  5. What soil to add ? – One can add good gardening soil. First time I went to local nursery and asked them to fill it in the pots and had some extra too. While buying the larger pots, I got it filled with the persons selling the pot itself. Soil should not be soggy and should not stick together. One can spread it to dry faster before using it. One should add compost fertilizer before sowing. It has been suggested to not use any chemical fertilizers or pesticides etc.(See my comments in next Blog about this)
  6. Which wheat to use? – I bought it from local grocery shop. They did not have any choice so used whatever they had. If there is choice, one can use bigger grains.
  7. What quantity of seeds should be used? – I use two and half table spoons full of wheat for smaller pot and six table spoon for larger one.But you can adjust as per your experience, this is just initial guess.
  8. What preparation to do before sowing? – Wash and soak wheat for about 12 hours or overnight. Then tie it in thick damp cloth for another 8-10 hours. In Indian warm weather, you should see wheat sprouting by this time. Once is has sprouted a little, it is ready to be sowed.
  9. How to sow? – Spread the wheat in single layer touching each other so that it is as dense as possible without overlapping. Spread a very thin layer of soil on the top of this. Now spray very small amount of water to just make tit damp. More water can be bad here. Cover the pot with damp newspaper sheets so that damp environment is maintained inside. If it  is too hot cover with a plastic sheet or some other thing to keep the seeds in damp environment. Respray twice a day or so to keep it damp. Once you see little sprouts coming out, you can start to expose it to fresh air. Direct strong sunlight for long time may not be good for plants in early stage.
  10. When it is ready to be harvested ? – Keep spraying water every morning and evening and plants should keep growing. Once it has reached a height of 6 inch or so, it is ready to be harvested.
  11. How to harvest? – I use a pair of scissors with long enough blade to cut the wheat grass as close to soil as possible. I bought a sturdy Tailors all metal scissors for this as cheap ones with plastic handle do not last long.
  12. How to Juice? – Wash the grass properly and juice it in spice grinder by adding little water. It would become like a paste in this and now one can strain it through a thin cloth to get juice out of the pulp. It is suggested to use a low RPM machine to do this to keep temperature low during this. Higher temperature destroys  some beneficial enzymes.  One could use other means of extracting juice as well. I could not find a low RPM machine in India, but they are available abroad though expensive. I am using normal spice grinder for the time being. However I have ordered a hand juicer from eBay (India) for something that looks like this(one below that is on Amazon.com) :
  13. How to drink? – It is best taken in morning on empty stomach. It is suggested to not gulp it down at once but consume it slowly as if you are eating it.
  14. What to do after harvesting? – One can reuse the plant couple of times more after which it starts to get little harder. I am still experimenting with this.
  15. Can I freeze grass? – One can keep it upto 2-3 days in freeze but Juice should be consumed within 20-30 minutes of making it.

There is lot of material on the web and you can go through it. I am a learner and not an expert! See my comments in next Blog on this.

TinyOS-2.x zigbit serial communication

As mentioned in the previous post, due to the fact that we were downloading the Motorola S-record file ‘main.srec’ via Serial Bootloader (using meshprog on Linux), fuse bits were not getting updated. If we had used JTAG interface (e.g using DRAGON Kit) and aurdude, this would have happened. S-record can have application code as well as fuse bit setting, unlike Intel Hex format.

This meant that the default TinyOS setting of 8 MHz for clock rate was not appropriate for this since Meshbeans are set for 4 MHz by default. So to get the Serial Communication working, we had to make the following changes:

1. Check the following  in

tinyos-2.x/tos/platforms/meshbean/hardware.h

=> change clock rate to 4 MHz by

#define MHZ  4

=> Change here the default baud rate, if you need – 57600 works fine for me

#define PLATFORM_BAUDRATE 57600L

2. make sure that:

“The file chips/atm128/Atm128Uart.h contained some wrong constants, which produce  strange results. The correct ones can be found in the ATmega 1281 datasheet and are:
ATM128_38400_BAUD_8MHZ_2X = 25
ATM128_57600_BAUD_8MHZ_2X = 16”

This change would not have effect on 4 MHz clock that we are using but its best to correct them anyway. Anyother Baud Rate combination can also be added.

I must add here that give a choice use a crystal which gives less errors  – e.g. 3.6864 MHz instead of 4 MHz , similarly 7.3728 MHz instead of 8 MHz. (See the ATMega128a manual).

3. With these changes done, now one can try TestPrintf utility. Do read this README file :

http://www.tinyos.net/tinyos-2.x/apps/tests/TestPrintf/

I was first looking at serial data using MiniCom – this was producing some unprintable characters including what is expected. One has to use the Jave client to get the proper message displayed as output of Printf command. I used the following command to get the data displayed right:
java  net.tinyos.tools.PrintfClient  -comm serial@/dev/ttyUSB3:57600

Here /dev/ttyUSB3 is the port to which my meshbean module was connected vis USB port.

This would give the this  output in a loop:

Hi I am writing to you from my TinyOS application!!
Here is a uint8: 123
Here is a uint16: 12345
Here is a uint32: 1234567890

TinyOS-2.x on Zigbit – Baud rate mismatch

We tried to use TinyOS on Meshnetics Meshbean modules based on Zigbit module containing both microcontroller and radio transceiver. Fortunately a port was made available as a contributed code. I got many student group to start using TinyOS on Meshbean modules. However no one could get the UART communication through USB port working and all the projects which needed this got stalled. I took up this task as I got little free now to figure out what may be happening. It looked like a Baud Mismatch problem since we were received some characters but no baud rate setting was making it come right.

I think I have now understood the problem and however need to try it out tomorrow to make sure that my guess is correct. I am writing it up now and would verify later.

TinyOS port by Distributed Computing Group, ETH used JTAG interface to download firmware into the Meshbean module. This had the capability of programming fues bit as well. What we have been doing is to use Serial Bootloader to program the modules. This does not have the capability of programming the fuse bits. My guess it that due to this the Baud Rates do not match to the right value since clock related fuse does not get set appropriately. I also noticed the default settings of fuse bits are different in Meshnetics software as compared to TinyOS :

Meshnetics : 0xFF, 0x9D, 0x62.

TinyOS : 0xFF, 0x99, 9xE2

So Meshnetics default settings may not work specially since CKDIV8 is the most significant bit of low fuse byte (0x62 vs 0xE2) and can have impact on the clock rate.

I plan to use Dragon to do JTAG programming of Meshbean modules and verify my guess! If it works, we can work on doing Time Synchronization development for seismic measurements.

[Added later : My hunch was correct. Dr Philipp Sommer, who is managing TinyOS port on meshbean also confirmed same. I adjusted some parameters based on his suggestion and it nearly works now. Would update more details in a separate blog.]