Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: Associate Led blinks no matter what? on: April 19, 2013, 04:23:06 am
Bump, sorry is this a dumb question?
If there is anything needed to enable a response, please let me know?
2  Using Arduino / Networking, Protocols, and Devices / Re: Associate Led blinks no matter what? on: April 18, 2013, 01:14:02 am
Sorry for late response did not realize how late it was when I posted.

Yes both (router & coord) blink, 250ms - router 500ms - coordinator

The coordinator starts blinking on power up.
The router starts as ON for 1 - 2 secs then changes to BLINK.

This leads you to think that it is doing as specified in the data sheet, ON when not associated and BLINK when associated. However it does this even when powered on by its self,
no coordinator. Which tells me the ON and BLINK is not indicating network status as specified in the data sheet.

Coordinator
Code:

XB24-ZB_21A7.mxi
80
0
251
21A7
0
[A]ID=1707
[A]SC=FFFF
[A]SD=3
[A]ZS=0
[A]NJ=FF
[A]DH=0
[A]DL=FFFF
[A]NI= COORD
[A]NH=1E
[A]BH=0
[A]AR=FF
[A]DD=30000
[A]NT=3C
[A]NO=0
[A]CR=3
[A]PL=4
[A]PM=1
[A]EE=0
[A]EO=0
[A]BD=3
[A]NB=0
[A]SB=0
[A]D7=1
[A]D6=0
[A]AP=2
[A]AO=0
[A]SP=20
[A]SN=1
[A]D0=1
[A]D1=0
[A]D2=0
[A]D5=1
[A]P1=0
[A]P2=0
[A]PR=1FFF
[A]LT=0
[A]RP=28
[A]DO=1
[A]IR=0
[A]IC=0
[A]V+=0
Router
Code:
XB24-ZB_23A7.mxi
80
0
251
23A7
0
[A]ID=1707
[A]SC=FFFF
[A]SD=3
[A]ZS=0
[A]NJ=FF
[A]NW=0
[A]JV=0
[A]JN=0
[A]DH=0
[A]DL=0
[A]NI= ROUTER2
[A]NH=1E
[A]BH=0
[A]AR=FF
[A]DD=30000
[A]NT=3C
[A]NO=0
[A]CR=3
[A]PL=4
[A]PM=1
[A]EE=0
[A]EO=0
[A]BD=3
[A]NB=0
[A]SB=0
[A]D7=1
[A]D6=0
[A]AP=2
[A]AO=0
[A]SM=0
[A]SN=1
[A]SO=0
[A]SP=20
[A]PO=0
[A]D0=1
[A]D1=0
[A]D2=0
[A]D5=1
[A]P1=0
[A]P2=0
[A]PR=1FFF
[A]LT=0
[A]RP=28
[A]DO=1
[A]IR=0
[A]IC=0
[A]V+=0
3  Using Arduino / Networking, Protocols, and Devices / Associate Led blinks no matter what? on: April 17, 2013, 04:30:08 pm
Hi

I have S2 xbees in API mode, all working as I would expect except that the associate led does not act as specified in the data sheet. I expect it to stay high (on) when powered up and not joined to a network, and once joined it flashes either fast for remote or slower as a coordinator. Below is a quote from the data sheet with regards this.

Am I reading/interpreting this incorrectly? Is there something that I could have changed to cause this, the Ass LED functionality is set as default.
Any Ideas on what is going on?

" The Associate pin (pin 15) can provide indication of the device’s network status and diagnostics information. To take advantage of these indications, an LED can be connected to the Associate pin as shown in the figure above.The Associate LED functionality is enabled by setting the D5 command to 1 (enabled by default). If enabled, the Associate pin is configured as an output and will behave as described in the following sections.

Joined Indication
The Associate pin indicates the network status of a device.
1. If the module is not joined to a network, the Associate pin is set high.
2. Once the module successfully joins a network, the Associate pin blinks at a regular time interval. "
4  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 19, 2013, 02:59:59 am
smiley only half glazed

To be honest when I first tried using char arrays with my code it was the defining the size of the array that got me, and the reason why I went to dynamic "Strings".
My xbee data was changing ever so slightly, the first bit, timestamp, flag and doors were fixed size but the 10 temp floats were changing in size, could be a -127.0 for a faulty or disconnected sensor, right up to 127.0 and anything in between.

This resulted in bad data for me, I now know I was just not doing it right!
5  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 19, 2013, 02:42:17 am
Question?

Code:
sprintf(query,"GET /mypage.php?oneParam=%i&twoParam=%s HTTP/1.0",stuffInt,stuffString);

does the order of 'stuffInt, stuffString' determine were it will be inserted into the string?

For example is this true?

Code:
sprintf(query,"GET /mypage.php?oneParam=%i&twoParam=%s&threeParam=%i&fourParam=%s HTTP/1.0",stuffInt,stuffString,stuffInt2,stuffString2);
6  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 19, 2013, 02:32:27 am
For now the code appears stable, what I need to do going forward is work out how to use "string" not "String" and char arrays correctly, and convert all my Strings to char arrays as you suggest, this I am sure will go a far way to making the code even more stable.

And a bit more about http query strings

Thanks for the lesson smiley
7  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 19, 2013, 02:24:59 am
smiley it does help to see the bewilderment in the eyes.

Yes I think I do, why would you need to tag strings on after the HTTP/1.0 ?

EDIT: Sorry ignore rather dumb smiley-sad
8  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 19, 2013, 02:09:09 am
Sorry missing the plot here, I need to do some homework so I can offer a partly intelligent response as what you are saying is going over my head.
9  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 19, 2013, 01:50:17 am
Thanks for that, however something I am forgetting is the fact that I have to have a query "string" there is no way round that, char arrays wont help.
The query string is what is used in the the HTTP post request to post the data to a web site, that query has to be a url encoded string, it cant be anything else.

My problem was running out of memory when trying to put that query string together "if" there was also a whole lot of other serial.print strings happening at the same time.

I think that problem would exist whether I was using normal strings or char arrays, if there is not enough memory to deal with it all it will crash, or am I wrong?

I am taking the byte array data from the xbee response and putting it into the query string directly and then posting it, I dont see how using char arrays in this scenario will help?

Or am I missing something?
10  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 18, 2013, 04:05:31 pm
Thanks, need to play with char arrays and get to grips with it, I however do need floats.
11  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 18, 2013, 03:41:09 pm
@Conguito
Thanks, the xbee are in API mode, that part part of the code work great, its off the shelf code  so I dont think there is much I can do with it to to make it work any better.

@SurferTim
Thanks, you have pretty much hit the nail on the head, in my very limited knowledge way, I have narrowed it down to running out of memory.
I think I proved this by:

a. removing softwareserial lib and all serial.print calls, the code runs without hanging.
b. running available ram check calls at different points, it went as low as 124 at one point.
Put all serial stuff back:
c. putting all serial.print fixed strings into flash using F(), lowest was 564

It is now running with all my original serial stuff plus additional ram checks and serial prints and it appears to be running ok, 12 hours and counting.

You are right I think about the query string, I suspect that a lot of the code I wrote to put that string comprising the xbee data, timestamp etc is very inefficient.
I just do not quite know how to re-factor it. This is my 1st C project so have a lot to learn about the basics and structure of the language.

Any pointer on converting my query string to a character array?

Afterthought, I thought text strings in C were character arrays?
12  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 18, 2013, 03:37:15 am
Just in case you were interested, the actual gibberish that was being printed was this:

Code:
POST /logger/remoteAdd?timestamp=2013-03-18+10%3A21%3A44&seri\0x08 1\0x00\0x00\0x00\0x08\0x02\0x00A 1\0x00 1\0x006\0x00\0x04\0x05\0xe4\0x08\0x9e w\0x00\0x04\0x00\0x00\0x01\0xb6\0x08\0x1e\0xf7 \0x92\0x00\0x1ex\0x08\0xb6\0x00 HTTP/1.1

Should be:

Code:
POST /logger/remoteAdd"?timestamp=2012-10-23+15%3A10%3A13&serial=13c20032465765&sensor=-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0 HTTP/1.1
13  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 17, 2013, 05:29:48 am
As to pointers in my code, I dont use them as I have not as yet mastered them.
Yes have been looking at code to see what is happening with available ram.

I came across a F function used to help out with memory issues, that might help so I can still use the print functions,
but still need to fix the underlying code problem.

Serial.println("This string is in SRAM and FLASH");
Serial.println(F("This string is not in SRAM, just FLASH."));

Thanks for the pointers smiley  will play some and see what I can come up with
14  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 17, 2013, 04:25:11 am
Sorry that just me writing the type of rubbish that was there not actual, would the actual gibberish help you say what might be happening?
If so I will run the AtlSoft lib again and copy the exact output.

It hung again after only a few hours, and that was with no Software Serial library included, all calls to serial.print removed.

So I have something else wrong, I just have no idea on how to fault find it.....

Yes library from pjrc.com
15  Using Arduino / Project Guidance / Re: Problem code hangs after a few hours - Xbee / Uno / WIZ820io on: March 17, 2013, 02:26:35 am
It ran for about 3 days then hung again....

I have removed all print calls and removed the SoftwareSerial lib to see if that prevents the hangs.
I only need the print calls when setting up and debugging, it is not needed when running live.

I tried the AltSoftSerial lib but could not get it to work properly, the  calls to client.print() that posts
data to website contained half garbled messages, the query part should be something like:

Code:
"?timestamp=2012-10-23+15%3A10%3A13&serial=13c20032465765&sensor=-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0"

Instead the first part of query is ok and half the sensors readings are gibberish, gobbldy gook.

Code:
"?timestamp=2012-10-23+15%3A10%3A13&serial=13c20032465765&sensor=-127.0%2C-127.0%2C-127.0%2C-127.0%2C-127.0%2C\B4\00\00\00\\B4\00\00\00\B4\00\00\00"



I think I have a flaw in my code that might be causing this, if removing the serial library and print calls
does not fix the hangs then i have to assume that is the case.

Any ideas on what I might be doing wrong with the AltSoftSerial would be appreciated.
Pages: [1] 2