Openserial on non-root Openmote-B with openWSN

Hi,

Thanks for your valuable time. I am a newbie and kindly pardon me if my query is a simple one.

I have a few Openmote-B devices and I am trying with openWSN(6TiSCH stack) in RIOT. I can successfully flash a non-root Openmote-B device with “RIOT/tests/pkg_openwsn” and interact through the shell (without openwsn_serial). In order to view the debugging information, I enabled the optional module, openserial in the non-root node (USEMODULE += openwsn_serial). Now the characters printed on my screen does not appear properly (looks like some junk characters as shown below). I was going through https://api.riot-os.org/group__pkg__openwsn.html and I came across, “For non-root nodes, OpenSerial only provides debugging information so no special care needs to be taken”.

I might have missed something. Any workaround to sort out this will be very helpful.

Thanks, Jobish

Output of BOARD=openmote-b make term


/home/jobish/RIOT/dist/tools/pyterm/pyterm -p “/dev/ttyUSB1” -b “115200”
2021-03-16 16:15:15,813 # Connect to serial port /dev/ttyUSB1 Welcome to pyterm! Type ‘/exit’ to exit. 2021-03-16 16:15:16,844 # ��x���x���x���x��x��x<�x<��x<������x���x���x���x��x��x��x���x���x���x��x��x<�x<��x��x��x<�x�x��xx<x�x������x<���x���x���x���x��x��x<�x<�����������~Sm,��ͺSm,���~Sm,��nVnV_nSm, �Sm,�SmصSm, �Sm, 2021-03-16 16:15:17,174 # ��Sm, ��~Sm, ��~Sm,*Sm,�m,����E����Sm,��3;Sm,��n�Sm,�Sm,��z�z�u�~Sm, 2021-03-16 16:15:17,414 # �eSm,�Smص~~Sm,

Hi @jobishjohn, openserial uses HDLC to encode the uart data, so its normal to see rubbish. As its mentioned in the docs that output should be fed to openvisualizer, the output will thus only make sense if using openvisualizer.

In RIOT, the first configured uart device is mapped to STDIO in most cases. In OpenWSN however, the openserial tool uses uart to feed external software running on a host computer such as Openvisualizer

You can install and use directly openvisualizer in your system by following setup in GitHub - openwsn-berkeley/openvisualizer: OpenWSN software: network visualizing and gateway implementation.. If in RIOT there are some make wrappers described in dist/tools/openvisualizer/makefile.openvisualizer.inc.mk, but this required openvisualizer to be already installed.

BOARD=openmote-b make -C tests/pkg_openwsn openv-term

Hope this clarifies your issue.

@fjmolinas, thanks a lot for all the detailed response along with pointers.

Currently I have openvisualizer installed on a host laptop to which the Border router (root node) is physically connected and it works good, I can apply the commands (openv-server / openv-client) as mentioned in https://github.com/openwsn-berkeley/openvisualizer

My non-root openmote-b devices are not physically connected to the the laptop. In order to know whats happening on those devices (through viewing the debug messages), I have connected each non-root openmote-b physically to Raspberry-pi (only for testing / debugging purpose) and I can access Rpi through ssh from the host laptop to see whats happening on the non-root openmote-b end.

If the non-root openmote-b device is flashed without openwsn_serial module, I am able to get the basic information available at the device (by issuing openwsn shell commands; openwsn neigh, openwsn queue, etc…).

I am expecting that I may be able to view additional debug messages which are printed by the non-root device to Rpi terminal (if any). Something similar to the messages/info printed at the host laptop side, when we run openv-server on it. With this in mind, I enable the openwsn_serial module in the non-root openmote-b

Considering all these, I am not able to get you completely. Currently I don’t have openvisualizer in any of non-root openmote-b connected Rpis. So am I supposed to set up openvisualizer in each of these non-root OpenMote-B connected Rpi and then use openv-client? I am not sure about running multiple openv-servers (can we do that?). Considering no, any additional debug info/message can be viewed/accessed by setting up openvisualiser and using openv-client at non-root openmote-b side (which is not available through openwsn shell commands) ?.

Please pardon me if my queries seems non-sense. Thanks in advance for your valuable time and efforts.

HI @jobishjohn, openmote-b only have 1 uart available which means that you must pick between using openserial or RIOT stdio (which is required for the shell). If you have a BOARD with two uarts available then you can have openserial debug output as well as RIOT stdio output, but as I said this is not the case for openmote-b.

If the non-root openmote-b device is flashed without openwsn_serial module, I am able to get the basic information available at the device (by issuing openwsn shell commands; openwsn neigh, openwsn queue, etc…).

So this would mean that open-serial is not running. FYI, when making the port I added some RIOT style logging in OpenWSN, you can enable them with the following, to get logging with RIOT stdio.

# To enable debugging prints on OpenWSN code
export OPENWSN_LOG_LEVEL ?= LOG_DEBUG

But note, that logging/printing within the 6TSCH might disrupt timing, when openserial is used printing does not happen during TSCH operation.

Considering all these, I am not able to get you completely. Currently I don’t have openvisualizer in any of non-root openmote-b connected Rpis. So am I supposed to set up openvisualizer in each of these non-root OpenMote-B connected Rpi and then use openv-client? I am not sure about running multiple openv-servers (can we do that?). Considering no, any additional debug info/message can be viewed/accessed by setting up openvisualiser and using openv-client at non-root openmote-b side (which is not available through openwsn shell commands) ?.

You can as long as they run on different ports, please take a look RIOT/dist/tools/openvisualizer/makefile.openvisualizer.inc.mk for this. But personally, I would rather launch openvisulizer once and connect to all devices instead of multiple openvisualizer instances running on different ports, so something like openv-server (if you installed this then it should be available in your cli). You don’t need to “setup” openvisualizer, just have it connect to your motes serial output, it will then be able to parse the output and show it in human-readable way. openv-client is only used to send commands to the server AFAIK (latest development could have changed that) it does not allow you to get the logs.

Hope this answers your question.

Hi @fjmolinas, Thanks very much for the detailed response and it seems clear to me now. I will try these options with the devices and will update in this thread if anything comes up.

Thank you once again for the help and all these amazing works by the RIOT team.