tests/wamp/README
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Sun, 06 Jan 2019 03:11:39 +0300
changeset 2501 eba2bbb2dd9a
parent 2289 cf0934b42d66
permissions -rw-r--r--
Make online debug optional

It could be useful for very small targets like Atmega (Arduino) and
for target bring-up there developer want to have running PLC program,
but has not implemented runtime communication yet.


TARGET_DEBUG_AND_RETAIN_DISABLE - completely disable debug and retain
functionality. Previously named TARGET_DEBUG_DISABLE.

TARGET_ONLINE_DEBUG_DISABLE - can be used to enable retain
functionality (no define TARGET_DEBUG_AND_RETAIN_DISABLE is used), but disable
online debug with corresponding RAM/FLASH overhead.

TARGET_LOGGING_DISABLE - disables logging functionality from runtime and PLC program

TARGET_EXT_SYNC_DISABLE - disables PLC program synchronization with
external events. For example, it could be used to synchronize several
PLCs that control motors for different axes.

By default all these options are off.

To test generate program for Generic target, put following files in
project files directory and run build.sh after generating PLC program.
This is very easy to integrate into makefile (Generic target).

[------------- build.sh --------------------------]
files=$(find $PWD/../build -iname '*.c' | grep -v POUS.c)
arm-none-eabi-gcc \
-DTARGET_DEBUG_AND_RETAIN_DISABLE \
-DTARGET_ONLINE_DEBUG_DISABLE \
-DTARGET_LOGGING_DISABLE \
-DTARGET_EXT_SYNC_DISABLE \
-flto -ffunction-sections -fdata-sections -I../../../../matiec/lib/C \
$files \
main.c \
-Wl,--Map=./program.map,--cref \
-nodefaultlibs --specs=nano.specs -Wl,--static -Wl,--gc-section -Wl,--start-group -lc -lm -lnosys -lgcc -Wl,--end-group
[------------------------------------------------]

[------------- main.c --------------------------]
#ifndef TARGET_DEBUG_AND_RETAIN_DISABLE
void Retain(void){}
void InValidateRetainBuffer(void){}
void ValidateRetainBuffer(void){}
#endif

extern void __run(void);
int main(void)
{
for(;;) {
__run();
// sleep common_ticktime__ ns
// add common_ticktime__ ns to __CURRENT_TIME
}
return 0;
}
[------------------------------------------------]
2194
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
     1
/* This project contains wamp client config to be loaded at runtime startup. */
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
     2
./project_files/wampconf.json
1439
a68cd4253259 Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff changeset
     3
a68cd4253259 Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff changeset
     4
wampconf.json is in "Project Files", so it is copied to runtime's working directory, and then loaded after program transfer + runtime restart.
a68cd4253259 Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff changeset
     5
a68cd4253259 Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff changeset
     6
Otherwise, wamp config file path can be forced :
1896
2081de16e726 update tests/wamp README file, based on changes from dporopat.
Edouard Tisserant
parents: 1439
diff changeset
     7
./Beremiz_service.py -c /path/to/my/wampconf.json /working/dir
1439
a68cd4253259 Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff changeset
     8
2194
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
     9
/* Crossbar install */
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    10
#sudo apt-get update
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    11
#sudo apt-get -y dist-upgrade
2289
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    12
sudo apt-get -y install build-essential libssl-dev libffi-dev libreadline-dev libbz2-dev libsqlite3-dev libncurses5dev
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    13
sudo apt-get -y install python3-pip
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    14
sudo python3 -m pip install -U pip
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    15
sudo pip3 install crossbar
2194
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    16
crossbar version
1439
a68cd4253259 Added stub code for runtime WAMP client. Added runtime command line switch to select WAMP url and Nevow web site port. Web port is now fixed, next port number is not tested if bind fails.
Edouard Tisserant
parents:
diff changeset
    17
2194
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    18
/* Start Crossbar command: */
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    19
crossbar start
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    20
35d6b9321ffd #2486 Updated wamp test project to work with the latest Crossbar version.
dporopat <denis.poropat@smarteh.si>
parents: 1896
diff changeset
    21
/* Crossbar test router configuration is available in .crossbar directory. */
1896
2081de16e726 update tests/wamp README file, based on changes from dporopat.
Edouard Tisserant
parents: 1439
diff changeset
    22
Tested on version:
2289
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    23
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    24
    :::::::::::::::::
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    25
          :::::          _____                      __
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    26
    :::::   :   :::::   / ___/____ ___   ___  ___  / /  ___ _ ____
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    27
    :::::::   :::::::  / /__ / __// _ \ (_-< (_-< / _ \/ _ `// __/
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    28
    :::::   :   :::::  \___//_/   \___//___//___//_.__/\_,_//_/
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    29
          :::::
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    30
    :::::::::::::::::   Crossbar v18.7.2
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    31
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    32
    Copyright (c) 2013-2018 Crossbar.io Technologies GmbH, licensed under AGPL 3.0.
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    33
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    34
 Crossbar.io        : 18.7.2
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    35
   Autobahn         : 18.7.1
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    36
   Twisted          : 18.7.0-EPollReactor
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    37
   LMDB             : 0.94/lmdb-0.9.22
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    38
   Python           : 3.6.6/CPython
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    39
 Frozen executable  : no
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    40
 Operating system   : Linux-4.16.0-2-rt-amd64-x86_64-with-debian-buster-sid
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    41
 Host machine       : x86_64
cf0934b42d66 Update README for WAMP example to use crossbar with python3
Andrey Skvortsov <andrej.skvortzov@gmail.com>
parents: 2288
diff changeset
    42
 Release key        : RWS9T4NltFjmKSMbEtETnOMxRjLhOEZ6e80T5MYzTTh/+NP9Jk20sJmA