Closed gvz closed 11 years ago
Hmmm. I'm not sure I want to merge this. In case you're using an WSN OS (such as Contiki) that adds newline characters to the end of a logging statement this is probably fine. In the other case, or in the case where you log binary packets you need to have a possibility to differentiate between different packets, and that is typically the newline character. I would propose to have a check instead that looks if the last character is a newline character and if not prints a newline after logging the packet. WDYT?
Checking the last character would not fix the problem, because the writer sometimes adds newlines between the characters of one message. I think a good way is to write a new writer and use it. The problem is I do not know how to configure the iwsn-server to use my writer.
The writers here are not used at all in iwsn-server. This was only written for the command line client that you can use to connect to locally attached devices.
If I understand your problem correctly then you have a different problem which is that the backend does not do deframing correctly for the sensor OS you're currently running (BTW... which one are you running?). So, in the default behavior the backend will just split the byte stream coming from the device serial port on "arbitrary" positions (because it cannot assume if the sensor OS does some packeting and which). In order to make the backend split up the stream at the correct position you must call the WSN APIs setChannelPipeline method. Please see the following links of documentation:
https://github.com/wisebed/experimentation-scripts/wiki/Customizing-the-channel-pipeline https://github.com/wisebed/experimentation-scripts/wiki/Experimentation-Scripts-0.8#wb-get-supported-channelhandlers https://github.com/wisebed/experimentation-scripts/wiki/Experimentation-Scripts-0.8#wb-set-channel-pipeline
Hope this helps!
Thanks for the links they helped a lot. I am using contiki and what I am searching for is a possibility to get just the strings sent by the sensor nodes from the wb-listen script. Is it possible or do I have to parse the whole log and reformat it to its original layout?
Hi,
I just removed the redundant new lines in the StringWriter. This makes the output much more readable and now the StringWriter output is the same as the original output. In addition I did not find a case where it is necessary to add these new lines.
Regards
Georg von Zengen