This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1312R7: About the implementation of the alternative to py-spinel

Part Number: CC1312R7
Other Parts Discussed in Thread: SYSCONFIG, WI-SUN

Hi team,

Recently, I carefully examined the project code based on the Wisun-fan SDK and set up the environment for using py-spinel. Everything is working fine, and I discovered that the script commands of py-spinel are implemented by invoking other functions in the project's ncp_base_mtd.cpp file, such as ns_br_src.

 

Now, I want to replace the py-spinel tool with a certain serial port assistant as a Serial port assistant host computer and execute corresponding actions by recognizing strings received from the serial port in the project.

 

I have already implemented functionalities similar to the py-spinel tool, such as obtaining parameters like ncpversion, role, and routerstate. However, there are still some specific instructions that I am unsure how to invoke, such as the "ping" command or other data sending instructions.

 

My goal is to be able to send data to a specified node in a BR or Router by entering a string through the serial port, for example, "udp + destaddr + data."

Thanks & Best regards,

Yolande

  • Hi team,

    I want to know what is the "ping" command or other data sending instructions.

    I am looking forward to you .

    Thanks & Best regards,

    Yolande

  • Hi team,

    I tried to search, but unfortunately I did not find the relevant operation function for the ping command in ncp_base_mtd.cpp. I debugged and simulated the program ns_br_src, and found that inputting the ping command using the py-spinel tool will call the HandleDatagramFromStack() function (as shown below) ), but this is called when the NCP function is turned on. Assuming that I do not turn on the NCP function, which function will the border router (br) call to send data to the router node?

    As far as I know, in ns_coap_node, the router node as the server can use the coap_service_request_send() function to send data. Then, the border router as the client can also use the coap_service_request_send function to send data.?

    Thanks & Best regards,

    Yolande

  • Hi Yolande,

    We have one available alternative to pyspinel: the wfantund network daemon that you can fin on github: (this one uses the same ns_br hex file)

    https://github.com/TexasInstruments/ti-wisunfantund

    I don't understand what you mean by "NCP function not turned on", we only support BR in NCP mode.

    Did you see our SimpleLink Academy module on how to use CoAP messaging? It details how to send data from the RN to the BR in Task 3.

    https://dev.ti.com/tirex/explore/node?node=A__Ab5oYpAuOfLVRwkotwJZNQ__com.ti.SIMPLELINK_ACADEMY_CC13XX_CC26XX_SDK__AfkT0vQ__LATEST&placeholder=true

    Cheers,

    Marie

  • Hi Marie,

    Thank you very much for your suggestion, but before that, I have completed what you said "SimpleLink Academy module using CoAP messaging? Detailed description of how to send data from RN to BR in task 3.", my doubt now is, How to use the border router node (BR) to send any data I want to send to my designated router node (RN). For example, I want to send "Hello world" data from the BR node to a certain RN node connected to the BR node network. superior?

    Thanks & Best regards,

    Yolande

  • Hi Marie,

    Is there any updates?

    Thanks & Best regards,

    Yolande

  • Hi Yolande,

    Sending data from the BR to the RN is covered in Task 2 of the SLA I linked. It's using the LED resource, but you could switch the type from binary to string to send a "Hello world" message.

    Cheers,

    Marie H

  • Hi Marie,

    At present, I temporarily use UDP communication mode for communication between nodes. I also want to ask two questions:

    1. When using UDP communication mode, I found that after using routing nodes to form a network with other nodes, the routing nodes were powered off and stopped working. Other nodes can still communicate with each other using UDP mode. Does this mean that UDP communication mode does not require Depends on the existence of routing nodes?

    2. Regarding the update of the routing table: I found that after the successful networking, if a node is disconnected, the routing table displayed in the routing node or other nodes still contains the disconnected node information, and the routing table is not updated. I want to  know Which parameter of the project can be used to update the current routing table information in real time?

    Thanks & Best regards,

    Yolande

  • Hi Yolande,

    Starting with 2; after a device is powered off, it takes fairly long before it's considered "disconnected". I believe the timeout is around 15 mins. 

    In the next SimpleLink F2 SDK (version 7.40, expected to be released at the end of Feb), we're adding a SysConfig option to shorten this time. 

    I'm not sure I understand your question 1. If some devices are powered down, the network will use an alternative route.

    Cheers,

    Marie H

  • Hi Marie H,

    For question 1, I referred to this article before: e2e.ti.com/.../sub-1-ghz - forum/1067601/lp-cc1352p7-wi-sun-router-node-point-to-point-communication,

    I saw the technical engineer said: "For multiple hops between devices, communication needs to be carried out through BR." Based on my current situation, after successfully networking the devices, the BR nodes are connected in a decentralized manner, and the remaining nodes can still pass through Communicate via UDP. Therefore, I would like to ask, if the devices in the network use UDP communication, can the communication not go through the BR?

    Thanks & Best regards,

    Yolande

  • Hi Marie H,

    Is there any updates?

    Best regards,

    Yolande

  • Hi Yolande,

    As I said in the linked thread: For devices that have a direct connection (1-hop connection), packets can be sent directly to the neighbor. For devices with more than one hop between them, the communication needs to go through the BR.

    I don't understand your test setup. E.g. you say "BR nodes are connected in a decentralized manner", does it mean you have more than one BR? Thus more than one PAN? What does decentralized mean, is it the physical distance between the devices?

    Cheers,

    Marie

  • Hi Marie,

    Sorry, not decentralized.

    The customer's current situation is that after successfully networking the device, the BR node is disconnected, and the remaining nodes can still communicate with each other through UDP. So what I want to ask is, if the devices in the network use UDP communication, can the communication not go through the BR?

    Best regards,

    Yolande

  • Hi Marie, The previous questions were conveyed by Ms. Yolande. I am glad that I can talk to you directly.

    I'm sorry for my misrepresentation. In my current scenario, there is only one PAN network and only one BR node. What I mean is that when the devices in the PAN network are successfully networked, I let the BR disconnect and no longer work, and the other routing nodes can still communicate normally using UDP.Does that make sense?

    In addition, regarding your reply last time, I still have a question: In a successfully networked network, how can I determine whether two nodes belong to the neighbor relationship? Can it be determined by a certain parameter?

    Just like my current situation, my device has one border route and three route nodes. When the networking is successful, I query the neighbor information of each device, and the result is that each device can query three neighbor nodes. Does it mean that the three routing nodes and the border route belong to the neighbor relationship?

    Looking forward to your reply very much!

    Best regards,

    Bill

  • Hi Bill,

    Are you using unicast or multicast messages?

    When you switch off the BR router, it takes a while for the nodes in the network to register this. I suspect this is what happens. When the RN registers that it's no longer connected to a BR the whole network will essentially break apart, and all the RNs will start looking for a BR again, sending out PAN advertisement etc.

    We don't have a direct API for finding your nearest neighbors. However you can use the protocol_stack_interface_info_get() API to get the information. If you look at the ns_coap_node example, application/application.c file you can see an example in the fetch_neighbor_details() helper function:

    /*!
     * Helper function to get neighbor node metrics like rssi_in, rssi_out
     * Metrics are copied over to a global structure instance.
     */
    void fetch_neighbor_details()
    {
        protocol_interface_info_entry_t *cur;
        cur = protocol_stack_interface_info_get(IF_6LoWPAN);
    
        uint8_t max_nbrs, nbr_idx = 0;
    
        max_nbrs = cur->mac_parameters->mac_neighbor_table->list_total_size;
        cur_num_nbrs = (cur->mac_parameters->mac_neighbor_table->neighbour_list_size) - 1;
        
        // ...

    Cheers,

    Marie H

  • Hi,Marie

    I am currently using the ns_coap_node example, but I configure both the multicast and unicast port numbers to UDP_PORT (1234), and I call socket_sendto() as the data sending function, passing in the IP address of the other device or multicast address as the destination address, which can indeed achieve unicast and broadcast functions.

    As you mentioned, I was using what you call the "fetch_neighbor_details()" function, and if there's no direct API for finding your nearest neighbor right now, my question is, Is the function fetch_neighbor_details() to get information about all the nodes that are currently in the network?
    I am trying to determine if the wisun network is formed like a tree, and if so, does a hop transfer occur when socket_sendto() is called from the leaf node to the boundary node?

  • Hi Bill,

    Wi-SUN FAN is indeed a tree network. We have some basic information in the User's Guide:

    https://dev.ti.com/tirex/content/simplelink_cc13xx_cc26xx_sdk_7_10_02_23/docs/ti_wisunfan/html/wisun-stack/wisun-stack-overview.html#what-is-a-fan

    The fetch_neighbor_details() function is used to obtain RSSI information that can be forwarded to the BR in the ns_coap example. But as you can see there is a lot of information that can be extracted from the protocol_stack_interface_info_get() API.

    Cheers,

    Marie H

  • Hi Marie,

    Thank you for your answer. Finally, I would like to ask, when a new routing node joins the network, which callback function does BR use to update the node information in time?
    In addition, for the newly added routing node, can you directly obtain the IP address of the BR in the current network by which parameter?

  • Hi Bill,

    You will need the source code version of the project to be able to locate this: ns_br_src (found in the same example folder as the other Wi-SUN projects.)

    You can follow the function calls back up through the Wi-SUN Stack, but they end up in NcpBase::SendRouteTableUpdate. This sends the PROP_ROUTING_TABLE_UPDATE event to pyspinel. 

    SendRouteTableUpdate is called from nanostack_process_routing_table_update_from_stack(). This API is called from the ipv6 layer in ipv6_route_add_metric(). You can use the CCS Search functionality to trace the API calls further if you wish.

    Cheers,

    Marie H

  • Hi,Marie

    As you mentioned the ipv6_route_add_metric () function, my current practice is: every time a new node is added to the network, the BR node will broadcast the data. At this time, the newly added node can receive the broadcast information, obtain and store the IP address of the BR device, and then periodically report the data to the BR device.
    But I think this approach is unnecessary, the ipv6_route_add_metric() function you refer to is used by the BR node. For the routing node example ns_coap_node_src (or ns_node_src), is there any place where the IP information of the network BR can be obtained when the routing node joins the network?

    Best regards,

    Bill

  • Hi Bill,

    You're right, the RN receives the IP address of the BR when it joins the network. It's stored in the global variable root_unicast_addr that you find in application.c.

    Did you see our SimpleLink Academy module on how to use CoAP messaging? It details how to send data from the RN to the BR in Task 3, including code snippet.

    https://dev.ti.com/tirex/explore/node?node=A__Ab5oYpAuOfLVRwkotwJZNQ__com.ti.SIMPLELINK_ACADEMY_CC13XX_CC26XX_SDK__AfkT0vQ__LATEST&placeholder=true

    Cheers,

    Marie H