Atmel Lightweight Mesh stack

Go To Last Post
566 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Where can i find out any available functions, is there a certain help file?

For example If I want to leave the network and re join the network on another nework, so where would I find out to leave the current network?

And is there also a libary for I2C,or timers, or do we create it ?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't leave the network. Just set another network parameters and you are done.

There are application timers, but there is no library for any peripherals - this is just a wireless stack.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great So I can jump from one network to another on the fly?

Are the timers still based on 32.768Khz

Adding Peripherals are no problem.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, you can.

Timers are based on the system clock source - RC-oscillator or external crystal. The same way as in BitCloud.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bitcloud also used 32Khz.

Can I just run on 8Mhz or 1Mhz?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BitCloud system time can run on 32 kHz, but application timers are always run from the system clock.

Yes, you can.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What about this stacks system time? Can I do without 32Khz in bom. I do not need accurate timing for my application

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is no system time in LwMesh. You only need 32 kHz crystal if you have sleeping devices or you need to calibrate your main oscillator for serial interfaces. Otherwise you don't need it at all.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Alex

Thank You

In that case I will still keep 32 Khz, as uart is required and waking up from sleep is also required?

I have download the stack and I am starting to look into it.

I got some questions...

1. As nodes can talk directly to one another, what difference do they have compared to routers? It seems from page 4 diagram in Developers guide that they can also pass on message as a router would?

2. If a node is sleeping, and a message is sent to that node. Would that just be a failed message OR does it get buffered on transmitting node or Router?

3. To make a 1284P project do I copy and paste the 1281 folder in the hal folder and make all the nessary changes in all files or just a particular file?

4. Am I correct that in the WSNDEMO folder  astudio you have multiple projects, each represent a different platform but the C files for main application is the same? Therefore you can jump from one platform to another with its own individual project file, with your same C code ?

5. My boards do not have an external flash. Is it possible to make a simple code small enough to sit in the bootloader that does a peer to peer firmware update for a node.

Thanks

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
1. As nodes can talk directly to one another, what difference do they have compared to routers? It seems from page 4 diagram in Developers guide that they can also pass on message as a router would?
Non-routing nodes are never selected as an intermediate node in the longer route. Non-routing flag is a hint to the stack that node might disappear. This is useful for sleeping nodes, but can be used in many more applications. For example mobile terminal that does not sleep, but moves around.

djoshi wrote:
2. If a node is sleeping, and a message is sent to that node. Would that just be a failed message OR does it get buffered on transmitting node or Router?
It will be failed message. Routers have no idea how to buffer anything, they don't keep track of their "children" and a device after wake up would not know who to ask for its data.

djoshi wrote:
3. To make a 1284P project do I copy and paste the 1281 folder in the hal folder and make all the nessary changes in all files or just a particular file?
Copy entire folder and make changes in all relevant places.

djoshi wrote:
4. Am I correct that in the WSNDEMO folder  astudio you have multiple projects, each represent a different platform but the C files for main application is the same? Therefore you can jump from one platform to another with its own individual project file, with your same C code ?
Correct. If you create projects for your application the same way. By default Atmel Studio wants to copy all files to the project folder. But there is a way to make a link instead of the copy in the "Add file" dialog.

djoshi wrote:
5. My boards do not have an external flash. Is it possible to make a simple code small enough to sit in the bootloader that does a peer to peer firmware update for a node.
It might be possible, but usual solution is to receive the image into second half of the flash, and then just do a switch when entire image is received. This is how standard LwMesh OTA process works.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Non-routing nodes are never selected as an intermediate node in the longer route. Non-routing flag is a hint to the stack that node might disappear. This is useful for sleeping nodes, but can be used in many more applications. For example mobile terminal that does not sleep, but moves around.

What would be seen as a longer path?

So if somthing moves around but does not sleep, then would the node just pass on the message?

So am I correct first choice is given to router and then nodes providing they do no sleep.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Please explain, what would I need to do if I wanted to make project from ATMEGA 1284P +RF230, just like all the other projects and then 1284 +rf233.This is in regards to Studio 6 setup?

Just noticed there is a soloution file along with project.

Dj

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
What would be seen as a longer path?
For example route (0)-(1)-(2). Non-routing node will never be in a position (1) because it can not be relied upon to pass messages from (0) to (2).

djoshi wrote:
So if somthing moves around but does not sleep, then would the node just pass on the message?
If contacted directly, it will, but it is not likely to happen, since other nodes will avoid sending messages though non-routing nodes. But broadcasts, for example, will be passed.

djoshi wrote:
So am I correct first choice is given to router and then nodes providing they do no sleep.
There is no first or second choice. Routing node, when it has to add a next hop address in the routing table, looks at the address. If it is a non-routing node, then it won't add the record and will wait for a routing node. If there is no routing nodes to support this route, then it will be re-discovered each time a message has to be sent.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
Please explain, what would I need to do if I wanted to make project from ATMEGA 1284P +RF230, just like all the other projects and then 1284 +rf233.This is in regards to Studio 6 setup?
You don't need to do anything special with Studio. Just open a project you like and replace all links to 1281 with links to 1284. Do the same for the radio.

djoshi wrote:
Just noticed there is a soloution file along with project.
Solution is just a simple file that links to all projects. In this case there is only one project.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, think I understood. A non routing node must be directly connected to a node in terms of RF signal for it to send data.
If for some reason it can not directly connect, then router is nessary even though another can connect to both the TX and RX ing nodes.

So in short I could setup two nodes to talk to one another and if routers do have exist also the base unit presuming RF signal is not strong enough for direct connection.

I have also read routers can sleep? But wouldent they miss out fowarding messages?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Non-routing node can send data, entire can be made out of non-routing nodes. It is just there will be no recorded routes, each new message will cause a new route discovery.

If routing node will go to sleep, it will loose frames, obviously. But you can have a network of sleeping routers that wake up from time to time, communicate data, and go to sleep. If all devices are asleep, then there is no one to miss frames from.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Non-routing node can send data, entire can be made out of non-routing nodes. It is just there will be no recorded routes, each new message will cause a new route discovery.

So does this mean non-routing nodes can forward messages, but it would start the discovery process every time?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well in regards to sleeping, you could do a sync once in while among all nodes and routers and transmit a message the setups a sleep period while all nodes are fully awake . And then setup router to wake up few seconds before the nodes.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
So does this mean non-routing nodes can forward messages, but it would start the discovery process every time?
Exactly.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
Well in regards to sleeping, you could do a sync once in while among all nodes and routers and transmit a message the setups a sleep period while all nodes are fully awake . And then setup router to wake up few seconds before the nodes.
And that is the intended use.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So if a node goes through discovery every time and message transmision is not frequent e.g 3 msg every min, then am I correct in saying I would not be much of a problem.

I can understand of applications where a continous transmission occurs might have timing issues

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Technically it is not a problem, but I would not intentionally design application like this.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok...

I am now going to start working on the project file.

I have copied the project file
ZigBit_ATmega1281_Rf230 and renamed it ATmega1284_Rf230

Under Solution I see a Hal foler.

Under That I see Atmega1281, how do I get that the point to the newly created Atmega1284 folder?

There is also a new folder called drivers, what is this?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
Under That I see Atmega1281, how do I get that the point to the newly created Atmega1284 folder?
First you need to create copies of the relevant files in the filesystem (renamed accordingly).

Then you need to change paths in the project. There are two ways of doing this:
1. "Official", but also longer and error-prone. In AS solution explorer remove links to the old files and add links to the new files.
2. Fast. Just open project file with a text editor and do search and replace of MCU and RF name. Project file is just an XML. Make sure that it is not open in AS at the moment of editing.

djoshi wrote:
There is also a new folder called drivers, what is this?
Drivers are not essential for normal stack operation, but a useful for the applications. If you don't need functionality provided by drivers, then you don't have to port them.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Let me give option 2 a go

When you say copy the relavant files you mean just copy the whole folder and rename it. In this case it will be 1284, should I be doing any more files or folders.

Now In the project file I will replace all 1281 refernce with 1284?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now the files in driver folder are missing in soloution explorer .

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, copy entire folder and replace 1281 with 1284 in the projects.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

djoshi wrote:
Now the files in driver folder are missing in soloution explorer .
Then you did something wrong. If files are present on the drive and paths in the projects are not changed (except for 1281 -> 1284), then it all should work.

Another option - just run with 1281 and change MCU in the project settings. It should work as well.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok, I just noticed the driver folder inside the hal folder, so I made a copy of the 1281 folder inside an renamed it 1284.

I then did a compile and I I go PORT E errors, As there is not PORT E's in ATMEG1284, so I changed it PORT A for now.

And it seems to remove the errors.

I now get

Unknown HAL

I think somewhere I need to introduce HAL_ATMEGA1284 ?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go to the error source. It will be obvious.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes I see why it happens,

Do I comment it out ? or do I need to add a HAL_ATMEGA1284 reference some where.

Where is the HAL_ATMEGA1281 been specified?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just add another #ifdef section by analogy. HAL_ATMEGA1281 (and 1284 now) comes from the project settings, which you have changed when you were editing XML file.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok I got it working, HAL_ATMEGA1281 is renamed HAL_atmega1284.

I am now getting all the reg error, so I guess its time to look for the equailant reg from ATMEGA1284 datasheet.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You need to preserve the case when replacing stuff in the project XML.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I am going through the files and seeing where I need to make the change.

Just out of curiosity why is that when you change from RF230 to RF231 with 1281, the internal REG of 1281 also change.

#if defined(PLATFORM_ZIGBIT)
  EICRB |= (1 << ISC51) | (1 << ISC50);
  EIMSK |= (1 << INT5);
#elif defined(PLATFORM_RCB231)
  EICRA |= (1 << ISC01) | (1 << ISC00);
  EIMSK |= (1 << INT0);

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RCB and ZigBit have radio connected to different pins. You will have to rewrite this code for your platform as well.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is due to the PCB layout of each platforms, but my layout will be the same for RF230 and RF231,RF233 so once set, i guess i don't have to change this part when i try another IC?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, here we see support for two different radios on two different platforms. In your case you'll have to write code once.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No problem, when I swap my RF I can just edit the files with in the project?

Looking this piece of code, its reflects that pin is connected to a external INT, but on the Raven boards I don't see any external INT.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

On Raven it is connected to PD6, which can be a Pin Change interrupt or Input Capture interrupt. Look at how it is done in BitCloud. You will have to do more work yourself, otherwise it is me doing everything.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Its a IRQ on the RAVAN(1284) its going to PIN PD6 PCINT30, so its a pin change, so when ever it changes this interupt will fire rather then just rising edge.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Filter out failing edges in the software, what's the problem?

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OK, thank I will have a look

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, I see how Raven interupt is set as input capture and then I see how the input capture has a edge setup.

It looks simple, let me give it a go , step by step and then get back to you with my results?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have made all changes, but seems when I debug I can not get into APP_TASKHandler().

I am always stuck at

INLINE uint8_t HAL_PhySpiWriteByteInline(uint8_t value)
{
  SPDR = value;
  while (!(SPSR & (1 << SPIF)));
  return SPDR;
}

When I click on the pause.

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you really get stuck in this function and can't get out if you single step? Not likely. Most likely you are stuck in some code that polls the radio over SPI, which means that you might have the wrong settings for the radio connection.

PS: Please delete duplicate messages yourself, or fix your internet connection.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Got it working.

I edited

HAL_UART_CHANNEL       0

inside halUart.c and set it to 1.

I have now set it to 0 as I say a HAL_UART_CHANNEL define in config.h

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to give each node a unique ID dynamically, previously I had a 64-bit UID from EEPROM? I see that a MAC address is no longer needed, is 16-bit the only ID that seperates each node?

I use to use the same MAC address as the CORD as the network ID, so every Cord had its own network, can the same be achived with this stack?

Thanks

Regards

DJ

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, all you need is 16-bit address. If you want to have dynamic allocation, then you will have to implement it yourself. Next version of the stack will include application service that implements dynamic allocation, but it will require 64-bit UIDs to work.

There is no extended network addresses, only 16-bit PAN ID. Again, it is either static, or you have to implement dynamic allocation yourself.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Does application timmer need to be stopped before going into sleeping state?

Thanks

Regards

DJ

Pages