firestarter 1.3.0__tar.gz → 1.3.2__tar.gz
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.
- {firestarter-1.3.0 → firestarter-1.3.2}/PKG-INFO +1 -1
- firestarter-1.3.2/firestarter/__init__.py +1 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/firmware.py +12 -11
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/main.py +8 -1
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/serial_comm.py +20 -14
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter.egg-info/PKG-INFO +1 -1
- firestarter-1.3.0/firestarter/__init__.py +0 -1
- {firestarter-1.3.0 → firestarter-1.3.2}/.github/scripts/update_version.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/.github/workflows/publish.yml +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/.github/workflows/release.yml +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/.gitignore +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/.vscode/launch.json +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/LICENSE +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/MANIFEST.in +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/README.md +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/doc/package-details.md +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/doc/protocol-id.md +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/avr_tool.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/config.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/data/avrdude.conf +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/data/database.json +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/data/pin-maps.json +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/database.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/eprom_info.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/eprom_operations.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/hardware.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/ic_layout.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter/utils.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter.egg-info/SOURCES.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter.egg-info/dependency_links.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter.egg-info/entry_points.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter.egg-info/requires.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter.egg-info/top_level.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/firestarter_test.sh +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/pyproject.toml +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/requirements.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/setup.cfg +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/test.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/things.md +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/tools/infoic.xml +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/tools/parse_db.py +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/tools/pin-layouts.odt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/tools/verified.txt +0 -0
- {firestarter-1.3.0 → firestarter-1.3.2}/write_test.sh +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.3.2"
|
|
@@ -11,12 +11,12 @@ import os
|
|
|
11
11
|
import requests
|
|
12
12
|
|
|
13
13
|
try:
|
|
14
|
-
from .serial_comm import find_programmer, wait_for_response
|
|
14
|
+
from .serial_comm import find_programmer, wait_for_response, find_comports
|
|
15
15
|
from .config import get_config_value, set_config_value
|
|
16
16
|
from .avr_tool import Avrdude
|
|
17
17
|
from .utils import verbose
|
|
18
18
|
except ImportError:
|
|
19
|
-
from serial_comm import find_programmer, wait_for_response
|
|
19
|
+
from serial_comm import find_programmer, wait_for_response, find_comports
|
|
20
20
|
from config import get_config_value, set_config_value
|
|
21
21
|
from avr_tool import Avrdude
|
|
22
22
|
from utils import verbose
|
|
@@ -33,7 +33,7 @@ STATE_CONFIG = 14
|
|
|
33
33
|
HOME_PATH = os.path.join(os.path.expanduser("~"), ".firestarter")
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
def firmware(install, avrdude_path, port):
|
|
36
|
+
def firmware(install, avrdude_path, port, board="uno"):
|
|
37
37
|
"""
|
|
38
38
|
Handles firmware-related operations, including version check and installation.
|
|
39
39
|
|
|
@@ -51,7 +51,7 @@ def firmware(install, avrdude_path, port):
|
|
|
51
51
|
|
|
52
52
|
if install:
|
|
53
53
|
if not url:
|
|
54
|
-
version, url = latest_firmware()
|
|
54
|
+
version, url = latest_firmware(board)
|
|
55
55
|
print(f"Trying to install firmware version: {version}")
|
|
56
56
|
if not selected_port:
|
|
57
57
|
selected_port = port
|
|
@@ -80,14 +80,15 @@ def firmware_check(port=None):
|
|
|
80
80
|
try:
|
|
81
81
|
ser.write("OK".encode("ascii"))
|
|
82
82
|
resp, version = wait_for_response(ser)
|
|
83
|
-
board = "uno"
|
|
84
|
-
if ":" in version:
|
|
85
|
-
version, board = version.split(":")
|
|
86
83
|
|
|
87
|
-
if resp
|
|
84
|
+
if not resp == "OK":
|
|
88
85
|
print(f"Failed to read firmware version. {resp}: {version}")
|
|
89
86
|
return False, None, None
|
|
90
87
|
|
|
88
|
+
board = "uno"
|
|
89
|
+
if ":" in version:
|
|
90
|
+
version, board = version.split(":")
|
|
91
|
+
|
|
91
92
|
print(f"Current firmware version: {version}, for controller: {board}")
|
|
92
93
|
latest_version, url = latest_firmware(board)
|
|
93
94
|
|
|
@@ -121,9 +122,9 @@ def install_firmware(url, avrdude_path, port=None):
|
|
|
121
122
|
if port:
|
|
122
123
|
ports = [port]
|
|
123
124
|
else:
|
|
124
|
-
ports =
|
|
125
|
+
ports = find_comports()
|
|
125
126
|
if not ports:
|
|
126
|
-
print("No
|
|
127
|
+
print("No programmer found.")
|
|
127
128
|
return 1
|
|
128
129
|
|
|
129
130
|
for port in ports:
|
|
@@ -258,7 +259,7 @@ def test_avrdude_connection(avrdude):
|
|
|
258
259
|
print("Programmer connected successfully.")
|
|
259
260
|
return True
|
|
260
261
|
else:
|
|
261
|
-
print("Failed to connect to programmer.")
|
|
262
|
+
print(f"Failed to connect to programmer. {error.decode('ascii')}")
|
|
262
263
|
# if error:
|
|
263
264
|
# print(error.decode("ascii"))
|
|
264
265
|
return False
|
|
@@ -132,6 +132,13 @@ def main():
|
|
|
132
132
|
action="store_true",
|
|
133
133
|
help="Try to install the latest firmware.",
|
|
134
134
|
)
|
|
135
|
+
fw_parser.add_argument(
|
|
136
|
+
"-b",
|
|
137
|
+
"--board",
|
|
138
|
+
type=str,
|
|
139
|
+
default="uno",
|
|
140
|
+
help="Microcontroller board (optional), defaults to 'uno'."
|
|
141
|
+
)
|
|
135
142
|
fw_parser.add_argument(
|
|
136
143
|
"-p",
|
|
137
144
|
"--avrdude-path",
|
|
@@ -195,7 +202,7 @@ def main():
|
|
|
195
202
|
elif args.command == "vpp":
|
|
196
203
|
return read_vpp(args.timeout)
|
|
197
204
|
elif args.command == "fw":
|
|
198
|
-
return firmware(args.install, args.avrdude_path, args.port)
|
|
205
|
+
return firmware(args.install, args.avrdude_path, args.port, args.board)
|
|
199
206
|
elif args.command == "hw":
|
|
200
207
|
return hardware()
|
|
201
208
|
elif args.command == "config":
|
|
@@ -55,14 +55,16 @@ def check_port(port, data, baud_rate=BAUD_RATE):
|
|
|
55
55
|
while res != "OK":
|
|
56
56
|
if res == "ERROR":
|
|
57
57
|
raise Exception(msg)
|
|
58
|
-
print(f"{res} - {msg}")
|
|
59
58
|
if res == "TIMEOUT_ERROR":
|
|
60
59
|
return None
|
|
60
|
+
print(f"{res} - {msg}")
|
|
61
61
|
|
|
62
62
|
if verbose():
|
|
63
63
|
print(f"Programmer: {msg}")
|
|
64
64
|
return ser
|
|
65
65
|
except (OSError, serial.SerialException):
|
|
66
|
+
if verbose():
|
|
67
|
+
print(f"Failed to open port: {port}")
|
|
66
68
|
pass
|
|
67
69
|
|
|
68
70
|
return None
|
|
@@ -90,9 +92,13 @@ def find_comports(port=None):
|
|
|
90
92
|
for port in serial_ports:
|
|
91
93
|
if (
|
|
92
94
|
port.manufacturer
|
|
93
|
-
and (
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
and (
|
|
96
|
+
"Arduino" in port.manufacturer
|
|
97
|
+
or "FTDI" in port.manufacturer
|
|
98
|
+
or "CH340" in port.manufacturer
|
|
99
|
+
)
|
|
100
|
+
or "USB Serial" in port.description
|
|
101
|
+
) and port.device not in ports:
|
|
96
102
|
ports.append(port.device)
|
|
97
103
|
|
|
98
104
|
if verbose():
|
|
@@ -159,30 +165,31 @@ def wait_for_response(ser):
|
|
|
159
165
|
if "OK:" in res:
|
|
160
166
|
msg = res.split("OK:")[-1].strip()
|
|
161
167
|
type = "OK"
|
|
162
|
-
return
|
|
168
|
+
return
|
|
163
169
|
elif "INFO:" in res:
|
|
164
170
|
msg = res.split("INFO:")[-1].strip()
|
|
165
|
-
write_feedback("INFO",msg)
|
|
171
|
+
write_feedback("INFO", msg)
|
|
166
172
|
# return "INFO", msg
|
|
167
173
|
elif "ERROR:" in res:
|
|
168
174
|
msg = res.split("ERROR:")[-1].strip()
|
|
169
|
-
type ="ERROR"
|
|
170
|
-
return
|
|
175
|
+
type = "ERROR"
|
|
176
|
+
return
|
|
171
177
|
elif "WARN:" in res:
|
|
172
178
|
msg = res.split("WARN:")[-1].strip()
|
|
173
179
|
type = "WARN"
|
|
174
|
-
return
|
|
180
|
+
return
|
|
175
181
|
elif "DATA:" in res:
|
|
176
182
|
msg = res.split("DATA:")[-1].strip()
|
|
177
183
|
type = "DATA"
|
|
178
|
-
return
|
|
184
|
+
return
|
|
179
185
|
timeout = time.time() + 2 # Reset timeout
|
|
180
186
|
finally:
|
|
181
187
|
write_feedback(type, msg)
|
|
182
188
|
if type:
|
|
183
189
|
return type, msg
|
|
184
|
-
|
|
185
|
-
|
|
190
|
+
msg = f"Timeout, no response on {ser.portstr}"
|
|
191
|
+
write_feedback("ERROR", msg)
|
|
192
|
+
return "TIMEOUT_ERROR", msg
|
|
186
193
|
|
|
187
194
|
|
|
188
195
|
def write_feedback(type, msg):
|
|
@@ -192,11 +199,10 @@ def write_feedback(type, msg):
|
|
|
192
199
|
Args:
|
|
193
200
|
msg (str): The feedback message.
|
|
194
201
|
"""
|
|
195
|
-
if msg and verbose():
|
|
202
|
+
if msg and (verbose() or type == "ERROR" or type == "WARN"):
|
|
196
203
|
print(f"{type}: {msg}")
|
|
197
204
|
|
|
198
205
|
|
|
199
|
-
|
|
200
206
|
def read_filtered_bytes(byte_array):
|
|
201
207
|
"""
|
|
202
208
|
Filters a byte array to extract readable characters.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "1.3.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|