1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

dist/tools/openvisualizer: inital support

This commit is contained in:
Francisco Molina 2020-06-25 22:37:13 +02:00
parent 985a706733
commit d01476a661
No known key found for this signature in database
GPG Key ID: 3E94EAC3DBDEEDA8
3 changed files with 333 additions and 0 deletions

View File

@ -896,6 +896,10 @@ ifneq (,$(filter iotlab-m3 wsn430-v1_3b wsn430-v1_4,$(BOARD)))
endif
endif
ifneq (,$(filter openv-%,$(MAKECMDGOALS)))
include $(RIOTBASE)/dist/tools/openvisualizer/makefile.openvisualizer.inc.mk
endif
# Include desvirt Makefile
include $(RIOTTOOLS)/desvirt/Makefile.desvirt

236
dist/tools/openvisualizer/logging.conf vendored Normal file
View File

@ -0,0 +1,236 @@
# Note Expects 'logDir' passed in with location for file output.
#============================ formatters ===============================
[formatters]
keys=std, console
[formatter_std]
format=%(asctime)s [%(name)s:%(levelname)s] %(message)s
datefmt=%H:%M:%S
[formatter_console]
class=openvisualizer.main.ColoredFormatter
format=%(asctime)s [%(name)s:%(levelname)s] %(message)s
datefmt=%H:%M:%S
#============================ handlers =================================
[handlers]
keys=std,console
[handler_std]
class=handlers.RotatingFileHandler
# args: filename, open mode, max file size, backup file count
args=('LOG_PATH/openv-server.log', 'a', 2000000, 5)
formatter=std
[handler_console]
class=StreamHandler
args=()
formatter=console
#============================ loggers ==================================
[loggers]
keys=
root,
EventBusMonitor,
EventBusClient,
OpenTun,
OpenTunMacOS,
OpenTunWindows,
OpenTunLinux,
MoteConnector,
MoteProbe,
MoteState,
OpenParser,
ParserData,
ParserPrintf,
ParserIEC,
ParserStatus,
Parser,
OpenHdlc,
OpenLbr,
SixLowPanFrag,
RPL,
SourceRoute,
JRC,
Topology,
OpenVisualizerServer,
Utils,
OVWebServer,
OVtracer,
CoAP
[logger_root]
level=ERROR
handlers=std
[logger_EventBusMonitor]
level=ERROR
handlers=std
propagate=0
qualname=EventBusMonitor
[logger_EventBusClient]
level=ERROR
handlers=std
propagate=0
qualname=EventBusClient
[logger_OpenTun]
level=ERROR
handlers=std
propagate=0
qualname=OpenTun
[logger_OpenTunWindows]
level=INFO
handlers=std, console
propagate=0
qualname=OpenTunWindows
[logger_OpenTunLinux]
level=INFO
handlers=std, console
propagate=0
qualname=OpenTunLinux
[logger_OpenTunMacOS]
level=INFO
handlers=std, console
propagate=0
qualname=OpenTunMacOS
[logger_MoteConnector]
level=ERROR
handlers=std
propagate=0
qualname=MoteConnector
[logger_MoteProbe]
level=INFO
handlers=std, console
propagate=0
qualname=MoteProbe
[logger_MoteState]
level=ERROR
handlers=std
propagate=0
qualname=MoteState
[logger_OpenParser]
level=ERROR
handlers=std
propagate=0
qualname=OpenParser
[logger_Parser]
level=ERROR
handlers=std
propagate=0
qualname=Parser
[logger_ParserIEC]
level=VERBOSE
handlers=std, console
propagate=0
qualname=ParserIEC
[logger_ParserData]
level=ERROR
handlers=std
propagate=0
qualname=ParserData
[logger_ParserPrintf]
level=INFO
handlers=std, console
propagate=0
qualname=ParserPrintf
[logger_ParserPacket]
level=ERROR
handlers=std
propagate=0
qualname=ParserPacket
[logger_ParserStatus]
level=ERROR
handlers=std
propagate=0
qualname=ParserStatus
[logger_OpenHdlc]
level=ERROR
handlers=std
propagate=0
qualname=OpenHdlc
[logger_OpenLbr]
level=ERROR
handlers=std
propagate=0
qualname=OpenLbr
[logger_SixLowPanFrag]
level=INFO
handlers=std
propagate=0
qualname=SixLowPanFrag
[logger_RPL]
level=INFO
handlers=std, console
propagate=0
qualname=RPL
[logger_SourceRoute]
level=ERROR
handlers=std
propagate=0
qualname=SourceRoute
[logger_JRC]
level=VERBOSE
handlers=std, console
propagate=0
qualname=JRC
[logger_Topology]
level=ERROR
handlers=std
propagate=0
qualname=Topology
[logger_OpenVisualizerServer]
level=VERBOSE
handlers=std, console
propagate=0
qualname=OpenVisualizerServer
[logger_Utils]
level=VERBOSE
handlers=std, console
propagate=0
qualname=Utils
[logger_OVWebServer]
level=INFO
handlers=std
propagate=0
qualname=OVWebServer
[logger_OVtracer]
level=INFO
handlers=std, console
propagate=0
qualname=OVtracer
[logger_CoAP]
level=INFO
handlers=std, console
propagate=0
qualname=coap

View File

@ -0,0 +1,93 @@
.PHONY: openv-clean openv-setroot openv-term openv-termroot
# Use a single board with openv
# ===================================
#
# OpenVisualizer runs on port 9000 by default, if that ports conflicts or
# multiple instances are spawned you will need to specify the port, eg.
# * `OPENV_FLAGS='--port=9001`
#
# Not all logs for openvisualizer are piped to the terminal, more detailed logs
# are stored in $(BINDIR)/openv-server.log
#
# More info at https://github.com/fjmolinas/openvisualizer/blob/develop_SW-318-RIOT/README.md
#
# Supported:
# * openv-term
# * openv-termroot
# * openv-termtun
# * openv-setroot
# * openv-clean
# * openv-serial
#
# Prerequisites
# -------------
#
# * Install openvisualizer:
# * git clone -b develop_SW-318-RIOT https://github.com/fjmolinas/openvisualizer.git
# * cd openvisualizer
# * pip2 install .
#
# * If using iotlab nodes, pre-requisites in makefile.iotlab.single.inc.mk
#
# * For `openv-termtun` it will require root must be able to ssh into iotlab
#
# Use full path in case it needs to be run with sudo
OPENV_SERVER_PATH := $(shell which openv-server)
OPENV_CLIENT_PATH := $(shell which openv-client)
OPENV_SERIAL_PATH := $(shell which openv-serial)
# Openvisualizer requires to know where openwsn-fw is located
OPENV_OPENWSN_FW_PATH ?= --fw-path=$(RIOTBASE)/build/pkg/openwsn
OPENV_DEFAULT_FLAGS += $(OPENV_OPENWSN_FW_PATH)
OPENV_DEFAULT_FLAGS ?=
ifneq (,$(IOTLAB_NODE))
OPENV_MOTE ?= $(IOTLAB_NODE)
OPENV_DEFAULT_FLAGS += --iotlab-motes=$(IOTLAB_NODE)
else
OPENV_MOTE += $(PORT)
OPENV_DEFAULT_FLAGS += --port-mask=$(OPENV_MOTE) --baudrate=$(BAUD)
endif
# Use modified logging configuration
OPENV_LOG_CONFIG = $(BINDIR)/logging.conf
OPENV_LOG_FILE = $(BINDIR)/openv-server.log
OPENV_DEFAULT_FLAGS += --lconf=$(OPENV_LOG_CONFIG)
$(OPENV_LOG_CONFIG): $(LAST_MAKEFILEDIR)/logging.conf
$(Q)cp $^ $@.tmp
$(Q)sed -i 's#LOG_PATH#'"$(BINDIR)"'#g' $@.tmp
$(Q)mv $@.tmp $@
# Start tun interface
ifneq (,$(filter openv-termtun,$(MAKECMDGOALS)))
OPENV_DEFAULT_FLAGS += --opentun
endif
# Optional flags to pass through command line
OPENV_FLAGS ?=
openv-term: $(OPENV_LOG_CONFIG)
openv-term: $(TERMDEPS)
$(Q)$(OPENV_SERVER_PATH) $(OPENV_DEFAULT_FLAGS) $(OPENV_FLAGS)
openv-termroot: $(OPENV_LOG_CONFIG)
openv-termroot: $(TERMDEPS)
$(Q)$(OPENV_SERVER_PATH) $(OPENV_DEFAULT_FLAGS) $(OPENV_FLAGS) --root=$(OPENV_MOTE)
openv-termtun: $(OPENV_LOG_CONFIG)
openv-termtun: $(TERMDEPS)
sudo $(OPENV_SERVER_PATH) $(OPENV_DEFAULT_FLAGS) $(OPENV_FLAGS) --root=$(OPENV_MOTE)
openv-setroot:
$(Q)$(OPENV_CLIENT_PATH) $(OPENV_OPENWSN_FW_PATH) $(OPENV_FLAGS) root=$(OPENV_MOTE)
openv-clean:
$(Q)rm -rf $(OPENV_LOG_CONFIG)
$(Q)rm -rf $(OPENV_LOG_FILE)
openv-serial:
$(Q)$(OPENV_SERIAL_PATH) --port=$(PORT) --baudrate=$(BAUD)