UAV Gui Tool Hangs on Anonymous Node

182 views
Skip to first unread message

CyberMerln

unread,
Aug 13, 2018, 2:46:37 PM8/13/18
to UAVCAN
Ok.  By now you all know that I am still figuring all this out.  So please bear with me.  I was able to use an Arduino Uno and a CAN-Shield as a CAN-USB interface to the PC using: https://github.com/latonita/arduino-canbus-monitor.  Working on getting it over to a Teensy. But that's I stray.  Anyway The Gui does see the node and tells me that its anonymous and then hangs actually crashes.  

So I think that means its not seeing the Node name or UID.  But I am not sure how to resolve this.  I think I have to do a publish Node status and the gui does a GetNodeInfo?  really unclear on this.  Or do I have to get the UID and send that somehow?


In the gui I can see the Node ID but the next column is a ? so not sure the name is coming through?

Any guidance would be appreciated.

Thanks
Mike

Pavel Kirienko

unread,
Aug 13, 2018, 3:56:59 PM8/13/18
to cyber...@gmail.com, uav...@googlegroups.com
Hi Mike,

Please click this to assign a node ID to the local node:

image.png

This will bring the local node of UAVCAN GUI Tool out of the passive mode, allowing it to send a GetNodeInfo request to your node, thus retrieving its name and other data.

Could you share more info on crashing, please? It's the first time I'm hearing about this.

Pavel.

--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+un...@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/uavcan/73d202b3-870f-4cad-8d48-c12d612a17e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

CyberMerln

unread,
Aug 13, 2018, 4:55:12 PM8/13/18
to UAVCAN
Hi Pavel.  Again thanks for all your help.

I am not 100% sure the issue is Gui related at this point on the crashing.  Anyway with Arduino Uno and CanShield combo this is what happens:
1.  The first screen shot is on opening the Gui

Capture.PNG




2.  This next shot is after a few seconds - at this point it hangs

Capture1.PNG




Since I got the teensy version working I decided to give it a try.  Here a couple of screen shots:

Capture3.PNG

Capture4.PNG

I then click on the dynamic node button

Capture5.PNG

It shows the node I created but nothing I coming across - it appears that the node is not responding the getnodeinfo request.  At least this version doesn't hang :)


Am I missing something I need to do in the sketch or something I can use to test it with?





Pavel Kirienko

unread,
Aug 13, 2018, 5:21:00 PM8/13/18
to cyber...@gmail.com, uav...@googlegroups.com
Let's focus on the second image. The GUI tool says there that the toggle bit sequence emitted by your node is incorrect. It causes the PyUAVCAN library (the GUI tool is built on top of it) to report an error; upon seeing too many errors the tool just disconnects itself from the bus. What happens next is unclear, but right now it's not that important - we can get to that later. The first explanation that comes to mind is this: your SLCAN adapter operates in the passive mode (listen-only). In this mode, its own CAN controller cannot confirm CAN frames emitted by your node, and that (assuming that there aren't any other nodes on the bus) triggers your node to emit the same frame over and over, overwhelming the application (it is known to be a bit slow on Windows). My recommendation is to ensure that the SLCAN adapter works properly. The easiest way to check this that comes to mind is to attach a third node to the bus that is known to work properly. The third node will be acknowledging the CAN frames emitted by your node, thus avoiding endless retransmissions of the same frame. If the error disappears after that, your SLCAN adapter is probably broken or misconfigured.

Pavel.

--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+un...@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.

CyberMerln

unread,
Aug 13, 2018, 6:25:40 PM8/13/18
to UAVCAN
Attached the third node as you recommended.. Still failed.

Capture6.PNG

 The interesting thing is that publisher is still sending info, the subscriber still printing received messages and the can shield is still seeing data.

Capture7.PNG


CyberMerln

unread,
Aug 13, 2018, 6:34:02 PM8/13/18
to UAVCAN
Is there something else I am suppose to be doing with the publisher.  Right now all I am sending is the GNSS fix test message 

CyberMerln

unread,
Aug 14, 2018, 10:53:10 AM8/14/18
to UAVCAN
Going through the tutorials and basic usage this morning and think the problem maybe that I am not handling service request on the node?  This may be causing the node not to respond to getNodeInfo

CyberMerln

unread,
Aug 14, 2018, 3:17:54 PM8/14/18
to UAVCAN
Decided to give it a go.  I used tutorial 4. Services to create a service server - that compiled fine but I got a unable to start server 7 message:
"ErrInvalidTransferListener".  So I guess I set it up wrong.  Here is what I used:

using namespace uavcan;
using namespace protocol;
void startServer(Node<NodeMemoryPoolSize> *node)
{
 
/*
     * Starting the server.
     * This server doesn't do anything useful; it just prints the received request and returns some meaningless
     * response.
     *
     * The service callback accepts two arguments:
     *  - a reference to a request structure (input)
     *  - a reference to a default-initialized response structure (output)
     * The type of the input can be either of these two:
     *  - T::Request&
     *  - uavcan::ReceivedDataStructure<T::Request>&
     * The type of the output is strictly T::Response&.
     * Note that for the service data structure, it is not possible to instantiate T itself, nor does it make any
     * sense.
     *
     * In C++11 mode, callback type defaults to std::function<>.
     */

   
static ServiceServer<GetNodeInfo> srv(*node);
   
const int srv_start_res = srv.start(
       
[&](const ReceivedDataStructure<GetNodeInfo::Request>& req, GetNodeInfo::Response& rsp)
       
{
           
OStream::instance() << req << OStream::endl << OStream::endl;
           
//rsp.status = ;
           
//rsp.software_version = ;
           
//rsp.hardware_version = ;
            rsp
.name = node->getName();
       
});
   
if (srv_start_res < 0)
   
{
     
Serial.print("Unable to start server! Exiting!  ");
     
Serial.println(srv_start_res);
     
for(;;);
   
} else {
     
Serial.println("Server Starter");
   
}
}

What did I mess up now.

Pavel Kirienko

unread,
Aug 14, 2018, 3:41:47 PM8/14/18
to cyber...@gmail.com, uav...@googlegroups.com
Nope, you are not supposed to handle the GetNodeInfo request yourself, because it is already handled by the library. The error ErrInvalidTransferListener you're getting means that this service is already handled (by the library in your case).

Let's focus on the toggle bit error reported by the GUI tool. Maybe the SLCAN adapter is misbehaving or is incompatible with the SLCAN driver implemented in PyUAVCAN. I suggest starting the GUI Tool and opening the Bus Monitor (Ctrl+Shift+B) immediately; don't forget to start capture by clicking the button in the upper-left corner:

image.png

See if the data flow looks sensible.

Pavel.

--
You received this message because you are subscribed to the Google Groups "UAVCAN" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavcan+un...@googlegroups.com.
To post to this group, send email to uav...@googlegroups.com.

CyberMerln

unread,
Aug 14, 2018, 5:04:31 PM8/14/18
to UAVCAN
Well at least I learned by mistake on how to do a service request/response :)

Anyway.  Hooked everything up again.  Did what you suggested and yes the flow of data before it hung looked about right.  Here is the screenshot.  Looks like its suppose to

Capture.PNG

Pavel Kirienko

unread,
Aug 14, 2018, 5:08:58 PM8/14/18
to cyber...@gmail.com, uav...@googlegroups.com
Nope, the capture looks bad. You can see there that the last two frames of each transfer come out-of-order. I am inclined to blame the CAN adapter you are using.

Pavel.

CyberMerln

unread,
Aug 14, 2018, 5:15:44 PM8/14/18
to UAVCAN
Ok wrong again, now you know why I posted it  - will have to look closer - have different one that I just ordered coming on Thursday that I got from tindie that some one recommended in this group.  Will keep you posted. 

CyberMerln

unread,
Aug 16, 2018, 8:15:03 PM8/16/18
to UAVCAN
I just hooked up one of these: https://www.tindie.com/products/protofusion/canable-usb-to-can-bus-adapter/ on a windows 10 machine and no luck.  This version gave me an "can not initialize node as soon as I clicked the ok button on the initial connect window

George Small

unread,
Aug 16, 2018, 9:06:21 PM8/16/18
to UAVCAN
Hi CyberMerlin,

I got that same error under Windows and Linux.  I was able to get that Canable adapter to work under Linux with an extra step as defined here http://canable.io/getting-started.html


Also, if you have a few STM parts laying around I was able to get this DIY SLCAN adapter to work on Windows and Linux http://www.olliw.eu/2017/uavcan-for-hobbyists/#chapterslcanadapter 


I'll try using your Teensy lib examples up and running using my DIY SLCAN adapter this weekend and report back, 

George

George Small

unread,
Aug 16, 2018, 9:25:19 PM8/16/18
to UAVCAN
This post in particular was needed to get the Canable adapter to work https://www.rcgroups.com/forums/showpost.php?p=39900397&postcount=13

I suspect it is not a fully compliant implementation.

George Small

unread,
Aug 16, 2018, 9:32:31 PM8/16/18
to UAVCAN
I suspect best action on my part would be to just cough up the $65 and follow Pavel's recommendation https://groups.google.com/d/msg/uavcan/ErQGIHx-EuA/BU8UzXqYHQAJ


But my DIY STM32F103 based SLCAN adapter from Olliw has been working fine.

George

CyberMerln

unread,
Aug 17, 2018, 7:08:17 AM8/17/18
to UAVCAN
Hi George

Thanks for the added information on the adapter.  Going to try and contact them to see if ollimx;'s firmware would work on it.  Otherwise may just break down and get the components to put together DIY version that you mentioned.  Should have gone that way to begin with to be honest.

Thanks for the teensy UAVcan version I put together a try.  Will look forward to the feedback.  A couple of things that I am working on right now is updating the library to the latest uavcan version (was using the teensy-drive-main version which I found was a bit behind) and looking at updating flexcan driver.  We will see how that goes.

Mike

CyberMerln

unread,
Aug 18, 2018, 10:41:20 AM8/18/18
to UAVCAN
Hi Pavel

Just wanted to let you know I traced the issue to the CAN adapter firmware.  I did a kludge to get it working and started the GUI up and it worked fine.  Saw the messages and no issues.  Now I have to get it working the way it was suppose to work.  BTW it works on Teensy no problem and with any CAN breakout.  Assuming I can it working with out the Kludge I will post here.

Thanks for help
Mike

CyberMerln

unread,
Aug 19, 2018, 9:22:15 AM8/19/18
to UAVCAN
Got the fix in for the Teensy adapter.  Here's a link to the discussion: https://forum.pjrc.com/threads/53394-UAVcan-for-Teensy-3-x-Proof-of-Concept?p=185649&viewfull=1#post185649.

Thanks
Mike

Pavel Kirienko

unread,
Aug 19, 2018, 9:45:16 AM8/19/18
to cyber...@gmail.com, uav...@googlegroups.com
That's cool.

I quickly skimmed through the relevant topics and noticed that you people seem to care a great deal about ROM footprints. If that's the case, consider looking at this Q&A on the subject of static object initialization and the related overhead - your compiler may need some tweaking: https://stackoverflow.com/questions/22985570/g-using-singleton-in-an-embedded-application

Pavel.

Reply all
Reply to author
Forward
0 new messages