From: Declan D. <dec...@gm...> - 2010-12-10 16:47:39
|
Great! Thanks for your reply! On Fri, Dec 10, 2010 at 12:40 PM, Fredrik Österlind <fr...@si...> wrote: > Hi Declan, > > See below. > > Declan Delaney skrev 2010-12-08 14:12: > > Hi All, > > Apologies if this has been answered before on the list. I have seen posts > with regard to printing but nothing particular to emulated motes or which > resulted in a solution to my problem. > > I am having an issue while printing statements in Cooja. > > I am emulating a TinyOS program, complied for telosb, using "Sky Mote > Type" mote emulation in cooja. > > I am using the Printf library - > http://docs.tinyos.net/index.php/The_TinyOS_printf_Library - for TinyOs to > print the statements. > I am unable to see the print statements in the "log listener" or serial > port for the node in cooja. > Using the same program binary on real nodes I can see the expected output > using: > >java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB0:telosb > > I have confirmed with another cooja user that the printf statements do > indeed work for emulated motes but I cannot seem to find the problem in my > own program. > > Has anyone experienced problems using the printf library with emulated > mote in cooja? > Can anyone suggest where to look, or what might be the cause of this > problem? > > > I think the general problem is that none of the COOJA developers commonly > emulate TinyOS/Sky applications, so the active message conversion is largely > untested and is not updated with new TinyOS versions. (Patches from TinyOS > experienced users are of course welcome!) > > I just had a look at the related code (SerialUI.java in > tools/cooja/java/se/sics/cooja/dialogs), and I'm not happy. > We have discussed how to implement a more generic solution. > Meanwhile, as a temporary solution, I recommend disabling the tosMode flag > (see line 329). > This Solution works. It still prints some garbage to the log listener but can be easily resolved using your suggestion below > You may also want to add something like: > lastLogMessage = lastLogMessage.replaceAll("[^\\p{Print}]", ""); > after line 341 to increase readability in the log listener. > > > > I have also been advised that I could use the TinyOS (e.g. > net.tinyos.tools.PrintfClient, net.tinyos.tools.Listen ) tools directly > by connecting to the serial port of Cooja. Looking around I cannot find how > this can be done. I assume (for some reason unknown to me) > cooja supplies some kind of serial interface that I could connect to like > so: > >java net.tinyos.tools.PrintfClient -comm serial@ > "ContikiSerialPort":telosb > To print out all serial comms - much like the log listener would do, or > would have to connect to the serial of each emulated mote.... which im not > sure how to do. > > Yes, you can use the "Serial Socket Server" plugin in COOJA. > Right-click a node in the Visualizer > Start mote plugin > Serial Socket > (SERVER). > > Connect from outside using network-mode, e.g. > > java net.tinyos.tools.Listen -comm network@localhost:60001 > I am able to connect to each node using this process. Thanks, Dec > > The raw serial output from nodes is forwarded over this socket, so you need > some tool to parse the active messages headers. > > Best, > Fredrik > > > Is my assumption here correct? > Would I have to use normal serial communication via active messages in the > program in order to avail of TinyOs serial tools or can I continue to use > the printf library and view the statements in a manner shown above? > > > Thanks for any help you can offer, > > Dec > > > > ------------------------------------------------------------------------------ > What happens now with your Lotus Notes apps - do you make another costly > upgrade, or settle for being marooned without product support? Time to move > off Lotus Notes and onto the cloud with Force.com, apps are easier to build, > use, and manage than apps on traditional platforms. Sign up for the Lotus > Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d > > > _______________________________________________ > Contiki-developers mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/contiki-developers > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Contiki-developers mailing list > Con...@li... > https://lists.sourceforge.net/lists/listinfo/contiki-developers > > |