Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 9ea123a

Browse files
committed
EM-345: Merge EM-345-port-pyd7a-from-python2-to-python3-run-sub-iot-testsuite-with-python3 to master
1 parent 372c2b4 commit 9ea123a

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

.gitlab-ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ job 2:
149149
- job 1
150150
script:
151151
- if $(lsof -i -P -n | grep -q JLinkExe) ; then exit 1; fi
152-
- if pgrep -f "python2 run.py" ; then exit 1; fi
152+
- if pgrep -f "python3 run.py" ; then exit 1; fi
153153
- cd build/apps/modem
154154
- JLinkExe -SelectEmuBySN 770821797 -CommandFile jlink-flash-full.script > flashOutput1.txt
155155
- JLinkExe -SelectEmuBySN 772958091 -CommandFile jlink-flash-full.script > flashOutput2.txt
@@ -158,20 +158,18 @@ job 2:
158158
- if grep -q 'FAILED\|ERROR' "flashOutput1.txt"; then exit 1; fi
159159
- if grep -q 'FAILED\|ERROR' "flashOutput2.txt"; then exit 1; fi
160160
job 3:
161+
image: python:3.8
161162
tags:
162163
- testsuite
163164
stage: run tests
164165
script:
165166
- if $(lsof -i -P -n | grep -q JLinkExe) ; then exit 1; fi
166-
- if pgrep -f "python2 run.py" ; then exit 1; fi
167+
- if pgrep -f "python3 run.py" ; then exit 1; fi
167168
- rm -rf Sub-IoT-testsuite
168169
- git clone --recurse-submodules https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com/aloxy/Sub-IoT-testsuite.git
169170
- cd Sub-IoT-testsuite
170-
- pip install -r requirements.txt
171-
- cd lib/pyd7a/
172-
- pip install -r requirements.txt
173-
- cd ../..
174-
- python2 run.py --serial-test-device=/dev/ttyUSB0 --serial-dut=/dev/ttyUSB1 -m "not band433 and not band915 and not known_issue" --junitxml report.xml -v
171+
- python3 -m pip install -r requirements.txt -r lib/pyd7a/requirements.txt
172+
- python3 run.py --serial-test-device=/dev/ttyUSB0 --serial-dut=/dev/ttyUSB1 -m "not band433 and not known_issue" --junitxml report.xml -v
175173
artifacts:
176174
reports:
177175
junit: Sub-IoT-testsuite/report.xml

docs/_docs/filesystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The platform should define the blockdevices to use for the filesystem. The files
2121
To do this, the platform should define `PLATFORM_METADATA_BLOCKDEVICE`, `PLATFORM_PERMANENT_BLOCKDEVICE` and `PLATFORM_VOLATILE_BLOCKDEVICE` in its platform.h (see for instance `stack/framework/hal/platforms/B_L072Z_LRWAN1/inc/platform.h`).
2222

2323
The data in the systemfiles contained in `d7ap_fs_data.c` is not hardcoded, instead it is generated.
24-
For this we use [pyd7a](https://github.com/Sub-IoT/pyd7a), which provides an API to generate the files, together with [cog](https://github.com/nedbat/cog). Cog is a code generation tool which allows to run the python code embedded in comments in `d7ap_fs_data.c` and generate output, which is used to fill the C arrays. If wanted, the filesystem data can be updated by running `PYTHONPATH="<path to pyd7a>" python2 -m cogapp -c -r stack/fs/d7ap_fs_data.c` (after installing pyd7a).
24+
For this we use [pyd7a](https://github.com/Sub-IoT/pyd7a), which provides an API to generate the files, together with [cog](https://github.com/nedbat/cog). Cog is a code generation tool which allows to run the python code embedded in comments in `d7ap_fs_data.c` and generate output, which is used to fill the C arrays. If wanted, the filesystem data can be updated by running `PYTHONPATH="<path to pyd7a>" python3 -m cogapp -c -r stack/fs/d7ap_fs_data.c` (after installing pyd7a).
2525

2626
The value of the systemfiles in `d7ap_fs_data.c` is provided as a default. If you want to override it for your application you can do it out-of-tree to keep the source in sync with upstream. To do so, set the `MODULE_D7AP_FS_USE_DEFAULT_SYSTEMFILES` cmake variable to `false` and define `fs_systemfiles` and `fs_systemfiles_file_offsets` in your application code (which can be [out-of-tree]({{ site.baseurl }}{% link _docs/out-of-tree.md %})). The easiest way is to copy `d7ap_fs_data.c` to your application directory, strip everything besides the `fs_systemfiles` and `fs_systemfiles_file_offsets` definitions, adapt file contents where needed and add it to the `APP_BUILD` sources in the app's CMakeLists.txt.
2727

stack/fs/d7ap_fs_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ LoRaWAN_OTAA_Keys = [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07] + \
9999
100100
#This is an offset to factor in the antenna gain in order to comply with max tx pow regulations. So e.g. setting this to 2 will DROP the tx power used in software by 2dBm.
101101
lorawan_antenna_gain_in_db = 1 #dBm #in EU868 the MAX_EIRP is 16dBm so this corresponds to a max TX power of 15dBm
102-
lorawan_antenna_gain = [int(bytes(lorawan_antenna_gain_in_db & 0xff))] #dBm
102+
lorawan_antenna_gain = [lorawan_antenna_gain_in_db & 0xff] #dBm
103103
lorawan_antenna_gain_file_size = 1
104104
105105
ctrl_stack_file_size = 2

0 commit comments

Comments
 (0)