Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
troyka
PostPosted: Jan 16, 2011 - 03:08 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi everybody,
Regarding to bitcloud WSNDemo example application,
I couldn’t find where is defined the function APL_WRITE_LOG(0x??).

Where / how can we access this log? (if we can)

Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 16, 2011 - 09:52 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
I couldn’t find where is defined the function APL_WRITE_LOG(0x??).


It is defined somewhere inside stack headers. But nevermind them, they are a part of very old testing and debugging infrastructure, which is not really helpful anyway. Basically all they were doing is sending parameter byte to the UART.

They don't do anything in release unless you explicitly enable them and even then I'm not sure that they are still working.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jan 18, 2011 - 04:28 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


...and the assert function?
Code:
#ifdef _TEMPERATURE_SENSOR_
  assert(BC_SUCCESS == BSP_OpenTemperatureSensor(), 0xf007);
#endif
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 18, 2011 - 05:02 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
...and the assert function?

This one is quite useful, but also disabled in releases since it drastically increases code size.

This function checks provided condition and if condition is false function hangs programm execution and outputs second number into UART. Helps to catch run-time bugs.

LE: but it is in HAL which is open source, so you may use it in your applications, just copy it from HAL.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jan 20, 2011 - 04:55 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


APS_DataReq()function is available anywhere to watch and learn how it works?
or maybe it is a binary and has to be transparent to me and I just need to modify APS_DataReq_t structure as needed?
Thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jan 20, 2011 - 05:24 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
or maybe it is a binary and has to be transparent to me and I just need to modify APS_DataReq_t structure as needed?
That one Smile
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Feb 12, 2011 - 10:45 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi,
I'm having problem starting the connection with WSN Monitor.
The sniffer from wireless services is working fine, but the wsn demo shows "can't connect" all the times I do "connect" to the IP:PORT (same as server)
Could be a problem that WSNDemoApp_USB_Coord.hex is not loaded on the usb stick? (I'm using the default firmware of the stick )

I'm asking this because for some reason, I couldn't reprogram the usbstick.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 13, 2011 - 08:01 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
The sniffer from wireless services is working fine
Which means that there is sniffer firmware loaded to the stick.

troyka wrote:
Could be a problem that WSNDemoApp_USB_Coord.hex is not loaded on the usb stick?
By default there is sniffer firmware, which makes more sense.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Feb 26, 2011 - 10:09 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Alex,do you know where I can find (maybe you already got this) information about the raven board relating:
1-Antena maximum coverage range
2-max numbers of nodes allwed
3-average data rate etc...

thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Feb 27, 2011 - 08:58 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
1-Antena maximum coverage range
Have no idea, maybe it is easier just to try it yourself.

troyka wrote:
2-max numbers of nodes allwed
Depends on application.

troyka wrote:
3-average data rate etc...
Regularly 80-90 kbit/sec in one direction in peer-to-peer mode without APS ACKs.

All of above applies only to BitCloud, of course.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 01, 2011 - 02:07 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, I'll check that params by myself.
starting to configuring p2p application, found the CS_POWER_FAILURE.
what is the effect after enabled?
There is no info on manuals or web.

And after change BOARD to BOARD_USB_DONGLE
Quote:

E:\PROYECTO\BitCloud_ATAVRRZRAVEN_1_10_0\Applications\ThroughputTest/src/throughputTest.c:89: undefined reference to `BSP_OpenLcd'
./objs/throughputTest.o: In function `startingNetworkTimerFired':
E:\PROYECTO\BitCloud_ATAVRRZRAVEN_1_10_0\Applications\ThroughputTest/src/throughputTest.c:66: undefined reference to `BSP_SendLcdCmd'
./objs/throughputTest.o: In function `ZDO_StartNetworkConf':
E:\PROYECTO\BitCloud_ATAVRRZRAVEN_1_10_0\Applications\ThroughputTest/src/throughputTest.c:199: undefined reference to `BSP_SendLcdCmd'
make: *** [throughputTest.elf] Error 1
Build failed with 3 errors and 0 warnings...

IT's like the default value is still on BOARD_RAVEN and continues looking for LCD.h not leds.h


regards!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 01, 2011 - 09:51 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
what is the effect after enabled?
Node will save it's state every 5 minutes into EEPROM and restore this state after power off without rejoin. Feature is pretty much useless since in 5 minutes a lot could happen and all this will be lost.

troyka wrote:
And after change BOARD to BOARD_USB_DONGLE
I guess you need to "make clean all" instead of just "make".
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 01, 2011 - 02:47 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


That fix the problem.
ok, now I have the boards programmed, but it seems I need "AT91 USB to Serial Converter driver" (says on manual)
Do you know where to find it?

For the original firmware on the boards, the "jungo" driver works fine, but the Throughput Test Application ask for another one??...is this correct?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 01, 2011 - 04:20 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Do you know where to find it?
It should be included in SDK. Search for *.ini files, this is description of device.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 01, 2011 - 05:19 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


No, nothing on SDK, or wireless services installation or wireless studio.
Tried on XP, vista and W7, all of them asking for a driver.
Tried a USB folder under Atmel\AVR Tools\usb, there are some .inf files, but nothing.
AVR2051 (BitCloud Stack Documentation) talks about ""AT91 USB to Serial Converter driver""
How could be that no one before ask for this driver?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 01, 2011 - 05:28 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
How could be that no one before ask for this driver?


How about ThirdPartySoftware/6119_VCP.inf?

I don't have Raven SDK at hand, but in SDK for SAM7X_EK it is there.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 01, 2011 - 08:03 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


THAT'S THE ONE!!!

I saw that WSNDemo contains a connect to serial port.
does that program works with Throughput Test Application? or just hyper terminal or related ones?

Another question. Still I haven't reach the connection between the two usb nodes.
My USB coordinator, shows the leds:
BLUE continuously on
Red blinks
Yellow continuously on

The other side, the router, blue, green and yellow are on continuously on all (red off).

From the manual, I read that the coordinator created the network successfully and sending data to the USB but not sending or receiving nothing through air.

Could you please check this config that I've used?:
Coordinator:
Code:

BOARD = BOARD_USB_DONGLE
SECURITY_MODE = NO_SECURITY_MODE
STACK_TYPE = COORDINATOR
CS_EXT_PANID = 0xAAAAAAAAAAAAAAAALL
CS_UID = 0x00LL
APP_USE_APS_ACK = 0
APP_DEVICE_TYPE = DEV_TYPE_COORDINATOR

All other variables as default.
And the Router:
Code:

BOARD = BOARD_USB_DONGLE
SECURITY_MODE = NO_SECURITY_MODE
STACK_TYPE = ROUTER
CS_EXT_PANID = 0xAAAAAAAAAAAAAAAALL
CS_UID = 0x01LL
APP_USE_APS_ACK = 0
APP_DEVICE_TYPE = DEV_TYPE_ROUTER


And that's all...did I miss something??
Thankyou!!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 01, 2011 - 08:34 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
does that program works with Throughput Test Application? or just hyper terminal or related ones?
What program?

CS_UID == 0 means "read hardware UID" and I'm not sure raven has one.

Also try with STACK_TYPE = ALL for both sides.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 01, 2011 - 09:19 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, now it's working the Throughput Test Application.
The changes made was remove the 0 from the CS_UID.
Thanks again
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Mar 01, 2011 - 10:01 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Watching the data rates, if the coordinator and router are separated 1m of each other, no ACK and no security, the best bandwidth I get is 95Kbps (average)
If zigbee at 2.4Ghz predicts a 250Kbps of max speed...
I assume that bitcloud is calculating bandwidth only for the data payload. right?
if not, why is that slowdown on velocity?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 02, 2011 - 07:00 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
the best bandwidth I get is 95Kbps (average)
That's as much as you gonna get with ZigBee.

troyka wrote:
If zigbee at 2.4Ghz predicts a 250Kbps of max speed...
Not ZigBee, IEEE802.15.4. And this is a physical transfer speed, at which bits are transferred inside single frame. Once you have two frames, you get inter-frame delay and frame header, so data rate drops a bit. Then you add ZigBee headers and speed drops even more (but you get routing, retries, acknowledgments, etc in exchange).


troyka wrote:
I assume that bitcloud is calculating bandwidth only for the data payload. right?
ThroughputTest calculates actual data transfer rate.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 02, 2011 - 08:15 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi again, I was trying to find APP_PAYLOAD_SIZE and found that it's equal to APS_MAX_ASDU_SIZE who is equal to
NWK_MAX_NSDU_SIZE - APS_MAX_DATA_FRAME_HEADER_LENGTH - APS_MAX_DATA_FRAME_FOOTER_LENGTH

None of the three last ones are defined as a number...

maybe you know the size of any of them.
Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 02, 2011 - 08:25 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
None of the three last ones are defined as a number...
Keep digging and you'll end up with hairy equation.

In real life you need to use APS_MAX_ASDU_SIZE and not worry about anything else.

APS_MAX_ASDU_SIZE value is different depending on stack settings, particularly security.

Without security it is around 93-95 (don't remember exact value). And with security it is around 60+.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 03, 2011 - 03:25 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


look at the attached table please,
using the worst case for all the frames, the lowest value I can get for bandwidth is 130 kbps...(105 on practice, 95 the average)
maybe you found the mistake...


Last edited by troyka on Mar 03, 2011 - 03:39 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 03, 2011 - 06:41 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
maybe you found the mistake...
No mistake, you are assuming 250 kbps of sustained throughput, this is not true, there are random delays between frames (which are quite big), there are mandatory MAC acknowledge frames.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 03, 2011 - 03:40 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


alexru wrote:
there are mandatory MAC acknowledge frames.
Do you refer to the Synchronization with beacons?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 03, 2011 - 03:58 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
alexru wrote:
there are mandatory MAC acknowledge frames.
Do you refer to the Synchronization with beacons?
No, ZigBee does not use beacon mode. But every received frame is acknowledged on MAC layer.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 03, 2011 - 04:07 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


so, If I disable ACK on NWK layer, this action do not disable on MAC layer too?
I don't want to be reiterative, it's because MAC layer has the ability to disable ack request too.
thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 03, 2011 - 04:11 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
so, If I disable ACK on NWK layer, this action do not disable on MAC layer too?
There are no ACKs on NWK layer, only on APS.

troyka wrote:
MAC layer has the ability to disable ack request too.
thanks
No, MAC ACKs are mandatory in ZigBee.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 05, 2011 - 05:37 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi, Related to Throughput Test application,
when enabling security (CS_ZDO_SECURITY_STATUS = 0)
both (coordinator and router) start blink yellow led.
I think maybe, they are not reaching an agreement on keys, on the other cases, with no security, the yellow led was constantly ON.
ps, the bandwidth is now on 3kbps....
Is this normal? unlikely right??

the same thing when enabled ACK, but now the bandwidth is 2kbps...1 sometimes...

looking a post from the user RabidCicada, I see that this bandwidth is normal thing...
Quote:
I set RZUSBStick to Coordinator. And setup 2 Raven Board Routers.

With Security Enabled (Pre-Shared network key, MAX packet payload of 53 bytes according to Bitcloud users guide):
1 Router transmitting = 123 Bytes per second transmitted.
2Routers transmitting = 350 Bytes per second transmitted.


Please confirm me that behaviour.

Another question:
Is there any method (or maybe is documented anywhere) how may nodes (maximum number) is supported by a coordinator?
or maybe the max bandwidth supported, that could lead to a conclusion using the Throughput results...

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 06, 2011 - 07:31 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
the yellow led was constantly ON.
Yellow toggles when packet is sent or received, so it was blinking, but really fast Smile

troyka wrote:
ps, the bandwidth is now on 3kbps....
Is this normal? unlikely right??
Yes, this is normal, rf230 does not have hardware encryption module, so encryption in implemented in software and it is pretty slow.

troyka wrote:
Is there any method (or maybe is documented anywhere) how may nodes (maximum number) is supported by a coordinator?
Depends on what do you mean by "supported". Amount of EDs that may connect to it is limited by available RAM, amount of routers that may connect is unlimited. But it can't receive data from too many nodes simultaneously, this depends on scenario.

It is really hard to put this into one document.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 07, 2011 - 02:05 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


No problem, you gave me an idea how to aboard the subject.
One more question, using the RAVENS and the RZUSB, I have aprox. 120m on a point to point communications...
(nobody walking through because the link goes down)
Do you know how much better is the communications using a zigbit amp? or how much can improve with the amps modules?
Actually, with the ravens, I can go through 2 or three walls, 30m, 50 on the best case...and they need to be directed because the antenna is no omni directional...
It's a good board to start learning, but on the field, more power is needed.
Regards!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 07, 2011 - 09:15 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Do you know how much better is the communications using a zigbit amp? or how much can improve with the amps modules?
With proper antenna I've seen reports of them working at a 3 km line of sight distance.

ZigBee way of extending range is placing routers along the distance, not increasing TX power.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 09, 2011 - 05:59 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Does the wsn demo application need the rfservicesserver.exe to be started before the connection?

I can't connect the soft to any board, now I'm doubting about wich connection to use on the "connect" menu, there is a serial connection and a TCP/IP connection. None of them working.

Thanks
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Mar 09, 2011 - 06:03 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, clear that... I was uploading from a wrong path...
Sorry about that..
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 09, 2011 - 06:04 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Does the wsn demo application need the rfservicesserver.exe to be started before the connection?
I have no idea what it is, so no Smile

troyka wrote:
I can't connect the soft to any board, now I'm doubting about wich connection to use on the "connect" menu, there is a serial connection and a TCP/IP connection. None of them working.
You need serial connection. But before that just open corresponding COM-port in HyperTerminal or another terminal program and make sure that is it sending something.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 15, 2011 - 11:23 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Searching at the zigbee specification,
LQI = Link quality indicator
but what RSSI stands for??

or maybe you know the propouse of the function:
void appReadLqiRssi(void)

thanks
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 06:15 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
but what RSSI stands for??
Received Signal Strength Indicator.

troyka wrote:
or maybe you know the propouse of the function:
void appReadLqiRssi(void)
It reads LQI and RSSI values from parent to put them into sent data frame.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 12:31 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


maybe you know why happens this:
Quote:
make: *** No rule to make target `objs/WSNSENSORMANAGER.C', needed by `WSNDemoApp.elf'. Stop.
Build failed with 1 errors and 0 warnings...

Sometimes just happens after modify a simple variable, then even if I make a clear or recompile, the problem persist...
I have to start the project again and the compilation works fine.
any idea??
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 01:16 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
maybe you know why happens this:
Never seen this. Message is pretty weird, it expects .c file in objs/ directory.

Can you check next time this happens what is the output of "make clean all" invoked in the directory with the Makefile?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 01:40 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Here it is:
Quote:

-------Application cleaning------------------------
rm -rf ./objs/WSNCoord.o ./objs/WSNDemoApp.o ./objs/WSNEndDevice.o ./objs/WSNRouter.o ./objs/WSNSENSORMANAGER.C ./objs/WSNUARTManager.o ./objs/WSNVisualizer.o ./objs/WSNZclManager.o ./list/*.* WSNDemoApp.elf WSNDemoApp.hex WSNDemoApp.srec WSNDemoApp.bin
make clean -C ../../BitCloud/Components/./PersistDataServer
make[1]: Entering directory `E:/TESTING/RAVEN_1/BitCloud/Components/PersistDataServer'

----------------------------------------------------
Persist Data Server component cleaning.
----------------------------------------------------
rm -f ./objs/pdsDataServer.o ./objs/pdsWriteData.o ./objs/pdsCrcService.o ./lib/libPersistDataServer.a ./list/*.*
make[1]: Leaving directory `E:/TESTING/RAVEN_1/BitCloud/Components/PersistDataServer'
make clean -C ../../BitCloud/Components/./ConfigServer
make[1]: Entering directory `E:/TESTING/RAVEN_1/BitCloud/Components/ConfigServer'

----------------------------------------------------
Config Server component cleaning.
----------------------------------------------------
rm -f ./objs/configServer.o ./lib/libConfigServer.a ./list/*.*
make[1]: Leaving directory `E:/TESTING/RAVEN_1/BitCloud/Components/ConfigServer'
make clean -C ../../BitCloud/Components/./BSP
make[1]: Entering directory `E:/TESTING/RAVEN_1/BitCloud/Components/BSP'

----------------------------------------------------
Board Support component cleaning.
----------------------------------------------------
rm -f ./RAVEN/objs/lcd.o ./RAVEN/objs/bspTaskManager.o ./RAVEN/objs/joystik.o ./RAVEN/objs/sipc.o ./RAVEN/objs/sensors.o ./RAVEN/objs/buttons.o ./lib/libBSPRaven.a ./list/*.*
make[1]: Leaving directory `E:/TESTING/RAVEN_1/BitCloud/Components/BSP'
Build succeeded with 0 Warnings...

 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 01:44 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

This is an output of "make clean", I need an output of "make clean all" in the case where this problem is reproduced.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 01:55 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


my mistake, the attached file shows the "make clean all" output.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 02:10 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

From this line
Code:
rm -rf ./objs/WSNCoord.o ./objs/WSNDemoApp.o ./objs/WSNEndDevice.o ./objs/WSNRouter.o ./objs/WSNSENSORMANAGER.C ./objs/WSNUARTManager.o
I see that WSNSENSORMANAGER.C is included in the list of objects.

Do you know exact change that leads to such result?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 02:28 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


I just made a change on that file, after the compile, the error message start poping up.
Now, reverted the change,"clean all" the error disappear, after that, I change wsnroutermanager back and everything fine.
If I was wrong modifying WSNSENSORMANAGER.C let me know, maybe the way I did it.
regards.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 02:33 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
I just made a change on that file, after the compile, the error message start poping up.
What change exactly?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 02:53 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Code:
static void temperatureDataReady(bool result, int16_t temperature)
{
  //save sensor data
  if (result){
     temperature = 88;
    appMessage.data.meshbean.temperature = temperature;
   }
//    appMessage.data.meshbean.temperature = CPU_TO_LE32(temperature);
  else
    appMessage.data.meshbean.temperature = CPU_TO_LE32(0);

#ifdef _LIGHT_SENSOR_
  assert(BC_SUCCESS == BSP_ReadLightData(lightDataReady), 0xf002);
#else
  lightDataReady(false, 0);
#endif //_LIGHT_SENSOR_
}

I just want to be aware on the coordinator side about that "88" value of temperature.
I'm aware that the code will override all future temperature readings.It's just a test.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 02:58 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

Are you sure you haven't changed Makefile by any chance? I really looks like error is there.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 03:08 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


No, I never touched Makefile, just working on the code.
This is the third time I see this error.
The last two times was always changing some part of the code, one after modify WSNvisualizaer.c, lighting the raven led, and the other one after added inside the states: APP_INITING_STATE\APP_PROCESS:
Code:

#ifdef _ROUTER_
BSP_OpenButtons(buttonsPressed, buttonsReleased);
#endif // _ROUTER_
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 05:46 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


one question:
I modified WSNdemo to accept interruptions (router side).
The interruption does the following:
Code:

extern AppMessageRequest_t  appMessage;
int16_t temperature;

  switch (buttonNumber){
      case BSP_KEY0:
         appSendLcdMsg("INT  0 ");
         break;
      case BSP_KEY1:
         appSendLcdMsg("INT  1 ");
           appSendLcdCmd(LCD_CMD_LED_OFF);
         break;
      case BSP_KEY2:
         appSendLcdMsg("TOO HOT");
           appSendLcdCmd(LCD_CMD_LED_ON);
         temperature=88;            
         appMessage.data.meshbean.temperature = temperature;
         break;
 }

When Interruption BSP_KEY2 is generated, I see the led on and the message, but few seconds later, the router disapears from the wsnmonitor topology map. Immediately, after removed the interruption, appears again, and wsn monitor shows 88 on temp.

I think that the "brake" command from the interruption is not returning to the execution thread.
Could you give me your opinion? Thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 05:50 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
No, I never touched Makefile, just working on the code.
Then I see no apparent connection between the error and what you are doing, your actions are perfectly valid. I guess you need to observe this for some time to see if you can find some pattern.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 05:54 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
I think that the "brake" command from the interruption is not returning to the execution thread.
Show complete code please, with all interrupt handlers, etc. It is hard to say anything meaningful from this code snippet.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 06:12 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, it's attached the entire code...
Int 0 and INT 1 are not working.(so trying with INT 2)
and the problem is the hang-up on the interruption...
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 16, 2011 - 07:24 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

And files from BSP? There is nothing wrong with the code you've sent, apart from functions being placed in header files, of course.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 16, 2011 - 08:48 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


I'm Attaching all the BSP folder to avoid forget any file...
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 17, 2011 - 06:29 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

I can't find anything wrong with the code, you'll have to debug it.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 17, 2011 - 04:36 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, I'll do that.
My experience debugging consist on smaller assembler codes, I don't have experience doing debug on bitcloud.
In this case, what do you think about using avr studio simulator?
Looking on other threads, I found that you use the serial port and put on the execution thread outputs to that serial port....
Can I use this method on raven boards? The question is because (if I remember correctly) that the serial port is actually connected to the 3290.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 17, 2011 - 04:54 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

I'd connect couple of LEDs to a free port and use them. It is simple and reliable.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 17, 2011 - 05:04 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


I Like that!
thanks!
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Mar 18, 2011 - 08:21 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


on last code, I was sending a temperature = 88º
now, on router side, if I do
Code:
void appCoordinatorTaskHandler(AppEvent_t event, void *param)
{
  param = param; // warning prevention

  switch (appDeviceState)
  {    case SENDING_DEVICE_STATE:
      switch (event)
      {
        case APP_PROCESS:
          visualizeSerialTx();
        if (appMessage.data.meshbean.temperature == 88){
         visualizeTEMP88();
        }
          appSendMessageToUsart(&appMessage.data);
          appDeviceState = STARTING_TIMER_STATE;
          appPostSubTaskTask();
          break;

I know that the value is arriving to the coordinator because I can see it on the graph of wsnmonitor.
The question is: on the transmission, is there any change of format to the field appMessage.data.meshbean.temperature ??

I can't find an explication to couldn't match temperature == 88
PD:
Code:
void visualizeTEMP88(void)
{
   appToggleLed(LED_RED);
}

And the led red was removed from his previous functions.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 18, 2011 - 08:31 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
now, on router side, if I do
You mean coordinator?

In this code SENDING state refers to sending of local coordinator's data, it has nothing to do with received over the air data. Application deals with received data in the APS_DataIndCoord() function.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 18, 2011 - 09:11 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


yes, I said router but I mean coordinator side.

I understand that the "sending state" refers to "data sending to the computer" right?
That's why I put the "if(==8Cool" there, because that is the place where the router's frame is still intact.
or not?

Anyway, if I put the if(==8Cool on any other place, the result is the same, (no change of the led).
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 18, 2011 - 09:15 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
the place where the router's frame is still intact.
There is no router's frame there at all, that is where coordinator sends its own data.

Router's data is sent from APS_DataIndCoord() function.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 18, 2011 - 09:43 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, I see that now.
Edit -> Find in files ->APS_DataIndCoord only 3 ocurrences, and all definitions.
Looking at the parameter received by the function, APS_DataInd_t is defined on aps.h, but there is no temperature field in there.
And back to bitcloud manual, IND sands for indication, I don't think there is data inside right?
Where can I found the temperature value on the coordinator code?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 18, 2011 - 09:51 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
ok, I see that now.
Edit -> Find in files ->APS_DataIndCoord only 3 ocurrences, and all definitions.
In original application it is in WSNCoord.c.

troyka wrote:
Looking at the parameter received by the function, APS_DataInd_t is defined on aps.h, but there is no temperature field in there.
Of course there is not, it is a general structure.

indData->asdu is a pointer to actual data, you need to typecast it to a pointer to AppMessage_t.

Like it is done in this case:
Code:
appSendMessageToUsart((AppMessage_t *)indData->asdu);


or in general it would be something like
Code:
AppMessage_t *msg = (AppMessage_t *)indData->asdu;

if (msg->meshbean.temperature == 88)
{
 ...
}
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 18, 2011 - 10:29 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Problem solved.
thank you
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Mar 19, 2011 - 04:25 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


I have a conceptual doubt about the last.
Router 1 informs to the coordinator that the temp. is 88 degrees.
The coordinator receives that value.
Can Router 2 read that value too from the frame sended by router 1?
so the question is: if the frame was send in a unicast formast (p2p) the other router, is reading all the frames transmitted by air? (even the ones that are not destinated to him?)
I understand that router two must be reading all transmission from his PAN on his range, just in case one of that frames was destinated to him. But I don’t know if the protocol allow me to reach that frames…
Regards!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 19, 2011 - 05:49 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Can Router 2 read that value too from the frame sended by router 1?
No, you must use either broadcast or additional unicast message.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 19, 2011 - 07:41 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


On wsndemo, if I change the message from router 1 to broadcast type, the application will continuing functioning?
I guess in this case, all nodes will be aware about the 88º, right?
I'm asking you before do nothing because it could take too much time to find out how to do that, and discover later that will not work...
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 19, 2011 - 08:05 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
On wsndemo, if I change the message from router 1 to broadcast type, the application will continuing functioning?
It should. Why not just try and see it for yourself? It will take less time then waiting for a reply.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 20, 2011 - 04:03 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


If I change on INITIAL_DEVICE_STATE/APP_PROCESS
messageParams.dstAddress.shortAddress =ALL_DEVICES_IN_PAN_ADDR;
the router can never join to the network because enters in a loop Join -> Leaving ->Join...
I assume that some of the initial control frames must be unicast.
So, moved the broadcast to the "Sending device state"
Code:
    case SENDING_DEVICE_STATE:
      switch (event)
      {
        case APP_PROCESS:
          visualizeAirTxStarted();
          APL_WRITE_LOG(0x70)
        messageParams.dstAddress.shortAddress = ALL_DEVICES_IN_PAN_ADDR;
          APS_DataReq(&messageParams);
          appDeviceState = WAITING_DEVICE_STATE;
          break;

And the same result...
could be that after joined, the control frames are in broadcast mode and generate the same problem?

so, change it to only broadcast when the event is generated:
Code:
    case SENDING_DEVICE_STATE:
      switch (event)
      {
        case APP_PROCESS:
          visualizeAirTxStarted();
          APL_WRITE_LOG(0x70)

        if(appMessage.data.meshbean.temperature==88){
                 messageParams.dstAddress.shortAddress = ALL_DEVICES_IN_PAN_ADDR;
        }

          APS_DataReq(&messageParams);
        appMessage.data.meshbean.temperature=8;

          appDeviceState = WAITING_DEVICE_STATE;
          break;

In this case, that frame was never sent because the coordinator didn't show up the red led.

Tried to start the sniffer but wsndemo uses a CS_EXT_PANID and the sniffer software only a 2 bytes panID.

could you guide me here a little please?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 20, 2011 - 04:11 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
could you guide me here a little please?
You need to start learning how to debug applications.

There is a reason why device leaves is not it? Why not trace the code find it?

In this case you need to disable APS ACKs, since you can't have them with broadcast messages: messageParams.txOptions.acknowledgedTransmission = 0;
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 20, 2011 - 08:32 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


alexru wrote:
You need to start learning how to debug applications.

Yes...I agree with you.
Turning on the led is not very useful in this case.
Tried using mkII and avrsimulator, but I can't control the program flow very well, in deed, I had seed breakpoints all over my code (I can count all of them with one hand) sometimes the cursor disappears, the micro is doing "who know what" and I have to stop manually after 10 minutes...
If you tell me "maybe that's the problem"...well...maybe that's right, but I never reach my code. Maybe bitcloud is to big to simulate that way.
I'm open mind to learn what it's necessary to debug this code... I will continue trying with simulator and led...any idea to improve debug is welcome
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 20, 2011 - 08:36 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Tried using mkII and avrsimulator
Simulator is obviously useless here, BitCloud needs a real RF-chip.

troyka wrote:
I had seed breakpoints all over my code (I can count all of them with one hand)
Not a good idea either, there is only limited amount of hardware breakpoints, more than 2-3 breakpoints at a time will just slow things down.

It also may help to put
Code:
asm("nop");
on the line where you are planning to put a break point, this way compiler won't optimize it.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Mar 21, 2011 - 02:19 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


It's working now. The "nop" was helpful, and was necessary to add acknowledgedTransmission = 0 too.
Thank you about all the help provided.

My next step now is to move on to the zigbit modules.
Due to there is no 3290 on that architecture, I think It will be possible to debug using the serial port right? and that function "writelog" or similar that I have seen over there...
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Mar 21, 2011 - 06:45 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
It will be possible to debug using the serial port right?
Sure, but I won't recommend using writeLog functions (since they don't do anything in release build).

I usually use this function, which I place in every file for simplicity:
Code:
static void write(uint8_t message)
{
  static bool log_started = false;

  if (!log_started)
  {
    UBRR1H = 0;
    UBRR1L = 25;
    UCSR1A = (1 << U2X1);
    UCSR1B = (1 << TXEN1);
    UCSR1C = (3 << UCSZ10);
    log_started = true;
  }

  UDR1 = message;
  while (!(UCSR1A & (1 << UDRE1)));
}
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 07, 2011 - 10:55 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi Alex,
Is it possible to enable pin change interrupts for port A on the raven board?
I added myself some extra code to support the PCINT on port A, but I reach a level where the stuff is defined at binary mode and I don't know how to proceed.
If it's not possible to add PCINT, how do you recommend me to add some extra 3 or 4 buttons to the board?
Maybe if there where joystick support I can solve my problem, but the joystick’s file is empty...
Thanks in advance
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 08, 2011 - 12:55 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
I added myself some extra code to support the PCINT on port A, but I reach a level where the stuff is defined at binary mode and I don't know how to proceed.
What do you mean by "binary level"? All the hardware depended stuff is open source.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 08, 2011 - 04:00 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ok, then I'm making a mistake here...
When I step the code with breakpoints, I can see that HAL_EnableIrq(IRQ_0)puts a hi logic level on EIMSK bit 0.
The same if I use HAL_EnableIrq(IRQ_1) and IRQ_2.
After that, all the external interrupt works fine.
If I use IRQ_3, it seems that there is nothing defined here...(at least for the raven board)
so, looking down the code for de definition of IRQ_x I finally reach
extern IrqCallback_t IrqCallbackList[HAL_NUM_IRQ_LINES];
and cannot find the definition of IrqCallback_t that's why I thought it could be defined on a binary way.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 08, 2011 - 04:05 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

It is defined in ./HAL/avr/atmega1284/common/include/halIrq.h.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 09, 2011 - 02:18 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Right, thank you.. I hope not making the same mistake now, but still cannot find the interruption vectors...

The problem is I cannot find the part of the code dedicated to determine which interruption is generated,...
I have to add there, the filter to select the correct pin change interruption.

Another way to explain my question:
I understand that
HAL_RegisterIrq(IRQ_1, IRQ_LOW_LEVEL, bspKey1InterruptHandler);
is used something like "pass the new interrupt vector" through bspKey1InterruptHandler.
That's ok, but if I want to use the pin change interrupt, I have to check the PCIFx register to determine the correct pin change... I think this is not contemplated by the code right?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 09, 2011 - 08:43 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

Well, there is no code to handle Pin Change interrupts in the HAL. So you need either add this code, or just define handlers in your application without modifying HAL, this will save you time when updating to the new version of BitCloud.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 09, 2011 - 04:01 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


All right, I'll do that, but I need a starting point to insert my code.
Where are located bitcloud's interruption vectors?
Regards
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 09, 2011 - 04:07 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

For already defined regular interrupts (not Pin Change interrupts) they are located in HAL/avr/atmega1284/common/src/halIrq.c.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 09, 2011 - 05:00 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


you mean the ISR(INT0_vect)function for example?
I couldn't find definitions of both, ISR and the vector.
Is that function defined in binary mode?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 09, 2011 - 05:23 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
I couldn't find definitions of both, ISR and the vector.
I don't understand what do you need. ISR() is the handler for the interrupt vector.

troyka wrote:
Is that function defined in binary mode?
Nothing hardware depended is closed.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 09, 2011 - 05:37 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Sorry that i'm not familiarized with ISR() handler, I'm mostly an assembler user and the procedure it's different.

I explain what I need:
On assembler, when the interruption is generated, the microcontroller jumps to a memory address, I'm trying to figure out what exactly happens on C and specifically how bitcloud handle that.

I assume that somehow when the interruption is generated, bitcloud can recognize different interruptions and automatically jump to ISR(INT0_vect) (if INT0 is fired)

I need to find that code who takes the decision to add the pin change code there too.

How much wrong I’m?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 09, 2011 - 05:42 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Sorry that i'm not familiarized with ISR() handler,
It is a part of the standard C library (avr-libc). It has nothing to to with the BitCloud. You need to find a tutorial on this site or just read avr-libc documentation.

ISR(INT0_vect) basically generates ISR handler code and puts jmp instruction into a vector table at the appropriate offset (INT0 in this case).

So you'll need to define something like ISR(PCINT0_vect).
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 10, 2011 - 02:54 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


That information was very helpfull, thanks.
After made the Pin Change interruption handlers, I was doing some tests:
When disabled the external interruptions using
Code:
EMPTY_INTERRUPT(INT0_vect);
EMPTY_INTERRUPT(INT1_vect);
EMPTY_INTERRUPT(INT2_vect);

The external interruptions was still working.
And the last strange thing was that if I modify the code on halirq.c with an error syntax, it's still compiling...
Syntax errors on the main C file are detected but on halirq.c I can write a letter to Santa and compile it... any idea why?
already run "make clean all"
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 10, 2011 - 03:17 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
any idea why?
After any change to the HAL you need to recompile it. Run "make clean all" in the HAL directory. Application just uses compiled library.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 10, 2011 - 03:41 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Problem solved! thank you!
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: May 13, 2011 - 04:56 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Just the same way there are "commands" to light up symbols on the raven's LCD, and to send text to the alphanumeric section. Is there any pre-defined function to send numbers to the display's time section?
Regards!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 13, 2011 - 06:28 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Is there any pre-defined function to send numbers to the display's time section?
I have no idea, we use stock LCD driver firmware, so I suppose it should include those commands, but I don't know what they are. BSP for the Raven includes complete source code for the display firmware, you may look there.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 18, 2011 - 10:07 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi, testing the following code on the board:
Code:

char post_screen[7]="   ";               
char num[10]="0123456789";
char   alfa[37]="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
appSendLcdMsg(post_screen);

The display start to show up all the numbers and letters, I think the reason was that "post_screen" was taken like a pointer and not like a string...right?
How can I do that casting?
I found some solutions on the web but no success…
Thankyou for your help!
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 19, 2011 - 06:54 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
I think the reason was that "post_screen" was taken like a pointer and not like a string...right?
I don't know what you did before, so I don't know what was wrong with it.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 19, 2011 - 02:21 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


This is the most simple code I can do and the error is similar, this time, the display start shifting from right to left the characters: "1234567@@@@@@@BBBBBB1234567 " and start again...
The @ I don't know if it's exactly @, maybe is an "e"

Code:
void APL_TaskHandler(void)
{
char   post_screen[7]="1234567";
char   post_screen2[7]="890ABCD";
appOpenLcd();
appSendLcdMsg(post_screen);
}
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: May 19, 2011 - 02:28 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Problem solved, the array was bad dimensioned....
Thaks!!
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: May 19, 2011 - 07:45 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Due to the last problem, I realise that all strings greater than 7 chars, the ATMEGA3290's functions automatically put the chars on a continuous rotating loop.
After that, all stream sended, (greater, equal or less than 7 chars) will participate on that continuous shifting...
Do you know any way to stop that shift?
regards.
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 19, 2011 - 08:52 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Do you know any way to stop that shift?
No, you should look into the 3290's code. I've never seen it myself.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 28, 2011 - 07:12 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Could you please tell me where is located/documented the 3290's code?
Sure is not on bitcloud bundle.
Do you refer to the AVR2017: RZRAVEN Firmware?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 28, 2011 - 07:14 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Could you please tell me where is located/documented the 3290's code?
It is in the BitCloud's BSP package for the Raven board. But it is unmodified copy of some standard package, I have no idea which one.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: May 30, 2011 - 09:51 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi, If I program the coordinator with:
CS_EXT_PANID = 0x00000001LL
On wsndemo I see 0x60CF
why is that?
I must specify that number with CS_WriteParameter(CS_EXT_PANID_ID, &value)
?
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: May 30, 2011 - 10:18 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi, If I program the coordinator with:
CS_EXT_PANID = 0x00000001LL
On wsndemo I see 0x60CF
why is that?
The same thing is happening using CS_WriteParameter(CS_EXT_PANID_ID, &value)
?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 31, 2011 - 07:02 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
CS_EXT_PANID = 0x00000001LL
On wsndemo I see 0x60CF
why is that?
I suspect that 0x60cf is a short PAN ID, while CS_EXT_PANID assigns extended PAN ID.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jun 03, 2011 - 02:37 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Thanks for the last, wsndemo shows the network panid as panid, that's why I was seeing a randomly address.

Another question, this is related to wsndemo (no modifications made:
When transmitting, the frame is stored in the struct
appMessage.data.meshbean.something
but when receiving? are you using a "clone" struct called msg?
AppMessage_t *msg = (AppMessage_t *)indData->asdu;

is that correct?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jun 03, 2011 - 02:44 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
are you using a "clone" struct called msg?
AppMessage_t *msg = (AppMessage_t *)indData->asdu;
msg is just a pointer, received message array is type-casted to the pointer to AppMessage_t structure.

No memory being allocated for msg here.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jun 03, 2011 - 02:49 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


ahh ok, so if I have a message already loaded in the AppMessage_t structure, it's not affected because im just using the struct format to read the memory space pointed by msg?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jun 03, 2011 - 02:52 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
ahh ok, so if I have a message already loaded in the AppMessage_t structure, it's not affected because im just using the struct format to read the memory space pointed by msg?
correct.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jun 04, 2011 - 03:37 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Time ago, watching the meshnetics software similitude’s to wsndemo, I was wondering if they bought some class of source code to modify, and then, develop that tool.
Does Atmel offer that code? (as open source or paid? )
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jun 04, 2011 - 05:09 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Time ago, watching the meshnetics software similitude’s to wsndemo, I was wondering if they bought some class of source code to modify, and then, develop that tool.
Does Atmel offer that code? (as open source or paid? )
I don't know what you are talking about. Can you elaborate?
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jun 05, 2011 - 08:28 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


I'm talking about this software:
http://www.meshnetics.com/images/WSNmonitor.jpg

It's an ATMEL's WSNdemo clone with different brand and few more (or different) features.

My question is: Is there any way to get the source code?
Is this code paid? or freeware?

This question comes up because, once you modify the ASDU on wsndemo firmware, all program's features are not compatible with the modifications made therefore they are not displayed on pc....
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jun 05, 2011 - 08:32 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
It's an ATMEL's WSNdemo clone with different brand and few more (or different) features.
This software was always called WSN Monitor, and it is called so in Atmel's reincarnation. WSNDemo is the name for the embedded part.

troyka wrote:
My question is: Is there any way to get the source code?
Nope, source code is not available.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jun 06, 2011 - 05:09 AM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Yes, you are right about the names...
sturday night (4AM) + a very "little" drink = "WSNwhat??"
Anyway, thanks for clarify the source code matter.
 
 View user's profile Send private message  
Reply with quote Back to top
hnhoan
PostPosted: Jun 06, 2011 - 04:27 PM
Hangaround


Joined: Jan 20, 2011
Posts: 115
Location: Montreal, QC., Canada

troyka, may be this can clarify a little. Atmel bought Meshnetics about 2-3 years ago. That is where all the Atmel ZigBee software came from. Correct me if I am wrong about the details. It's all Atmel now.
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Jun 06, 2011 - 04:51 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Yes, you are right.
I saw that "news" but for me wasn't clear yet, who designed first WSNmonitor and who modified...
My first thought was "Meshnetic buy the licence to ATMEL"
maybe we can buy a licence too...
But it seems that things happened just the opposite way
 
 View user's profile Send private message  
Reply with quote Back to top
troyka
PostPosted: Jun 21, 2011 - 08:53 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


Hi, any idea the purpose of initSubStateMachine();
OTAU related?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jun 21, 2011 - 09:01 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
Hi, any idea the purpose of initSubStateMachine();

Initializes sub-statemachine. Application logic is divided between 2 state machines - main one, that handles network start/rejoin/leave, and device specific one, that handles application logic (reads sensors, sends data, etc) when the main one is in the joined state.

Quote:
OTAU related?
Not at all.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
troyka
PostPosted: Jun 21, 2011 - 09:06 PM
Hangaround


Joined: Oct 28, 2009
Posts: 179


I'm guessing here but just in case here go the question:

The variable "appState" is related to the first state machine?
and the variables
"event" and "status" are related to the second one?
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: Jun 22, 2011 - 11:45 AM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

troyka wrote:
The variable "appState" is related to the first state machine?
Correct. It is a state if the main state machine.

troyka wrote:
and the variables "event" and "status" are related to the second one?
No, "event" is not a variable, it is a function parameter, it is an event state machine makes transition on.

And there is no "status" variable.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Marco84
PostPosted: May 22, 2012 - 11:39 PM
Newbie


Joined: Feb 23, 2012
Posts: 11


Hello,

I hope this topic isn't dead...
(I working with Bitcloud - WSNdemoApp in Ravens boards)
So, supose I have two ravens (both AVRRAVEN)and i have configure each coordinator and EndDevice.
Well, until here everything is great! My net is created!
But how can I send a frame from coordinator to endDevice? I can send frame from endDevice changing
WSNEndDeviceApp.c in "INITIAL_DEVICE_STATE":

messageParams.asduLength = 8;
messageParams.asdu = (uint8_t *)("ABCDEF ");
messageParams.APS_DataConf = APS_DataConf;

i can't see how do the same with the coord...

maybe i must create another EndPoint...

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 22, 2012 - 11:41 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

The same way, using APS_DataReq(). There is no "change one-line solution", you'll need to understand how demo application works and modify it accordingly.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Marco84
PostPosted: May 28, 2012 - 05:24 PM
Newbie


Joined: Feb 23, 2012
Posts: 11


Thank you alexru,

I made the coord send frames to it self (just testing) and i figure that the problem is the endDevice, it just ignore frames... i have try doing the same thing (send frames to it self) but nothing happens...

I did following changes cause i think the problem is the address:

//Configuring EndDevice like source
simpleDescriptor.AppDeviceId=CPU_TO_LE16(2);

//Configuring EnDevice like dst
messageParams.dstAddress.shortAddress=CPU_TO_LE16(2);
...
//Config msg
messageParams.asduLength=5;
messageParams.asdu = (uint8_t *)("HELLO");

//Callback
void APS_DataIndDevice(APS_DataInd_t *indData)
{
//indData = indData;

appSendLcdMsg(indData->asdu);
}

And i know that it sent frames cause APS_DataConf() works

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
Marco84
PostPosted: May 29, 2012 - 11:08 AM
Newbie


Joined: Feb 23, 2012
Posts: 11


Hello again,

i cheked that endDevice address was wrong...

I checked my real endDevice address from this:

static void ZDO_StartNetworkConf(ZDO_StartNetworkConf_t *confirmInfo)
{
//MY LINE CODE
appSendLcdMsg(confirmInfo->shortAddr);

appTaskHandler(
APP_NETWORK_STARTING_DONE,confirmInfo);
}

but i retrieve a strange result like "UUUU>>>C" what it is mean? and never is the same when i restar it, but that is because is selected randomly by the stack right?.

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
Marco84
PostPosted: May 29, 2012 - 02:31 PM
Newbie


Joined: Feb 23, 2012
Posts: 11


ok! I did it! I set the endDevice send frames to it self too.

but now i have a new issue...How coordinator extracts the short address of the frame that comes EndDevice?
The problem is here:

void APS_DataIndCoord(APS_DataInd_t *indData)
{

appSendLcdMsg(indData->asdu);

messageParams.dstAddress.shortAddress = indData->srcAddress; //ERROR!
}

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 29, 2012 - 06:47 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

1.
Quote:
messageParams.asdu = (uint8_t *)("HELLO");
is incorrect. You need to define place for headers and footers.
2. You should look at the definition of APS_DataInd_t. In this case it is indData->srcAddress.shortAddress (or .extAddress); you also need to take into account addressing mode (indData->srcAddrMode).

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Marco84
PostPosted: May 30, 2012 - 10:43 AM
Newbie


Joined: Feb 23, 2012
Posts: 11


Thanks for your reply alexru,

Quote:
You should look at the definition of APS_DataInd_t. In this case it is indData->srcAddress.shortAddress (or .extAddress); you also need to take into account addressing mode (indData->srcAddrMode).

I got it, I set the EndDevice to send frames to itself.
Code:
// Prefilling request parameters messageParams.profileId=simpleDescriptor.AppProfileId;
messageParams.dstAddrMode=APS_SHORT_ADDRESS;
messageParams.dstEndpoint=1;
messageParams.clusterId=CPU_TO_LE16(1);
messageParams.srcEndpoint=simpleDescriptor.endpoint;
messageParams.asduLength=6;
messageParams.asdu=(uint8_t *)("HELLO");
messageParams.txOptions.acknowledgedTransmission=1;
messageParams.radius=0x0;
messageParams.APS_DataConf=APS_DataConf;


to get the destAdress:

Code:
static void ZDO_StartNetworkConf(ZDO_StartNetworkConf_t *confirmInfo)
{
messageParams.dstAddress.shortAddress=confirmInfo->shortAddr;

appTaskHandler(APP_NETWORK_STARTING_DONE,confirmInfo);
}


and to show on display:

Code:
void APS_DataIndDevice(APS_DataInd_t *indData)
{
  //indData = indData;
  appSendLcdMsg(indData->asdu);
}
 
 View user's profile Send private message  
Reply with quote Back to top
Marco84
PostPosted: May 30, 2012 - 11:16 AM
Newbie


Joined: Feb 23, 2012
Posts: 11


Now, to send frames from coordinator to EndDevice.
The coordinator must get the adress of the EndDevice and use it, right?
I tried get it by APS_DataInd function but nothing...
and by ZDO_MgmtNwkUpdateNotf function and nothing too.

How do i for the Coordinator get EndDevice's address?

regards

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 30, 2012 - 05:12 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

I'm sorry, but I will not reply unless you correct the error in this line:
Code:
messageParams.asdu=(uint8_t *)("HELLO");
\
It might work right now, but you've got memory override problem here.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Marco84
PostPosted: May 31, 2012 - 12:04 PM
Newbie


Joined: Feb 23, 2012
Posts: 11


Ok, I'm taking up Header and Footer space...
So, my "HELLO" must be in data field of AppMessageRequest_t struct

and back to the same code line:
messageParams.asdu =(uint8_t *)(&appMessage.data);

EndDevice:

So, In the apropriate struct I added "myData":
Code:
//--------------------------------------------------
// ASDU
typedef struct
{
  uint8_t        header[APS_ASDU_OFFSET];
  AppMessage_t   data;
  uint8_t        footer[APS_AFFIX_LENGTH - APS_ASDU_OFFSET];
} PACK AppMessageRequest_t;
END_PACK
//--------------------------------------------------


Code:
BEGIN_PACK
typedef struct
{
  uint32_t    myData;
  uint8_t     messageType;
  uint8_t     nodeType;
  ExtAddr_t   extAddr;
  ShortAddr_t shortAddr;
  uint32_t    softVersion;
  uint32_t    channelMask;
  PanId_t     panID;
  uint8_t     workingChannel;
  ShortAddr_t parentShortAddr;
  uint8_t     lqi;
  int8_t      rssi;
  //additional field
  uint8_t     boardType;//1
  uint8_t     sensorsSize;//1
  struct {
    int32_t  battery;
    int32_t  temperature;
    int32_t  light;
  } meshbean;
} PACK AppMessage_t;


and give it "HELLO" Frame:

Code:
AppMessageRequest_t appMessage;
appMessage.data.myData        = "HELLO";
messageParams.asdu =(uint8_t *)(&appMessage.data.myData);


In Coordinator

Code:
void APS_DataIndCoord(APS_DataInd_t *indData)
{
//---------------------------------------------------
  appSendLcdMsg(indData->asdu);
//---------------------------------------------------
}


But this doesn't works properly...
What I missed?

_________________
Marco Alves
 
 View user's profile Send private message  
Reply with quote Back to top
alexru
PostPosted: May 31, 2012 - 04:52 PM
Raving lunatic


Joined: Apr 15, 2009
Posts: 4865
Location: San Jose, CA

"HELLO" is not of type uint32_t.

Compiler should have complained about this.

_________________
The opinions and views expressed by me on this forum are my own and do not represent my employer or anyone else that I’m affiliated with.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits