You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requires build C extension Python module: **wiringpiook**
80
+
81
+
To build the module:
82
+
```sh
83
+
$ cd wiringpiook
84
+
$ python3 setup.py develop --user
85
+
```
75
86
76
87
The "**wiringpiook**" module only has the function "**tx()**", to transmit pulse train using gpio digital levels.
77
88
Return total transmission time in milliseconds or a negative error code.
78
89
79
-
Usage: `tx(bcm_gpio,pulse_list,repeats=4)`
90
+
Usage: `tx(bcm_gpio,pulse_list,repeats = 4)`
80
91
81
92
Example:
82
93
```python
83
-
>>> import wiringpiook
84
-
>>> wiringpiook.tx(21,[500,500,2000,2000])
94
+
>>>import wiringpiookas rf
95
+
>>>rf.tx(21,[500,500,2000,2000])
85
96
>>>20
86
97
```
87
98
99
+
The pulse list can be Python generated by [pyPiCode](https://github.com/latchdevel/pyPiCode) module, from any **picode** string or encoding any [pilight supported RF protocols.](https://github.com/latchdevel/picoder?tab=readme-ov-file#show-protocol-list)
100
+
88
101
## Process affinity to isolated CPU
89
102
For better timing accuracy when code transmit, the Python script should be executed in a CPU isolated from the OS scheduler.
90
103
91
104
CPU isolation is a powerful set of features that can be found behind the settings for workloads which rely on specific and often extreme latency or performance requirements.
92
105
93
106
"isolcpus" is one of the Linux kernel boot params that isolated certain cpus from kernel scheduling, which is especially useful if you want to dedicate some cpus for special tasks with least unwanted interruption (but cannot get to zero) in a multi-core system.
94
107
95
-
Remove the specified CPUs, as defined by the cpu_number values, from the general kernel SMP balancing and scheduler algroithms.
108
+
Remove the specified CPUs, as defined by the cpu_number values, from the general kernel SMP balancing and scheduler algorithms.
96
109
97
110
Raspberry Pi models 2, 3, 4 and Zero 2, have 4 cores, cpus: `{0,1,2,3}`, so is possible to dedicate one CPU to improve the transmission without much impact over system.
98
111
@@ -116,8 +129,8 @@ $ taskset -c 3 ./raspicode.py
116
129
117
130
Anyway, if there are CPUs isolated from the OS, Python script will try to set affinity to one of the isolated CPUs:
118
131
```
119
-
[2022-09-19 00:24:38,782] 1388 WARINING - Process id: 1388 not OS scheduler isolated cpu process affinity
120
-
[2022-09-19 00:24:38,784] 1388 WARINING - Trying to set process affinity cpu: {3}
132
+
[2022-09-19 00:24:38,782] 1388 WARNING - Process id: 1388 not OS scheduler isolated cpu process affinity
133
+
[2022-09-19 00:24:38,784] 1388 WARNING - Trying to set process affinity cpu: {3}
121
134
[2022-09-19 00:24:38,786] 1388 INFO - OK Process id: 1388 affinity cpu: {3} isolated from OS scheduler cpu: {0, 1, 2}
122
135
[2022-09-19 00:24:38,787] 1388 INFO - Web server binding to 0.0.0.0 port 8087 local url http://192.168.1.49:8087/
123
136
```
@@ -242,7 +255,7 @@ Remember that in any radio frequency system, the most important element is the a
242
255
243
256
244
257
# License
245
-
Copyright (c) 2022 Jorge Rivera. All right reserved.
258
+
Copyright (c) 2022-2024 Jorge Rivera. All right reserved.
0 commit comments