You Are Here:

Community: Developer Discussion Boards

#1 Old Question !!!! URGENT: problems using SPP protocol of N70 !!!! - 2008-12-01, 19:32

Join Date: May 2008
Posts: 12
huss81
Offline
Registered User
Hi everybody,

PROJECT:
---------
One of the tasks for my graduation project is to write an application for Nokia N70 device (javaME) to communicate via Bluetooth with a sensor node (simply: microcontroller with SD memory card, camera etc.). It will make it possible to send commands that are executed on the sensor node and receive the results. Furthermore it should be possible to send/receive files between phone and sensor node. The sensor node is provided with a bluetooth module (LMX9820A) supporting SPP protocol.


PROBLEM:
--------
I have implemented the application for N70 in Java using SPP protocol of Bluetooth API (JSR82). I am now able to send commands that are executed and i also get the textual results. Commands and results consist of small amount of bytes (20-200). But when trying to send/receive big files to/from sensor node, the application frequently either "freezes" or crashes, ALTHOUGH the sensor at that point is still sending/receiving data to/from phone. Sending/Receiving files is implemented such that each data block of 256 bytes must be acknowledged by the receiver before the next block is sent--> to avoid any buffer overflows by sender or receiver. With big files i mean: > 100 KByte. Smaller files (10-50 KByte) can be sent/received without problems!!!

Has anybody worked with N70 and communicating via SPP protocol? Anybody experienced same or similar problems? Are there any known problems/bugs with SPP protocol of N70?


I AM GRATEFUL FOR EVERY HELP, AS I HAVE TO GET FINISHED WITH THE PROJECT VERY SOON !!!!!

REMARK 1: I use a progess bar (java class "Gauge") to inform the user about the amount of data already sent. I upate it each time a 2KByte data amount is sent/received.

REMARK 2: sending/receiving file data is done byte for byte (and as said in 256 byte blocks)

REMARK 3: the application runs on Nokia N71 WITHOUT any problems, but i "must" use N70 (I have the latest firmware update)!!




Best Regards,
Huss.
Reply With Quote

#2 Old Re: !!!! URGENT: problems using SPP protocol of N70 !!!! - 2008-12-02, 14:52

Join Date: May 2008
Posts: 12
huss81
Offline
Registered User
Hi,

nobody can give any tips/known bugs of SPP protocol for N70 (S60,2nd Edition) that may lead to the reason why sending/receiving bigger amount of data sometimes goes OK and sometimes not??
Reply With Quote

#3 Old Re: !!!! URGENT: problems using SPP protocol of N70 !!!! - 2008-12-02, 18:43

Join Date: May 2008
Posts: 12
huss81
Offline
Registered User
Hi folks,


---update------update------update------update---

It is SymbianOS error -6305 !! Any known workarounds pleassse??

---update------update------update------update---

After some debugging work, the problem can be identifed as following: The application does no longer "freeze", but reading from InputStream leads sometimes to an IOException, although the sender (sensor node) is STILL sending data!!?? Waiting some time (1 sec) after an IOException and rereading does not help too!

I am getting crazy...any ideas when an IOException is thrown for SPP?


int errorCounter = 0;
while(true)
{
try
{
return (virtualSerialInputCh.read()); //try to read
}
catch(Exception ex)
{
try
{
if(++errorCounter==10) //max trials: 10
throw new Exception("READ ERROR....");
Thread.sleep(1000); //wait 1 sec and then retry...
}
catch(InterruptedException e) { }
}
}
Last edited by huss81 : 2008-12-02 at 22:44.
Reply With Quote

#4 Old Talking Re: !!!! URGENT: problems using SPP protocol of N70 !!!! - 2008-12-04, 04:24

Join Date: May 2008
Posts: 12
huss81
Offline
Registered User
Hi,

Replying to myself for the case somebody would face the same difficulties with respect to symbian OS error "-6305" on S60 2nd Edition, Feature pack 3:


I would claim (after some tests) that the problem is solved:
I changed my application such that i first receive **ALL** file data (some 100s of KBs) and **AFTER** that i process the received data properly. In my old implementation each time i received a data block of 256 bytes i had to convert each (1,2 or 4 bytes) to its string representation.

I made some tests reading more than 15 files (between 100KB and 1Mbyte) and there were no problems as i reported before.


I hope this would be helping for someone...





Regards,
Huss
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
SPP connetion on Nokia 6600 (Very Urgent) thakurrajiv Bluetooth Technology 0 2005-11-23 17:41
URGENT: Problems with overloaded methods mopfattn Mobile Java General 8 2004-08-28 20:49
Problems with N7210 emulator! Please help, it's urgent!! Mobile Java General 1 2002-11-18 07:55
Problems with HTTP /1.0 Protocol AlbertoPereira General Messaging 3 2002-08-06 14:43
Urgent - problems sending SMS text from PC Nokia_Archive General Messaging 1 2002-05-23 15:56

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia