LWMesh.. how to change the routing strategy - Page 1
Forum section: electronics / general

author: welby1977
author_rank: Contributor
timestamp: November 08, 2016, 09:47:54 am
content: Hello to allsomeone tell me if there code to implement the routing levelMPRR(multi path ring routing) and the MAC layer as a B-MAC or tuneable MACfor LwMesh.I've already read:Microcontrollers & FPGAs / Re: Atmel LwMesh: How is the MAC layer implemented?I would need to create a high latency network 0.5, 1 or 2 packages per hourthink is possible with sleep? or would it be better to use the RTC?my test hardware (AVAILABLE):ATZB-212B-XPRO + ATSAMW25-XPRO << DATA SINKATZB-212B-XPRO + SAML21 XPLANED XPRO << DATA SINKATZB-212B-XPRO + XMEGA-A3BU << SOLUTION FOR BETTER TO NODEATZB-X-212B-USBATZB-X-212B-XPROBest regards to all

author: ataradov
author_rank: Super Contributor
timestamp: November 08, 2016, 04:03:15 pm
content: Quote from: welby1977 on November 08, 2016, 09:47:54 amThis is basically equivalent to rewriting 70% of the stack, since it is mostly a routing level implementation. So there is no simple answer, you need to understand how existing code works and write MPRR implementation yourself. At which point, if you are not going for a generic stack, it may be easier to create an application specific solution from scratch.Quote from: welby1977 on November 08, 2016, 09:47:54 amDo you want routing nodes to sleep as well?It all also depends on total number of nodes. With some dedication and experimentation a lot of things are possible.

author: welby1977
author_rank: Contributor
timestamp: November 10, 2016, 09:37:38 am
content: thanks very much for ataradov answer.I suspected he needed a major change of the LWMesh stack, this is a very tough job.Let me know in your opinion which I will have to restructure files ...you all nodes is terminadi that routing will go to sleep and wake up in unison to make communication in a fairly narrow time, this for energy consumption issues.<MY Work>My application is agricultural environmental monitoring for large areas.The estimated distance between the nodes and 10-50m population of node will be very high (+200).All will communicate with the data sinkcurrently I have developed an Android app (Tested in LG K8) for m24rl64 tag programming and code for reading such a devicehttp://www.avrfreaks.net/forum/atxmegaa3bu-xpld-m24lr64e-r-resolvedI did the first tests on the exampleshttp://community.atmel.com/forum/help-start-zigbit-212b-resolved<Concept Hardware>Best Regards Alex

author: ataradov
author_rank: Super Contributor
timestamp: November 10, 2016, 06:17:13 pm
content: Quote from: welby1977 on November 10, 2016, 09:37:38 amNon necessarily. LwMesh has enough APIs for you to implement everything from the application layer. You will basically bypass most of what stack is doing in the process, but it is not all that important. It all depends on your general algorithmic and programming skills.Since you only have one data sink, your task will be relatively simple. There are three basic things you will need to figure out:1. Network commissioning. Since your network is more or less static, this step may include original route discovery.2. Routing. Again, with one destination, the task will simplify a lot.3. Sleeping and synchronization. This is probably the hardest part.Here are some things I would do if I was working on this project:1. Do not use regular routing algorithms.2. Use tree structure instead of mesh. This will simplify routing.3. For sleep and synchronization reasons, make intermediate devices accumulate data from all of their children and pass it along the tree. You will save on traffic and routing.4. Each device will have multiple awake intervals - one for communicating with each child and one for communicating with the next router (as a child of some other router).5. Time intervals will have to be assigned by the central node, and maintained autonomously.This is a very brad picture, there are a lot of details to take care of, but it is not beyond abilities of any reasonable engineer. Just think though the algorithm using only one primitive - each device can communicate to other devices in RF range, no routing is available. And you will figure out what needs to be done exactly pretty fast.

author: welby1977
author_rank: Contributor
timestamp: November 11, 2016, 04:15:27 pm
content: I thank you very much for the advice.some aspects I believe to have them resolved in the node startup procedure where the app transfers the utc received by nmea (GPS smartphone) and the Start of Network (UTC start of the whole network). this to get from the nodes located in different moments a start as simultaneous as possible.at the stroke of the Network will take place Start of the definition of the levels of multipath routing.according to the scheme, with Castalia simulated and displayed with CastaliaViz, the configuration package starts from the data sink until it reaches the farthest nodeshttps://drive.google.com/open?id=0B-HI4wxq5sPzYnFCTmVGUWlJcTQThis is my PhD projectBest Regards Alex

author: welby1977
author_rank: Contributor
timestamp: November 13, 2016, 11:22:58 am
content: Hi Alex.I studied a bit the code of LWmesh.I suggested that the types of nodes are only 2END D. and D. COORDINATOREND D. becomes the generic node of the network.COORDIANTOR D. becomes the Data Sink.The ROUTER D. are excluded because not allow the Sleep MenagerI generally look for devices the following statesCode:APP_STATE_INITIAL,APP_STATE_SEND,APP_STATE_WAIT_CONF,APP_STATE_SENDING_DONE,APP_STATE_WAIT_SEND_TIMER,APP_STATE_WAIT_COMMAND_TIMER,APP_STATE_PREPARE_TO_SLEEP,APP_STATE_SLEEP,APP_STATE_WAKEUPI want to show how I would proceed at this stage, because I'm interested to have your opinion.Add the statesprevious APP_STATE_INITIAL,Code:APP_STATE_NO_INIZIALIZED,Device connected to the batteries at its birthCode:APP_STATE_INZIALIZED,After the NFC programming and data validationCode:APP_STATE_WAIT_SON_TIME,device pending the launch of the networkCode:APP_STATE_WAIT_RING_DEFINE,device waiting for the definition of the level packagesI would also ask for clarification of these sections of code that I do not understandin sleep_mgr.c fileCode:static void RTC32_SetTimeout( uint32_t alarmTimeout ){uint32_t compareValue;/* Synchronize CNT from RTC to system clock domain. */RTC32_SyncCnt();do { } while (RTC32_SyncCntBusy());/* Calculate compare time. */compareValue = RTC32.CNT + alarmTimeout;/* Wrap on period. */if (compareValue > RTC32.PER) {compareValue -= RTC32.PER;}/* Add the timeout value to get the absolute time of the alarm. */RTC32.COMP = compareValue;}how works this code/* Wrap on period. */if (compareValue > RTC32.PER) {compareValue -= RTC32.PER;}the sysTimerIt is a timer for short delays , but I can not understand how it does work..Best Regards Alex

author: ataradov
author_rank: Super Contributor
timestamp: November 13, 2016, 05:59:05 pm
content: Quote from: welby1977 on November 13, 2016, 11:22:58 amI don't have an opinion on exact states, states will change as you go. I think you need to start with just two nodes and make it work as you expect. Then once you get that base code, it will be easier to see who to scale this up.Quote from: welby1977 on November 13, 2016, 11:22:58 amNote that I'm not going to answer questions on ASF. And I generally recommend you go with a standalone version of LwMesh.Quote from: welby1977 on November 13, 2016, 11:22:58 amThis code will give delay up to the period of a timer, timer overflows on a match with the programmed period, so we are putting the expected delay on the overflowed area. Draw a few periods of timer operation on paper and you will see exactly what this code is doing.

author: welby1977
author_rank: Contributor
timestamp: November 13, 2016, 11:22:08 pm
content: Thank you very much Alex for the speedI apologize for the questionI'll try to do a trial run to see if I am progressing wellBest Regards Alex

author: welby1977
author_rank: Contributor
timestamp: July 30, 2018, 09:20:29 am
content: Hi Alex, I trust you ...unfortunately for several evnti I had to put aside the mppt routing project.I need to create a small network to measure environmental parameters.I am using the WSNdemo examples as a basis.I added the code to use the 4 channels of the ADC. it seems to work.disabling the adc after each conversion to keep the end device timings.I would like to use as a cordinator (data sink) a samw25 xpro + atzb-212-xpro (no atzb-x-212-xpro). This is to send the received data via soket.The code to receive data from routers / end devices works ...The code to open the soket works ...integrating is complicated for me ... I tried various ways.can you give me some suggestions?I thank you so muchBest regards, Alex

author: ataradov
author_rank: Super Contributor
timestamp: July 30, 2018, 04:11:22 pm
content: Quote from: welby1977 on July 30, 2018, 09:20:29 amIf you have started with ASF version of LwMesh, then I have no idea what to do. It will be hard and you just have to power though it.If you have started with a standalone version, then just add all files to the W25 project. Then compile and see what does not build, resolve, repeat. There are very few dependencies, so it should just work.

author: welby1977
author_rank: Contributor
timestamp: July 31, 2018, 11:29:56 am
content: Thank you very much Alex for the speedI used the project WSNdemo application for samd21. I modified it for the samw25 and it works ... but for sending via serial console.Below I have opened the example WINC1500_SIMPLE_TCP_CLIENT_EXAMPLE for samw25.I loaded the configuration files (pin reference) of the winc1500 in the project WSNdemo I loaded the ASF libraries as in the WIN1500_SIMPLE_TCP ...I created a function:appSoketSendMessage ((uint8_t *) & appMsg, sizeof (appMsg));to insert after:appUartSendMessage ((uint8_t *) & appMsg, sizeof (appMsg));everything compiled correctly ....but in run mode errors do not end up debugging consol ... and obviously it does not work. The two projects are completely different in terms of operating logic.It may help some similar project ... if you know it ..best regards Alex

author: ataradov
author_rank: Super Contributor
timestamp: July 31, 2018, 04:20:40 pm
content: I don't understand. Do you have one project with two stacks merged or two separate projects? Does appSoketSendMessage() work if you can it from anywhere?I don't know of any projects that use SAM W25 and LwMesh.

author: welby1977
author_rank: Contributor
timestamp: August 01, 2018, 08:51:50 am
content: Thank you very much Alex for the speedthe SAM W25 and LwMesh project I did it and it works ...but I would like this project to take advantage of the features of the sam w25 to make a connection to a cloud to store data.I should integrate the two stacks ... which I have already tried ...but with poor results.The purpose is to create a bridge to send data on the internet with only one device, which can potentially do it.I always have a plan B which plans to use two devices so as to divide the tasks.A samw25, or alternatively Arduino MKR1000, for internet connection and an atzb-x-212-xpro as network coordinator.Samw25 communicates with atzb-x-212-xpro via serial ...It may help some similar project ... to make the bridge.best regards Alex

author: ataradov
author_rank: Super Contributor
timestamp: August 01, 2018, 03:52:28 pm
content: You describe the results as "poor", but don't provide any evidence that you have actually tried to debug anything. And you are not really providing any information to help you debug things. Like what exactly does not work after the integration?Integration of two big software components is not a trivial process, I would not expect it to work right away. You have to do more debugging, it may be some thing simple.

author: welby1977
author_rank: Contributor
timestamp: August 02, 2018, 12:49:25 pm
content: Hi Alexmy current situation is as follows:if I compile with the fuction that starts sending the data with soket the coordiantore stops receiving the packets of the routers / end devices but opens the soket and communicates with TCP ..if you comment the function the network works correctly.The problem seems to be the m2m_wifi_init () functionthat at its execution it stops the reception of the packages.I assume it is a problem related to the rewriting of interrupts ...the wifi works with callback statusdo you have a suggestion? do you need more information?thanks Alex

author: ataradov
author_rank: Super Contributor
timestamp: August 02, 2018, 05:12:56 pm
content: I'm not going to debug this for you remotely. If you suspect that m2m_wifi_init() interferes with LwMesh somehow, then step through it and figure out what exactly happens.There is no easy way out, merging two big stacks is hard, you will have to work through it.

author: welby1977
author_rank: Contributor
timestamp: August 03, 2018, 09:38:45 am
content: Hi AlexI understand the possibility of a remote debugging .....This object is being developed for academic / recreational purposes onlyI have no problem to share this project with you and the world ...For the sake of completeness I share both the coordinator's project (samw25 xplained pro + + atzb-212-xpro) and that of the ED / Ro sensor nodes (atzb-x-212-xpro or atzb-x-212-usb).obviously for the nodes I recommend the atzb-x-212-xpro which have available adc on header j3.I hope this can be something you like.the projects are large, I link to Gdrive.https://drive.google.com/open?id=1Rg0frNX_Yd5jEdWqlbb1Uw1ZsHcOgHmothanks Alex

author: ataradov
author_rank: Super Contributor
timestamp: August 03, 2018, 04:46:34 pm
content: Ok, i think I was not clear. I will not do your work for you. I can guide you, but you have to actually do the work and provide specific questions. You seem to have no debugging at all so far.

author: welby1977
author_rank: Contributor
timestamp: August 07, 2018, 02:49:30 pm
content: Hi Alexto start, I thank you for looking at the code, it's actually not a clean code.unfortunately I do not have time to devote myself to solving this problem.Looking at the wiring diagrams of the two devices I noticed that both the atzb-212-xpro module and the flash memory mounted in the samw25 xplained pro are connected on the same SPI (PA16-PA17-PA18-PA19). The only one available externally in the module SamW25 ...Surely I have to study better and more ...Do you think this example could be more relevant to my case?AT15964-SmartConnect-6LoWPAN-Gateway-Intein this example they use a samd21 + WILC1000 XPRO (Similar Win1500) ...and two different channels for atzb-212-xpro and flash ...thanks Alex for your patience

author: ataradov
author_rank: Super Contributor
timestamp: August 07, 2018, 05:53:15 pm
content: I'm NOT looking into your code. If you don't have time to deal with this, then why would I?6LoWPAN is a completely different stack. It will have its own learning curve and limitations. I can't say if it will work for you.