Compare commits
23 Commits
f1defa98f2
...
PCB_Rev_1.
Author | SHA1 | Date | |
---|---|---|---|
8cf310e634 | |||
1ee326fd57 | |||
b627f52272 | |||
d723290e57 | |||
fbe5f0b202 | |||
f92f6a23c7 | |||
ac8be93faf | |||
059b693889 | |||
b723a80d46 | |||
26ec46eb0e | |||
d01953409e | |||
8ef469b9f1 | |||
88b572f408 | |||
75ed8e6308 | |||
bbd76e77fa | |||
dcaf56074e | |||
bc2c19dad1 | |||
8f494dfa05 | |||
e913ce6e1b | |||
d994fd25a0 | |||
cebf0db60c | |||
d524b919fd | |||
eac5dd243b |
24
Hardware/MC33660.lib
Normal file
24
Hardware/MC33660.lib
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
EESchema-LIBRARY Version 2.4
|
||||||
|
#encoding utf-8
|
||||||
|
#
|
||||||
|
# MC33660
|
||||||
|
#
|
||||||
|
DEF MC33660 U 0 40 Y Y 1 F N
|
||||||
|
F0 "U" 0 0 50 H V C CNN
|
||||||
|
F1 "MC33660" 0 -100 50 H V C CNN
|
||||||
|
F2 "" 0 0 50 H I C CNN
|
||||||
|
F3 "" 0 0 50 H I C CNN
|
||||||
|
DRAW
|
||||||
|
S -400 250 400 -350 0 1 0 N
|
||||||
|
X VBB 1 50 450 200 D 50 50 1 1 W
|
||||||
|
X NC 2 -50 -550 200 U 50 50 1 1 W
|
||||||
|
X GND 3 50 -550 200 U 50 50 1 1 W
|
||||||
|
X ISO 4 600 -50 200 L 50 50 1 1 B
|
||||||
|
X TX 5 -600 -200 200 R 50 50 1 1 O
|
||||||
|
X RX 6 -600 -50 200 R 50 50 1 1 I
|
||||||
|
X VDD 7 -50 450 200 D 50 50 1 1 W
|
||||||
|
X CEN 8 -600 100 200 R 50 50 1 1 I
|
||||||
|
ENDDRAW
|
||||||
|
ENDDEF
|
||||||
|
#
|
||||||
|
#End Library
|
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,19 @@
|
|||||||
{
|
{
|
||||||
"board": {
|
"board": {
|
||||||
|
"3dviewports": [],
|
||||||
"design_settings": {
|
"design_settings": {
|
||||||
"defaults": {
|
"defaults": {
|
||||||
"board_outline_line_width": 0.049999999999999996,
|
"apply_defaults_to_fp_fields": false,
|
||||||
"copper_line_width": 0.19999999999999998,
|
"apply_defaults_to_fp_shapes": false,
|
||||||
|
"apply_defaults_to_fp_text": false,
|
||||||
|
"board_outline_line_width": 0.05,
|
||||||
|
"copper_line_width": 0.2,
|
||||||
"copper_text_italic": false,
|
"copper_text_italic": false,
|
||||||
"copper_text_size_h": 1.5,
|
"copper_text_size_h": 1.5,
|
||||||
"copper_text_size_v": 1.5,
|
"copper_text_size_v": 1.5,
|
||||||
"copper_text_thickness": 0.3,
|
"copper_text_thickness": 0.3,
|
||||||
"copper_text_upright": false,
|
"copper_text_upright": false,
|
||||||
"courtyard_line_width": 0.049999999999999996,
|
"courtyard_line_width": 0.05,
|
||||||
"dimension_precision": 4,
|
"dimension_precision": 4,
|
||||||
"dimension_units": 3,
|
"dimension_units": 3,
|
||||||
"dimensions": {
|
"dimensions": {
|
||||||
@@ -20,13 +24,13 @@
|
|||||||
"text_position": 0,
|
"text_position": 0,
|
||||||
"units_format": 1
|
"units_format": 1
|
||||||
},
|
},
|
||||||
"fab_line_width": 0.09999999999999999,
|
"fab_line_width": 0.1,
|
||||||
"fab_text_italic": false,
|
"fab_text_italic": false,
|
||||||
"fab_text_size_h": 1.0,
|
"fab_text_size_h": 1.0,
|
||||||
"fab_text_size_v": 1.0,
|
"fab_text_size_v": 1.0,
|
||||||
"fab_text_thickness": 0.15,
|
"fab_text_thickness": 0.15,
|
||||||
"fab_text_upright": false,
|
"fab_text_upright": false,
|
||||||
"other_line_width": 0.09999999999999999,
|
"other_line_width": 0.1,
|
||||||
"other_text_italic": false,
|
"other_text_italic": false,
|
||||||
"other_text_size_h": 1.0,
|
"other_text_size_h": 1.0,
|
||||||
"other_text_size_v": 1.0,
|
"other_text_size_v": 1.0,
|
||||||
@@ -45,11 +49,100 @@
|
|||||||
"silk_text_upright": false,
|
"silk_text_upright": false,
|
||||||
"zones": {
|
"zones": {
|
||||||
"45_degree_only": false,
|
"45_degree_only": false,
|
||||||
"min_clearance": 0.19999999999999998
|
"min_clearance": 0.2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"diff_pair_dimensions": [],
|
"diff_pair_dimensions": [],
|
||||||
"drc_exclusions": [],
|
"drc_exclusions": [
|
||||||
|
[
|
||||||
|
"courtyards_overlap|118511500|75177000|1553c88f-2adb-4497-8788-967b865e436a|b792e1a3-e773-46cb-bdd0-cca64b65c21c",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"courtyards_overlap|123007000|75355000|00000000-0000-0000-0000-000061d28ad3|1553c88f-2adb-4497-8788-967b865e436a",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_issues|141478000|85575000|00000000-0000-0000-0000-000061d2ae4b|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|115824000|80772000|1553c88f-2adb-4497-8788-967b865e436a|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|124460000|93980000|f3127aa8-4fa0-47de-9985-06be44bbdf06|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|125984000|82296000|00000000-0000-0000-0000-000061d2caf2|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|129032000|77978000|00000000-0000-0000-0000-000061de69e4|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|129540000|88900000|479edbfe-22e9-482f-abe6-e8a9ee4f8095|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|132842000|93218000|00000000-0000-0000-0000-000061d28984|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|139700000|89916000|0b7b6b80-ae94-4b1b-a38e-a90a7895e1d0|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"lib_footprint_mismatch|145703000|65864500|00000000-0000-0000-0000-000061d2f827|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"malformed_courtyard|124128000|98140000|00000000-0000-0000-0000-000061d2ae4b|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"malformed_courtyard|124178000|72040000|00000000-0000-0000-0000-000061d2ae4b|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"malformed_courtyard|158828000|72040000|00000000-0000-0000-0000-000061d2ae4b|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_edge_clearance|108458000|61861000|ccc4cc25-ac17-45ef-825c-e079951ffb21|dc75368d-0996-4249-8abb-dc4cf7e8b3a4",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_edge_clearance|108458000|74901000|ccc4cc25-ac17-45ef-825c-e079951ffb21|53b3d478-aede-49e5-a9c6-af0d51081e6b",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_edge_clearance|131953000|99060000|626679e8-6101-4722-ac57-5b8d9dab4c8b|0ceda40c-021b-4e82-b42f-da6ab60c2da7",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_over_copper|124256491|96080000|5918385d-932b-42f5-93dc-b50c4d404527|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_over_copper|126686000|72160000|c0c7c21a-5ba8-4e1a-b19c-dd42f87b5e73|00000000-0000-0000-0000-000000000000",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_overlap|114722000|93418819|2389429b-e330-41bd-ae02-ffdf7f42affb|277dc3b2-ee65-405f-ac52-614baa7cb1bf",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_overlap|114807618|80226819|2cde46e7-b5a2-4709-b127-bb84cc090edc|d0190ea1-2eb5-4019-a426-876a8032a9c9",
|
||||||
|
""
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"silk_overlap|125118537|76007746|ba335760-ecfa-408d-9aa6-aeeaddbba1a7|d65dbdcd-4994-45be-8af9-98fc61c06e09",
|
||||||
|
""
|
||||||
|
]
|
||||||
|
],
|
||||||
"meta": {
|
"meta": {
|
||||||
"filename": "board_design_settings.json",
|
"filename": "board_design_settings.json",
|
||||||
"version": 2
|
"version": 2
|
||||||
@@ -57,35 +150,56 @@
|
|||||||
"rule_severities": {
|
"rule_severities": {
|
||||||
"annular_width": "error",
|
"annular_width": "error",
|
||||||
"clearance": "error",
|
"clearance": "error",
|
||||||
|
"connection_width": "warning",
|
||||||
"copper_edge_clearance": "error",
|
"copper_edge_clearance": "error",
|
||||||
|
"copper_sliver": "warning",
|
||||||
"courtyards_overlap": "error",
|
"courtyards_overlap": "error",
|
||||||
|
"creepage": "error",
|
||||||
"diff_pair_gap_out_of_range": "error",
|
"diff_pair_gap_out_of_range": "error",
|
||||||
"diff_pair_uncoupled_length_too_long": "error",
|
"diff_pair_uncoupled_length_too_long": "error",
|
||||||
"drill_out_of_range": "error",
|
"drill_out_of_range": "error",
|
||||||
"duplicate_footprints": "warning",
|
"duplicate_footprints": "warning",
|
||||||
"extra_footprint": "warning",
|
"extra_footprint": "warning",
|
||||||
|
"footprint": "error",
|
||||||
|
"footprint_filters_mismatch": "ignore",
|
||||||
|
"footprint_symbol_mismatch": "warning",
|
||||||
"footprint_type_mismatch": "error",
|
"footprint_type_mismatch": "error",
|
||||||
"hole_clearance": "error",
|
"hole_clearance": "error",
|
||||||
"hole_near_hole": "error",
|
"hole_near_hole": "error",
|
||||||
|
"hole_to_hole": "error",
|
||||||
|
"holes_co_located": "warning",
|
||||||
"invalid_outline": "error",
|
"invalid_outline": "error",
|
||||||
|
"isolated_copper": "warning",
|
||||||
"item_on_disabled_layer": "error",
|
"item_on_disabled_layer": "error",
|
||||||
"items_not_allowed": "error",
|
"items_not_allowed": "error",
|
||||||
"length_out_of_range": "error",
|
"length_out_of_range": "error",
|
||||||
|
"lib_footprint_issues": "warning",
|
||||||
|
"lib_footprint_mismatch": "warning",
|
||||||
"malformed_courtyard": "error",
|
"malformed_courtyard": "error",
|
||||||
"microvia_drill_out_of_range": "error",
|
"microvia_drill_out_of_range": "error",
|
||||||
|
"mirrored_text_on_front_layer": "warning",
|
||||||
"missing_courtyard": "ignore",
|
"missing_courtyard": "ignore",
|
||||||
"missing_footprint": "warning",
|
"missing_footprint": "warning",
|
||||||
"net_conflict": "warning",
|
"net_conflict": "warning",
|
||||||
|
"nonmirrored_text_on_back_layer": "warning",
|
||||||
"npth_inside_courtyard": "ignore",
|
"npth_inside_courtyard": "ignore",
|
||||||
"padstack": "error",
|
"padstack": "error",
|
||||||
"pth_inside_courtyard": "ignore",
|
"pth_inside_courtyard": "ignore",
|
||||||
"shorting_items": "error",
|
"shorting_items": "error",
|
||||||
|
"silk_edge_clearance": "warning",
|
||||||
"silk_over_copper": "warning",
|
"silk_over_copper": "warning",
|
||||||
"silk_overlap": "warning",
|
"silk_overlap": "warning",
|
||||||
"skew_out_of_range": "error",
|
"skew_out_of_range": "error",
|
||||||
|
"solder_mask_bridge": "error",
|
||||||
|
"starved_thermal": "error",
|
||||||
|
"text_height": "warning",
|
||||||
|
"text_on_edge_cuts": "error",
|
||||||
|
"text_thickness": "warning",
|
||||||
"through_hole_pad_without_hole": "error",
|
"through_hole_pad_without_hole": "error",
|
||||||
"too_many_vias": "error",
|
"too_many_vias": "error",
|
||||||
|
"track_angle": "error",
|
||||||
"track_dangling": "warning",
|
"track_dangling": "warning",
|
||||||
|
"track_segment_length": "error",
|
||||||
"track_width": "error",
|
"track_width": "error",
|
||||||
"tracks_crossing": "error",
|
"tracks_crossing": "error",
|
||||||
"unconnected_items": "error",
|
"unconnected_items": "error",
|
||||||
@@ -101,24 +215,100 @@
|
|||||||
"allow_microvias": false,
|
"allow_microvias": false,
|
||||||
"max_error": 0.005,
|
"max_error": 0.005,
|
||||||
"min_clearance": 0.0,
|
"min_clearance": 0.0,
|
||||||
"min_copper_edge_clearance": 0.049999999999999996,
|
"min_connection": 0.0,
|
||||||
|
"min_copper_edge_clearance": 0.05,
|
||||||
|
"min_groove_width": 0.0,
|
||||||
"min_hole_clearance": 0.25,
|
"min_hole_clearance": 0.25,
|
||||||
"min_hole_to_hole": 0.25,
|
"min_hole_to_hole": 0.25,
|
||||||
"min_microvia_diameter": 0.19999999999999998,
|
"min_microvia_diameter": 0.2,
|
||||||
"min_microvia_drill": 0.09999999999999999,
|
"min_microvia_drill": 0.1,
|
||||||
|
"min_resolved_spokes": 2,
|
||||||
"min_silk_clearance": 0.0,
|
"min_silk_clearance": 0.0,
|
||||||
|
"min_text_height": 0.8,
|
||||||
|
"min_text_thickness": 0.08,
|
||||||
"min_through_hole_diameter": 0.3,
|
"min_through_hole_diameter": 0.3,
|
||||||
"min_track_width": 0.19999999999999998,
|
"min_track_width": 0.2,
|
||||||
"min_via_annular_width": 0.049999999999999996,
|
"min_via_annular_width": 0.05,
|
||||||
"min_via_diameter": 0.39999999999999997,
|
"min_via_diameter": 0.4,
|
||||||
|
"solder_mask_to_copper_clearance": 0.005,
|
||||||
"use_height_for_length_calcs": true
|
"use_height_for_length_calcs": true
|
||||||
},
|
},
|
||||||
|
"teardrop_options": [
|
||||||
|
{
|
||||||
|
"td_onpthpad": true,
|
||||||
|
"td_onroundshapesonly": false,
|
||||||
|
"td_onsmdpad": true,
|
||||||
|
"td_ontrackend": false,
|
||||||
|
"td_onvia": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"teardrop_parameters": [
|
||||||
|
{
|
||||||
|
"td_allow_use_two_tracks": true,
|
||||||
|
"td_curve_segcount": 0,
|
||||||
|
"td_height_ratio": 1.0,
|
||||||
|
"td_length_ratio": 0.5,
|
||||||
|
"td_maxheight": 2.0,
|
||||||
|
"td_maxlen": 1.0,
|
||||||
|
"td_on_pad_in_zone": false,
|
||||||
|
"td_target_name": "td_round_shape",
|
||||||
|
"td_width_to_size_filter_ratio": 0.9
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"td_allow_use_two_tracks": true,
|
||||||
|
"td_curve_segcount": 0,
|
||||||
|
"td_height_ratio": 1.0,
|
||||||
|
"td_length_ratio": 0.5,
|
||||||
|
"td_maxheight": 2.0,
|
||||||
|
"td_maxlen": 1.0,
|
||||||
|
"td_on_pad_in_zone": false,
|
||||||
|
"td_target_name": "td_rect_shape",
|
||||||
|
"td_width_to_size_filter_ratio": 0.9
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"td_allow_use_two_tracks": true,
|
||||||
|
"td_curve_segcount": 0,
|
||||||
|
"td_height_ratio": 1.0,
|
||||||
|
"td_length_ratio": 0.5,
|
||||||
|
"td_maxheight": 2.0,
|
||||||
|
"td_maxlen": 1.0,
|
||||||
|
"td_on_pad_in_zone": false,
|
||||||
|
"td_target_name": "td_track_end",
|
||||||
|
"td_width_to_size_filter_ratio": 0.9
|
||||||
|
}
|
||||||
|
],
|
||||||
"track_widths": [
|
"track_widths": [
|
||||||
0.0,
|
0.0,
|
||||||
0.5,
|
0.5,
|
||||||
1.0,
|
1.0,
|
||||||
2.0
|
2.0
|
||||||
],
|
],
|
||||||
|
"tuning_pattern_settings": {
|
||||||
|
"diff_pair_defaults": {
|
||||||
|
"corner_radius_percentage": 80,
|
||||||
|
"corner_style": 1,
|
||||||
|
"max_amplitude": 1.0,
|
||||||
|
"min_amplitude": 0.2,
|
||||||
|
"single_sided": false,
|
||||||
|
"spacing": 1.0
|
||||||
|
},
|
||||||
|
"diff_pair_skew_defaults": {
|
||||||
|
"corner_radius_percentage": 80,
|
||||||
|
"corner_style": 1,
|
||||||
|
"max_amplitude": 1.0,
|
||||||
|
"min_amplitude": 0.2,
|
||||||
|
"single_sided": false,
|
||||||
|
"spacing": 0.6
|
||||||
|
},
|
||||||
|
"single_track_defaults": {
|
||||||
|
"corner_radius_percentage": 80,
|
||||||
|
"corner_style": 1,
|
||||||
|
"max_amplitude": 1.0,
|
||||||
|
"min_amplitude": 0.2,
|
||||||
|
"single_sided": false,
|
||||||
|
"spacing": 0.6
|
||||||
|
}
|
||||||
|
},
|
||||||
"via_dimensions": [
|
"via_dimensions": [
|
||||||
{
|
{
|
||||||
"diameter": 0.0,
|
"diameter": 0.0,
|
||||||
@@ -140,7 +330,16 @@
|
|||||||
"zones_allow_external_fillets": false,
|
"zones_allow_external_fillets": false,
|
||||||
"zones_use_no_outline": true
|
"zones_use_no_outline": true
|
||||||
},
|
},
|
||||||
"layer_presets": []
|
"ipc2581": {
|
||||||
|
"dist": "",
|
||||||
|
"distpn": "",
|
||||||
|
"internal_id": "",
|
||||||
|
"mfg": "",
|
||||||
|
"mpn": ""
|
||||||
|
},
|
||||||
|
"layer_pairs": [],
|
||||||
|
"layer_presets": [],
|
||||||
|
"viewports": []
|
||||||
},
|
},
|
||||||
"boards": [],
|
"boards": [],
|
||||||
"cvpcb": {
|
"cvpcb": {
|
||||||
@@ -331,11 +530,21 @@
|
|||||||
"different_unit_net": "error",
|
"different_unit_net": "error",
|
||||||
"duplicate_reference": "error",
|
"duplicate_reference": "error",
|
||||||
"duplicate_sheet_names": "error",
|
"duplicate_sheet_names": "error",
|
||||||
|
"endpoint_off_grid": "warning",
|
||||||
"extra_units": "error",
|
"extra_units": "error",
|
||||||
|
"footprint_filter": "ignore",
|
||||||
|
"footprint_link_issues": "warning",
|
||||||
|
"four_way_junction": "ignore",
|
||||||
"global_label_dangling": "warning",
|
"global_label_dangling": "warning",
|
||||||
"hier_label_mismatch": "error",
|
"hier_label_mismatch": "error",
|
||||||
"label_dangling": "error",
|
"label_dangling": "error",
|
||||||
|
"label_multiple_wires": "warning",
|
||||||
"lib_symbol_issues": "warning",
|
"lib_symbol_issues": "warning",
|
||||||
|
"lib_symbol_mismatch": "warning",
|
||||||
|
"missing_bidi_pin": "warning",
|
||||||
|
"missing_input_pin": "warning",
|
||||||
|
"missing_power_pin": "error",
|
||||||
|
"missing_unit": "warning",
|
||||||
"multiple_net_names": "warning",
|
"multiple_net_names": "warning",
|
||||||
"net_not_bus_member": "warning",
|
"net_not_bus_member": "warning",
|
||||||
"no_connect_connected": "warning",
|
"no_connect_connected": "warning",
|
||||||
@@ -344,8 +553,14 @@
|
|||||||
"pin_not_driven": "error",
|
"pin_not_driven": "error",
|
||||||
"pin_to_pin": "warning",
|
"pin_to_pin": "warning",
|
||||||
"power_pin_not_driven": "error",
|
"power_pin_not_driven": "error",
|
||||||
|
"same_local_global_label": "warning",
|
||||||
|
"similar_label_and_power": "warning",
|
||||||
"similar_labels": "warning",
|
"similar_labels": "warning",
|
||||||
|
"similar_power": "warning",
|
||||||
|
"simulation_model_issue": "ignore",
|
||||||
|
"single_global_label": "ignore",
|
||||||
"unannotated": "error",
|
"unannotated": "error",
|
||||||
|
"unconnected_wire_endpoint": "warning",
|
||||||
"unit_value_mismatch": "error",
|
"unit_value_mismatch": "error",
|
||||||
"unresolved_variable": "error",
|
"unresolved_variable": "error",
|
||||||
"wire_dangling": "error"
|
"wire_dangling": "error"
|
||||||
@@ -357,12 +572,12 @@
|
|||||||
},
|
},
|
||||||
"meta": {
|
"meta": {
|
||||||
"filename": "oiler SMD.kicad_pro",
|
"filename": "oiler SMD.kicad_pro",
|
||||||
"version": 1
|
"version": 3
|
||||||
},
|
},
|
||||||
"net_settings": {
|
"net_settings": {
|
||||||
"classes": [
|
"classes": [
|
||||||
{
|
{
|
||||||
"bus_width": 12.0,
|
"bus_width": 12,
|
||||||
"clearance": 0.2,
|
"clearance": 0.2,
|
||||||
"diff_pair_gap": 0.25,
|
"diff_pair_gap": 0.25,
|
||||||
"diff_pair_via_gap": 0.25,
|
"diff_pair_via_gap": 0.25,
|
||||||
@@ -372,32 +587,112 @@
|
|||||||
"microvia_drill": 0.1,
|
"microvia_drill": 0.1,
|
||||||
"name": "Default",
|
"name": "Default",
|
||||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||||
|
"priority": 2147483647,
|
||||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||||
"track_width": 0.25,
|
"track_width": 0.25,
|
||||||
"via_diameter": 0.8,
|
"via_diameter": 0.8,
|
||||||
"via_drill": 0.4,
|
"via_drill": 0.4,
|
||||||
"wire_width": 6.0
|
"wire_width": 6
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"meta": {
|
"meta": {
|
||||||
"version": 2
|
"version": 4
|
||||||
},
|
},
|
||||||
"net_colors": null
|
"net_colors": null,
|
||||||
|
"netclass_assignments": null,
|
||||||
|
"netclass_patterns": []
|
||||||
},
|
},
|
||||||
"pcbnew": {
|
"pcbnew": {
|
||||||
"last_paths": {
|
"last_paths": {
|
||||||
"gencad": "",
|
"gencad": "",
|
||||||
"idf": "",
|
"idf": "",
|
||||||
"netlist": "Rehoiler SMD.net",
|
"netlist": "Rehoiler SMD.net",
|
||||||
|
"plot": "",
|
||||||
|
"pos_files": "",
|
||||||
"specctra_dsn": "",
|
"specctra_dsn": "",
|
||||||
"step": "",
|
"step": "",
|
||||||
|
"svg": "",
|
||||||
"vrml": ""
|
"vrml": ""
|
||||||
},
|
},
|
||||||
"page_layout_descr_file": ""
|
"page_layout_descr_file": ""
|
||||||
},
|
},
|
||||||
"schematic": {
|
"schematic": {
|
||||||
"annotate_start_num": 0,
|
"annotate_start_num": 0,
|
||||||
|
"bom_export_filename": "${PROJECTNAME}.csv",
|
||||||
|
"bom_fmt_presets": [],
|
||||||
|
"bom_fmt_settings": {
|
||||||
|
"field_delimiter": ",",
|
||||||
|
"keep_line_breaks": false,
|
||||||
|
"keep_tabs": false,
|
||||||
|
"name": "CSV",
|
||||||
|
"ref_delimiter": ",",
|
||||||
|
"ref_range_delimiter": "",
|
||||||
|
"string_delimiter": "\""
|
||||||
|
},
|
||||||
|
"bom_presets": [],
|
||||||
|
"bom_settings": {
|
||||||
|
"exclude_dnp": false,
|
||||||
|
"fields_ordered": [
|
||||||
|
{
|
||||||
|
"group_by": false,
|
||||||
|
"label": "Reference",
|
||||||
|
"name": "Reference",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": false,
|
||||||
|
"label": "Qty",
|
||||||
|
"name": "${QUANTITY}",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": true,
|
||||||
|
"label": "Value",
|
||||||
|
"name": "Value",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": true,
|
||||||
|
"label": "DNP",
|
||||||
|
"name": "${DNP}",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": true,
|
||||||
|
"label": "Exclude from BOM",
|
||||||
|
"name": "${EXCLUDE_FROM_BOM}",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": true,
|
||||||
|
"label": "Exclude from Board",
|
||||||
|
"name": "${EXCLUDE_FROM_BOARD}",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": true,
|
||||||
|
"label": "Footprint",
|
||||||
|
"name": "Footprint",
|
||||||
|
"show": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"group_by": false,
|
||||||
|
"label": "Datasheet",
|
||||||
|
"name": "Datasheet",
|
||||||
|
"show": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"filter_string": "",
|
||||||
|
"group_symbols": true,
|
||||||
|
"include_excluded_from_bom": true,
|
||||||
|
"name": "Default Editing",
|
||||||
|
"sort_asc": true,
|
||||||
|
"sort_field": "Referenz"
|
||||||
|
},
|
||||||
|
"connection_grid_size": 50.0,
|
||||||
"drawing": {
|
"drawing": {
|
||||||
|
"dashed_lines_dash_length_ratio": 12.0,
|
||||||
|
"dashed_lines_gap_length_ratio": 3.0,
|
||||||
"default_line_thickness": 6.0,
|
"default_line_thickness": 6.0,
|
||||||
"default_text_size": 50.0,
|
"default_text_size": 50.0,
|
||||||
"field_names": [],
|
"field_names": [],
|
||||||
@@ -408,6 +703,11 @@
|
|||||||
"intersheets_ref_suffix": "",
|
"intersheets_ref_suffix": "",
|
||||||
"junction_size_choice": 3,
|
"junction_size_choice": 3,
|
||||||
"label_size_ratio": 0.25,
|
"label_size_ratio": 0.25,
|
||||||
|
"operating_point_overlay_i_precision": 3,
|
||||||
|
"operating_point_overlay_i_range": "~A",
|
||||||
|
"operating_point_overlay_v_precision": 3,
|
||||||
|
"operating_point_overlay_v_range": "~V",
|
||||||
|
"overbar_offset_ratio": 1.23,
|
||||||
"pin_symbol_size": 25.0,
|
"pin_symbol_size": 25.0,
|
||||||
"text_offset_ratio": 0.08
|
"text_offset_ratio": 0.08
|
||||||
},
|
},
|
||||||
@@ -423,20 +723,26 @@
|
|||||||
"meta": {
|
"meta": {
|
||||||
"version": 0
|
"version": 0
|
||||||
},
|
},
|
||||||
"model_mode": 0,
|
"model_mode": 4,
|
||||||
"workbook_filename": ""
|
"workbook_filename": ""
|
||||||
},
|
},
|
||||||
"page_layout_descr_file": "",
|
"page_layout_descr_file": "",
|
||||||
"plot_directory": "",
|
"plot_directory": "",
|
||||||
|
"space_save_all_events": true,
|
||||||
"spice_adjust_passive_values": false,
|
"spice_adjust_passive_values": false,
|
||||||
|
"spice_current_sheet_as_root": false,
|
||||||
"spice_external_command": "spice \"%I\"",
|
"spice_external_command": "spice \"%I\"",
|
||||||
|
"spice_model_current_sheet_as_root": true,
|
||||||
|
"spice_save_all_currents": false,
|
||||||
|
"spice_save_all_dissipations": false,
|
||||||
|
"spice_save_all_voltages": false,
|
||||||
"subpart_first_id": 65,
|
"subpart_first_id": 65,
|
||||||
"subpart_id_separator": 0
|
"subpart_id_separator": 0
|
||||||
},
|
},
|
||||||
"sheets": [
|
"sheets": [
|
||||||
[
|
[
|
||||||
"b1ddb058-f7b2-429c-9489-f4e2242ad7e5",
|
"b1ddb058-f7b2-429c-9489-f4e2242ad7e5",
|
||||||
""
|
"Root"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"text_variables": {}
|
"text_variables": {}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,257 +0,0 @@
|
|||||||
update=03.01.2022 00:33:13
|
|
||||||
version=1
|
|
||||||
last_client=kicad
|
|
||||||
[general]
|
|
||||||
version=1
|
|
||||||
RootSch=
|
|
||||||
BoardNm=
|
|
||||||
[cvpcb]
|
|
||||||
version=1
|
|
||||||
NetIExt=net
|
|
||||||
[eeschema]
|
|
||||||
version=1
|
|
||||||
LibDir=
|
|
||||||
[eeschema/libraries]
|
|
||||||
[schematic_editor]
|
|
||||||
version=1
|
|
||||||
PageLayoutDescrFile=
|
|
||||||
PlotDirectoryName=
|
|
||||||
SubpartIdSeparator=0
|
|
||||||
SubpartFirstId=65
|
|
||||||
NetFmtName=Pcbnew
|
|
||||||
SpiceAjustPassiveValues=0
|
|
||||||
LabSize=50
|
|
||||||
ERC_TestSimilarLabels=1
|
|
||||||
[pcbnew]
|
|
||||||
version=1
|
|
||||||
PageLayoutDescrFile=
|
|
||||||
LastNetListRead=Rehoiler SMD.net
|
|
||||||
CopperLayerCount=2
|
|
||||||
BoardThickness=1.6
|
|
||||||
AllowMicroVias=0
|
|
||||||
AllowBlindVias=0
|
|
||||||
RequireCourtyardDefinitions=0
|
|
||||||
ProhibitOverlappingCourtyards=1
|
|
||||||
MinTrackWidth=0.2
|
|
||||||
MinViaDiameter=0.4
|
|
||||||
MinViaDrill=0.3
|
|
||||||
MinMicroViaDiameter=0.2
|
|
||||||
MinMicroViaDrill=0.09999999999999999
|
|
||||||
MinHoleToHole=0.25
|
|
||||||
TrackWidth1=0.25
|
|
||||||
TrackWidth2=0.5
|
|
||||||
TrackWidth3=1
|
|
||||||
TrackWidth4=2
|
|
||||||
ViaDiameter1=0.8
|
|
||||||
ViaDrill1=0.4
|
|
||||||
ViaDiameter2=0.7
|
|
||||||
ViaDrill2=0.35
|
|
||||||
ViaDiameter3=1
|
|
||||||
ViaDrill3=0.6
|
|
||||||
ViaDiameter4=2
|
|
||||||
ViaDrill4=1
|
|
||||||
dPairWidth1=0.2
|
|
||||||
dPairGap1=0.25
|
|
||||||
dPairViaGap1=0.25
|
|
||||||
SilkLineWidth=0.12
|
|
||||||
SilkTextSizeV=1
|
|
||||||
SilkTextSizeH=1
|
|
||||||
SilkTextSizeThickness=0.15
|
|
||||||
SilkTextItalic=0
|
|
||||||
SilkTextUpright=1
|
|
||||||
CopperLineWidth=0.2
|
|
||||||
CopperTextSizeV=1.5
|
|
||||||
CopperTextSizeH=1.5
|
|
||||||
CopperTextThickness=0.3
|
|
||||||
CopperTextItalic=0
|
|
||||||
CopperTextUpright=1
|
|
||||||
EdgeCutLineWidth=0.05
|
|
||||||
CourtyardLineWidth=0.05
|
|
||||||
OthersLineWidth=0.15
|
|
||||||
OthersTextSizeV=1
|
|
||||||
OthersTextSizeH=1
|
|
||||||
OthersTextSizeThickness=0.15
|
|
||||||
OthersTextItalic=0
|
|
||||||
OthersTextUpright=1
|
|
||||||
SolderMaskClearance=0
|
|
||||||
SolderMaskMinWidth=0
|
|
||||||
SolderPasteClearance=0
|
|
||||||
SolderPasteRatio=-0
|
|
||||||
[pcbnew/Layer.F.Cu]
|
|
||||||
Name=F.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.In1.Cu]
|
|
||||||
Name=In1.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In2.Cu]
|
|
||||||
Name=In2.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In3.Cu]
|
|
||||||
Name=In3.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In4.Cu]
|
|
||||||
Name=In4.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In5.Cu]
|
|
||||||
Name=In5.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In6.Cu]
|
|
||||||
Name=In6.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In7.Cu]
|
|
||||||
Name=In7.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In8.Cu]
|
|
||||||
Name=In8.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In9.Cu]
|
|
||||||
Name=In9.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In10.Cu]
|
|
||||||
Name=In10.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In11.Cu]
|
|
||||||
Name=In11.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In12.Cu]
|
|
||||||
Name=In12.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In13.Cu]
|
|
||||||
Name=In13.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In14.Cu]
|
|
||||||
Name=In14.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In15.Cu]
|
|
||||||
Name=In15.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In16.Cu]
|
|
||||||
Name=In16.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In17.Cu]
|
|
||||||
Name=In17.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In18.Cu]
|
|
||||||
Name=In18.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In19.Cu]
|
|
||||||
Name=In19.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In20.Cu]
|
|
||||||
Name=In20.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In21.Cu]
|
|
||||||
Name=In21.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In22.Cu]
|
|
||||||
Name=In22.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In23.Cu]
|
|
||||||
Name=In23.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In24.Cu]
|
|
||||||
Name=In24.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In25.Cu]
|
|
||||||
Name=In25.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In26.Cu]
|
|
||||||
Name=In26.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In27.Cu]
|
|
||||||
Name=In27.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In28.Cu]
|
|
||||||
Name=In28.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In29.Cu]
|
|
||||||
Name=In29.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.In30.Cu]
|
|
||||||
Name=In30.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Layer.B.Cu]
|
|
||||||
Name=B.Cu
|
|
||||||
Type=0
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.B.Adhes]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.F.Adhes]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.B.Paste]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.F.Paste]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.B.SilkS]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.F.SilkS]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.B.Mask]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.F.Mask]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Dwgs.User]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Cmts.User]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Eco1.User]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Eco2.User]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Edge.Cuts]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Margin]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.B.CrtYd]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.F.CrtYd]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.B.Fab]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.F.Fab]
|
|
||||||
Enabled=1
|
|
||||||
[pcbnew/Layer.Rescue]
|
|
||||||
Enabled=0
|
|
||||||
[pcbnew/Netclasses]
|
|
||||||
[pcbnew/Netclasses/Default]
|
|
||||||
Name=Default
|
|
||||||
Clearance=0.2
|
|
||||||
TrackWidth=0.25
|
|
||||||
ViaDiameter=0.8
|
|
||||||
ViaDrill=0.4
|
|
||||||
uViaDiameter=0.3
|
|
||||||
uViaDrill=0.1
|
|
||||||
dPairWidth=0.2
|
|
||||||
dPairGap=0.25
|
|
||||||
dPairViaGap=0.25
|
|
@@ -1,698 +0,0 @@
|
|||||||
EESchema Schematic File Version 4
|
|
||||||
EELAYER 30 0
|
|
||||||
EELAYER END
|
|
||||||
$Descr A4 11693 8268
|
|
||||||
encoding utf-8
|
|
||||||
Sheet 1 1
|
|
||||||
Title ""
|
|
||||||
Date ""
|
|
||||||
Rev ""
|
|
||||||
Comp ""
|
|
||||||
Comment1 ""
|
|
||||||
Comment2 ""
|
|
||||||
Comment3 ""
|
|
||||||
Comment4 ""
|
|
||||||
$EndDescr
|
|
||||||
$Comp
|
|
||||||
L MCU_Module:WeMos_D1_mini U1
|
|
||||||
U 1 1 61D21889
|
|
||||||
P 6500 3150
|
|
||||||
F 0 "U1" H 6500 2261 50 0000 C CNN
|
|
||||||
F 1 "WeMos_D1_mini" H 6500 2170 50 0000 C CNN
|
|
||||||
F 2 "Module:WEMOS_D1_mini_light" H 6500 2000 50 0001 C CNN
|
|
||||||
F 3 "https://wiki.wemos.cc/products:d1:d1_mini#documentation" H 4650 2000 50 0001 C CNN
|
|
||||||
1 6500 3150
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Transistor_FET:IRLZ44N Q1
|
|
||||||
U 1 1 61D22C04
|
|
||||||
P 9400 3750
|
|
||||||
F 0 "Q1" H 9604 3796 50 0000 L CNN
|
|
||||||
F 1 "IRLZ44N" H 9604 3705 50 0000 L CNN
|
|
||||||
F 2 "Package_TO_SOT_THT:TO-220-3_Vertical" H 9650 3675 50 0001 L CIN
|
|
||||||
F 3 "http://www.irf.com/product-info/datasheets/data/irlz44n.pdf" H 9400 3750 50 0001 L CNN
|
|
||||||
1 9400 3750
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Device:R R3
|
|
||||||
U 1 1 61D23437
|
|
||||||
P 9050 4000
|
|
||||||
F 0 "R3" H 9120 4046 50 0000 L CNN
|
|
||||||
F 1 "4k7" H 9120 3955 50 0000 L CNN
|
|
||||||
F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder" V 8980 4000 50 0001 C CNN
|
|
||||||
F 3 "~" H 9050 4000 50 0001 C CNN
|
|
||||||
1 9050 4000
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Device:R R2
|
|
||||||
U 1 1 61D23883
|
|
||||||
P 8750 3750
|
|
||||||
F 0 "R2" V 8543 3750 50 0000 C CNN
|
|
||||||
F 1 "100" V 8634 3750 50 0000 C CNN
|
|
||||||
F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder" V 8680 3750 50 0001 C CNN
|
|
||||||
F 3 "~" H 8750 3750 50 0001 C CNN
|
|
||||||
1 8750 3750
|
|
||||||
0 1 1 0
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0101
|
|
||||||
U 1 1 61D23AAC
|
|
||||||
P 9050 4200
|
|
||||||
F 0 "#PWR0101" H 9050 3950 50 0001 C CNN
|
|
||||||
F 1 "GND" H 9055 4027 50 0000 C CNN
|
|
||||||
F 2 "" H 9050 4200 50 0001 C CNN
|
|
||||||
F 3 "" H 9050 4200 50 0001 C CNN
|
|
||||||
1 9050 4200
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0102
|
|
||||||
U 1 1 61D240D1
|
|
||||||
P 9500 4200
|
|
||||||
F 0 "#PWR0102" H 9500 3950 50 0001 C CNN
|
|
||||||
F 1 "GND" H 9505 4027 50 0000 C CNN
|
|
||||||
F 2 "" H 9500 4200 50 0001 C CNN
|
|
||||||
F 3 "" H 9500 4200 50 0001 C CNN
|
|
||||||
1 9500 4200
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0103
|
|
||||||
U 1 1 61D2429A
|
|
||||||
P 6500 4200
|
|
||||||
F 0 "#PWR0103" H 6500 3950 50 0001 C CNN
|
|
||||||
F 1 "GND" H 6505 4027 50 0000 C CNN
|
|
||||||
F 2 "" H 6500 4200 50 0001 C CNN
|
|
||||||
F 3 "" H 6500 4200 50 0001 C CNN
|
|
||||||
1 6500 4200
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
6500 4200 6500 3950
|
|
||||||
Wire Wire Line
|
|
||||||
8450 3750 8600 3750
|
|
||||||
Wire Wire Line
|
|
||||||
8900 3750 9050 3750
|
|
||||||
Wire Wire Line
|
|
||||||
9050 3850 9050 3750
|
|
||||||
Connection ~ 9050 3750
|
|
||||||
Wire Wire Line
|
|
||||||
9050 3750 9200 3750
|
|
||||||
Wire Wire Line
|
|
||||||
9050 4200 9050 4150
|
|
||||||
Wire Wire Line
|
|
||||||
9500 4200 9500 3950
|
|
||||||
$Comp
|
|
||||||
L Connector_Generic:Conn_01x02 J4
|
|
||||||
U 1 1 61D24E27
|
|
||||||
P 9800 3350
|
|
||||||
F 0 "J4" H 9880 3342 50 0000 L CNN
|
|
||||||
F 1 "PUMP" H 9880 3251 50 0000 L CNN
|
|
||||||
F 2 "Connector_Phoenix_MC:PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_Horizontal" H 9800 3350 50 0001 C CNN
|
|
||||||
F 3 "~" H 9800 3350 50 0001 C CNN
|
|
||||||
1 9800 3350
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Connector_Generic:Conn_01x02 J3
|
|
||||||
U 1 1 61D2549D
|
|
||||||
P 9800 2750
|
|
||||||
F 0 "J3" H 9880 2742 50 0000 L CNN
|
|
||||||
F 1 "POWER" H 9880 2651 50 0000 L CNN
|
|
||||||
F 2 "Connector_Phoenix_MC:PhoenixContact_MC_1,5_2-G-3.5_1x02_P3.50mm_Horizontal" H 9800 2750 50 0001 C CNN
|
|
||||||
F 3 "~" H 9800 2750 50 0001 C CNN
|
|
||||||
1 9800 2750
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
9500 3550 9500 3500
|
|
||||||
Wire Wire Line
|
|
||||||
9500 3450 9600 3450
|
|
||||||
Wire Wire Line
|
|
||||||
9600 3350 9500 3350
|
|
||||||
Wire Wire Line
|
|
||||||
9500 3350 9500 3200
|
|
||||||
Wire Wire Line
|
|
||||||
9500 2750 9600 2750
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0104
|
|
||||||
U 1 1 61D25EA9
|
|
||||||
P 9600 2900
|
|
||||||
F 0 "#PWR0104" H 9600 2650 50 0001 C CNN
|
|
||||||
F 1 "GND" H 9605 2727 50 0000 C CNN
|
|
||||||
F 2 "" H 9600 2900 50 0001 C CNN
|
|
||||||
F 3 "" H 9600 2900 50 0001 C CNN
|
|
||||||
1 9600 2900
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
9600 2850 9600 2900
|
|
||||||
Connection ~ 9500 2750
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0105
|
|
||||||
U 1 1 61D27601
|
|
||||||
P 10100 2350
|
|
||||||
F 0 "#PWR0105" H 10100 2100 50 0001 C CNN
|
|
||||||
F 1 "GND" H 10105 2177 50 0000 C CNN
|
|
||||||
F 2 "" H 10100 2350 50 0001 C CNN
|
|
||||||
F 3 "" H 10100 2350 50 0001 C CNN
|
|
||||||
1 10100 2350
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+3.3V #PWR0106
|
|
||||||
U 1 1 61D282EA
|
|
||||||
P 6600 2350
|
|
||||||
F 0 "#PWR0106" H 6600 2200 50 0001 C CNN
|
|
||||||
F 1 "+3.3V" H 6615 2523 50 0000 C CNN
|
|
||||||
F 2 "" H 6600 2350 50 0001 C CNN
|
|
||||||
F 3 "" H 6600 2350 50 0001 C CNN
|
|
||||||
1 6600 2350
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Regulator_Switching:R-78C5.0-1.0 U2
|
|
||||||
U 1 1 61D28955
|
|
||||||
P 10100 2050
|
|
||||||
F 0 "U2" H 10100 2292 50 0000 C CNN
|
|
||||||
F 1 "R-78C5.0-1.0" H 10100 2201 50 0000 C CNN
|
|
||||||
F 2 "Converter_DCDC:Converter_DCDC_RECOM_R-78E-0.5_THT" H 10150 1800 50 0001 L CIN
|
|
||||||
F 3 "https://www.recom-power.com/pdf/Innoline/R-78Cxx-1.0.pdf" H 10100 2050 50 0001 C CNN
|
|
||||||
1 10100 2050
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+5V #PWR0107
|
|
||||||
U 1 1 61D2BC64
|
|
||||||
P 6400 2350
|
|
||||||
F 0 "#PWR0107" H 6400 2200 50 0001 C CNN
|
|
||||||
F 1 "+5V" H 6415 2523 50 0000 C CNN
|
|
||||||
F 2 "" H 6400 2350 50 0001 C CNN
|
|
||||||
F 3 "" H 6400 2350 50 0001 C CNN
|
|
||||||
1 6400 2350
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+5V #PWR0108
|
|
||||||
U 1 1 61D2C166
|
|
||||||
P 10550 1900
|
|
||||||
F 0 "#PWR0108" H 10550 1750 50 0001 C CNN
|
|
||||||
F 1 "+5V" H 10565 2073 50 0000 C CNN
|
|
||||||
F 2 "" H 10550 1900 50 0001 C CNN
|
|
||||||
F 3 "" H 10550 1900 50 0001 C CNN
|
|
||||||
1 10550 1900
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
10400 2050 10550 2050
|
|
||||||
Wire Wire Line
|
|
||||||
10550 2050 10550 1900
|
|
||||||
$Comp
|
|
||||||
L Diode:BAT42 D2
|
|
||||||
U 1 1 61D2CD57
|
|
||||||
P 8250 4400
|
|
||||||
F 0 "D2" V 8296 4320 50 0000 R CNN
|
|
||||||
F 1 "BAT42" V 8205 4320 50 0000 R CNN
|
|
||||||
F 2 "Diode_SMD:D_SOD-123" H 8250 4225 50 0001 C CNN
|
|
||||||
F 3 "http://www.vishay.com/docs/85660/bat42.pdf" H 8250 4400 50 0001 C CNN
|
|
||||||
F 4 "BAT 42" H 8250 4400 50 0001 C CNN "Reichelt Order No."
|
|
||||||
1 8250 4400
|
|
||||||
0 -1 -1 0
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Connector_Generic:Conn_01x02 J2
|
|
||||||
U 1 1 61D2DCEE
|
|
||||||
P 8550 4700
|
|
||||||
F 0 "J2" H 8630 4692 50 0000 L CNN
|
|
||||||
F 1 "SIGNAL" H 8630 4601 50 0000 L CNN
|
|
||||||
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Horizontal" H 8550 4700 50 0001 C CNN
|
|
||||||
F 3 "~" H 8550 4700 50 0001 C CNN
|
|
||||||
1 8550 4700
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
8350 4700 8250 4700
|
|
||||||
Wire Wire Line
|
|
||||||
8250 4700 8250 4550
|
|
||||||
Wire Wire Line
|
|
||||||
8250 4250 8250 3350
|
|
||||||
$Comp
|
|
||||||
L Device:C C1
|
|
||||||
U 1 1 61D2F740
|
|
||||||
P 7400 3700
|
|
||||||
F 0 "C1" H 7515 3746 50 0000 L CNN
|
|
||||||
F 1 "10n" H 7515 3655 50 0000 L CNN
|
|
||||||
F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder" H 7438 3550 50 0001 C CNN
|
|
||||||
F 3 "~" H 7400 3700 50 0001 C CNN
|
|
||||||
1 7400 3700
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Device:C C2
|
|
||||||
U 1 1 61D32638
|
|
||||||
P 8000 3700
|
|
||||||
F 0 "C2" H 8115 3746 50 0000 L CNN
|
|
||||||
F 1 "10n" H 8115 3655 50 0000 L CNN
|
|
||||||
F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder" H 8038 3550 50 0001 C CNN
|
|
||||||
F 3 "~" H 8000 3700 50 0001 C CNN
|
|
||||||
1 8000 3700
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0109
|
|
||||||
U 1 1 61D32EB9
|
|
||||||
P 8000 3850
|
|
||||||
F 0 "#PWR0109" H 8000 3600 50 0001 C CNN
|
|
||||||
F 1 "GND" H 8005 3677 50 0000 C CNN
|
|
||||||
F 2 "" H 8000 3850 50 0001 C CNN
|
|
||||||
F 3 "" H 8000 3850 50 0001 C CNN
|
|
||||||
1 8000 3850
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0110
|
|
||||||
U 1 1 61D331A8
|
|
||||||
P 7400 3850
|
|
||||||
F 0 "#PWR0110" H 7400 3600 50 0001 C CNN
|
|
||||||
F 1 "GND" H 7405 3677 50 0000 C CNN
|
|
||||||
F 2 "" H 7400 3850 50 0001 C CNN
|
|
||||||
F 3 "" H 7400 3850 50 0001 C CNN
|
|
||||||
1 7400 3850
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Diode:BAT42 D1
|
|
||||||
U 1 1 61D35ED1
|
|
||||||
P 7750 4400
|
|
||||||
F 0 "D1" V 7796 4320 50 0000 R CNN
|
|
||||||
F 1 "BAT42" V 7705 4320 50 0000 R CNN
|
|
||||||
F 2 "Diode_SMD:D_SOD-123" H 7750 4225 50 0001 C CNN
|
|
||||||
F 3 "http://www.vishay.com/docs/85660/bat42.pdf" H 7750 4400 50 0001 C CNN
|
|
||||||
F 4 "BAT 42" H 7750 4400 50 0001 C CNN "Reichelt Order No."
|
|
||||||
1 7750 4400
|
|
||||||
0 -1 -1 0
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Diode:1N4001 D3
|
|
||||||
U 1 1 61D36E68
|
|
||||||
P 9100 2750
|
|
||||||
F 0 "D3" H 9100 2967 50 0000 C CNN
|
|
||||||
F 1 "1N4001" H 9100 2876 50 0000 C CNN
|
|
||||||
F 2 "Diode_THT:D_DO-35_SOD27_P7.62mm_Horizontal" H 9100 2575 50 0001 C CNN
|
|
||||||
F 3 "http://www.vishay.com/docs/88503/1n4001.pdf" H 9100 2750 50 0001 C CNN
|
|
||||||
1 9100 2750
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
9250 2750 9500 2750
|
|
||||||
Wire Wire Line
|
|
||||||
8950 2050 8950 2750
|
|
||||||
Wire Wire Line
|
|
||||||
8950 2050 9450 2050
|
|
||||||
$Comp
|
|
||||||
L Device:CP C3
|
|
||||||
U 1 1 61D3892A
|
|
||||||
P 9450 2200
|
|
||||||
F 0 "C3" H 9568 2246 50 0000 L CNN
|
|
||||||
F 1 "470µF" H 9568 2155 50 0000 L CNN
|
|
||||||
F 2 "Capacitor_SMD:CP_Elec_8x10" H 9488 2050 50 0001 C CNN
|
|
||||||
F 3 "~" H 9450 2200 50 0001 C CNN
|
|
||||||
F 4 "ECC MZS350ARA471" H 9450 2200 50 0001 C CNN "Reichelt Order No."
|
|
||||||
1 9450 2200
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Connection ~ 9450 2050
|
|
||||||
Wire Wire Line
|
|
||||||
9450 2050 9800 2050
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0111
|
|
||||||
U 1 1 61D3952C
|
|
||||||
P 9450 2350
|
|
||||||
F 0 "#PWR0111" H 9450 2100 50 0001 C CNN
|
|
||||||
F 1 "GND" H 9455 2177 50 0000 C CNN
|
|
||||||
F 2 "" H 9450 2350 50 0001 C CNN
|
|
||||||
F 3 "" H 9450 2350 50 0001 C CNN
|
|
||||||
1 9450 2350
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Device:CP C4
|
|
||||||
U 1 1 61D39810
|
|
||||||
P 10550 2200
|
|
||||||
F 0 "C4" H 10668 2246 50 0000 L CNN
|
|
||||||
F 1 "100µ" H 10668 2155 50 0000 L CNN
|
|
||||||
F 2 "Capacitor_SMD:CP_Elec_6.3x7.7" H 10588 2050 50 0001 C CNN
|
|
||||||
F 3 "~" H 10550 2200 50 0001 C CNN
|
|
||||||
F 4 "ECC HXE250ARA101" H 10550 2200 50 0001 C CNN "Reichelt Order No."
|
|
||||||
1 10550 2200
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Connection ~ 10550 2050
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0112
|
|
||||||
U 1 1 61D39D32
|
|
||||||
P 10550 2350
|
|
||||||
F 0 "#PWR0112" H 10550 2100 50 0001 C CNN
|
|
||||||
F 1 "GND" H 10555 2177 50 0000 C CNN
|
|
||||||
F 2 "" H 10550 2350 50 0001 C CNN
|
|
||||||
F 3 "" H 10550 2350 50 0001 C CNN
|
|
||||||
1 10550 2350
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0113
|
|
||||||
U 1 1 61D3BF4D
|
|
||||||
P 7850 5450
|
|
||||||
F 0 "#PWR0113" H 7850 5200 50 0001 C CNN
|
|
||||||
F 1 "GND" H 7855 5277 50 0000 C CNN
|
|
||||||
F 2 "" H 7850 5450 50 0001 C CNN
|
|
||||||
F 3 "" H 7850 5450 50 0001 C CNN
|
|
||||||
1 7850 5450
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+5V #PWR0114
|
|
||||||
U 1 1 61D3C31B
|
|
||||||
P 7850 5050
|
|
||||||
F 0 "#PWR0114" H 7850 4900 50 0001 C CNN
|
|
||||||
F 1 "+5V" H 7865 5223 50 0000 C CNN
|
|
||||||
F 2 "" H 7850 5050 50 0001 C CNN
|
|
||||||
F 3 "" H 7850 5050 50 0001 C CNN
|
|
||||||
1 7850 5050
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
7900 5100 7850 5100
|
|
||||||
Wire Wire Line
|
|
||||||
7850 5100 7850 5050
|
|
||||||
$Comp
|
|
||||||
L Device:R R1
|
|
||||||
U 1 1 61D3DA39
|
|
||||||
P 7450 5300
|
|
||||||
F 0 "R1" V 7243 5300 50 0000 C CNN
|
|
||||||
F 1 "100" V 7334 5300 50 0000 C CNN
|
|
||||||
F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder" V 7380 5300 50 0001 C CNN
|
|
||||||
F 3 "~" H 7450 5300 50 0001 C CNN
|
|
||||||
1 7450 5300
|
|
||||||
0 1 1 0
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Diode:1N4001 D4
|
|
||||||
U 1 1 61D3DFDC
|
|
||||||
P 9300 3350
|
|
||||||
F 0 "D4" V 9254 3430 50 0000 L CNN
|
|
||||||
F 1 "1N4001" V 9345 3430 50 0000 L CNN
|
|
||||||
F 2 "Diode_THT:D_DO-35_SOD27_P7.62mm_Horizontal" H 9300 3175 50 0001 C CNN
|
|
||||||
F 3 "http://www.vishay.com/docs/88503/1n4001.pdf" H 9300 3350 50 0001 C CNN
|
|
||||||
1 9300 3350
|
|
||||||
0 1 1 0
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
9300 3500 9500 3500
|
|
||||||
Connection ~ 9500 3500
|
|
||||||
Wire Wire Line
|
|
||||||
9500 3500 9500 3450
|
|
||||||
Wire Wire Line
|
|
||||||
9300 3200 9500 3200
|
|
||||||
Connection ~ 9500 3200
|
|
||||||
Wire Wire Line
|
|
||||||
9500 3200 9500 2750
|
|
||||||
$Comp
|
|
||||||
L Connector_Generic:Conn_01x04 J1
|
|
||||||
U 1 1 61D4071E
|
|
||||||
P 8100 5200
|
|
||||||
F 0 "J1" H 8180 5192 50 0000 L CNN
|
|
||||||
F 1 "COCKPIT" H 8180 5101 50 0000 L CNN
|
|
||||||
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Horizontal" H 8100 5200 50 0001 C CNN
|
|
||||||
F 3 "~" H 8100 5200 50 0001 C CNN
|
|
||||||
1 8100 5200
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
7900 5400 7850 5400
|
|
||||||
Wire Wire Line
|
|
||||||
7850 5400 7850 5450
|
|
||||||
Wire Wire Line
|
|
||||||
7150 5300 7300 5300
|
|
||||||
Wire Wire Line
|
|
||||||
7750 4550 7750 5200
|
|
||||||
Wire Wire Line
|
|
||||||
7900 5200 7750 5200
|
|
||||||
Wire Wire Line
|
|
||||||
7600 5300 7900 5300
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0115
|
|
||||||
U 1 1 61D47EEA
|
|
||||||
P 8250 4850
|
|
||||||
F 0 "#PWR0115" H 8250 4600 50 0001 C CNN
|
|
||||||
F 1 "GND" H 8255 4677 50 0000 C CNN
|
|
||||||
F 2 "" H 8250 4850 50 0001 C CNN
|
|
||||||
F 3 "" H 8250 4850 50 0001 C CNN
|
|
||||||
1 8250 4850
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
8250 4850 8250 4800
|
|
||||||
Wire Wire Line
|
|
||||||
8250 4800 8350 4800
|
|
||||||
$Comp
|
|
||||||
L Connector_Generic:Conn_01x04 J5
|
|
||||||
U 1 1 61E12B85
|
|
||||||
P 8450 2500
|
|
||||||
F 0 "J5" H 8530 2492 50 0000 L CNN
|
|
||||||
F 1 "I2C" H 8530 2401 50 0000 L CNN
|
|
||||||
F 2 "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Horizontal" H 8450 2500 50 0001 C CNN
|
|
||||||
F 3 "~" H 8450 2500 50 0001 C CNN
|
|
||||||
1 8450 2500
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+3.3V #PWR0116
|
|
||||||
U 1 1 61E137AF
|
|
||||||
P 8050 1550
|
|
||||||
F 0 "#PWR0116" H 8050 1400 50 0001 C CNN
|
|
||||||
F 1 "+3.3V" H 8065 1723 50 0000 C CNN
|
|
||||||
F 2 "" H 8050 1550 50 0001 C CNN
|
|
||||||
F 3 "" H 8050 1550 50 0001 C CNN
|
|
||||||
1 8050 1550
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0117
|
|
||||||
U 1 1 61E147DB
|
|
||||||
P 8200 2750
|
|
||||||
F 0 "#PWR0117" H 8200 2500 50 0001 C CNN
|
|
||||||
F 1 "GND" H 8205 2577 50 0000 C CNN
|
|
||||||
F 2 "" H 8200 2750 50 0001 C CNN
|
|
||||||
F 3 "" H 8200 2750 50 0001 C CNN
|
|
||||||
1 8200 2750
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
8250 2700 8200 2700
|
|
||||||
Wire Wire Line
|
|
||||||
8200 2700 8200 2750
|
|
||||||
Wire Wire Line
|
|
||||||
8050 2950 8050 2400
|
|
||||||
Wire Wire Line
|
|
||||||
8050 2400 8250 2400
|
|
||||||
Wire Wire Line
|
|
||||||
7950 2850 7950 2500
|
|
||||||
Wire Wire Line
|
|
||||||
7950 2500 8250 2500
|
|
||||||
$Comp
|
|
||||||
L Device:R R4
|
|
||||||
U 1 1 61E189A2
|
|
||||||
P 7950 1850
|
|
||||||
F 0 "R4" H 7880 1804 50 0000 R CNN
|
|
||||||
F 1 "4k7" H 7880 1895 50 0000 R CNN
|
|
||||||
F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder" V 7880 1850 50 0001 C CNN
|
|
||||||
F 3 "~" H 7950 1850 50 0001 C CNN
|
|
||||||
1 7950 1850
|
|
||||||
-1 0 0 1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Device:R R5
|
|
||||||
U 1 1 61E1955B
|
|
||||||
P 8050 2150
|
|
||||||
F 0 "R5" H 7980 2104 50 0000 R CNN
|
|
||||||
F 1 "4k7" H 7980 2195 50 0000 R CNN
|
|
||||||
F 2 "Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder" V 7980 2150 50 0001 C CNN
|
|
||||||
F 3 "~" H 8050 2150 50 0001 C CNN
|
|
||||||
1 8050 2150
|
|
||||||
-1 0 0 1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
8250 2600 7850 2600
|
|
||||||
Wire Wire Line
|
|
||||||
7850 2600 7850 1600
|
|
||||||
Wire Wire Line
|
|
||||||
7850 1600 7950 1600
|
|
||||||
Wire Wire Line
|
|
||||||
8050 1600 8050 1550
|
|
||||||
Connection ~ 7950 1600
|
|
||||||
Wire Wire Line
|
|
||||||
7950 1600 8050 1600
|
|
||||||
Wire Wire Line
|
|
||||||
8050 2000 8050 1600
|
|
||||||
Connection ~ 8050 1600
|
|
||||||
Wire Wire Line
|
|
||||||
7950 1600 7950 1700
|
|
||||||
Wire Wire Line
|
|
||||||
8050 2300 8050 2400
|
|
||||||
Connection ~ 8050 2400
|
|
||||||
Wire Wire Line
|
|
||||||
7950 2000 7950 2500
|
|
||||||
Connection ~ 7950 2500
|
|
||||||
Wire Wire Line
|
|
||||||
6900 3550 7150 3550
|
|
||||||
Wire Wire Line
|
|
||||||
7150 3550 7150 5300
|
|
||||||
Wire Wire Line
|
|
||||||
6900 3450 7400 3450
|
|
||||||
Connection ~ 7400 3450
|
|
||||||
Wire Wire Line
|
|
||||||
7400 3450 7400 3550
|
|
||||||
Wire Wire Line
|
|
||||||
7400 3450 7750 3450
|
|
||||||
Wire Wire Line
|
|
||||||
7750 3450 7750 4250
|
|
||||||
Wire Wire Line
|
|
||||||
6900 3350 8000 3350
|
|
||||||
Wire Wire Line
|
|
||||||
8000 3350 8000 3550
|
|
||||||
Wire Wire Line
|
|
||||||
8000 3350 8250 3350
|
|
||||||
Connection ~ 8000 3350
|
|
||||||
Wire Wire Line
|
|
||||||
8450 3250 8450 3750
|
|
||||||
Wire Wire Line
|
|
||||||
6900 3250 8450 3250
|
|
||||||
$Comp
|
|
||||||
L Memory_EEPROM:24LC64 U3
|
|
||||||
U 1 1 61DDD4E7
|
|
||||||
P 6750 1550
|
|
||||||
F 0 "U3" H 6750 2031 50 0000 C CNN
|
|
||||||
F 1 "24LC64" H 6750 1940 50 0000 C CNN
|
|
||||||
F 2 "Package_SO:SOIC-8_3.9x4.9mm_P1.27mm" H 6750 1550 50 0001 C CNN
|
|
||||||
F 3 "http://ww1.microchip.com/downloads/en/DeviceDoc/21189f.pdf" H 6750 1550 50 0001 C CNN
|
|
||||||
1 6750 1550
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+3.3V #PWR0118
|
|
||||||
U 1 1 61DDE198
|
|
||||||
P 6750 1250
|
|
||||||
F 0 "#PWR0118" H 6750 1100 50 0001 C CNN
|
|
||||||
F 1 "+3.3V" H 6765 1423 50 0000 C CNN
|
|
||||||
F 2 "" H 6750 1250 50 0001 C CNN
|
|
||||||
F 3 "" H 6750 1250 50 0001 C CNN
|
|
||||||
1 6750 1250
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0119
|
|
||||||
U 1 1 61DDE4C0
|
|
||||||
P 6750 1850
|
|
||||||
F 0 "#PWR0119" H 6750 1600 50 0001 C CNN
|
|
||||||
F 1 "GND" H 6755 1677 50 0000 C CNN
|
|
||||||
F 2 "" H 6750 1850 50 0001 C CNN
|
|
||||||
F 3 "" H 6750 1850 50 0001 C CNN
|
|
||||||
1 6750 1850
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0120
|
|
||||||
U 1 1 61DDE71F
|
|
||||||
P 6300 1850
|
|
||||||
F 0 "#PWR0120" H 6300 1600 50 0001 C CNN
|
|
||||||
F 1 "GND" H 6305 1677 50 0000 C CNN
|
|
||||||
F 2 "" H 6300 1850 50 0001 C CNN
|
|
||||||
F 3 "" H 6300 1850 50 0001 C CNN
|
|
||||||
1 6300 1850
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
6350 1650 6300 1650
|
|
||||||
Wire Wire Line
|
|
||||||
6300 1650 6300 1850
|
|
||||||
Wire Wire Line
|
|
||||||
6350 1450 6300 1450
|
|
||||||
Wire Wire Line
|
|
||||||
6300 1450 6300 1550
|
|
||||||
Connection ~ 6300 1650
|
|
||||||
Wire Wire Line
|
|
||||||
6350 1550 6300 1550
|
|
||||||
Connection ~ 6300 1550
|
|
||||||
Wire Wire Line
|
|
||||||
6300 1550 6300 1650
|
|
||||||
Wire Wire Line
|
|
||||||
6900 2850 7400 2850
|
|
||||||
Wire Wire Line
|
|
||||||
6900 2950 7500 2950
|
|
||||||
Wire Wire Line
|
|
||||||
7150 1550 7400 1550
|
|
||||||
Wire Wire Line
|
|
||||||
7400 1550 7400 2850
|
|
||||||
Connection ~ 7400 2850
|
|
||||||
Wire Wire Line
|
|
||||||
7400 2850 7950 2850
|
|
||||||
Wire Wire Line
|
|
||||||
7500 1450 7500 2950
|
|
||||||
Wire Wire Line
|
|
||||||
7150 1450 7500 1450
|
|
||||||
Connection ~ 7500 2950
|
|
||||||
Wire Wire Line
|
|
||||||
7500 2950 8050 2950
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0121
|
|
||||||
U 1 1 61DFBD18
|
|
||||||
P 7250 1850
|
|
||||||
F 0 "#PWR0121" H 7250 1600 50 0001 C CNN
|
|
||||||
F 1 "GND" H 7255 1677 50 0000 C CNN
|
|
||||||
F 2 "" H 7250 1850 50 0001 C CNN
|
|
||||||
F 3 "" H 7250 1850 50 0001 C CNN
|
|
||||||
1 7250 1850
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
Wire Wire Line
|
|
||||||
7150 1650 7250 1650
|
|
||||||
Wire Wire Line
|
|
||||||
7250 1650 7250 1850
|
|
||||||
$Comp
|
|
||||||
L power:GND #PWR0122
|
|
||||||
U 1 1 61DEAC05
|
|
||||||
P 6000 1700
|
|
||||||
F 0 "#PWR0122" H 6000 1450 50 0001 C CNN
|
|
||||||
F 1 "GND" H 6005 1527 50 0000 C CNN
|
|
||||||
F 2 "" H 6000 1700 50 0001 C CNN
|
|
||||||
F 3 "" H 6000 1700 50 0001 C CNN
|
|
||||||
1 6000 1700
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L Device:C C5
|
|
||||||
U 1 1 61DEA081
|
|
||||||
P 6000 1550
|
|
||||||
F 0 "C5" H 6115 1596 50 0000 L CNN
|
|
||||||
F 1 "10n" H 6115 1505 50 0000 L CNN
|
|
||||||
F 2 "Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder" H 6038 1400 50 0001 C CNN
|
|
||||||
F 3 "~" H 6000 1550 50 0001 C CNN
|
|
||||||
1 6000 1550
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$Comp
|
|
||||||
L power:+3.3V #PWR0123
|
|
||||||
U 1 1 61DEAFE2
|
|
||||||
P 6000 1400
|
|
||||||
F 0 "#PWR0123" H 6000 1250 50 0001 C CNN
|
|
||||||
F 1 "+3.3V" H 6015 1573 50 0000 C CNN
|
|
||||||
F 2 "" H 6000 1400 50 0001 C CNN
|
|
||||||
F 3 "" H 6000 1400 50 0001 C CNN
|
|
||||||
1 6000 1400
|
|
||||||
1 0 0 -1
|
|
||||||
$EndComp
|
|
||||||
$EndSCHEMATC
|
|
4
Hardware/sym-lib-table
Normal file
4
Hardware/sym-lib-table
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
(sym_lib_table
|
||||||
|
(version 7)
|
||||||
|
(lib (name "MC33660")(type "Legacy")(uri "MC33660.lib")(options "")(descr ""))
|
||||||
|
)
|
@@ -7,14 +7,26 @@ import shutil
|
|||||||
import gzip
|
import gzip
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import platform
|
||||||
Import("env")
|
Import("env")
|
||||||
Import("projenv")
|
Import("projenv")
|
||||||
|
|
||||||
# Setze die Pfade zu den Tools als Variablen
|
# Überprüfe die Betriebssystemplattform
|
||||||
html_minifier_path = os.path.join(os.getenv("APPDATA"), "npm", "html-minifier.cmd")
|
if platform.system() == "Windows":
|
||||||
uglifyjs_path = os.path.join(os.getenv("APPDATA"), "npm", "uglifyjs.cmd")
|
# Setze die Pfade zu den Tools für Windows
|
||||||
terser_path = os.path.join(os.getenv("APPDATA"), "npm", "terser.cmd")
|
html_minifier_path = os.path.join(os.getenv("APPDATA"), "npm", "html-minifier.cmd")
|
||||||
cssnano_path = os.path.join(os.getenv("APPDATA"), "npm", "cssnano.cmd")
|
uglifyjs_path = os.path.join(os.getenv("APPDATA"), "npm", "uglifyjs.cmd")
|
||||||
|
terser_path = os.path.join(os.getenv("APPDATA"), "npm", "terser.cmd")
|
||||||
|
cssnano_path = os.path.join(os.getenv("APPDATA"), "npm", "cssnano.cmd")
|
||||||
|
elif platform.system() == "Linux":
|
||||||
|
# Setze die Namen der Tools für Linux
|
||||||
|
html_minifier_path = "html-minifier"
|
||||||
|
uglifyjs_path = "uglifyjs"
|
||||||
|
terser_path = "terser"
|
||||||
|
cssnano_path = "cssnano"
|
||||||
|
else:
|
||||||
|
# Hier könntest du weitere Bedingungen für andere Betriebssysteme hinzufügen
|
||||||
|
raise Exception("Unterstütztes Betriebssystem nicht erkannt")
|
||||||
|
|
||||||
|
|
||||||
def minify_html(input_path, output_path):
|
def minify_html(input_path, output_path):
|
||||||
|
@@ -45,9 +45,14 @@ def extract_struct_fields(file_content, variable_types):
|
|||||||
|
|
||||||
if match:
|
if match:
|
||||||
# Extrahiere die Felder aus dem Treffer
|
# Extrahiere die Felder aus dem Treffer
|
||||||
fields_match = re.findall(r'\b(\w+)\s+(\w+)\s*;', match.group(1))
|
fields_match = re.findall(r'\b(\w+)\s+(\w+)(?:\[(\d+)\])?\s*;', match.group(1))
|
||||||
if fields_match:
|
if fields_match:
|
||||||
result[var_name] = {'type': var_type, 'fields': {field_name: field_type for field_type, field_name in fields_match}}
|
result[var_name] = {'type': var_type, 'fields': {}}
|
||||||
|
for field_type, field_name, array_size in fields_match:
|
||||||
|
if array_size:
|
||||||
|
result[var_name]['fields'][field_name] = {'type': field_type, 'size': int(array_size)}
|
||||||
|
else:
|
||||||
|
result[var_name]['fields'][field_name] = {'type': field_type}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#include "struct2json.h"
|
#include "struct2json.h"
|
||||||
|
|
||||||
{% for var_name, var_info in structs.items() -%}
|
{% for var_name, var_info in structs.items() -%}
|
||||||
void generateJsonObject_{{ var_name }}(JsonObject& data)
|
void generateJsonObject_{{ var_name }}(JsonObject data)
|
||||||
{
|
{
|
||||||
{% for field_name, field_type in var_info['fields'].items() -%}
|
{% for field_name, field_type in var_info['fields'].items() -%}
|
||||||
data["{{ field_name }}"] = {{ var_name }}.{{ field_name }};
|
data["{{ field_name }}"] = {{ var_name }}.{{ field_name }};
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
{% for var_name, var_info in structs.items() -%}
|
{% for var_name, var_info in structs.items() -%}
|
||||||
void generateJsonObject_{{ var_name }}(JsonObject& data);
|
void generateJsonObject_{{ var_name }}(JsonObject data);
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
#endif /* _STRUCT2JSON_H_ */
|
#endif /* _STRUCT2JSON_H_ */
|
||||||
|
@@ -24,10 +24,13 @@
|
|||||||
<div id="overlay">
|
<div id="overlay">
|
||||||
<div class="overlay-content">
|
<div class="overlay-content">
|
||||||
<p>Verbinde...</p>
|
<p>Verbinde...</p>
|
||||||
<!-- Hier können Sie eine einfache Animation hinzufügen -->
|
<span class="loader"></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Connection-Overlay -->
|
<!-- Connection-Overlay -->
|
||||||
|
<!-- Notification-Container -->
|
||||||
|
<div id="notification-container" class="notification-container"></div>
|
||||||
|
<!-- Notification-Container -->
|
||||||
<nav class="navbar fixed-top navbar-dark bg-primary" id="navbar1">
|
<nav class="navbar fixed-top navbar-dark bg-primary" id="navbar1">
|
||||||
<a class="navbar-brand" href="#">
|
<a class="navbar-brand" href="#">
|
||||||
<img src="static/img/logo.png" width="30" height="30" class="d-inline-block align-top mr-1" alt="">
|
<img src="static/img/logo.png" width="30" height="30" class="d-inline-block align-top mr-1" alt="">
|
||||||
@@ -122,7 +125,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<button id="resettank" class="btn-wsevent btn btn-outline-primary ml-2">Tank zurücksetzen</button>
|
<button id="resettank" class="btn-wsevent confirm btn btn-outline-primary ml-2">Tank zurücksetzen</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
@@ -195,7 +198,7 @@
|
|||||||
<h4>Gerät neustarten</h4>
|
<h4>Gerät neustarten</h4>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<button id="reboot" class="btn-wsevent btn btn-outline-primary">Reboot</button>
|
<button id="reboot" class="btn-wsevent confirm btn btn-outline-primary">Reboot</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
@@ -230,7 +233,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col text-center">
|
<div class="col text-center">
|
||||||
<button id="sourcesave" class="btn-wsevent btn btn-outline-primary">Übernehmen</button>
|
<button id="sourcesave" class="btn-wsevent confirm btn btn-outline-primary">Übernehmen</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
@@ -315,11 +318,6 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
|
||||||
<div class="col text-center">
|
|
||||||
<button id="gpssave" class="btn-wsevent btn btn-outline-primary">Speichern</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- Div Group Source:GPS Settings-->
|
<!-- Div Group Source:GPS Settings-->
|
||||||
@@ -427,7 +425,42 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<!-- Div Group Lube Settings-->
|
<!-- Div Group LED Settings-->
|
||||||
|
<!-- Div Group WiFi Settings-->
|
||||||
|
<hr />
|
||||||
|
<p>
|
||||||
|
<h4>WiFi Einstellungen</h4>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="wifi-ssid" class="control-label col-4">WiFi SSID</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<select id="wifi-ssid" class="set-wsevent data-wifi-ssid select form-control">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="wifi-pass" class="control-label col-4">WiFi Passwort</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="input-group" id="show_hide_password">
|
||||||
|
<input id="wifi-pass" type="password" minlength="8" maxlength="63" class="set-wsevent data-wifi-pass form-control">
|
||||||
|
<div class="input-group-addon">
|
||||||
|
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="wifi-conavailable" class="control-label col-4">automatisch verbinden</label>
|
||||||
|
<div class="col-8">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="set-wsevent data-wifi-conavailable form-check-input" type="checkbox" id="wifi-conavailable">
|
||||||
|
<label class="form-check-label" for="wifi-conavailable">
|
||||||
|
verbinden wenn verfügbar
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p>
|
||||||
|
<!-- Div Group WiFi Settings-->
|
||||||
<!-- Div Group Save Button-->
|
<!-- Div Group Save Button-->
|
||||||
<hr />
|
<hr />
|
||||||
<p>
|
<p>
|
||||||
|
@@ -4075,9 +4075,9 @@ input[type=submit].btn-block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.alert-success {
|
.alert-success {
|
||||||
color: #012d36;
|
color: #002200;
|
||||||
background-color: #ccdde1;
|
background-color: #99ff99;
|
||||||
border-color: #b8d0d5
|
border-color: #20bb20
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-success hr {
|
.alert-success hr {
|
||||||
@@ -4089,9 +4089,9 @@ input[type=submit].btn-block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.alert-info {
|
.alert-info {
|
||||||
color: #084367;
|
color: #000022;
|
||||||
background-color: #cfe6f4;
|
background-color: #99ddff;
|
||||||
border-color: #bcdcef
|
border-color: #2040FF
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-info hr {
|
.alert-info hr {
|
||||||
@@ -4103,9 +4103,9 @@ input[type=submit].btn-block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.alert-warning {
|
.alert-warning {
|
||||||
color: #07767a;
|
color: #222200;
|
||||||
background-color: #cff9fb;
|
background-color: #FFFF99;
|
||||||
border-color: #bbf7f9
|
border-color: #FFFF00
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-warning hr {
|
.alert-warning hr {
|
||||||
@@ -4117,9 +4117,9 @@ input[type=submit].btn-block {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.alert-danger {
|
.alert-danger {
|
||||||
color: #851929;
|
color: #200000;
|
||||||
background-color: #ffd6dc;
|
background-color: #ffcccc;
|
||||||
border-color: #ffc5ce
|
border-color: #AA2020
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-danger hr {
|
.alert-danger hr {
|
||||||
|
@@ -41,4 +41,50 @@ hr {
|
|||||||
|
|
||||||
.overlay-content {
|
.overlay-content {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
font-size: 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.loader {
|
||||||
|
width: 96px;
|
||||||
|
height: 96px;
|
||||||
|
border: 12px solid #FFF;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: inline-block;
|
||||||
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
animation: rotation 1s linear infinite;
|
||||||
|
}
|
||||||
|
.loader::after {
|
||||||
|
content: '';
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: 12px solid transparent;
|
||||||
|
border-bottom-color: #FF3D00;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes rotation {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification-container {
|
||||||
|
position: fixed;
|
||||||
|
top: 30%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notification {
|
||||||
|
margin-bottom: 20px; /* Fügen Sie bei Bedarf weitere Stile hinzu */
|
||||||
|
}
|
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"codegenerator_checksum": "23dff82a4745f67041012080b05ec367c2dd44c6bb02974143b227ba49682b6f",
|
"codegenerator_checksum": "15e9152fb712bc6ed7c3353a05b1b54dc697f3e489a6e1ff42b7e57f0fa094d4",
|
||||||
"timestamp": "2024-01-10 19:06:30",
|
"timestamp": "2025-05-04 12:01:55",
|
||||||
"dtc_table_data": [
|
"dtc_table_data": [
|
||||||
{
|
{
|
||||||
"num": 0,
|
"num": 0,
|
||||||
@@ -89,6 +89,31 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"num": 17,
|
"num": 17,
|
||||||
|
"title": "OBD2-KLine Timeout",
|
||||||
|
"description": "Die Anfrage über OBD2-KLine konnte nicht gesendet werden. Prüfen Sie den K-Line-Treiber (z. B. L9637D) und die Verkabelung."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"num": 18,
|
||||||
|
"title": "OBD2-CAN Timeout",
|
||||||
|
"description": "Die Anfrage an das Steuergerät über OBD2-CAN konnte nicht gesendet werden. Prüfen Sie die Verbindung zum CAN-Modul und die OBD2-Konfiguration."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"num": 19,
|
||||||
|
"title": "Keine OBD2-CAN Antwort",
|
||||||
|
"description": "Es wurde innerhalb der erwarteten Zeit keine Antwort vom Steuergerät über OBD2-CAN empfangen. Prüfen Sie, ob das Fahrzeug OBD2 unterstützt und die Verbindung korrekt ist."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"num": 20,
|
||||||
|
"title": "Keine OBD2-KLine Antwort",
|
||||||
|
"description": "Es wurde innerhalb der erwarteten Zeit keine Antwort über OBD2-KLine empfangen. Prüfen Sie die Verbindung zum Steuergerät und die Protokollkompatibilität."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"num": 21,
|
||||||
|
"title": "OBD2-KLine Antwort ungültig",
|
||||||
|
"description": "Das empfangene Frame war unvollständig oder entsprach nicht dem erwarteten OBD2-Format. Möglicherweise inkompatibles Steuergerät."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"num": 22,
|
||||||
"title": "Last Error",
|
"title": "Last Error",
|
||||||
"description": "Last Error"
|
"description": "Last Error"
|
||||||
}
|
}
|
||||||
|
@@ -2,142 +2,111 @@ const jsonFilePath = "static/dtc_table.json";
|
|||||||
|
|
||||||
var dtcState = {};
|
var dtcState = {};
|
||||||
|
|
||||||
function processDTCNotifications(dtcArray) {
|
async function processDTCNotifications(dtcArray) {
|
||||||
|
if (dtcArray.length === 0 || dtcArray[0] == "0") {
|
||||||
|
dtcState = {};
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (var i = 0; i < dtcArray.length; i++) {
|
for (var i = 0; i < dtcArray.length; i++) {
|
||||||
var dtcInfo = dtcArray[i].split(",");
|
var dtcInfo = dtcArray[i].split(",");
|
||||||
var errorCode = dtcInfo[1];
|
var errorCode = parseInt(dtcInfo[1]);
|
||||||
var activity = parseInt(dtcInfo[3]);
|
var activity = parseInt(dtcInfo[3]);
|
||||||
|
var severity = parseInt(dtcInfo[2]);
|
||||||
|
|
||||||
if (dtcState[errorCode]) {
|
try {
|
||||||
// Überprüfen, ob sich der Zustand von "previous" auf "active" geändert hat
|
var { title, description } = await getDescriptionForDTCNumber(errorCode);
|
||||||
if (activity !== dtcState[errorCode]) {
|
|
||||||
dtcState[errorCode] = activity;
|
switch (severity) {
|
||||||
if (activity === 1) showDTCNotification(errorCode);
|
case 1:
|
||||||
|
severity = "info";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
severity = "warning";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
severity = "danger";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// DTC ist neu, Zustand speichern und Benachrichtigung anzeigen
|
|
||||||
dtcState[errorCode] = activity;
|
|
||||||
showDTCNotification(errorCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showDTCNotification(dtctext, severity) {
|
if (dtcState[errorCode]) {
|
||||||
// Überprüfen, ob der Browser die Notification API unterstützt
|
// Überprüfen, ob sich der Zustand von "previous" auf "active" geändert hat
|
||||||
if ("Notification" in window) {
|
if (activity !== dtcState[errorCode]) {
|
||||||
// Überprüfen, ob der Benutzer bereits Berechtigungen erteilt hat
|
dtcState[errorCode] = activity;
|
||||||
if (Notification.permission === "granted") {
|
if (activity === 1) showNotification(description, severity);
|
||||||
// Benachrichtigung anzeigen
|
|
||||||
showNotification(dtctext, severity);
|
|
||||||
} else if (Notification.permission !== "denied") {
|
|
||||||
// Aufforderung zur Erlaubnis einholen
|
|
||||||
Notification.requestPermission().then(function (permission) {
|
|
||||||
if (permission === "granted") {
|
|
||||||
// Benachrichtigung anzeigen
|
|
||||||
showNotification(dtctext, severity);
|
|
||||||
} else {
|
|
||||||
// Der Benutzer hat die Berechtigung abgelehnt oder das Dialogfeld geschlossen
|
|
||||||
console.log("Benachrichtigungsberechtigung wurde verweigert.");
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
} else {
|
// DTC ist neu, Zustand speichern und Benachrichtigung anzeigen
|
||||||
// Der Benutzer hat die Berechtigung bereits verweigert
|
dtcState[errorCode] = activity;
|
||||||
console.log("Benachrichtigungsberechtigung wurde bereits verweigert.");
|
showNotification(description, severity);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error processing DTC:", error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Funktion zum Anzeigen der Benachrichtigung
|
function getDescriptionForDTCNumber(number) {
|
||||||
function showNotification(dtctext, severity) {
|
return new Promise((resolve, reject) => {
|
||||||
var severityIcon;
|
fetch(jsonFilePath)
|
||||||
switch (severity) {
|
.then((response) => response.json())
|
||||||
case 1:
|
.then((data) => {
|
||||||
severityIcon = "static/img/info.png";
|
const dtcList = data.dtc_table_data;
|
||||||
break;
|
const foundEntry = dtcList.find((entry) => entry.num === number);
|
||||||
case 2:
|
|
||||||
severityIcon = "static/img/warn.png";
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
severityIcon = "static/img/critical.png";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
severityIcon = "static/img/none.png";
|
|
||||||
}
|
|
||||||
|
|
||||||
var options = {
|
if (foundEntry) {
|
||||||
body: dtctext,
|
const description = foundEntry.description;
|
||||||
icon: severityIcon,
|
const title = foundEntry.title;
|
||||||
};
|
resolve({ title, description });
|
||||||
|
} else {
|
||||||
var notification = new Notification("KTM Chain Oiler DTC", options);
|
// Wenn die Nummer nicht gefunden wurde, geben Sie einen Fehler zurück
|
||||||
|
reject(`Beschreibung für Nummer ${number} nicht gefunden.`);
|
||||||
// Optional: Handle Click-Event
|
}
|
||||||
notification.onclick = function () {
|
})
|
||||||
console.log("Benachrichtigung wurde angeklickt.");
|
.catch((error) => {
|
||||||
};
|
// Im Fehlerfall geben Sie den Fehler zurück
|
||||||
|
reject(error);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDescriptionForDTCNumber(number, callback) {
|
async function showDTCModal(event) {
|
||||||
fetch(jsonFilePath)
|
|
||||||
.then((response) => response.json())
|
|
||||||
.then((data) => {
|
|
||||||
const dtcList = data.dtc_table_data;
|
|
||||||
const foundEntry = dtcList.find((entry) => entry.num === number);
|
|
||||||
|
|
||||||
if (foundEntry) {
|
|
||||||
const description = foundEntry.description;
|
|
||||||
const title = foundEntry.title;
|
|
||||||
callback(null, title, description);
|
|
||||||
} else {
|
|
||||||
// Wenn die Nummer nicht gefunden wurde, geben Sie einen Fehler zurück
|
|
||||||
callback(
|
|
||||||
`Beschreibung für Nummer ${number} nicht gefunden.`,
|
|
||||||
null,
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
// Im Fehlerfall geben Sie den Fehler zurück
|
|
||||||
callback(error, null, null);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function showDTCModal(event) {
|
|
||||||
var dtc = parseInt(event.currentTarget.getAttribute("data-dtc"));
|
var dtc = parseInt(event.currentTarget.getAttribute("data-dtc"));
|
||||||
var debugval = event.currentTarget.getAttribute("data-debugval");
|
var debugval = event.currentTarget.getAttribute("data-debugval");
|
||||||
var modal = $("#dtcModal");
|
var modal = $("#dtcModal");
|
||||||
|
|
||||||
getDescriptionForDTCNumber(dtc, function (error, title, description) {
|
try {
|
||||||
if (error) {
|
var { title, description } = await getDescriptionForDTCNumber(dtc);
|
||||||
console.error("Fehler beim Abrufen der Beschreibung:", error);
|
|
||||||
modal.find(".modal-title").text("Fehler");
|
modal.find(".modal-title").text(title);
|
||||||
modal
|
modal.find(".dtc-desc").text(description);
|
||||||
.find(".dtc-desc")
|
|
||||||
.text("DTC-Beschreibung konnte nicht geladen werden");
|
if (debugval > 0) {
|
||||||
|
modal.find(".dtc-debugval").text("Debugvalue: " + debugval);
|
||||||
} else {
|
} else {
|
||||||
modal.find(".modal-title").text(title);
|
modal.find(".dtc-debugval").remove();
|
||||||
modal.find(".dtc-desc").text(description);
|
|
||||||
if (debugval > 0) {
|
|
||||||
modal.find(".dtc-debugval").text("Debugvalue: " + debugval);
|
|
||||||
} else {
|
|
||||||
modal.find(".dtc-debugval").remove();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
} catch (error) {
|
||||||
|
console.error("Fehler beim Abrufen der Beschreibung:", error);
|
||||||
|
modal.find(".modal-title").text("Fehler");
|
||||||
|
modal.find(".dtc-desc").text("DTC-Beschreibung konnte nicht geladen werden");
|
||||||
|
}
|
||||||
|
|
||||||
// Modal anzeigen
|
// Modal anzeigen
|
||||||
modal.modal("show");
|
modal.modal("show");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function fillDTCTable(dtcArray) {
|
function fillDTCTable(dtcArray) {
|
||||||
// Referenz auf das Tabellen-Element
|
// Referenz auf das Tabellen-Element
|
||||||
var table = document.getElementById("dtc_table");
|
var table = document.getElementById("dtc_table");
|
||||||
var tablediv = document.getElementById("dtc_container");
|
var tablediv = document.getElementById("dtc_container");
|
||||||
|
|
||||||
// Prüfen, ob DTC vorhanden sind
|
// Prüfen, ob DTC vorhanden sind
|
||||||
if (dtcArray.length === 0) {
|
if (dtcArray.length === 0 || dtcArray[0] == "0") {
|
||||||
// Verstecke das Tabellen-Div, wenn keine DTC vorhanden sind
|
// Verstecke das Tabellen-Div, wenn keine DTC vorhanden sind
|
||||||
tablediv.hidden = true;
|
tablediv.hidden = true;
|
||||||
|
table.innerHTML = "";
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
// Zeige das Tabellen-Div, wenn DTC vorhanden sind
|
// Zeige das Tabellen-Div, wenn DTC vorhanden sind
|
||||||
|
@@ -1,6 +1,19 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function () {
|
||||||
$('.navbar-nav a').on('click', function(){
|
$(".navbar-nav a").on("click", function () {
|
||||||
$('.navbar-collapse').collapse('hide');
|
$(".navbar-collapse").collapse("hide");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#show_hide_password a").on("click", function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
if ($("#show_hide_password input").attr("type") == "text") {
|
||||||
|
$("#show_hide_password input").attr("type", "password");
|
||||||
|
$("#show_hide_password i").addClass("fa-eye-slash");
|
||||||
|
$("#show_hide_password i").removeClass("fa-eye");
|
||||||
|
} else if ($("#show_hide_password input").attr("type") == "password") {
|
||||||
|
$("#show_hide_password input").attr("type", "text");
|
||||||
|
$("#show_hide_password i").removeClass("fa-eye-slash");
|
||||||
|
$("#show_hide_password i").addClass("fa-eye");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -11,6 +24,3 @@ document
|
|||||||
var nextSibling = e.target.nextElementSibling;
|
var nextSibling = e.target.nextElementSibling;
|
||||||
nextSibling.innerText = fileName;
|
nextSibling.innerText = fileName;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -25,9 +25,7 @@ function initButtons() {
|
|||||||
if (elements.length > 0) {
|
if (elements.length > 0) {
|
||||||
for (var i = 0; i < elements.length; i++) {
|
for (var i = 0; i < elements.length; i++) {
|
||||||
let element = elements[i];
|
let element = elements[i];
|
||||||
element.addEventListener("click", function () {
|
element.addEventListener("click", sendButton);
|
||||||
websocket_sendevent("btn-" + element.id, 0);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,57 +53,55 @@ function onClose(event) {
|
|||||||
overlay.style.display = "flex";
|
overlay.style.display = "flex";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sendButton(event) {
|
||||||
|
var targetElement = event.target;
|
||||||
|
|
||||||
|
if (
|
||||||
|
targetElement.classList.contains("confirm") &&
|
||||||
|
window.confirm("Sicher?") == false
|
||||||
|
)
|
||||||
|
return;
|
||||||
|
|
||||||
|
websocket_sendevent("btn-" + targetElement.id, targetElement.value);
|
||||||
|
}
|
||||||
|
|
||||||
function onMessage(event) {
|
function onMessage(event) {
|
||||||
var data = event.data;
|
var data = event.data;
|
||||||
console.log("ws_msg:" + event.data + "\n");
|
|
||||||
|
|
||||||
if (data.startsWith("DEBUG:")) {
|
if (data.startsWith("NOTIFY:")) {
|
||||||
|
var notify_data = data.slice(7).split(";")[1];
|
||||||
|
var notify_type = data.slice(7).split(";")[0];
|
||||||
|
showNotification(notify_data, notify_type);
|
||||||
|
} else if (data.startsWith("DEBUG:")) {
|
||||||
var addtext = data.slice(6);
|
var addtext = data.slice(6);
|
||||||
var livedebug_out = document.getElementById("livedebug-out");
|
var livedebug_out = document.getElementById("livedebug-out");
|
||||||
livedebug_out.value += addtext;
|
livedebug_out.value += addtext;
|
||||||
livedebug_out.scrollTop = livedebug_out.scrollHeight;
|
livedebug_out.scrollTop = livedebug_out.scrollHeight;
|
||||||
do_resize(livedebug_out);
|
do_resize(livedebug_out);
|
||||||
return;
|
} else if (data.startsWith("DTC:")) {
|
||||||
}
|
|
||||||
|
|
||||||
if (data.startsWith("DTC:")) {
|
|
||||||
const dtcs = data.slice(4);
|
const dtcs = data.slice(4);
|
||||||
const dtcArray = dtcs.trim() !== "" ? dtcs.split(";").filter(Boolean) : [];
|
const dtcArray = dtcs.trim() !== "" ? dtcs.split(";").filter(Boolean) : [];
|
||||||
|
|
||||||
if (dtcArray[0] != "0") {
|
processDTCNotifications(dtcArray);
|
||||||
processDTCNotifications(dtcArray);
|
fillDTCTable(dtcArray);
|
||||||
fillDTCTable(dtcArray);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.startsWith("MAPPING_STATUS:")) {
|
} else if (data.startsWith("MAPPING_STATUS:")) {
|
||||||
const data_sliced = data.slice(15);
|
const data_sliced = data.slice(15);
|
||||||
statusMapping = createMapping(data_sliced);
|
statusMapping = createMapping(data_sliced);
|
||||||
}
|
} else if (data.startsWith("MAPPING_STATIC:")) {
|
||||||
|
|
||||||
if (data.startsWith("MAPPING_STATIC:")) {
|
|
||||||
const data_sliced = data.slice(15);
|
const data_sliced = data.slice(15);
|
||||||
staticMapping = createMapping(data_sliced);
|
staticMapping = createMapping(data_sliced);
|
||||||
}
|
console.log(staticMapping);
|
||||||
|
} else if (data.startsWith("STATUS:")) {
|
||||||
if (data.startsWith("STATUS:")) {
|
|
||||||
const data_sliced = data.slice(7);
|
const data_sliced = data.slice(7);
|
||||||
const result = processDataString(data_sliced, statusMapping);
|
const result = processDataString(data_sliced, statusMapping);
|
||||||
console.log("STATUS:");
|
|
||||||
console.log(JSON.stringify(result, null, 2));
|
|
||||||
fillValuesToHTML(result);
|
fillValuesToHTML(result);
|
||||||
return;
|
} else if (data.startsWith("STATIC:")) {
|
||||||
}
|
|
||||||
|
|
||||||
if (data.startsWith("STATIC:")) {
|
|
||||||
const data_sliced = data.slice(7);
|
const data_sliced = data.slice(7);
|
||||||
const result = processDataString(data_sliced, staticMapping);
|
const result = processDataString(data_sliced, staticMapping);
|
||||||
console.log("STATIC:");
|
|
||||||
console.log(JSON.stringify(result, null, 2));
|
|
||||||
fillValuesToHTML(result);
|
fillValuesToHTML(result);
|
||||||
|
console.log(result);
|
||||||
overlay.style.display = "none";
|
overlay.style.display = "none";
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,3 +207,27 @@ function updateProgressBar(progressBar, value) {
|
|||||||
progressBar.style.width = value + "%";
|
progressBar.style.width = value + "%";
|
||||||
progressBar.textContent = value + "%";
|
progressBar.textContent = value + "%";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showNotification(message, type) {
|
||||||
|
// Erstellen Sie ein Bootstrap-Alert-Element
|
||||||
|
var alertElement = $(
|
||||||
|
'<div class="alert alert-' +
|
||||||
|
type +
|
||||||
|
' alert-dismissible fade show notification" role="alert">' +
|
||||||
|
"<strong>" +
|
||||||
|
message +
|
||||||
|
"</strong>" +
|
||||||
|
'<button type="button" class="close" data-dismiss="alert" aria-label="Close">' +
|
||||||
|
'<span aria-hidden="true">×</span>' +
|
||||||
|
"</button>" +
|
||||||
|
"</div>"
|
||||||
|
);
|
||||||
|
|
||||||
|
// Fügen Sie das Alert-Element dem Container hinzu
|
||||||
|
$("#notification-container").append(alertElement);
|
||||||
|
|
||||||
|
// Nach 5 Sekunden das Alert-Element ausblenden
|
||||||
|
setTimeout(function () {
|
||||||
|
alertElement.alert("close");
|
||||||
|
}, 5000);
|
||||||
|
}
|
||||||
|
@@ -32,7 +32,6 @@ struct can_frame
|
|||||||
|
|
||||||
// Function prototypes
|
// Function prototypes
|
||||||
void Init_CAN();
|
void Init_CAN();
|
||||||
void CAN_Process();
|
|
||||||
uint32_t Process_CAN_WheelSpeed();
|
uint32_t Process_CAN_WheelSpeed();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
#define GPIO_LED D8
|
#define GPIO_LED D8
|
||||||
#define GPIO_TRIGGER D6
|
#define GPIO_TRIGGER D6
|
||||||
#define GPIO_PUMP D5
|
#define GPIO_PUMP D5
|
||||||
|
#define GPIO_CS_CAN -1
|
||||||
#elif PCB_REV == 3
|
#elif PCB_REV == 3
|
||||||
#define GPIO_BUTTON D4
|
#define GPIO_BUTTON D4
|
||||||
#define GPIO_LED D3
|
#define GPIO_LED D3
|
||||||
@@ -84,7 +85,9 @@ typedef enum SpeedSource_e
|
|||||||
#endif
|
#endif
|
||||||
SOURCE_IMPULSE,
|
SOURCE_IMPULSE,
|
||||||
SOURCE_GPS,
|
SOURCE_GPS,
|
||||||
SOURCE_CAN
|
SOURCE_CAN,
|
||||||
|
SOURCE_OBD2_KLINE,
|
||||||
|
SOURCE_OBD2_CAN
|
||||||
} SpeedSource_t;
|
} SpeedSource_t;
|
||||||
|
|
||||||
// String representation of SpeedSource enum
|
// String representation of SpeedSource enum
|
||||||
|
@@ -21,6 +21,8 @@
|
|||||||
#include "dtc.h"
|
#include "dtc.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
|
#define EEPROM_STRUCTURE_REVISION 3 // Increment this version when changing EEPROM structures
|
||||||
|
|
||||||
#if PCB_REV == 1 || PCB_REV == 2 || PCB_REV == 3
|
#if PCB_REV == 1 || PCB_REV == 2 || PCB_REV == 3
|
||||||
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC64
|
#define EEPROM_SIZE_BYTES I2C_DEVICESIZE_24LC64
|
||||||
#elif PCB_REV == 4
|
#elif PCB_REV == 4
|
||||||
@@ -73,6 +75,11 @@ typedef struct
|
|||||||
bool LED_Mode_Flash;
|
bool LED_Mode_Flash;
|
||||||
uint8_t LED_Max_Brightness;
|
uint8_t LED_Max_Brightness;
|
||||||
uint8_t LED_Min_Brightness;
|
uint8_t LED_Min_Brightness;
|
||||||
|
char wifi_ap_ssid[33];
|
||||||
|
char wifi_ap_password[64];
|
||||||
|
char wifi_client_ssid[33];
|
||||||
|
char wifi_client_password[64];
|
||||||
|
bool wifi_autoconnect;
|
||||||
uint32_t checksum;
|
uint32_t checksum;
|
||||||
} LubeConfig_t;
|
} LubeConfig_t;
|
||||||
|
|
||||||
@@ -84,6 +91,11 @@ const LubeConfig_t LubeConfig_defaults = {
|
|||||||
false,
|
false,
|
||||||
255,
|
255,
|
||||||
5,
|
5,
|
||||||
|
"ChainLube",
|
||||||
|
QUOTE(WIFI_AP_PASSWORD),
|
||||||
|
QUOTE(WIFI_SSID_CLIENT),
|
||||||
|
QUOTE(WIFI_PASSWORD_CLIENT),
|
||||||
|
true,
|
||||||
0};
|
0};
|
||||||
|
|
||||||
void InitEEPROM();
|
void InitEEPROM();
|
||||||
@@ -98,6 +110,7 @@ uint32_t Checksum_EEPROM(uint8_t const *data, size_t len);
|
|||||||
void dumpEEPROM(uint16_t memoryAddress, uint16_t length);
|
void dumpEEPROM(uint16_t memoryAddress, uint16_t length);
|
||||||
void MovePersistencePage_EEPROM(boolean reset);
|
void MovePersistencePage_EEPROM(boolean reset);
|
||||||
uint32_t ConfigSanityCheck(bool autocorrect = false);
|
uint32_t ConfigSanityCheck(bool autocorrect = false);
|
||||||
|
bool validateWiFiString(char *string, size_t size);
|
||||||
|
|
||||||
extern LubeConfig_t LubeConfig;
|
extern LubeConfig_t LubeConfig;
|
||||||
extern persistenceData_t PersistenceData;
|
extern persistenceData_t PersistenceData;
|
||||||
|
@@ -7,10 +7,10 @@
|
|||||||
* It includes enums for DTC active status, severity levels, and specific DTC codes.
|
* It includes enums for DTC active status, severity levels, and specific DTC codes.
|
||||||
* The file also defines an array of DTC definitions and a timestamp indicating the generation time.
|
* The file also defines an array of DTC definitions and a timestamp indicating the generation time.
|
||||||
*
|
*
|
||||||
* @note This file is auto-generated by a script on 2024-01-10 18:37:05.
|
* @note This file is auto-generated by a script on 2025-05-04 12:01:55.
|
||||||
*
|
*
|
||||||
* @author Marcel Peterkau
|
* @author Marcel Peterkau
|
||||||
* @date 10.01.2024
|
* @date 04.05.2025
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef DTC_DEFS_H
|
#ifndef DTC_DEFS_H
|
||||||
@@ -57,7 +57,12 @@ typedef struct {
|
|||||||
#define DTC_FAKE_DTC_INFO 14
|
#define DTC_FAKE_DTC_INFO 14
|
||||||
#define DTC_FAKE_DTC_WARN 15
|
#define DTC_FAKE_DTC_WARN 15
|
||||||
#define DTC_FAKE_DTC_CRIT 16
|
#define DTC_FAKE_DTC_CRIT 16
|
||||||
#define DTC_LAST_DTC 17
|
#define DTC_OBD2_KLINE_TIMEOUT 17
|
||||||
|
#define DTC_OBD2_CAN_TIMEOUT 18
|
||||||
|
#define DTC_OBD2_CAN_NO_RESPONSE 19
|
||||||
|
#define DTC_OBD2_KLINE_NO_RESPONSE 20
|
||||||
|
#define DTC_OBD2_KLINE_BAD_FRAME 21
|
||||||
|
#define DTC_LAST_DTC 22
|
||||||
|
|
||||||
const DTC_t dtc_definitions[] = {
|
const DTC_t dtc_definitions[] = {
|
||||||
{ DTC_NO_DTC , DTC_NONE }, // No Error
|
{ DTC_NO_DTC , DTC_NONE }, // No Error
|
||||||
@@ -77,9 +82,14 @@ const DTC_t dtc_definitions[] = {
|
|||||||
{ DTC_FAKE_DTC_INFO , DTC_INFO }, // Ein Dummy-DTC der Schwere "Info" für Debugging-Zwecke
|
{ DTC_FAKE_DTC_INFO , DTC_INFO }, // Ein Dummy-DTC der Schwere "Info" für Debugging-Zwecke
|
||||||
{ DTC_FAKE_DTC_WARN , DTC_WARN }, // Ein Dummy-DTC der Schwere "Warnung" für Debugging-Zwecke
|
{ DTC_FAKE_DTC_WARN , DTC_WARN }, // Ein Dummy-DTC der Schwere "Warnung" für Debugging-Zwecke
|
||||||
{ DTC_FAKE_DTC_CRIT , DTC_CRITICAL }, // Ein Dummy-DTC der Schwere "Kritisch" für Debugging-Zwecke
|
{ DTC_FAKE_DTC_CRIT , DTC_CRITICAL }, // Ein Dummy-DTC der Schwere "Kritisch" für Debugging-Zwecke
|
||||||
|
{ DTC_OBD2_KLINE_TIMEOUT , DTC_CRITICAL }, // Die Anfrage über OBD2-KLine konnte nicht gesendet werden. Prüfen Sie den K-Line-Treiber (z. B. L9637D) und die Verkabelung.
|
||||||
|
{ DTC_OBD2_CAN_TIMEOUT , DTC_CRITICAL }, // Die Anfrage an das Steuergerät über OBD2-CAN konnte nicht gesendet werden. Prüfen Sie die Verbindung zum CAN-Modul und die OBD2-Konfiguration.
|
||||||
|
{ DTC_OBD2_CAN_NO_RESPONSE , DTC_WARN }, // Es wurde innerhalb der erwarteten Zeit keine Antwort vom Steuergerät über OBD2-CAN empfangen. Prüfen Sie, ob das Fahrzeug OBD2 unterstützt und die Verbindung korrekt ist.
|
||||||
|
{ DTC_OBD2_KLINE_NO_RESPONSE , DTC_WARN }, // Es wurde innerhalb der erwarteten Zeit keine Antwort über OBD2-KLine empfangen. Prüfen Sie die Verbindung zum Steuergerät und die Protokollkompatibilität.
|
||||||
|
{ DTC_OBD2_KLINE_BAD_FRAME , DTC_WARN }, // Das empfangene Frame war unvollständig oder entsprach nicht dem erwarteten OBD2-Format. Möglicherweise inkompatibles Steuergerät.
|
||||||
{ DTC_LAST_DTC , DTC_NONE } // Last Error
|
{ DTC_LAST_DTC , DTC_NONE } // Last Error
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DTC_DEFS_H
|
#endif // DTC_DEFS_H
|
||||||
|
|
||||||
// CODEGENERATOR_CHECKSUM: 23dff82a4745f67041012080b05ec367c2dd44c6bb02974143b227ba49682b6f
|
// CODEGENERATOR_CHECKSUM: 15e9152fb712bc6ed7c3353a05b1b54dc697f3e489a6e1ff42b7e57f0fa094d4
|
@@ -32,6 +32,7 @@ typedef struct Globals_s
|
|||||||
bool hasDTC; /**< Flag indicating the presence of Diagnostic Trouble Codes (DTC) */
|
bool hasDTC; /**< Flag indicating the presence of Diagnostic Trouble Codes (DTC) */
|
||||||
bool measurementActive; /**< Flag indicating active measurement */
|
bool measurementActive; /**< Flag indicating active measurement */
|
||||||
uint32_t measuredPulses; /**< Number of measured pulses */
|
uint32_t measuredPulses; /**< Number of measured pulses */
|
||||||
|
bool toggle_wifi;
|
||||||
} Globals_t;
|
} Globals_t;
|
||||||
|
|
||||||
extern Globals_t globals; /**< Global variable struct */
|
extern Globals_t globals; /**< Global variable struct */
|
||||||
|
10
Software/include/obd2_can.h
Normal file
10
Software/include/obd2_can.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _OBD2_CAN_H_
|
||||||
|
#define _OBD2_CAN_H_
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
// === Funktionen ===
|
||||||
|
void Init_OBD2_CAN();
|
||||||
|
uint32_t Process_OBD2_CAN_Speed();
|
||||||
|
|
||||||
|
#endif
|
10
Software/include/obd2_kline.h
Normal file
10
Software/include/obd2_kline.h
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
#ifndef _OBD2_KLINE_H_
|
||||||
|
#define _OBD2_KLINE_H_
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
// === Funktionen ===
|
||||||
|
void Init_OBD2_KLine(Stream &serial); // Übergib z.B. SoftwareSerial oder Serial1
|
||||||
|
uint32_t Process_OBD2_KLine_Speed(); // liefert mm seit letztem Aufruf
|
||||||
|
|
||||||
|
#endif
|
@@ -3,10 +3,10 @@
|
|||||||
*
|
*
|
||||||
* @brief Header file for converting structs to JSON objects.
|
* @brief Header file for converting structs to JSON objects.
|
||||||
*
|
*
|
||||||
* @note This file is auto-generated by a script on 2024-01-10 18:01:52.
|
* @note This file is auto-generated by a script on 2024-01-30 20:29:34.
|
||||||
*
|
*
|
||||||
* @author Marcel Peterkau
|
* @author Marcel Peterkau
|
||||||
* @date 10.01.2024
|
* @date 30.01.2024
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _STRUCT2JSON_H_
|
#ifndef _STRUCT2JSON_H_
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
void generateJsonObject_LubeConfig(JsonObject& data);
|
void generateJsonObject_LubeConfig(JsonObject data);
|
||||||
void generateJsonObject_PersistenceData(JsonObject& data);
|
void generateJsonObject_PersistenceData(JsonObject data);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _STRUCT2JSON_H_ */
|
#endif /* _STRUCT2JSON_H_ */
|
||||||
|
|
||||||
// CODEGENERATOR_CHECKSUM: 9e8dd21170fd6ef8fbf8c4b156d9af751836a76081f811bf0e3ab2b1eb8ee48c
|
// CODEGENERATOR_CHECKSUM: 59f35aadffd0bbef253210ea2fbaaf9a515553a2e3cc9bf4cfa2819b63c969ce
|
@@ -31,10 +31,19 @@
|
|||||||
#include "debugger.h"
|
#include "debugger.h"
|
||||||
#include "struct2json.h"
|
#include "struct2json.h"
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
info,
|
||||||
|
success,
|
||||||
|
warning,
|
||||||
|
error
|
||||||
|
} NotificationType_t;
|
||||||
|
|
||||||
void initWebUI();
|
void initWebUI();
|
||||||
void Webserver_Process();
|
void Webserver_Process();
|
||||||
void Webserver_Shutdown();
|
void Webserver_Shutdown();
|
||||||
|
|
||||||
void Websocket_PushLiveDebug(String Message);
|
void Websocket_PushLiveDebug(String Message);
|
||||||
|
void Websocket_PushNotification(String Message, NotificationType_t type);
|
||||||
|
|
||||||
#endif // _WEBUI_H_
|
#endif // _WEBUI_H_
|
||||||
|
@@ -11,21 +11,13 @@
|
|||||||
[platformio]
|
[platformio]
|
||||||
extra_configs =
|
extra_configs =
|
||||||
wifi_credentials.ini
|
wifi_credentials.ini
|
||||||
default_envs = pcb_rev_1-3, pcb_rev_1-2
|
default_envs = pcb_rev_1-3_serial, pcb_rev_1-3_ota, pcb_rev_1-2_serial, pcb_rev_1-2_ota
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
platform = espressif8266
|
platform = espressif8266
|
||||||
board = d1_mini
|
board = d1_mini
|
||||||
framework = arduino
|
framework = arduino
|
||||||
|
upload_speed = 921600
|
||||||
upload_speed = 921600
|
|
||||||
|
|
||||||
upload_protocol = espota
|
|
||||||
upload_port = 10.0.1.14
|
|
||||||
upload_flags =
|
|
||||||
--port=8266
|
|
||||||
--auth=${wifi_cred.admin_password}
|
|
||||||
|
|
||||||
|
|
||||||
build_flags =
|
build_flags =
|
||||||
!python codegen/git_rev_macro.py
|
!python codegen/git_rev_macro.py
|
||||||
@@ -35,6 +27,10 @@ build_flags =
|
|||||||
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
|
-DWIFI_AP_PASSWORD=${wifi_cred.wifi_ap_password}
|
||||||
-DWIFI_AP_IP_GW=10,0,0,1
|
-DWIFI_AP_IP_GW=10,0,0,1
|
||||||
-DATOMIC_FS_UPDATE
|
-DATOMIC_FS_UPDATE
|
||||||
|
-DCAN_DEBUG_MESSAGE
|
||||||
|
;-DFEATURE_ENABLE_WIFI_CLIENT
|
||||||
|
;-DFEATURE_ENABLE_TIMER
|
||||||
|
-DFEATURE_ENABLE_OLED
|
||||||
|
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
extra_scripts =
|
extra_scripts =
|
||||||
@@ -52,37 +48,51 @@ lib_deps =
|
|||||||
robtillaart/I2C_EEPROM @ ^1.8.2
|
robtillaart/I2C_EEPROM @ ^1.8.2
|
||||||
esphome/ESPAsyncWebServer-esphome @ 3.1.0
|
esphome/ESPAsyncWebServer-esphome @ 3.1.0
|
||||||
bblanchon/ArduinoJson @ ^7.0.1
|
bblanchon/ArduinoJson @ ^7.0.1
|
||||||
|
|
||||||
[env:pcb_rev_1-3]
|
|
||||||
;build_type = debug
|
|
||||||
custom_pcb_revision = 3
|
|
||||||
build_flags =
|
|
||||||
${env.build_flags}
|
|
||||||
;-DFEATURE_ENABLE_WIFI_CLIENT
|
|
||||||
;-DFEATURE_ENABLE_TIMER
|
|
||||||
-DFEATURE_ENABLE_OLED
|
|
||||||
-DCAN_DEBUG_MESSAGE
|
|
||||||
-DPCB_REV=${this.custom_pcb_revision}
|
|
||||||
|
|
||||||
board_build.ldscript = eagle.flash.4m1m.ld
|
|
||||||
|
|
||||||
lib_deps =
|
|
||||||
${env.lib_deps}
|
|
||||||
coryjfowler/mcp_can @ ^1.5.0
|
coryjfowler/mcp_can @ ^1.5.0
|
||||||
mikalhart/TinyGPSPlus @ ^1.0.3
|
mikalhart/TinyGPSPlus @ ^1.0.3
|
||||||
|
|
||||||
[env:pcb_rev_1-2]
|
|
||||||
;build_type = debug
|
[env:pcb_rev_1-3_serial]
|
||||||
custom_pcb_revision = 2
|
extends = env
|
||||||
|
custom_pcb_revision = 3
|
||||||
|
upload_protocol = esptool
|
||||||
build_flags =
|
build_flags =
|
||||||
${env.build_flags}
|
${env.build_flags}
|
||||||
;-DFEATURE_ENABLE_WIFI_CLIENT
|
|
||||||
;-DFEATURE_ENABLE_TIMER
|
|
||||||
-DFEATURE_ENABLE_OLED
|
|
||||||
-DFEATURE_ENABLE_WEBSOCKETS
|
|
||||||
-DPCB_REV=${this.custom_pcb_revision}
|
-DPCB_REV=${this.custom_pcb_revision}
|
||||||
|
|
||||||
board_build.ldscript = eagle.flash.4m1m.ld
|
board_build.ldscript = eagle.flash.4m1m.ld
|
||||||
|
|
||||||
lib_deps =
|
[env:pcb_rev_1-3_ota]
|
||||||
${env.lib_deps}
|
extends = env
|
||||||
|
custom_pcb_revision = 3
|
||||||
|
upload_protocol = espota
|
||||||
|
upload_port = 10.0.1.14
|
||||||
|
upload_flags =
|
||||||
|
--port=8266
|
||||||
|
--auth=${wifi_cred.admin_password}
|
||||||
|
build_flags =
|
||||||
|
${env.build_flags}
|
||||||
|
-DPCB_REV=${this.custom_pcb_revision}
|
||||||
|
board_build.ldscript = eagle.flash.4m1m.ld
|
||||||
|
|
||||||
|
|
||||||
|
[env:pcb_rev_1-2_serial]
|
||||||
|
extends = env
|
||||||
|
custom_pcb_revision = 2
|
||||||
|
upload_protocol = esptool
|
||||||
|
build_flags =
|
||||||
|
${env.build_flags}
|
||||||
|
-DPCB_REV=${this.custom_pcb_revision}
|
||||||
|
board_build.ldscript = eagle.flash.4m1m.ld
|
||||||
|
|
||||||
|
[env:pcb_rev_1-2_ota]
|
||||||
|
extends = env
|
||||||
|
custom_pcb_revision = 2
|
||||||
|
upload_protocol = espota
|
||||||
|
upload_port = 10.0.1.14
|
||||||
|
upload_flags =
|
||||||
|
--port=8266
|
||||||
|
--auth=${wifi_cred.admin_password}
|
||||||
|
build_flags =
|
||||||
|
${env.build_flags}
|
||||||
|
-DPCB_REV=${this.custom_pcb_revision}
|
||||||
|
board_build.ldscript = eagle.flash.4m1m.ld
|
||||||
|
@@ -49,21 +49,6 @@ void Init_CAN()
|
|||||||
CAN0.setMode(MCP_NORMAL);
|
CAN0.setMode(MCP_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Processes CAN messages and sends a CAN debug message periodically.
|
|
||||||
*
|
|
||||||
* This function processes CAN messages and sends a CAN debug message periodically based on a time interval.
|
|
||||||
*/
|
|
||||||
void CAN_Process()
|
|
||||||
{
|
|
||||||
static uint32_t previousMillis = 0;
|
|
||||||
|
|
||||||
if (millis() - previousMillis >= 100)
|
|
||||||
{
|
|
||||||
sendCANDebugMessage();
|
|
||||||
previousMillis = millis();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @brief Processes CAN messages to determine the wheel speed based on the configured CAN source.
|
* @brief Processes CAN messages to determine the wheel speed based on the configured CAN source.
|
||||||
*
|
*
|
||||||
@@ -115,6 +100,16 @@ uint32_t Process_CAN_WheelSpeed()
|
|||||||
MaintainDTC(DTC_NO_CAN_SIGNAL, (millis() > lastRecTimestamp + 10000 ? true : false));
|
MaintainDTC(DTC_NO_CAN_SIGNAL, (millis() > lastRecTimestamp + 10000 ? true : false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef CAN_DEBUG_MESSAGE
|
||||||
|
static uint32_t previousMillis = 0;
|
||||||
|
|
||||||
|
if (millis() - previousMillis >= 1000)
|
||||||
|
{
|
||||||
|
sendCANDebugMessage();
|
||||||
|
previousMillis = millis();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return milimeters_to_add;
|
return milimeters_to_add;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -182,7 +177,7 @@ void sendCANDebugMessage()
|
|||||||
}
|
}
|
||||||
else if (DebugSendFailTimeout == MAX_DEBUG_RETRIES)
|
else if (DebugSendFailTimeout == MAX_DEBUG_RETRIES)
|
||||||
{
|
{
|
||||||
Debug_pushMessage("disable CAN-DbgMsg due to timeout");
|
Debug_pushMessage("disable CAN-DbgMsg due to timeout\n");
|
||||||
DebugSendFailTimeout++;
|
DebugSendFailTimeout++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -7,8 +7,10 @@ const char *SpeedSourceString[] = {
|
|||||||
#endif
|
#endif
|
||||||
"Impuls",
|
"Impuls",
|
||||||
"GPS",
|
"GPS",
|
||||||
"CAN-Bus"
|
"CAN-Bus",
|
||||||
};
|
"OBD2 (K-Line)",
|
||||||
|
"OBD2 (CAN)",
|
||||||
|
};
|
||||||
|
|
||||||
const size_t SpeedSourceString_Elements = sizeof(SpeedSourceString) / sizeof(SpeedSourceString[0]);
|
const size_t SpeedSourceString_Elements = sizeof(SpeedSourceString) / sizeof(SpeedSourceString[0]);
|
||||||
|
|
||||||
@@ -19,14 +21,15 @@ const char *GPSBaudRateString[] = {
|
|||||||
"19200",
|
"19200",
|
||||||
"38400",
|
"38400",
|
||||||
"57600",
|
"57600",
|
||||||
"115200"
|
"115200",
|
||||||
};
|
};
|
||||||
|
|
||||||
const size_t GPSBaudRateString_Elements = sizeof(GPSBaudRateString) / sizeof(GPSBaudRateString[0]);
|
const size_t GPSBaudRateString_Elements = sizeof(GPSBaudRateString) / sizeof(GPSBaudRateString[0]);
|
||||||
|
|
||||||
// String representation of CANSource enum
|
// String representation of CANSource enum
|
||||||
const char *CANSourceString[] = {
|
const char *CANSourceString[] = {
|
||||||
"KTM 890 Adventure R (2021)",
|
"KTM 890 Adventure R (2021)",
|
||||||
"KTM 1290 Superduke R (2023)"};
|
"KTM 1290 Superduke R (2023)",
|
||||||
|
};
|
||||||
|
|
||||||
const size_t CANSourceString_Elements = sizeof(CANSourceString) / sizeof(CANSourceString[0]);
|
const size_t CANSourceString_Elements = sizeof(CANSourceString) / sizeof(CANSourceString[0]);
|
@@ -18,7 +18,7 @@ LubeConfig_t LubeConfig;
|
|||||||
persistenceData_t PersistenceData;
|
persistenceData_t PersistenceData;
|
||||||
|
|
||||||
// EEPROM version identifier
|
// EEPROM version identifier
|
||||||
const uint16_t eeVersion = 2; // Increment this version when changing EEPROM structures
|
const uint16_t eeVersion = EEPROM_STRUCTURE_REVISION;
|
||||||
|
|
||||||
// Flag indicating whether EEPROM is available
|
// Flag indicating whether EEPROM is available
|
||||||
boolean eeAvailable = false;
|
boolean eeAvailable = false;
|
||||||
@@ -145,19 +145,14 @@ void GetConfig_EEPROM()
|
|||||||
uint32_t checksum = LubeConfig.checksum;
|
uint32_t checksum = LubeConfig.checksum;
|
||||||
LubeConfig.checksum = 0;
|
LubeConfig.checksum = 0;
|
||||||
|
|
||||||
if (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) != checksum)
|
MaintainDTC(DTC_EEPROM_CFG_BAD, (Checksum_EEPROM((uint8_t *)&LubeConfig, sizeof(LubeConfig)) != checksum));
|
||||||
{
|
|
||||||
MaintainDTC(DTC_EEPROM_CFG_BAD, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
LubeConfig.checksum = checksum;
|
LubeConfig.checksum = checksum;
|
||||||
|
|
||||||
uint32_t ConfigSanityCheckResult = ConfigSanityCheck(false);
|
uint32_t ConfigSanityCheckResult = ConfigSanityCheck(false);
|
||||||
|
|
||||||
if (ConfigSanityCheckResult > 0)
|
MaintainDTC(DTC_EEPROM_CFG_SANITY, (ConfigSanityCheckResult > 0), ConfigSanityCheckResult);
|
||||||
{
|
|
||||||
MaintainDTC(DTC_EEPROM_CFG_SANITY, true, ConfigSanityCheckResult);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -210,10 +205,8 @@ void GetPersistence_EEPROM()
|
|||||||
uint32_t checksum = PersistenceData.checksum;
|
uint32_t checksum = PersistenceData.checksum;
|
||||||
PersistenceData.checksum = 0;
|
PersistenceData.checksum = 0;
|
||||||
|
|
||||||
if (Checksum_EEPROM((uint8_t *)&PersistenceData, sizeof(PersistenceData)) != checksum)
|
MaintainDTC(DTC_EEPROM_PDS_BAD, (Checksum_EEPROM((uint8_t *)&PersistenceData, sizeof(PersistenceData)) != checksum));
|
||||||
{
|
|
||||||
MaintainDTC(DTC_EEPROM_PDS_BAD, true);
|
|
||||||
}
|
|
||||||
PersistenceData.checksum = checksum;
|
PersistenceData.checksum = checksum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -492,6 +485,78 @@ uint32_t ConfigSanityCheck(bool autocorrect)
|
|||||||
if (autocorrect)
|
if (autocorrect)
|
||||||
LubeConfig.CANSource = LubeConfig_defaults.CANSource;
|
LubeConfig.CANSource = LubeConfig_defaults.CANSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!validateWiFiString(LubeConfig.wifi_ap_ssid, sizeof(LubeConfig.wifi_ap_ssid)))
|
||||||
|
{
|
||||||
|
SET_BIT(setting_reset_bits, 14);
|
||||||
|
if (autocorrect)
|
||||||
|
strncpy(LubeConfig.wifi_ap_ssid, LubeConfig_defaults.wifi_ap_ssid, sizeof(LubeConfig.wifi_ap_ssid));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!validateWiFiString(LubeConfig.wifi_ap_password, sizeof(LubeConfig.wifi_ap_password)))
|
||||||
|
{
|
||||||
|
SET_BIT(setting_reset_bits, 15);
|
||||||
|
if (autocorrect)
|
||||||
|
strncpy(LubeConfig.wifi_ap_password, LubeConfig_defaults.wifi_ap_password, sizeof(LubeConfig.wifi_ap_password));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!validateWiFiString(LubeConfig.wifi_client_ssid, sizeof(LubeConfig.wifi_client_ssid)))
|
||||||
|
{
|
||||||
|
SET_BIT(setting_reset_bits, 16);
|
||||||
|
if (autocorrect)
|
||||||
|
strncpy(LubeConfig.wifi_client_ssid, LubeConfig_defaults.wifi_client_ssid, sizeof(LubeConfig.wifi_client_ssid));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!validateWiFiString(LubeConfig.wifi_client_password, sizeof(LubeConfig.wifi_client_password)))
|
||||||
|
{
|
||||||
|
SET_BIT(setting_reset_bits, 17);
|
||||||
|
if (autocorrect)
|
||||||
|
strncpy(LubeConfig.wifi_client_password, LubeConfig_defaults.wifi_client_password, sizeof(LubeConfig.wifi_client_password));
|
||||||
|
}
|
||||||
// Return the bitmask indicating which settings need to be reset
|
// Return the bitmask indicating which settings need to be reset
|
||||||
return setting_reset_bits;
|
return setting_reset_bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Validates whether a given string contains only characters allowed in WiFi SSIDs and passwords.
|
||||||
|
*
|
||||||
|
* This function checks each character in the provided string to ensure
|
||||||
|
* that it contains only characters allowed in WiFi SSIDs and passwords.
|
||||||
|
* It considers characters from 'A' to 'Z', 'a' to 'z', '0' to '9', as well as
|
||||||
|
* the following special characters: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
|
||||||
|
*
|
||||||
|
* @param string Pointer to the string to be validated.
|
||||||
|
* @param size Size of the string including the null-terminator.
|
||||||
|
* @return true if the string contains only allowed characters or is NULL,
|
||||||
|
* false otherwise.
|
||||||
|
*/
|
||||||
|
bool validateWiFiString(char *string, size_t size)
|
||||||
|
{
|
||||||
|
if (string == NULL)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < size; i++)
|
||||||
|
{
|
||||||
|
char c = string[i];
|
||||||
|
if (c == '\0')
|
||||||
|
{
|
||||||
|
// Reached the end of the string, all characters were valid WiFi characters.
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
|
||||||
|
(c >= '0' && c <= '9') || c == '!' || c == '"' || c == '#' ||
|
||||||
|
c == '$' || c == '%' || c == '&' || c == '\'' || c == '(' ||
|
||||||
|
c == ')' || c == '*' || c == '+' || c == ',' || c == '-' ||
|
||||||
|
c == '.' || c == '/' || c == ':' || c == ';' || c == '<' ||
|
||||||
|
c == '=' || c == '>' || c == '?' || c == '@' || c == '[' ||
|
||||||
|
c == '\\' || c == ']' || c == '^' || c == '_' || c == '`' ||
|
||||||
|
c == '{' || c == '|' || c == '}' || c == '~'))
|
||||||
|
{
|
||||||
|
// Found a character that is not a valid WiFi character.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If the loop completes without finding a null terminator, the string is invalid.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -15,18 +15,19 @@
|
|||||||
|
|
||||||
DebugStatus_t DebuggerStatus[dbg_cntElements];
|
DebugStatus_t DebuggerStatus[dbg_cntElements];
|
||||||
|
|
||||||
String IpAddress2String(const IPAddress &ipAddress);
|
|
||||||
void processCmdDebug(String command);
|
void processCmdDebug(String command);
|
||||||
void Debug_formatCFG();
|
void Debug_formatCFG();
|
||||||
void Debug_formatPersistence();
|
void Debug_formatPersistence();
|
||||||
void Debug_printSystemInfo();
|
void Debug_printSystemInfo();
|
||||||
void Debug_printWifiInfo();
|
void Debug_printWifiInfo();
|
||||||
void Debug_CheckEEPOM();
|
void Debug_CheckEEPOM(bool autocorrect);
|
||||||
void Debug_dumpConfig();
|
void Debug_dumpConfig();
|
||||||
void Debug_dumpPersistance();
|
void Debug_dumpPersistance();
|
||||||
void Debug_ShowDTCs();
|
void Debug_ShowDTCs();
|
||||||
void Debug_dumpGlobals();
|
void Debug_dumpGlobals();
|
||||||
void Debug_printHelp();
|
void Debug_printHelp();
|
||||||
|
void Debug_Purge();
|
||||||
|
const char *uint32_to_binary_string(uint32_t num);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the debugger by setting the initial status for different debug ports.
|
* @brief Initializes the debugger by setting the initial status for different debug ports.
|
||||||
@@ -73,6 +74,7 @@ void Debug_Process()
|
|||||||
inputBuffer[inputCnt] = 0; // terminate the String
|
inputBuffer[inputCnt] = 0; // terminate the String
|
||||||
inputCnt = 0;
|
inputCnt = 0;
|
||||||
InputProcessed = CMD_COMPLETE;
|
InputProcessed = CMD_COMPLETE;
|
||||||
|
Serial.write(inputChar);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x1B: // Esc
|
case 0x1B: // Esc
|
||||||
@@ -84,6 +86,7 @@ void Debug_Process()
|
|||||||
case 0x21 ... 0x7E: // it's a real letter or sign and not some control-chars
|
case 0x21 ... 0x7E: // it's a real letter or sign and not some control-chars
|
||||||
inputBuffer[inputCnt] = inputChar;
|
inputBuffer[inputCnt] = inputChar;
|
||||||
inputCnt++;
|
inputCnt++;
|
||||||
|
Serial.write(inputChar);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -117,6 +120,10 @@ void Debug_Process()
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (InputProcessed != IDLE)
|
||||||
|
Serial.print(">");
|
||||||
|
|
||||||
InputProcessed = IDLE;
|
InputProcessed = IDLE;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -152,7 +159,7 @@ void Debug_pushMessage(const char *format, ...)
|
|||||||
if ((DebuggerStatus[dbg_Serial] == enabled) || (DebuggerStatus[dbg_Webui] == enabled))
|
if ((DebuggerStatus[dbg_Serial] == enabled) || (DebuggerStatus[dbg_Webui] == enabled))
|
||||||
{
|
{
|
||||||
char buff[128]; // Buffer to hold the formatted message
|
char buff[128]; // Buffer to hold the formatted message
|
||||||
va_list arg; // Variable argument list for vsnprintf
|
va_list arg; // Variable argument list for vsnprintf
|
||||||
va_start(arg, format);
|
va_start(arg, format);
|
||||||
|
|
||||||
// Format the message and store it in the buffer
|
// Format the message and store it in the buffer
|
||||||
@@ -230,7 +237,9 @@ void processCmdDebug(String command)
|
|||||||
else if (command == "formatPDS")
|
else if (command == "formatPDS")
|
||||||
Debug_formatPersistence();
|
Debug_formatPersistence();
|
||||||
else if (command == "checkEE")
|
else if (command == "checkEE")
|
||||||
Debug_CheckEEPOM();
|
Debug_CheckEEPOM(false);
|
||||||
|
else if (command == "checkEEfix")
|
||||||
|
Debug_CheckEEPOM(true);
|
||||||
else if (command == "dumpEE1k")
|
else if (command == "dumpEE1k")
|
||||||
dumpEEPROM(0, 1024);
|
dumpEEPROM(0, 1024);
|
||||||
else if (command == "dumpEE")
|
else if (command == "dumpEE")
|
||||||
@@ -257,6 +266,18 @@ void processCmdDebug(String command)
|
|||||||
MaintainDTC(DTC_FAKE_DTC_WARN, true, millis());
|
MaintainDTC(DTC_FAKE_DTC_WARN, true, millis());
|
||||||
else if (command == "dtc_info")
|
else if (command == "dtc_info")
|
||||||
MaintainDTC(DTC_FAKE_DTC_INFO, true, millis());
|
MaintainDTC(DTC_FAKE_DTC_INFO, true, millis());
|
||||||
|
else if (command == "notify_error")
|
||||||
|
Websocket_PushNotification("Debug Error Notification", error);
|
||||||
|
else if (command == "notify_warning")
|
||||||
|
Websocket_PushNotification("Debug Warning Notification", warning);
|
||||||
|
else if (command == "notify_success")
|
||||||
|
Websocket_PushNotification("Debug Success Notification", success);
|
||||||
|
else if (command == "notify_info")
|
||||||
|
Websocket_PushNotification("Debug Info Notification", info);
|
||||||
|
else if (command == "purge")
|
||||||
|
Debug_Purge();
|
||||||
|
else if (command == "toggle_wifi")
|
||||||
|
globals.toggle_wifi = true;
|
||||||
else
|
else
|
||||||
Debug_pushMessage("unknown Command\n");
|
Debug_pushMessage("unknown Command\n");
|
||||||
}
|
}
|
||||||
@@ -363,14 +384,14 @@ void Debug_dumpPersistance()
|
|||||||
*/
|
*/
|
||||||
void Debug_printWifiInfo()
|
void Debug_printWifiInfo()
|
||||||
{
|
{
|
||||||
// Add relevant code here if needed
|
Debug_pushMessage("IP Adress: %s\n", WiFi.localIP().toString().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Checks the EEPROM data integrity by calculating and comparing checksums.
|
* @brief Checks the EEPROM data integrity by calculating and comparing checksums.
|
||||||
* Prints the result to the debug output.
|
* Prints the result to the debug output.
|
||||||
*/
|
*/
|
||||||
void Debug_CheckEEPOM()
|
void Debug_CheckEEPOM(bool autocorrect)
|
||||||
{
|
{
|
||||||
// Check PersistenceData EEPROM checksum
|
// Check PersistenceData EEPROM checksum
|
||||||
uint32_t checksum = PersistenceData.checksum;
|
uint32_t checksum = PersistenceData.checksum;
|
||||||
@@ -400,6 +421,17 @@ void Debug_CheckEEPOM()
|
|||||||
Debug_pushMessage("LubeConfig EEPROM Checksum BAD\n");
|
Debug_pushMessage("LubeConfig EEPROM Checksum BAD\n");
|
||||||
}
|
}
|
||||||
LubeConfig.checksum = checksum;
|
LubeConfig.checksum = checksum;
|
||||||
|
|
||||||
|
uint32_t sanitycheck = ConfigSanityCheck(autocorrect);
|
||||||
|
|
||||||
|
if (sanitycheck == 0)
|
||||||
|
{
|
||||||
|
Debug_pushMessage("LubeConfig Sanity Check OK\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug_pushMessage("LubeConfig Sanity Check BAD: %s\n", uint32_to_binary_string(sanitycheck));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -460,3 +492,44 @@ void Debug_printHelp()
|
|||||||
Debug_pushMessage(buff);
|
Debug_pushMessage(buff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Start purging for 10 pulses.
|
||||||
|
*/
|
||||||
|
void Debug_Purge()
|
||||||
|
{
|
||||||
|
globals.purgePulses = 10;
|
||||||
|
globals.resumeStatus = globals.systemStatus;
|
||||||
|
globals.systemStatus = sysStat_Purge;
|
||||||
|
|
||||||
|
Debug_pushMessage("Purging 10 pulses\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Convert a uint32_t value to a binary string with nibbles separated by a space.
|
||||||
|
*
|
||||||
|
* This function takes a uint32_t value and converts it to a binary string
|
||||||
|
* representation. The binary string is stored in a static buffer and returned
|
||||||
|
* as a const char pointer. Each nibble (4 bits) in the binary representation
|
||||||
|
* is separated by a space. The buffer is overwritten on subsequent calls to
|
||||||
|
* this function.
|
||||||
|
*
|
||||||
|
* @param num The uint32_t value to convert.
|
||||||
|
* @return A pointer to a const char string containing the binary representation
|
||||||
|
* of the input number with nibbles separated by a space.
|
||||||
|
*/
|
||||||
|
const char *uint32_to_binary_string(uint32_t num)
|
||||||
|
{
|
||||||
|
static char binary_str[65]; // 32 bits + 31 spaces + null terminator
|
||||||
|
int i, j;
|
||||||
|
for (i = 31, j = 0; i >= 0; i--, j++)
|
||||||
|
{
|
||||||
|
binary_str[j] = ((num >> i) & 1) ? '1' : '0';
|
||||||
|
if (i % 4 == 0 && i != 0)
|
||||||
|
{
|
||||||
|
binary_str[++j] = ' '; // Insert space after every nibble
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binary_str[j] = '\0'; // Null terminator
|
||||||
|
return binary_str;
|
||||||
|
}
|
@@ -1,18 +1,23 @@
|
|||||||
# No. | DTC-Constant | Severity | Title | Description
|
# No. | DTC-Constant | Severity | Title | Description
|
||||||
#-----|------------------------------|---------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------------------------
|
#-----|------------------------------|---------------|----------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||||
1; DTC_TANK_EMPTY; DTC_CRITICAL; Ölvorrat leer; Ölvorrat ist komplett leer. Den Ölvorrat auffüllen und im Menu 'Wartung' zurück setzen
|
1; DTC_TANK_EMPTY; DTC_CRITICAL; Ölvorrat leer; Ölvorrat ist komplett leer. Den Ölvorrat auffüllen und im Menu 'Wartung' zurück setzen
|
||||||
2; DTC_TANK_LOW; DTC_WARN; Ölvorrat niedrig; Ölvorrat ist unter der Warnschwelle. Den Ölvorrat demnächst auffüllen und im Menu 'Wartung' zurück setzen
|
2; DTC_TANK_LOW; DTC_WARN; Ölvorrat niedrig; Ölvorrat ist unter der Warnschwelle. Den Ölvorrat demnächst auffüllen und im Menu 'Wartung' zurück setzen
|
||||||
3; DTC_NO_EEPROM_FOUND; DTC_CRITICAL; kein EEPROM erkannt; Es wurde kein EEPROM gefunden. Dies lässt einen Hardware-Defekt vermuten.
|
3; DTC_NO_EEPROM_FOUND; DTC_CRITICAL; kein EEPROM erkannt; Es wurde kein EEPROM gefunden. Dies lässt einen Hardware-Defekt vermuten.
|
||||||
4; DTC_EEPROM_CFG_BAD; DTC_CRITICAL; EEPROM CFG Checksumme; Die Checksumme der Config-Partition des EEPROM ist ungültig. Setzen sie den EEPROM-Bereich 'CFG' im Menu 'Wartung' zurück
|
4; DTC_EEPROM_CFG_BAD; DTC_CRITICAL; EEPROM CFG Checksumme; Die Checksumme der Config-Partition des EEPROM ist ungültig. Setzen sie den EEPROM-Bereich 'CFG' im Menu 'Wartung' zurück
|
||||||
5; DTC_EEPROM_PDS_BAD; DTC_CRITICAL; EEPROM PDS Checksumme; Die Checksumme der Betriebsdaten-Partition des EEPROM ist ungültig. Setzen sie den EEPROM-Bereich 'PDS' im Menu 'Wartung' zurück
|
5; DTC_EEPROM_PDS_BAD; DTC_CRITICAL; EEPROM PDS Checksumme; Die Checksumme der Betriebsdaten-Partition des EEPROM ist ungültig. Setzen sie den EEPROM-Bereich 'PDS' im Menu 'Wartung' zurück
|
||||||
6; DTC_EEPROM_PDSADRESS_BAD; DTC_CRITICAL; EEPROM PDS Adresse; Die Adresse der Betriebsdaten-Partition im EEPROM ist ungültig. Setzen sie den EEPROM-Bereich 'PDS' im Menu 'Wartung' zurück
|
6; DTC_EEPROM_PDSADRESS_BAD; DTC_CRITICAL; EEPROM PDS Adresse; Die Adresse der Betriebsdaten-Partition im EEPROM ist ungültig. Setzen sie den EEPROM-Bereich 'PDS' im Menu 'Wartung' zurück
|
||||||
7; DTC_EEPROM_VERSION_BAD; DTC_CRITICAL; EEPROM Version falsch; Die Layout-Version des EEPROM stimmt nicht mit der Firmware-Version überein. Setzen sie den EEPROM-Bereich 'CFG' im Menu 'Wartung' zurück
|
7; DTC_EEPROM_VERSION_BAD; DTC_CRITICAL; EEPROM Version falsch; Die Layout-Version des EEPROM stimmt nicht mit der Firmware-Version überein. Setzen sie den EEPROM-Bereich 'CFG' im Menu 'Wartung' zurück
|
||||||
8; DTC_FLASHFS_ERROR; DTC_CRITICAL; Flashspeicher Fehler; Der Flashspeicher konnte nicht initialisiert werden. Aktualisieren sie Flash & Firmware
|
8; DTC_FLASHFS_ERROR; DTC_CRITICAL; Flashspeicher Fehler; Der Flashspeicher konnte nicht initialisiert werden. Aktualisieren sie Flash & Firmware
|
||||||
9; DTC_FLASHFS_VERSION_ERROR; DTC_CRITICAL; Flashversion falsch; Die Version des Flashspeicher stimmt nicht mit der Firmware-Version überein. Aktualisieren sie den Flash mit der passenden Update-Datei
|
9; DTC_FLASHFS_VERSION_ERROR; DTC_CRITICAL; Flashversion falsch; Die Version des Flashspeicher stimmt nicht mit der Firmware-Version überein. Aktualisieren sie den Flash mit der passenden Update-Datei
|
||||||
10; DTC_NO_GPS_SERIAL; DTC_CRITICAL; Keine GPS-Verbindung; Es wurde kein GPS-Signal über die serielle Schnittstelle empfangen, Prüfen sie die Verbindung und das GPS-Modul
|
10; DTC_NO_GPS_SERIAL; DTC_CRITICAL; Keine GPS-Verbindung; Es wurde kein GPS-Signal über die serielle Schnittstelle empfangen, Prüfen sie die Verbindung und das GPS-Modul
|
||||||
11; DTC_CAN_TRANSCEIVER_FAILED; DTC_CRITICAL; CAN-Transceiver Error; Es konnte keine Verbindung zum CAN-Transceiver hergestellt werden. Prüfen Sie die Hardware auf Defekte
|
11; DTC_CAN_TRANSCEIVER_FAILED; DTC_CRITICAL; CAN-Transceiver Error; Es konnte keine Verbindung zum CAN-Transceiver hergestellt werden. Prüfen Sie die Hardware auf Defekte
|
||||||
12; DTC_NO_CAN_SIGNAL; DTC_WARN; Keine CAN-Verbindung; Es konnte kein CAN-Signal empfangen werden. Prüfen sie die Verbindung und die Einstellungen
|
12; DTC_NO_CAN_SIGNAL; DTC_WARN; Keine CAN-Verbindung; Es konnte kein CAN-Signal empfangen werden. Prüfen sie die Verbindung und die Einstellungen
|
||||||
13; DTC_EEPROM_CFG_SANITY; DTC_WARN; Config-Validierung; Ein oder mehrer Einstellungswerte sind ausserhalb plausibler Werte. Prüfen Sie Ihre Einstellungen
|
13; DTC_EEPROM_CFG_SANITY; DTC_WARN; Config-Validierung; Ein oder mehrer Einstellungswerte sind ausserhalb plausibler Werte. Prüfen Sie Ihre Einstellungen
|
||||||
14; DTC_FAKE_DTC_INFO; DTC_INFO; Dummy-DTC Info; Ein Dummy-DTC der Schwere "Info" für Debugging-Zwecke
|
14; DTC_FAKE_DTC_INFO; DTC_INFO; Dummy-DTC Info; Ein Dummy-DTC der Schwere "Info" für Debugging-Zwecke
|
||||||
15; DTC_FAKE_DTC_WARN; DTC_WARN; Dummy-DTC Warnung; Ein Dummy-DTC der Schwere "Warnung" für Debugging-Zwecke
|
15; DTC_FAKE_DTC_WARN; DTC_WARN; Dummy-DTC Warnung; Ein Dummy-DTC der Schwere "Warnung" für Debugging-Zwecke
|
||||||
16; DTC_FAKE_DTC_CRIT; DTC_CRITICAL; Dummy-DTC Kritisch; Ein Dummy-DTC der Schwere "Kritisch" für Debugging-Zwecke
|
16; DTC_FAKE_DTC_CRIT; DTC_CRITICAL; Dummy-DTC Kritisch; Ein Dummy-DTC der Schwere "Kritisch" für Debugging-Zwecke
|
||||||
|
17; DTC_OBD2_KLINE_TIMEOUT; DTC_CRITICAL; OBD2-KLine Timeout; Die Anfrage über OBD2-KLine konnte nicht gesendet werden. Prüfen Sie den K-Line-Treiber (z. B. L9637D) und die Verkabelung.
|
||||||
|
18; DTC_OBD2_CAN_TIMEOUT; DTC_CRITICAL; OBD2-CAN Timeout; Die Anfrage an das Steuergerät über OBD2-CAN konnte nicht gesendet werden. Prüfen Sie die Verbindung zum CAN-Modul und die OBD2-Konfiguration.
|
||||||
|
19; DTC_OBD2_CAN_NO_RESPONSE; DTC_WARN; Keine OBD2-CAN Antwort; Es wurde innerhalb der erwarteten Zeit keine Antwort vom Steuergerät über OBD2-CAN empfangen. Prüfen Sie, ob das Fahrzeug OBD2 unterstützt und die Verbindung korrekt ist.
|
||||||
|
20; DTC_OBD2_KLINE_NO_RESPONSE; DTC_WARN; Keine OBD2-KLine Antwort; Es wurde innerhalb der erwarteten Zeit keine Antwort über OBD2-KLine empfangen. Prüfen Sie die Verbindung zum Steuergerät und die Protokollkompatibilität.
|
||||||
|
21; DTC_OBD2_KLINE_BAD_FRAME; DTC_WARN; OBD2-KLine Antwort ungültig; Das empfangene Frame war unvollständig oder entsprach nicht dem erwarteten OBD2-Format. Möglicherweise inkompatibles Steuergerät.
|
@@ -26,4 +26,5 @@ void initGlobals()
|
|||||||
globals.systemStatus = sysStat_Startup;
|
globals.systemStatus = sysStat_Startup;
|
||||||
globals.measurementActive = false;
|
globals.measurementActive = false;
|
||||||
globals.measuredPulses = 0;
|
globals.measuredPulses = 0;
|
||||||
|
globals.toggle_wifi = false;
|
||||||
}
|
}
|
||||||
|
@@ -100,6 +100,7 @@ void RunLubeApp(uint32_t add_milimeters)
|
|||||||
|
|
||||||
case sysStat_Error:
|
case sysStat_Error:
|
||||||
strcpy_P(globals.systemStatustxt, PSTR("Error"));
|
strcpy_P(globals.systemStatustxt, PSTR("Error"));
|
||||||
|
globals.purgePulses = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case sysStat_Shutdown:
|
case sysStat_Shutdown:
|
||||||
|
@@ -37,6 +37,8 @@
|
|||||||
#include "gps.h"
|
#include "gps.h"
|
||||||
#include "dtc.h"
|
#include "dtc.h"
|
||||||
#include "led_colors.h"
|
#include "led_colors.h"
|
||||||
|
#include "obd2_kline.h"
|
||||||
|
#include "obd2_can.h"
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
#include <ESP8266WiFiMulti.h>
|
#include <ESP8266WiFiMulti.h>
|
||||||
@@ -48,6 +50,8 @@ const uint32_t connectTimeoutMs = 5000;
|
|||||||
ESP8266WiFiMulti wifiMulti;
|
ESP8266WiFiMulti wifiMulti;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
uint32_t (*wheelSpeedcapture)() = nullptr;
|
||||||
|
|
||||||
bool startSetupMode = false;
|
bool startSetupMode = false;
|
||||||
volatile uint32_t wheel_pulse = 0;
|
volatile uint32_t wheel_pulse = 0;
|
||||||
|
|
||||||
@@ -138,21 +142,33 @@ void setup()
|
|||||||
{
|
{
|
||||||
case SOURCE_CAN:
|
case SOURCE_CAN:
|
||||||
Init_CAN();
|
Init_CAN();
|
||||||
|
wheelSpeedcapture = &Process_CAN_WheelSpeed;
|
||||||
Serial.print("\nCAN-Init done");
|
Serial.print("\nCAN-Init done");
|
||||||
break;
|
break;
|
||||||
case SOURCE_GPS:
|
case SOURCE_GPS:
|
||||||
Init_GPS();
|
Init_GPS();
|
||||||
|
wheelSpeedcapture = &Process_GPS_WheelSpeed;
|
||||||
Serial.print("\nGPS-Init done");
|
Serial.print("\nGPS-Init done");
|
||||||
break;
|
break;
|
||||||
case SOURCE_IMPULSE:
|
case SOURCE_IMPULSE:
|
||||||
pinMode(GPIO_TRIGGER, INPUT_PULLUP);
|
pinMode(GPIO_TRIGGER, INPUT_PULLUP);
|
||||||
attachInterrupt(digitalPinToInterrupt(GPIO_TRIGGER), trigger_ISR, FALLING);
|
attachInterrupt(digitalPinToInterrupt(GPIO_TRIGGER), trigger_ISR, FALLING);
|
||||||
|
wheelSpeedcapture = &Process_Impulse_WheelSpeed;
|
||||||
Serial.print("\nPulse-Input Init done");
|
Serial.print("\nPulse-Input Init done");
|
||||||
break;
|
break;
|
||||||
|
case SOURCE_OBD2_KLINE:
|
||||||
|
Init_OBD2_KLine(Serial);
|
||||||
|
wheelSpeedcapture = &Process_OBD2_KLine_Speed;
|
||||||
|
Serial.print("\nOBD2-KLine-Init done");
|
||||||
|
break;
|
||||||
|
case SOURCE_OBD2_CAN:
|
||||||
|
Init_OBD2_CAN();
|
||||||
|
wheelSpeedcapture = &Process_OBD2_CAN_Speed;
|
||||||
|
Serial.print("\nOBD2-CAN-Init done");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
Serial.print("\nSource-Init done");
|
Serial.print("\nSource-Init done");
|
||||||
|
|
||||||
// Configure GPIO pins for button and pump control
|
// Configure GPIO pins for button and pump control
|
||||||
@@ -222,42 +238,15 @@ void setup()
|
|||||||
*/
|
*/
|
||||||
void loop()
|
void loop()
|
||||||
{
|
{
|
||||||
// Variable to store calculated wheel distance
|
|
||||||
uint32_t wheelDistance = 0;
|
|
||||||
|
|
||||||
// Switch based on the configured speed source
|
|
||||||
switch (LubeConfig.SpeedSource)
|
|
||||||
{
|
|
||||||
case SOURCE_IMPULSE:
|
|
||||||
wheelDistance = Process_Impulse_WheelSpeed();
|
|
||||||
break;
|
|
||||||
case SOURCE_CAN:
|
|
||||||
wheelDistance = Process_CAN_WheelSpeed();
|
|
||||||
break;
|
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_TIMER
|
|
||||||
case SOURCE_TIME:
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
case SOURCE_GPS:
|
|
||||||
wheelDistance = Process_GPS_WheelSpeed();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Run lubrication application with the calculated wheel distance
|
// Run lubrication application with the calculated wheel distance
|
||||||
RunLubeApp(wheelDistance);
|
if (wheelSpeedcapture != nullptr)
|
||||||
|
RunLubeApp(wheelSpeedcapture());
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_OLED
|
#ifdef FEATURE_ENABLE_OLED
|
||||||
// Update OLED display if enabled
|
// Update OLED display if enabled
|
||||||
Display_Process();
|
Display_Process();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Process CAN messages if the speed source is not impulse
|
|
||||||
if (LubeConfig.SpeedSource != SOURCE_IMPULSE)
|
|
||||||
{
|
|
||||||
CAN_Process();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Process button input, manage LED behavior, perform EEPROM tasks, handle webserver operations,
|
// Process button input, manage LED behavior, perform EEPROM tasks, handle webserver operations,
|
||||||
// process Diagnostic Trouble Codes (DTC), and manage debugging
|
// process Diagnostic Trouble Codes (DTC), and manage debugging
|
||||||
Button_Process();
|
Button_Process();
|
||||||
@@ -267,6 +256,12 @@ void loop()
|
|||||||
DTC_Process();
|
DTC_Process();
|
||||||
Debug_Process();
|
Debug_Process();
|
||||||
|
|
||||||
|
if (globals.toggle_wifi == true){
|
||||||
|
|
||||||
|
globals.toggle_wifi = false;
|
||||||
|
toggleWiFiAP();
|
||||||
|
}
|
||||||
|
|
||||||
// Handle OTA updates and update cyclic EEPROM tasks for Persistence Data Structure (PDS)
|
// Handle OTA updates and update cyclic EEPROM tasks for Persistence Data Structure (PDS)
|
||||||
ArduinoOTA.handle();
|
ArduinoOTA.handle();
|
||||||
EEPROMCyclicPDSTicker.update();
|
EEPROMCyclicPDSTicker.update();
|
||||||
@@ -284,24 +279,6 @@ void loop()
|
|||||||
yield();
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Converts an IPAddress object to a String representation.
|
|
||||||
*
|
|
||||||
* This function takes an IPAddress object and converts it into a String representing
|
|
||||||
* the IPv4 address. Each octet of the address is separated by a dot.
|
|
||||||
*
|
|
||||||
* @param ipAddress The IPAddress object to be converted.
|
|
||||||
* @return A String representing the IPv4 address.
|
|
||||||
*/
|
|
||||||
String IpAddress2String(const IPAddress &ipAddress)
|
|
||||||
{
|
|
||||||
// Concatenate each octet of the IPAddress with dots in between
|
|
||||||
return String(ipAddress[0]) + String(".") +
|
|
||||||
String(ipAddress[1]) + String(".") +
|
|
||||||
String(ipAddress[2]) + String(".") +
|
|
||||||
String(ipAddress[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
#ifdef FEATURE_ENABLE_WIFI_CLIENT
|
||||||
/**
|
/**
|
||||||
* @brief Callback function for maintaining WiFi connection and handling connection failures.
|
* @brief Callback function for maintaining WiFi connection and handling connection failures.
|
||||||
@@ -332,7 +309,7 @@ void wifiMaintainConnectionTicker_callback()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Trigger AP mode if the maximum failures are reached
|
// Trigger AP mode if the maximum failures are reached
|
||||||
Debug_pushMessage("WiFi not connected! - Start AP");
|
Debug_pushMessage("WiFi not connected! - Start AP\n");
|
||||||
toggleWiFiAP();
|
toggleWiFiAP();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
84
Software/src/obd2_can.cpp
Normal file
84
Software/src/obd2_can.cpp
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
#include "obd2_can.h"
|
||||||
|
#include <mcp_can.h>
|
||||||
|
#include <SPI.h>
|
||||||
|
#include "common.h"
|
||||||
|
#include "globals.h"
|
||||||
|
#include "dtc.h"
|
||||||
|
#include "debugger.h"
|
||||||
|
|
||||||
|
// === Setup: MCP2515 CS-Pin definieren ===
|
||||||
|
#define OBD2_CAN_CS_PIN 10
|
||||||
|
#define OBD2_OBD_REQUEST_ID 0x7DF
|
||||||
|
#define OBD2_OBD_RESPONSE_ID 0x7E8
|
||||||
|
|
||||||
|
MCP_CAN OBD_CAN(OBD2_CAN_CS_PIN);
|
||||||
|
|
||||||
|
static uint32_t lastQueryTime = 0;
|
||||||
|
static uint32_t lastRecvTime = 0;
|
||||||
|
static uint32_t lastSpeedMMperSec = 0;
|
||||||
|
|
||||||
|
#define OBD2_QUERY_INTERVAL 500 // alle 500ms
|
||||||
|
|
||||||
|
void Init_OBD2_CAN()
|
||||||
|
{
|
||||||
|
if (OBD_CAN.begin(MCP_STD, CAN_500KBPS, MCP_16MHZ) != CAN_OK)
|
||||||
|
{
|
||||||
|
Serial.println("OBD2 CAN Init FAILED!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
OBD_CAN.setMode(MCP_NORMAL);
|
||||||
|
delay(100);
|
||||||
|
Serial.println("OBD2 CAN Init OK");
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t Process_OBD2_CAN_Speed()
|
||||||
|
{
|
||||||
|
if (millis() - lastQueryTime < OBD2_QUERY_INTERVAL)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
lastQueryTime = millis();
|
||||||
|
|
||||||
|
// Anfrage: 01 0D → Geschwindigkeit
|
||||||
|
byte obdRequest[8] = {0x02, 0x01, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
|
byte sendStat = OBD_CAN.sendMsgBuf(OBD2_OBD_REQUEST_ID, 0, 8, obdRequest);
|
||||||
|
|
||||||
|
if (sendStat != CAN_OK)
|
||||||
|
{
|
||||||
|
MaintainDTC(DTC_OBD2_CAN_TIMEOUT, true);
|
||||||
|
Debug_pushMessage("OBD2_CAN: send failed (%d)\n", sendStat);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long rxId;
|
||||||
|
byte len = 0;
|
||||||
|
byte rxBuf[8];
|
||||||
|
uint32_t timeout = millis() + 100;
|
||||||
|
|
||||||
|
while (millis() < timeout)
|
||||||
|
{
|
||||||
|
if (OBD_CAN.checkReceive() == CAN_MSGAVAIL)
|
||||||
|
{
|
||||||
|
OBD_CAN.readMsgBuf(&rxId, &len, rxBuf);
|
||||||
|
if ((rxId & 0xFFF8) == OBD2_OBD_RESPONSE_ID && rxBuf[1] == 0x0D)
|
||||||
|
{
|
||||||
|
MaintainDTC(DTC_OBD2_CAN_NO_RESPONSE, false); // alles ok
|
||||||
|
|
||||||
|
uint8_t speed_kmh = rxBuf[3];
|
||||||
|
uint32_t speed_mm_per_sec = (uint32_t)speed_kmh * 1000000 / 3600;
|
||||||
|
uint32_t dt = millis() - lastRecvTime;
|
||||||
|
lastRecvTime = millis();
|
||||||
|
lastSpeedMMperSec = speed_mm_per_sec;
|
||||||
|
|
||||||
|
Debug_pushMessage("OBD2_CAN: %d km/h (%lu mm/s)\n", speed_kmh, speed_mm_per_sec);
|
||||||
|
return (speed_mm_per_sec * dt) / 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keine Antwort erhalten
|
||||||
|
MaintainDTC(DTC_OBD2_CAN_NO_RESPONSE, true);
|
||||||
|
Debug_pushMessage("OBD2_CAN: no response within timeout\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
74
Software/src/obd2_kline.cpp
Normal file
74
Software/src/obd2_kline.cpp
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
#include "obd2_kline.h"
|
||||||
|
|
||||||
|
// === Konstante für Anfrageintervalle ===
|
||||||
|
#define OBD2_QUERY_INTERVAL 500 // alle 500 ms neue Anfrage
|
||||||
|
|
||||||
|
// === Private Variablen ===
|
||||||
|
static Stream *klineSerial = nullptr;
|
||||||
|
static uint32_t lastQueryTime = 0;
|
||||||
|
static uint32_t lastRecvTime = 0;
|
||||||
|
static uint32_t lastSpeedMMperSec = 0;
|
||||||
|
|
||||||
|
// === Slow Init nach ISO9141-2 ===
|
||||||
|
void OBD2_KLine_SlowInit()
|
||||||
|
{
|
||||||
|
pinMode(1, OUTPUT); // TXD-Pin (z.B. D1)
|
||||||
|
digitalWrite(1, HIGH);
|
||||||
|
delay(3000);
|
||||||
|
|
||||||
|
digitalWrite(1, LOW);
|
||||||
|
delay(200); // 200ms
|
||||||
|
digitalWrite(1, HIGH);
|
||||||
|
delay(400); // 400ms
|
||||||
|
digitalWrite(1, LOW);
|
||||||
|
delay(400); // 400ms
|
||||||
|
digitalWrite(1, HIGH);
|
||||||
|
delay(200); // 200ms
|
||||||
|
|
||||||
|
// zurück auf Serialbetrieb
|
||||||
|
pinMode(1, INPUT);
|
||||||
|
delay(300);
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Initialisierung ===
|
||||||
|
void Init_OBD2_KLine(Stream &serial)
|
||||||
|
{
|
||||||
|
klineSerial = &serial;
|
||||||
|
OBD2_KLine_SlowInit();
|
||||||
|
delay(100);
|
||||||
|
|
||||||
|
// Sende 01 0D (Vehicle Speed)
|
||||||
|
byte speedRequest[] = {0x68, 0x6A, 0xF1, 0x01, 0x0D}; // OBD2 PID-Request
|
||||||
|
klineSerial->write(speedRequest, sizeof(speedRequest));
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Geschwindigkeit abfragen ===
|
||||||
|
uint32_t Process_OBD2_KLine_Speed()
|
||||||
|
{
|
||||||
|
if (!klineSerial || (millis() - lastQueryTime < OBD2_QUERY_INTERVAL)) return 0;
|
||||||
|
|
||||||
|
byte req[] = {0x68, 0x6A, 0xF1, 0x01, 0x0D};
|
||||||
|
klineSerial->write(req, sizeof(req));
|
||||||
|
lastQueryTime = millis();
|
||||||
|
|
||||||
|
uint8_t buf[16];
|
||||||
|
size_t len = klineSerial->readBytes(buf, sizeof(buf));
|
||||||
|
for (size_t i = 0; i < len - 2; ++i)
|
||||||
|
{
|
||||||
|
if (buf[i] == 0x48 && buf[i + 1] == 0x6B && buf[i + 2] == 0x10)
|
||||||
|
{
|
||||||
|
if (buf[i + 3] == 0x41 && buf[i + 4] == 0x0D)
|
||||||
|
{
|
||||||
|
uint8_t speed_kmh = buf[i + 5];
|
||||||
|
uint32_t speed_mm_per_sec = (uint32_t)speed_kmh * 1000000 / 3600;
|
||||||
|
uint32_t dt = millis() - lastRecvTime;
|
||||||
|
lastRecvTime = millis();
|
||||||
|
lastSpeedMMperSec = speed_mm_per_sec;
|
||||||
|
|
||||||
|
return (speed_mm_per_sec * dt) / 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
@@ -3,16 +3,16 @@
|
|||||||
*
|
*
|
||||||
* @brief Implementation file for converting structs to JSON objects.
|
* @brief Implementation file for converting structs to JSON objects.
|
||||||
*
|
*
|
||||||
* @note This file is auto-generated by a script on 2024-01-10 18:01:52.
|
* @note This file is auto-generated by a script on 2024-01-30 20:29:34.
|
||||||
*
|
*
|
||||||
* @author Marcel Peterkau
|
* @author Marcel Peterkau
|
||||||
* @date 10.01.2024
|
* @date 30.01.2024
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "struct2json.h"
|
#include "struct2json.h"
|
||||||
|
|
||||||
void generateJsonObject_LubeConfig(JsonObject& data)
|
void generateJsonObject_LubeConfig(JsonObject data)
|
||||||
{
|
{
|
||||||
data["EEPROM_Version"] = LubeConfig.EEPROM_Version;
|
data["EEPROM_Version"] = LubeConfig.EEPROM_Version;
|
||||||
data["DistancePerLube_Default"] = LubeConfig.DistancePerLube_Default;
|
data["DistancePerLube_Default"] = LubeConfig.DistancePerLube_Default;
|
||||||
@@ -32,10 +32,15 @@ void generateJsonObject_LubeConfig(JsonObject& data)
|
|||||||
data["LED_Mode_Flash"] = LubeConfig.LED_Mode_Flash;
|
data["LED_Mode_Flash"] = LubeConfig.LED_Mode_Flash;
|
||||||
data["LED_Max_Brightness"] = LubeConfig.LED_Max_Brightness;
|
data["LED_Max_Brightness"] = LubeConfig.LED_Max_Brightness;
|
||||||
data["LED_Min_Brightness"] = LubeConfig.LED_Min_Brightness;
|
data["LED_Min_Brightness"] = LubeConfig.LED_Min_Brightness;
|
||||||
|
data["wifi_ap_ssid"] = LubeConfig.wifi_ap_ssid;
|
||||||
|
data["wifi_ap_password"] = LubeConfig.wifi_ap_password;
|
||||||
|
data["wifi_client_ssid"] = LubeConfig.wifi_client_ssid;
|
||||||
|
data["wifi_client_password"] = LubeConfig.wifi_client_password;
|
||||||
|
data["wifi_autoconnect"] = LubeConfig.wifi_autoconnect;
|
||||||
data["checksum"] = LubeConfig.checksum;
|
data["checksum"] = LubeConfig.checksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
void generateJsonObject_PersistenceData(JsonObject& data)
|
void generateJsonObject_PersistenceData(JsonObject data)
|
||||||
{
|
{
|
||||||
data["writeCycleCounter"] = PersistenceData.writeCycleCounter;
|
data["writeCycleCounter"] = PersistenceData.writeCycleCounter;
|
||||||
data["tankRemain_microL"] = PersistenceData.tankRemain_microL;
|
data["tankRemain_microL"] = PersistenceData.tankRemain_microL;
|
||||||
@@ -47,4 +52,4 @@ void generateJsonObject_PersistenceData(JsonObject& data)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CODEGENERATOR_CHECKSUM: 9e8dd21170fd6ef8fbf8c4b156d9af751836a76081f811bf0e3ab2b1eb8ee48c
|
// CODEGENERATOR_CHECKSUM: 59f35aadffd0bbef253210ea2fbaaf9a515553a2e3cc9bf4cfa2819b63c969ce
|
@@ -198,7 +198,7 @@ void WebserverFirmwareUpdate_Callback(AsyncWebServerRequest *request, const Stri
|
|||||||
|
|
||||||
if (!index)
|
if (!index)
|
||||||
{
|
{
|
||||||
Debug_pushMessage("Update");
|
Debug_pushMessage("Update\n");
|
||||||
size_t content_len = request->contentLength();
|
size_t content_len = request->contentLength();
|
||||||
int cmd = (filename.indexOf(".fs") > -1) ? U_FS : U_FLASH;
|
int cmd = (filename.indexOf(".fs") > -1) ? U_FS : U_FLASH;
|
||||||
Update.runAsync(true);
|
Update.runAsync(true);
|
||||||
@@ -266,7 +266,7 @@ void WebserverEERestore_Callback(AsyncWebServerRequest *request, const String &f
|
|||||||
buffer = (char *)malloc(1536);
|
buffer = (char *)malloc(1536);
|
||||||
read_ptr = 0;
|
read_ptr = 0;
|
||||||
if (buffer == NULL)
|
if (buffer == NULL)
|
||||||
Debug_pushMessage("malloc() failed for EEPROM-Restore");
|
Debug_pushMessage("malloc() failed for EEPROM-Restore\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,6 +307,10 @@ void WebserverEERestore_Callback(AsyncWebServerRequest *request, const String &f
|
|||||||
LubeConfig.LED_Mode_Flash = json["config"]["LED_Mode_Flash"].as<bool>();
|
LubeConfig.LED_Mode_Flash = json["config"]["LED_Mode_Flash"].as<bool>();
|
||||||
LubeConfig.LED_Max_Brightness = json["config"]["LED_Max_Brightness"].as<uint8_t>();
|
LubeConfig.LED_Max_Brightness = json["config"]["LED_Max_Brightness"].as<uint8_t>();
|
||||||
LubeConfig.LED_Min_Brightness = json["config"]["LED_Min_Brightness"].as<uint8_t>();
|
LubeConfig.LED_Min_Brightness = json["config"]["LED_Min_Brightness"].as<uint8_t>();
|
||||||
|
strncpy(LubeConfig.wifi_ap_ssid, json["config"]["wifi_ap_ssid"].as<const char *>(), sizeof(LubeConfig.wifi_ap_ssid));
|
||||||
|
strncpy(LubeConfig.wifi_ap_password, json["config"]["wifi_ap_password"].as<const char *>(), sizeof(LubeConfig.wifi_ap_password));
|
||||||
|
strncpy(LubeConfig.wifi_client_ssid, json["config"]["wifi_client_ssid"].as<const char *>(), sizeof(LubeConfig.wifi_client_ssid));
|
||||||
|
strncpy(LubeConfig.wifi_client_password, json["config"]["wifi_client_password"].as<const char *>(), sizeof(LubeConfig.wifi_client_password));
|
||||||
|
|
||||||
PersistenceData.writeCycleCounter = json["persis"]["writeCycleCounter"].as<uint16_t>();
|
PersistenceData.writeCycleCounter = json["persis"]["writeCycleCounter"].as<uint16_t>();
|
||||||
PersistenceData.tankRemain_microL = json["persis"]["tankRemain_microL"].as<uint32_t>();
|
PersistenceData.tankRemain_microL = json["persis"]["tankRemain_microL"].as<uint32_t>();
|
||||||
@@ -328,7 +332,7 @@ void WebserverEERestore_Callback(AsyncWebServerRequest *request, const String &f
|
|||||||
|
|
||||||
if (ee_done)
|
if (ee_done)
|
||||||
{
|
{
|
||||||
Debug_pushMessage("Update complete");
|
Debug_pushMessage("Update complete\n");
|
||||||
globals.systemStatus = sysStat_Shutdown;
|
globals.systemStatus = sysStat_Shutdown;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -346,7 +350,7 @@ void WebServerEEJSON_Callback(AsyncWebServerRequest *request)
|
|||||||
{
|
{
|
||||||
AsyncResponseStream *response = request->beginResponseStream("application/json");
|
AsyncResponseStream *response = request->beginResponseStream("application/json");
|
||||||
JsonDocument json;
|
JsonDocument json;
|
||||||
JsonObject info = json.to<JsonObject>();
|
JsonObject info = json["info"].to<JsonObject>();
|
||||||
|
|
||||||
char buffer[16];
|
char buffer[16];
|
||||||
|
|
||||||
@@ -357,12 +361,12 @@ void WebServerEEJSON_Callback(AsyncWebServerRequest *request)
|
|||||||
snprintf_P(buffer, sizeof(buffer), "%s", constants.GitHash);
|
snprintf_P(buffer, sizeof(buffer), "%s", constants.GitHash);
|
||||||
info["Git-Hash"] = buffer;
|
info["Git-Hash"] = buffer;
|
||||||
|
|
||||||
JsonObject config = json.to<JsonObject>();
|
JsonObject config = json["config"].to<JsonObject>();
|
||||||
generateJsonObject_LubeConfig(config);
|
generateJsonObject_LubeConfig(config);
|
||||||
JsonObject persis = json.to<JsonObject>();
|
JsonObject persis = json["persis"].to<JsonObject>();
|
||||||
generateJsonObject_PersistenceData(persis);
|
generateJsonObject_PersistenceData(persis);
|
||||||
|
|
||||||
JsonObject eepart = json.to<JsonObject>();
|
JsonObject eepart = json["eepart"].to<JsonObject>();
|
||||||
sprintf(buffer, "0x%04X", globals.eePersistanceAdress);
|
sprintf(buffer, "0x%04X", globals.eePersistanceAdress);
|
||||||
eepart["PersistanceAddress"] = buffer;
|
eepart["PersistanceAddress"] = buffer;
|
||||||
|
|
||||||
@@ -492,6 +496,10 @@ void Websocket_HandleButtons(uint8_t *data)
|
|||||||
{
|
{
|
||||||
globals.systemStatus = sysStat_Shutdown;
|
globals.systemStatus = sysStat_Shutdown;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(identifier, "resettank") == 0)
|
||||||
|
{
|
||||||
|
PersistenceData.tankRemain_microL = LubeConfig.tankCapacity_ml * 1000;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug_pushMessage("Got unknown Button-id '%s' from ws-client\n", identifier);
|
Debug_pushMessage("Got unknown Button-id '%s' from ws-client\n", identifier);
|
||||||
@@ -509,7 +517,7 @@ void Websocket_HandleButtons(uint8_t *data)
|
|||||||
void Websocket_HandleSettings(uint8_t *data)
|
void Websocket_HandleSettings(uint8_t *data)
|
||||||
{
|
{
|
||||||
char identifier[32];
|
char identifier[32];
|
||||||
char value[32];
|
char value[63];
|
||||||
|
|
||||||
parseWebsocketString((char *)data, identifier, sizeof(identifier), value, sizeof(value));
|
parseWebsocketString((char *)data, identifier, sizeof(identifier), value, sizeof(value));
|
||||||
|
|
||||||
@@ -532,6 +540,46 @@ void Websocket_HandleSettings(uint8_t *data)
|
|||||||
int index = findIndexByString(value, GPSBaudRateString, GPSBaudRateString_Elements);
|
int index = findIndexByString(value, GPSBaudRateString, GPSBaudRateString_Elements);
|
||||||
LubeConfig.GPSBaudRate = (GPSBaudRate_t)index;
|
LubeConfig.GPSBaudRate = (GPSBaudRate_t)index;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(identifier, "ledmaxbrightness") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.LED_Max_Brightness = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "ledminbrightness") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.LED_Min_Brightness = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "pumppulse") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.BleedingPulses = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "tankwarn") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.TankRemindAtPercentage = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "tankcap") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.tankCapacity_ml = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "lubedistancerain") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.DistancePerLube_Rain = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "lubedistancenormal") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.DistancePerLube_Default = atoi(value);
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "ledmodeflash") == 0)
|
||||||
|
{
|
||||||
|
LubeConfig.LED_Mode_Flash = value[0] == '1' ? true : false;
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "wifi-ssid") == 0)
|
||||||
|
{
|
||||||
|
strncpy(LubeConfig.wifi_client_ssid, value, sizeof(LubeConfig.wifi_client_ssid));
|
||||||
|
}
|
||||||
|
else if (strcmp(identifier, "wifi-password") == 0)
|
||||||
|
{
|
||||||
|
strncpy(LubeConfig.wifi_client_password, value, sizeof(LubeConfig.wifi_client_password));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug_pushMessage("Got unknown Settings-id and value '%s' from ws-client\n", identifier);
|
Debug_pushMessage("Got unknown Settings-id and value '%s' from ws-client\n", identifier);
|
||||||
@@ -668,7 +716,9 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
|
|||||||
"showimpulse;"
|
"showimpulse;"
|
||||||
"showgps;"
|
"showgps;"
|
||||||
"showcan;"
|
"showcan;"
|
||||||
"bleedingpulses;";
|
"bleedingpulses;"
|
||||||
|
"wifi-ssid;"
|
||||||
|
"wifi-pass;";
|
||||||
|
|
||||||
if (client_id > 0)
|
if (client_id > 0)
|
||||||
webSocket.text(client_id, mapping);
|
webSocket.text(client_id, mapping);
|
||||||
@@ -697,6 +747,8 @@ void Websocket_RefreshClientData_Static(uint32_t client_id, bool send_mapping)
|
|||||||
temp.concat(String(LubeConfig.SpeedSource == SOURCE_GPS ? "1" : "0") + ";");
|
temp.concat(String(LubeConfig.SpeedSource == SOURCE_GPS ? "1" : "0") + ";");
|
||||||
temp.concat(String(LubeConfig.SpeedSource == SOURCE_CAN ? "1" : "0") + ";");
|
temp.concat(String(LubeConfig.SpeedSource == SOURCE_CAN ? "1" : "0") + ";");
|
||||||
temp.concat(String(LubeConfig.BleedingPulses) + ";");
|
temp.concat(String(LubeConfig.BleedingPulses) + ";");
|
||||||
|
temp.concat(String(LubeConfig.wifi_client_ssid) + ";");
|
||||||
|
temp.concat(String(LubeConfig.wifi_client_password) + ";");
|
||||||
|
|
||||||
for (uint32_t i = 0; i < SpeedSourceString_Elements; i++)
|
for (uint32_t i = 0; i < SpeedSourceString_Elements; i++)
|
||||||
{
|
{
|
||||||
@@ -794,4 +846,38 @@ int findIndexByString(const char *searchString, const char *const *array, int ar
|
|||||||
}
|
}
|
||||||
// String nicht gefunden, gib -1 zurück
|
// String nicht gefunden, gib -1 zurück
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Pushes a notification to all WebSocket clients.
|
||||||
|
*
|
||||||
|
* This function sends a live debug message to all connected WebSocket clients.
|
||||||
|
*
|
||||||
|
* @param Message The debug message to be sent.
|
||||||
|
* @param type The type of notification (info, success, warning, error).
|
||||||
|
* - Use NotificationType_t::info for informational messages.
|
||||||
|
* - Use NotificationType_t::success for successful operation messages.
|
||||||
|
* - Use NotificationType_t::warning for warning messages.
|
||||||
|
* - Use NotificationType_t::error for error messages.
|
||||||
|
*/
|
||||||
|
void Websocket_PushNotification(String Message, NotificationType_t type)
|
||||||
|
{
|
||||||
|
String typeString = "";
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case info:
|
||||||
|
typeString = "info";
|
||||||
|
break;
|
||||||
|
case success:
|
||||||
|
typeString = "success";
|
||||||
|
break;
|
||||||
|
case warning:
|
||||||
|
typeString = "warning";
|
||||||
|
break;
|
||||||
|
case error:
|
||||||
|
typeString = "danger";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
webSocket.textAll("NOTIFY:" + typeString + ";" + Message);
|
||||||
|
Debug_pushMessage("Sending Notification to WebUI: %s\n", typeString);
|
||||||
}
|
}
|
Reference in New Issue
Block a user