ents 2.3.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ents/__init__.py +23 -0
- ents/calibrate/PingSMU.py +51 -0
- ents/calibrate/PingSPS.py +66 -0
- ents/calibrate/README.md +3 -0
- ents/calibrate/__init__.py +0 -0
- ents/calibrate/linear_regression.py +78 -0
- ents/calibrate/plots.py +83 -0
- ents/calibrate/recorder.py +678 -0
- ents/calibrate/requirements.txt +9 -0
- ents/cli.py +546 -0
- ents/config/README.md +123 -0
- ents/config/__init__.py +1 -0
- ents/config/adv_trace.py +56 -0
- ents/config/user_config.py +935 -0
- ents/proto/__init__.py +33 -0
- ents/proto/decode.py +106 -0
- ents/proto/encode.py +298 -0
- ents/proto/esp32.py +179 -0
- ents/proto/soil_power_sensor_pb2.py +72 -0
- ents/simulator/__init__.py +0 -0
- ents/simulator/node.py +161 -0
- ents-2.3.2.dist-info/METADATA +206 -0
- ents-2.3.2.dist-info/RECORD +26 -0
- ents-2.3.2.dist-info/WHEEL +4 -0
- ents-2.3.2.dist-info/entry_points.txt +5 -0
- ents-2.3.2.dist-info/licenses/LICENSE +21 -0
ents/config/adv_trace.py
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""
|
|
2
|
+
@brief testing advance trace receive in stm32
|
|
3
|
+
@file adv_trace.py
|
|
4
|
+
@author Ahmed Hassan Falah
|
|
5
|
+
@date 2024-10-12
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import serial
|
|
9
|
+
import serial.tools.list_ports
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def sendToUART():
|
|
13
|
+
"""
|
|
14
|
+
Sends the encoded configuration data via UART.
|
|
15
|
+
"""
|
|
16
|
+
ser = None
|
|
17
|
+
try:
|
|
18
|
+
# Open the serial port
|
|
19
|
+
ser = serial.Serial(port="COM6", baudrate=115200, timeout=2)
|
|
20
|
+
# Send data (value 1)
|
|
21
|
+
data = bytes([1])
|
|
22
|
+
print(f"Sending: {data}")
|
|
23
|
+
ser.write(data)
|
|
24
|
+
print(
|
|
25
|
+
"________________________________________________________________________"
|
|
26
|
+
)
|
|
27
|
+
print(f"{data}")
|
|
28
|
+
|
|
29
|
+
# Read acknowledgment (1 byte)
|
|
30
|
+
ack = ser.read(1)
|
|
31
|
+
print(f"Received from STM32: {ack}")
|
|
32
|
+
print(
|
|
33
|
+
"________________________________________________________________________"
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
# Check acknowledgment
|
|
37
|
+
if ack == b"A":
|
|
38
|
+
print("Success")
|
|
39
|
+
elif ack == b"N":
|
|
40
|
+
print("Error NACK")
|
|
41
|
+
return False
|
|
42
|
+
else:
|
|
43
|
+
print("Error")
|
|
44
|
+
return False
|
|
45
|
+
|
|
46
|
+
except serial.SerialException as e:
|
|
47
|
+
print(f"UART Error: {e}")
|
|
48
|
+
return False
|
|
49
|
+
|
|
50
|
+
finally:
|
|
51
|
+
if ser is not None:
|
|
52
|
+
ser.close()
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
if __name__ == "__main__":
|
|
56
|
+
sendToUART()
|