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.]

Joomla Media Manager image upload fail

One of my websites, which uses Joomla as CMS got hacked as I had not paid attention to securing the site properly. After this I did go through the site carefully trying to remove any possible loopholes.

Recently I realized that Uploading images through Media Manager or any other means were failing to upload. I tried various things but nothing was helping. I am listing some of them here:

1. Checking the Directory permissions. Even tried changing the unsafe mode of 777 to all the relevant directory. Did not help.

2. Tried disabling Flash based uploader – did not  help.

What it did was to give an error message of following kind:

JFile::read: Unable to open file: ”
Warning: Failed to move file!
Error. Unable to upload file.

3. I followed up on this and eventually found that If I do not use the “open_basedir” feature in php.ini to make it more secure by commenting it out in php,ini file, it works fine.

;open_basedir = /home/www

4. As of now, I do not understand why this happened and would like to understand if I can still use this feature to keep site safer.

Meshprog – USB device opening failure on Fedora 11/12

I had been using meshprog to program Meshnetics Zigbit Evaluation Modules on Linux. I discovered that it was not getting programmed on Fedora 11 or 12. It took me some time to figure out what was happening. I am recording this here in case some one else faces the same problem. Here are my observations:

1. Meshnetics modules use UART to USB converter from Silicon Labs – CP2102. This has idVendor=10c4, idProduct=ea60 as shown by Kernel message.

2. I found that /dev/ttyUSBx to which it was getting attached was not opening by Meshprog

3. System log showed the following :

May 22 20:56:28 ranjan kernel: usb 4-1: cp210x converter now attached to ttyUSB3
May 22 20:56:30 ranjan NetworkManager: <info>  (ttyUSB3): ignoring due to lack of mobile broadband capabilties
May 22 20:56:30 ranjan gpsd.hotplug: gpsd_control(action=add, arg=/dev/ttyUSB3)
May 22 20:56:30 ranjan gpsd.hotplug: socket /var/run/gpsd.sock doesn’t exist
May 22 20:56:30 ranjan gpsd.hotplug: launching gpsd -F /var/run/gpsd.sock
May 22 20:56:30 ranjan gpsd.hotplug: socket /var/run/gpsd.sock doesn’t exist
May 22 20:56:30 ranjan gpsd.hotplug: can’t reach gpsd

4. So it looked like it was trying to attach it as a GPS device by starting gpsd

5. I located the hotplug rule for this and disabled that. In Fedora 11 it s in :

/etc/udev/rules.d/99-gpsd.rules

I commented the line :

#SYSFS{idVendor}==”10c4″, SYSFS{idProduct}==”ea60″, SYMLINK=”gps%n”, RUN+=”/lib/udev/gpsd.hotplug.wrapper”

6. Now it works !