diff --git a/hardware/dimensioner/dimensioner-case.3mf b/hardware/dimensioner/dimensioner-case.3mf new file mode 100644 index 0000000..56ad272 Binary files /dev/null and b/hardware/dimensioner/dimensioner-case.3mf differ diff --git a/hardware/dimensioner/dimensioner.skp b/hardware/dimensioner/dimensioner.skp index 03205dd..d804b2a 100644 Binary files a/hardware/dimensioner/dimensioner.skp and b/hardware/dimensioner/dimensioner.skp differ diff --git a/hardware/dimensioner/pcb/circuit/circuit.lp b/hardware/dimensioner/pcb/circuit/circuit.lp index 6f89b51..8f39b3e 100644 --- a/hardware/dimensioner/pcb/circuit/circuit.lp +++ b/hardware/dimensioner/pcb/circuit/circuit.lp @@ -110,6 +110,18 @@ (signal e40e1278-1893-43a5-8bbd-b519e526afee (net none)) (signal ea9d9416-b1fc-4e58-a932-aa390ddbf432 (net none)) ) + (component 7b7278c2-d99e-4ca3-a95f-11b56e231a25 + (lib_component 98e71eaa-1b90-4a84-8529-ed4f493e5c41) + (lib_variant f846507c-bc29-4a53-bc1b-b4fda7f50c80) + (name "FRAME1") (value "{{MPN or DEVICE}}") + (lock_assembly false) + (attribute "FIELD_SHEET" (type string) (unit none) (value "{{ SCH_FRAME_SHEET or SHEET }}")) + (attribute "FIELD_PROJECT" (type string) (unit none) (value "{{ SCH_FRAME_PROJECT or PROJECT }}")) + (attribute "FIELD_VERSION" (type string) (unit none) (value "{{ SCH_FRAME_VERSION or VERSION }}")) + (attribute "FIELD_DATE" (type string) (unit none) (value "{{ SCH_FRAME_DATE or DATE }}")) + (attribute "FIELD_AUTHOR" (type string) (unit none) (value "{{ SCH_FRAME_AUTHOR or AUTHOR }}")) + (attribute "FIELD_PAGE" (type string) (unit none) (value "{{ SCH_FRAME_PAGE_X_OF_Y or PAGE_X_OF_Y }}")) + ) (component c370124d-d8f4-43af-b209-dd713575a6cd (lib_component 0933259c-c603-4882-8ce6-154bff278b94) (lib_variant aed775d6-a426-484c-b1bb-14ef0d412f1d) diff --git a/hardware/dimensioner/pcb/library/cmp/98e71eaa-1b90-4a84-8529-ed4f493e5c41/.librepcb-cmp b/hardware/dimensioner/pcb/library/cmp/98e71eaa-1b90-4a84-8529-ed4f493e5c41/.librepcb-cmp new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/hardware/dimensioner/pcb/library/cmp/98e71eaa-1b90-4a84-8529-ed4f493e5c41/.librepcb-cmp @@ -0,0 +1 @@ +1 diff --git a/hardware/dimensioner/pcb/library/cmp/98e71eaa-1b90-4a84-8529-ed4f493e5c41/component.lp b/hardware/dimensioner/pcb/library/cmp/98e71eaa-1b90-4a84-8529-ed4f493e5c41/component.lp new file mode 100644 index 0000000..68f7b7a --- /dev/null +++ b/hardware/dimensioner/pcb/library/cmp/98e71eaa-1b90-4a84-8529-ed4f493e5c41/component.lp @@ -0,0 +1,116 @@ +(librepcb_component 98e71eaa-1b90-4a84-8529-ed4f493e5c41 + (name "Schematic Frame") + (description "") + (keywords "schematic,frame,sheet,drawing") + (author "U. Bruhin") + (version "0.3") + (created 2015-03-01T20:00:00Z) + (deprecated false) + (generated_by "") + (category e0702c57-f31f-497d-ae1e-e31c4017f3c0) + (schematic_only true) + (default_value "{{MPN or DEVICE}}") + (prefix "FRAME") + (attribute "FIELD_SHEET" (type string) (unit none) (value "{{ SCH_FRAME_SHEET or SHEET }}")) + (attribute "FIELD_PROJECT" (type string) (unit none) (value "{{ SCH_FRAME_PROJECT or PROJECT }}")) + (attribute "FIELD_VERSION" (type string) (unit none) (value "{{ SCH_FRAME_VERSION or VERSION }}")) + (attribute "FIELD_DATE" (type string) (unit none) (value "{{ SCH_FRAME_DATE or DATE }}")) + (attribute "FIELD_AUTHOR" (type string) (unit none) (value "{{ SCH_FRAME_AUTHOR or AUTHOR }}")) + (attribute "FIELD_PAGE" (type string) (unit none) (value "{{ SCH_FRAME_PAGE_X_OF_Y or PAGE_X_OF_Y }}")) + (variant 352cccd5-0c3c-4c66-88e0-6ee7c6a3cbf9 (norm "") + (name "A4 Landscape") + (description "") + (gate 6ca391c0-1c6d-4176-9607-31bf40d1b406 + (symbol f00ab942-6980-442b-86a8-51b92de5704d) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant f36134f2-90b4-4a79-aeec-285f3e5032d0 (norm "") + (name "A3 Landscape") + (description "") + (gate d2033a0b-3a77-4b9b-b255-56f94e4db74e + (symbol 4eeaadf5-5333-40ef-9329-58818775e676) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant ca7450a9-8cc0-43cd-b21f-b0a224be6a80 (norm "") + (name "A2 Landscape") + (description "") + (gate 390a7382-97e5-440b-bfc7-efa67e062e32 + (symbol c1970ff4-aa37-4edb-860d-797e681353c1) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant 0fc4b252-c29b-4d0d-bbd0-d16642cb20eb (norm "") + (name "A1 Landscape") + (description "") + (gate dae39cd8-8a1b-45cd-9934-48483b4c149d + (symbol 6efe4b7d-cb39-4bce-a954-3dc4b4913215) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant 2af87ef1-0057-42e9-b804-0a1aaa94fd00 (norm "") + (name "A0 Landscape") + (description "") + (gate e794dbbc-8fd6-4834-bb03-e8749e1764eb + (symbol 99fe3ae1-08d8-485e-8f33-669a7dcb3c73) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant bb3066a6-91ea-4796-aaaf-13d1caa1c827 (norm "") + (name "A4 Portrait") + (description "") + (gate 20eaedbb-929c-4850-ba27-0d1674faa09f + (symbol 599c45c6-cb9d-47a8-a58a-87618ddcc425) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant 5e6d0bdb-b1db-443b-aa8f-0c5136bb363d (norm "") + (name "A3 Portrait") + (description "") + (gate 3e3dbcd0-19f1-4e21-ae72-6f107a5968f2 + (symbol 7f2cc686-7863-4121-bdd8-a8acb3da6ac5) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant e246e1c1-7fd4-4c2b-8e4a-5cb0652cecf3 (norm "") + (name "A2 Portrait") + (description "") + (gate 2c94a8e9-9e7d-409b-a780-b913f7e42cb6 + (symbol ce1791aa-959a-4cc6-a678-025348856f35) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant 42054815-3f54-4dbc-9414-8ff8369b832f (norm "") + (name "A1 Portrait") + (description "") + (gate 6d1ce5b6-d196-40b6-b45b-c90873637f4d + (symbol cc9e95e8-8bb9-48d9-9cd9-9e02bd7246f3) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant 9dcf629c-9ab3-4816-8ac5-6c14226b07d1 (norm "") + (name "A0 Portrait") + (description "") + (gate 1495ef5a-32a6-4958-9370-2f76f2b243d4 + (symbol 6c6c6ffb-f107-4267-a82a-94a502bfacf0) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant 19ab1b44-8cf6-44d6-a5bc-c97f1cbb67a9 (norm "") + (name "US Letter") + (description "") + (gate 36a28674-d9ec-4daf-b772-4a8d957f3791 + (symbol f00ab942-6980-442b-86a8-51b92de5704d) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) + (variant f846507c-bc29-4a53-bc1b-b4fda7f50c80 (norm "") + (name "US Letter Half") + (description "Half a page of US Letter, landscape") + (gate 7dc26dbd-4781-48f2-b52e-1d891b3a4f95 + (symbol 7368fa75-2d24-4783-a5e5-8954c8d9680c) + (position 0.0 0.0) (rotation 0.0) (required true) (suffix "") + ) + ) +) diff --git a/hardware/dimensioner/pcb/library/sym/7368fa75-2d24-4783-a5e5-8954c8d9680c/.librepcb-sym b/hardware/dimensioner/pcb/library/sym/7368fa75-2d24-4783-a5e5-8954c8d9680c/.librepcb-sym new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/hardware/dimensioner/pcb/library/sym/7368fa75-2d24-4783-a5e5-8954c8d9680c/.librepcb-sym @@ -0,0 +1 @@ +1 diff --git a/hardware/dimensioner/pcb/library/sym/7368fa75-2d24-4783-a5e5-8954c8d9680c/symbol.lp b/hardware/dimensioner/pcb/library/sym/7368fa75-2d24-4783-a5e5-8954c8d9680c/symbol.lp new file mode 100644 index 0000000..1b2d375 --- /dev/null +++ b/hardware/dimensioner/pcb/library/sym/7368fa75-2d24-4783-a5e5-8954c8d9680c/symbol.lp @@ -0,0 +1,73 @@ +(librepcb_symbol 7368fa75-2d24-4783-a5e5-8954c8d9680c + (name "Letter Half Frame Landscape") + (description "") + (keywords "frame,letter,landscape,drawing,sheet") + (author "Skylar Ittner") + (version "0.1") + (created 2025-07-12T00:31:59Z) + (deprecated false) + (generated_by "") + (category e0702c57-f31f-497d-ae1e-e31c4017f3c0) + (polygon 14aae071-3cd4-493c-b1cd-18bf0453034d (layer sym_outlines) + (width 0.6) (fill false) (grab_area false) + (vertex (position 0.0 0.0) (angle 0.0)) + (vertex (position 0.0 129.7) (angle 0.0)) + (vertex (position 195.9 129.7) (angle 0.0)) + (vertex (position 195.9 0.0) (angle 0.0)) + (vertex (position 0.0 0.0) (angle 0.0)) + ) + (polygon 05fef42d-a603-4647-9bfc-e14c7910e233 (layer sym_outlines) + (width 0.6) (fill false) (grab_area false) + (vertex (position 78.72 0.0) (angle 0.0)) + (vertex (position 78.72 15.0) (angle 0.0)) + (vertex (position 195.72 15.0) (angle 0.0)) + ) + (polygon f753e694-0c15-4035-9ba7-88121448d95a (layer sym_outlines) + (width 0.6) (fill false) (grab_area false) + (vertex (position 163.72 0.0) (angle 0.0)) + (vertex (position 163.72 15.0) (angle 0.0)) + ) + (polygon e9d2f064-a1a9-4040-b6f1-da86cfa33330 (layer sym_outlines) + (width 0.6) (fill false) (grab_area false) + (vertex (position 78.72 5.0) (angle 0.0)) + (vertex (position 195.72 5.0) (angle 0.0)) + ) + (polygon 12aeedc6-0bb1-4508-a3ba-55231d617e13 (layer sym_outlines) + (width 0.6) (fill false) (grab_area false) + (vertex (position 163.72 10.0) (angle 0.0)) + (vertex (position 195.72 10.0) (angle 0.0)) + ) + (polygon 17a466d0-0e97-4b18-8c08-c67eb90935b1 (layer sym_outlines) + (width 0.6) (fill false) (grab_area false) + (vertex (position 143.72 5.0) (angle 0.0)) + (vertex (position 143.72 0.0) (angle 0.0)) + ) + (polygon edf6ce60-c5d8-4a34-a954-ed896d0a6a67 (layer sym_hidden_grab_areas) + (width 0.6) (fill true) (grab_area true) + (vertex (position 78.74 15.24) (angle 0.0)) + (vertex (position 195.58 15.24) (angle 0.0)) + (vertex (position 195.58 0.0) (angle 0.0)) + (vertex (position 78.74 0.0) (angle 0.0)) + (vertex (position 78.74 15.24) (angle 0.0)) + ) + (text 4604726a-7603-4928-9b4e-d206b9896de7 (layer sym_outlines) (value "{{FIELD_SHEET}}") + (align left center) (height 7.5) (position 80.72 10.0) (rotation 0.0) + ) + (text 2edf5643-4788-48c5-aa6d-f41153d9b612 (layer sym_outlines) (value "{{FIELD_PROJECT}}") + (align left center) (height 3.5) (position 80.72 2.5) (rotation 0.0) + ) + (text 0a036c28-2393-4b0e-bce9-0e6a0c76057e (layer sym_outlines) (value "{{FIELD_DATE}}") + (align left center) (height 3.5) (position 165.72 12.5) (rotation 0.0) + ) + (text f90ac07d-df97-4509-83c5-378a50d5338f (layer sym_outlines) (value "{{FIELD_AUTHOR}}") + (align left center) (height 3.5) (position 165.72 7.5) (rotation 0.0) + ) + (text fccbdea8-830d-4880-8840-cadecd909e55 (layer sym_outlines) (value "{{FIELD_PAGE}}") + (align left center) (height 3.5) (position 165.72 2.5) (rotation 0.0) + ) + (text 762d0c2f-34e6-4d1c-8a72-c90b5315c073 (layer sym_outlines) (value "{{FIELD_VERSION}}") + (align left center) (height 3.5) (position 145.72 2.5) (rotation 0.0) + ) + (approved missing_name_text) + (approved missing_value_text) +) diff --git a/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Board1.png b/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Board1.png new file mode 100644 index 0000000..3a7ef68 Binary files /dev/null and b/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Board1.png differ diff --git a/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Board2.png b/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Board2.png new file mode 100644 index 0000000..7d013f7 Binary files /dev/null and b/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Board2.png differ diff --git a/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Schematics.pdf b/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Schematics.pdf index 6f9c8eb..7807f0d 100644 Binary files a/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Schematics.pdf and b/hardware/dimensioner/pcb/output/v1/PostalPoint_Dimensioner_Schematics.pdf differ diff --git a/hardware/dimensioner/pcb/schematics/main/schematic.lp b/hardware/dimensioner/pcb/schematics/main/schematic.lp index 9e0d14d..1e00bad 100644 --- a/hardware/dimensioner/pcb/schematics/main/schematic.lp +++ b/hardware/dimensioner/pcb/schematics/main/schematic.lp @@ -4,71 +4,94 @@ (symbol 3149dca3-643b-4b58-b243-6cf3db92093b (component 3b281355-f2a9-440c-a234-ffd2ec1e24c4) (lib_gate b133fcc3-903c-4238-b3b8-a34f510e5ae9) - (position -45.72 22.86) (rotation 0.0) (mirror false) + (position -7.62 15.24) (rotation 0.0) (mirror false) (text 11d75f3a-d95e-43ff-b916-db0fcf9d7070 (layer sym_values) (value "{{VALUE}}") - (align left top) (height 2.5) (position -58.42 -12.7) (rotation 0.0) + (align left top) (height 2.5) (position -20.32 -20.32) (rotation 0.0) ) (text 7c323984-8ea0-4c4d-83d9-e73236a72abd (layer sym_names) (value "{{NAME}}") - (align left bottom) (height 2.5) (position -58.42 55.88) (rotation 0.0) + (align left bottom) (height 2.5) (position -20.32 48.26) (rotation 0.0) ) (text d2950112-2ab9-4836-992b-d13651e02f39 (layer sym_outlines) (value "Bottom Side Pads") - (align center top) (height 1.4) (position -51.435 5.08) (rotation 0.0) + (align center top) (height 1.4) (position -13.335 -2.54) (rotation 0.0) ) ) (symbol 5faad26c-b396-4280-bd85-9e8af8769cd3 (component c370124d-d8f4-43af-b209-dd713575a6cd) (lib_gate 9954a42d-4fc2-4444-b38d-a9ee7b13d68d) - (position -12.7 22.86) (rotation 0.0) (mirror false) + (position 25.4 15.24) (rotation 0.0) (mirror false) (text 9c769169-59ba-4be5-977d-f132e0c97e8b (layer sym_names) (value "{{NAME}}") - (align left bottom) (height 2.535771) (position -17.7897 28.71315) (rotation 0.0) + (align left bottom) (height 2.535771) (position 20.3103 21.09315) (rotation 0.0) ) (text c1b22707-1ab7-4b0d-bba3-56916cb06ff3 (layer sym_values) (value "{{VALUE}}") - (align left bottom) (height 2.535067) (position -17.78831 15.22753) (rotation 0.0) + (align left bottom) (height 2.535067) (position 20.31169 7.60753) (rotation 0.0) ) ) (symbol 978313cb-cef4-40d6-82ce-f44bbf1ffa71 (component 04859508-6611-43c3-a81e-afb4ebbb6c14) (lib_gate cf07df59-2403-45b5-a34c-f134255a9e37) - (position 27.94 10.16) (rotation 180.0) (mirror false) + (position 66.04 2.54) (rotation 180.0) (mirror false) (text 4b276099-5699-413d-8546-7cd500393d76 (layer sym_values) (value "{{VALUE}}") - (align center top) (height 2.54) (position 30.48 17.78) (rotation -180.0) + (align center top) (height 2.54) (position 68.58 10.16) (rotation -180.0) ) (text a71d71e7-4761-43c5-b50e-b82b58e8b92b (layer sym_names) (value "{{NAME}}") - (align center bottom) (height 2.54) (position 30.48 2.54) (rotation -180.0) + (align center bottom) (height 2.54) (position 68.58 -5.08) (rotation -180.0) ) ) (symbol b3206de5-3c42-4b98-886f-6c97ce2e3223 (component 05baed9b-c199-40e7-84a1-480ef52b8510) (lib_gate 9954a42d-4fc2-4444-b38d-a9ee7b13d68d) - (position -12.7 45.72) (rotation 0.0) (mirror false) + (position 25.4 38.1) (rotation 0.0) (mirror false) (text 9c769169-59ba-4be5-977d-f132e0c97e8b (layer sym_names) (value "{{NAME}}") - (align left bottom) (height 2.535771) (position -17.7897 51.57315) (rotation 0.0) + (align left bottom) (height 2.535771) (position 20.3103 43.95315) (rotation 0.0) ) (text c1b22707-1ab7-4b0d-bba3-56916cb06ff3 (layer sym_values) (value "{{VALUE}}") - (align left bottom) (height 2.535067) (position -17.78831 38.08753) (rotation 0.0) + (align left bottom) (height 2.535067) (position 20.31169 30.46753) (rotation 0.0) ) ) (symbol cbfa6011-724a-4239-b2d3-fb5a38f9e243 (component f3d03a6d-d155-4249-a9e6-fd781f31fd19) (lib_gate 00c0fa4d-bf3e-41e5-a1a0-954a41d34c67) - (position 33.02 43.18) (rotation 180.0) (mirror true) + (position 71.12 35.56) (rotation 180.0) (mirror true) (text 0699017c-2f4a-4417-b3d5-1f306acb1005 (layer sym_outlines) (value "128x64") - (align right top) (height 2.5) (position 40.64 48.26) (rotation 0.0) + (align right top) (height 2.5) (position 78.74 40.64) (rotation 0.0) ) (text 3a747d8c-3096-418f-af73-73ffa2e5d604 (layer sym_values) (value "{{VALUE}}") - (align left top) (height 2.5) (position 12.7 60.96) (rotation 0.0) + (align left top) (height 2.5) (position 50.8 53.34) (rotation 0.0) ) (text 50f53e6f-a448-4b18-8898-e23781fd1232 (layer sym_outlines) (value "OLED") - (align right top) (height 2.5) (position 40.64 45.72) (rotation 0.0) + (align right top) (height 2.5) (position 78.74 38.1) (rotation 0.0) ) (text 9be6cb44-3711-46dc-ba51-8f5b91019ca1 (layer sym_names) (value "{{NAME}}") - (align left top) (height 2.5) (position 12.7 27.0) (rotation 0.0) + (align left top) (height 2.5) (position 50.8 19.38) (rotation 0.0) + ) + ) + (symbol e663cbb8-a363-49e7-af66-17e47139d77d + (component 7b7278c2-d99e-4ca3-a95f-11b56e231a25) + (lib_gate 7dc26dbd-4781-48f2-b52e-1d891b3a4f95) + (position -76.2 -63.5) (rotation 0.0) (mirror false) + (text 0a036c28-2393-4b0e-bce9-0e6a0c76057e (layer sym_outlines) (value "{{FIELD_DATE}}") + (align left center) (height 3.5) (position 89.52 -51.0) (rotation 0.0) + ) + (text 2edf5643-4788-48c5-aa6d-f41153d9b612 (layer sym_outlines) (value "License: Creative Commons BY-SA 4.0 International") + (align left center) (height 3.5) (position 4.52 -61.0) (rotation 0.0) + ) + (text 4604726a-7603-4928-9b4e-d206b9896de7 (layer sym_outlines) (value "PostalPoint® Parcel Dimensioner") + (align left center) (height 7.0) (position 4.52 -53.5) (rotation 0.0) + ) + (text 762d0c2f-34e6-4d1c-8a72-c90b5315c073 (layer sym_outlines) (value "{{FIELD_VERSION}}") + (align left center) (height 3.5) (position 69.52 -61.0) (rotation 0.0) + ) + (text f90ac07d-df97-4509-83c5-378a50d5338f (layer sym_outlines) (value "© PostalPortal LLC") + (align left center) (height 3.5) (position 89.52 -56.0) (rotation 0.0) + ) + (text fccbdea8-830d-4880-8840-cadecd909e55 (layer sym_outlines) (value "{{FIELD_PAGE}}") + (align left center) (height 3.5) (position 89.52 -61.0) (rotation 0.0) ) ) (netsegment 28afc034-9d92-43db-a58c-de06dca96fc9 (net a011931a-8c89-4016-ac87-1f9583c3380b) - (junction 6db1d8f3-ed46-459c-ad37-9f935a4bfb18 (position -22.86 17.78)) - (junction fea2fcc8-1f27-42d5-8c76-13387d31ec87 (position -22.86 20.32)) + (junction 6db1d8f3-ed46-459c-ad37-9f935a4bfb18 (position 15.24 10.16)) + (junction fea2fcc8-1f27-42d5-8c76-13387d31ec87 (position 15.24 12.7)) (line 192f600e-d917-4228-85ab-8a26c4f486d4 (width 0.15875) (from (junction fea2fcc8-1f27-42d5-8c76-13387d31ec87)) (to (junction 6db1d8f3-ed46-459c-ad37-9f935a4bfb18)) @@ -88,18 +111,18 @@ ) (netsegment 2c4c352e-15a0-4ee8-beb4-83e1079eb50a (net ce1b79e1-57ec-4386-b8a9-1cc47fa3aa9d) - (junction 2186ed57-1dc5-46e0-a323-864c225511e4 (position 5.08 5.08)) - (junction 5b329324-75c5-4f69-b770-eb3f65acb041 (position -66.04 -20.32)) - (junction 5fb50e69-1b03-4b1c-a287-fc02d177b713 (position -2.54 43.18)) - (junction 6a2c9f0a-e066-4b01-aeb1-b63948f634bc (position -2.54 20.32)) - (junction 6bd23496-19f5-4486-a758-d8f951757070 (position 10.16 -20.32)) - (junction 7fb71fd5-f5c0-43b9-8b7b-910ec148bb92 (position -66.04 60.96)) - (junction 8cadcf76-8e41-4a4b-83f6-5161c4019a09 (position 10.16 60.96)) - (junction 958bbc33-010b-4d0b-93ff-dd2750215296 (position -66.04 27.94)) - (junction b0396c38-36d8-44c6-9f1e-b19edde2ab84 (position 5.08 20.32)) - (junction b7af4c76-f28a-46fd-b7f7-92ec8a89a5e8 (position 10.16 5.08)) - (junction bf1b0fec-6479-4a45-b02c-29fba6323488 (position 5.08 15.24)) - (junction c097e13b-a736-4fb0-84b6-b3d2a03c0e56 (position -2.54 25.4)) + (junction 2186ed57-1dc5-46e0-a323-864c225511e4 (position 43.18 -2.54)) + (junction 5b329324-75c5-4f69-b770-eb3f65acb041 (position -27.94 -27.94)) + (junction 5fb50e69-1b03-4b1c-a287-fc02d177b713 (position 35.56 35.56)) + (junction 6a2c9f0a-e066-4b01-aeb1-b63948f634bc (position 35.56 12.7)) + (junction 6bd23496-19f5-4486-a758-d8f951757070 (position 48.26 -27.94)) + (junction 7fb71fd5-f5c0-43b9-8b7b-910ec148bb92 (position -27.94 53.34)) + (junction 8cadcf76-8e41-4a4b-83f6-5161c4019a09 (position 48.26 53.34)) + (junction 958bbc33-010b-4d0b-93ff-dd2750215296 (position -27.94 20.32)) + (junction b0396c38-36d8-44c6-9f1e-b19edde2ab84 (position 43.18 12.7)) + (junction b7af4c76-f28a-46fd-b7f7-92ec8a89a5e8 (position 48.26 -2.54)) + (junction bf1b0fec-6479-4a45-b02c-29fba6323488 (position 43.18 7.62)) + (junction c097e13b-a736-4fb0-84b6-b3d2a03c0e56 (position 35.56 17.78)) (line 12c73785-5d6a-4468-bae7-57534742f757 (width 0.15875) (from (junction 5fb50e69-1b03-4b1c-a287-fc02d177b713)) (to (symbol b3206de5-3c42-4b98-886f-6c97ce2e3223) (pin 363f67fd-9aee-4233-ade9-00edf102ea0e)) @@ -175,8 +198,8 @@ ) (netsegment 2f11231b-aa98-403d-8f6b-ec9c8a70fe05 (net 0e6137da-98f3-4440-86af-9b037b2bb563) - (junction 8273668d-269b-4908-8d9e-8de9f6d68bd0 (position 2.54 35.56)) - (junction b0dcdff9-0657-469b-95a0-475b87763051 (position 2.54 40.64)) + (junction 8273668d-269b-4908-8d9e-8de9f6d68bd0 (position 40.64 27.94)) + (junction b0dcdff9-0657-469b-95a0-475b87763051 (position 40.64 33.02)) (line 21c352a3-a70b-4245-8337-7696cb13754f (width 0.15875) (from (symbol cbfa6011-724a-4239-b2d3-fb5a38f9e243) (pin 10027565-729b-4973-89a4-9a44923c0e7d)) (to (junction b0dcdff9-0657-469b-95a0-475b87763051)) @@ -192,9 +215,9 @@ ) (netsegment a2e55121-e054-4e45-bddb-1ca3da5d21e0 (net 7d652b7e-793b-48ef-b620-ea52a5664e54) - (junction 0cab3fb9-c98c-4968-991c-aec3bfde632c (position -22.86 48.26)) - (junction 15eace4b-ce87-4e34-80c4-a15ca5e1a8a7 (position -27.94 48.26)) - (junction 1f2e0a74-4037-492c-85a0-f0d8afd2e91d (position -27.94 20.32)) + (junction 0cab3fb9-c98c-4968-991c-aec3bfde632c (position 15.24 40.64)) + (junction 15eace4b-ce87-4e34-80c4-a15ca5e1a8a7 (position 10.16 40.64)) + (junction 1f2e0a74-4037-492c-85a0-f0d8afd2e91d (position 10.16 12.7)) (line 33a14855-7525-49f1-b971-2d5ef5a8c5d3 (width 0.15875) (from (symbol 3149dca3-643b-4b58-b243-6cf3db92093b) (pin 2f7ba14f-fe96-4e63-91bd-6edd640085f4)) (to (junction 1f2e0a74-4037-492c-85a0-f0d8afd2e91d)) @@ -218,8 +241,8 @@ ) (netsegment a3387f77-16aa-4482-b6b1-adc418fb19ef (net e133359a-6166-4ba8-b932-313897bb65de) - (junction 8572313e-a36f-401e-9573-87b30ff93759 (position -71.12 43.18)) - (junction ef090782-8e1a-403a-9ca3-478c3b898d3e (position -71.12 33.02)) + (junction 8572313e-a36f-401e-9573-87b30ff93759 (position -33.02 35.56)) + (junction ef090782-8e1a-403a-9ca3-478c3b898d3e (position -33.02 25.4)) (line 04787750-2583-4621-ab8b-ce047810cf5b (width 0.15875) (from (symbol 3149dca3-643b-4b58-b243-6cf3db92093b) (pin 54f07ef6-415e-4882-8c55-22a45623f3b1)) (to (junction 8572313e-a36f-401e-9573-87b30ff93759)) @@ -249,14 +272,14 @@ ) (netsegment fda349f6-226d-4ca1-bebe-cc0a9a281f9c (net 00a3ed97-b2b6-425f-8e8d-3cd0fe3524d2) - (junction 1ef84887-5f50-44f4-87d3-17c7b5aaa55e (position 15.24 -25.4)) - (junction 6365783d-c602-41c5-9c15-6ea99d4fa581 (position 22.86 22.86)) - (junction 870b5ab9-0d11-44f7-b131-767101973a06 (position 10.16 22.86)) - (junction bce76a6a-1879-427d-b80c-6de30b777bf4 (position -63.5 -25.4)) - (junction d26e9184-f37f-4cd2-bff8-e381498c30db (position -63.5 38.1)) - (junction d8b7e55c-ab09-4017-b4c2-f7d444fe4b81 (position 15.24 -2.54)) - (junction dbe565fc-9570-4648-a442-0b8885e0ecab (position 38.1 22.86)) - (junction e348d1a2-2fab-4f52-96dc-a488382e804e (position 38.1 -2.54)) + (junction 1ef84887-5f50-44f4-87d3-17c7b5aaa55e (position 53.34 -33.02)) + (junction 6365783d-c602-41c5-9c15-6ea99d4fa581 (position 60.96 15.24)) + (junction 870b5ab9-0d11-44f7-b131-767101973a06 (position 48.26 15.24)) + (junction bce76a6a-1879-427d-b80c-6de30b777bf4 (position -25.4 -33.02)) + (junction d26e9184-f37f-4cd2-bff8-e381498c30db (position -25.4 30.48)) + (junction d8b7e55c-ab09-4017-b4c2-f7d444fe4b81 (position 53.34 -10.16)) + (junction dbe565fc-9570-4648-a442-0b8885e0ecab (position 76.2 15.24)) + (junction e348d1a2-2fab-4f52-96dc-a488382e804e (position 76.2 -10.16)) (line 0bc87c60-86cc-401d-b86b-fd90ab002283 (width 0.15875) (from (junction bce76a6a-1879-427d-b80c-6de30b777bf4)) (to (junction d26e9184-f37f-4cd2-bff8-e381498c30db)) @@ -300,8 +323,8 @@ ) (netsegment fe2a7c7e-4532-4933-a284-a43dcf6498de (net 3c3953fd-1d13-4593-8d84-1066d0159733) - (junction 1a584fed-0dee-4525-a35e-5d3f0dcd9a01 (position 0.0 38.1)) - (junction 1af1d9d5-5cd8-42b3-b5cd-3b0a58f6a205 (position 0.0 45.72)) + (junction 1a584fed-0dee-4525-a35e-5d3f0dcd9a01 (position 38.1 30.48)) + (junction 1af1d9d5-5cd8-42b3-b5cd-3b0a58f6a205 (position 38.1 38.1)) (line 010d8778-c407-4284-b354-0086923c9042 (width 0.15875) (from (symbol 3149dca3-643b-4b58-b243-6cf3db92093b) (pin aec954b8-c6de-4ff4-894e-685c31d9ad61)) (to (junction 1a584fed-0dee-4525-a35e-5d3f0dcd9a01)) diff --git a/src/dimensioner/dimensioner_utils.py b/src/dimensioner/dimensioner_utils.py index fa53441..aa67acc 100644 --- a/src/dimensioner/dimensioner_utils.py +++ b/src/dimensioner/dimensioner_utils.py @@ -35,8 +35,6 @@ # import sys -from _thread import start_new_thread -from utime import sleep class DeltaError(ValueError): pass @@ -101,91 +99,8 @@ def roundUnits(x, units): # # -# -# USB serial communication for the Raspberry Pi Pico (RD2040) using the second RD2040 -# thread/processor (written by Dorian Wiskow - Janaury 2021) -# - -# -# global variables to share between both threads/processors -# -bufferSize = 1024 # size of circular buffer to allocate -buffer = [' '] * bufferSize # circuolar incomming USB serial data buffer (pre fill) -bufferEcho = False # USB serial port echo incooming characters (True/False) -bufferNextIn, bufferNextOut = 0,0 # pointers to next in/out character in circualr buffer -terminateThread = False # tell 'bufferSTDIN' function to terminate (True/False) -# -# bufferSTDIN() function to execute in parallel on second Pico RD2040 thread/processor -# -def bufferSTDIN(): - global buffer, bufferSize, bufferEcho, bufferNextIn, terminateThread +def printSerial(data, end = "\n"): + print(data, end) - while True: # endless loop - if terminateThread: # if requested by main thread ... - break # ... exit loop - buffer[bufferNextIn] = sys.stdin.read(1) # wait for/store next byte from USB serial - if bufferEcho: # if echo is True ... - print(buffer[bufferNextIn], end='') # ... output byte to USB serial - bufferNextIn += 1 # bump pointer - if bufferNextIn == bufferSize: # ... and wrap, if necessary - bufferNextIn = 0 -# -# instantiate second 'background' thread on RD2040 dual processor to monitor and buffer -# incoming data from 'stdin' over USB serial port using ‘bufferSTDIN‘ function (above) -# -bufferSTDINthread = start_new_thread(bufferSTDIN, ()) - -# -# function to check if a byte is available in the buffer and if so, return it -# -def getByteBuffer(): - global buffer, bufferSize, bufferNextOut, bufferNextIn - - if bufferNextOut == bufferNextIn: # if no unclaimed byte in buffer ... - return '' # ... return a null string - n = bufferNextOut # save current pointer - bufferNextOut += 1 # bump pointer - if bufferNextOut == bufferSize: # ... wrap, if necessary - bufferNextOut = 0 - return (buffer[n]) # return byte from buffer - -# -# function to check if a line is available in the buffer and if so return it -# otherwise return a null string -# -# NOTE 1: a line is one or more bytes with the last byte being LF (\x0a) -# 2: a line containing only a single LF byte will also return a null string -# -def getLineBuffer(): - global buffer, bufferSize, bufferNextOut, bufferNextIn - - if bufferNextOut == bufferNextIn: # if no unclaimed byte in buffer ... - return '' # ... RETURN a null string - - n = bufferNextOut # search for LF or CR in unclaimed bytes - while n != bufferNextIn: - if buffer[n] == '\x0a' or buffer[n] == '\x0d': # if LF or CR found ... - break # ... exit loop ('n' pointing to LF) - n += 1 # bump pointer - if n == bufferSize: # ... wrap, if necessary - n = 0 - if (n == bufferNextIn): # if no LF found ... - return '' # ... RETURN a null string - - line = '' # LF found in unclaimed bytes at pointer 'n' - n += 1 # bump pointer past LF - if n == bufferSize: # ... wrap, if necessary - n = 0 - - while bufferNextOut != n: # BUILD line to RETURN until LF or CR pointer 'n' hit - - if buffer[bufferNextOut] == '\x0a' or buffer[bufferNextOut] == '\x0d': # if current byte is LF or CR ... - bufferNextOut += 1 # bump pointer - if bufferNextOut == bufferSize: # ... wrap, if necessary - bufferNextOut = 0 - break # and exit loop, ignoring (i.e. strip) LF/CR byte - line = line + buffer[bufferNextOut] # add byte to line - bufferNextOut += 1 # bump pointer - if bufferNextOut == bufferSize: # wrap, if necessary - bufferNextOut = 0 - return line # RETURN unclaimed line of input +def readlineSerial(): + return sys.stdin.readline().strip() \ No newline at end of file diff --git a/src/dimensioner/main.py b/src/dimensioner/main.py index 55aade7..8eeceb8 100644 --- a/src/dimensioner/main.py +++ b/src/dimensioner/main.py @@ -86,13 +86,13 @@ class USBHIDInterface(HIDInterface): 0x26, 0xff, 0x00, # Logical Maximum (255) 0x85, 0x02, # Report ID 2 to host 0x09, 0x01, # Usage (Vendor Usage 1) - 0x95, 0x01, # Report Count (1 byte) - 0x75, 0x30, # Report Size (48 bits/6 bytes) + 0x95, 0x08, # Report Count (1 bit) + 0x75, 0x06, # Report Size (48 bits/6 bytes) 0x81, 0x00, # Input (Data,Ary,Abs) 0x85, 0x02, # Report ID 2 from host 0x09, 0x01, # Usage (Vendor Usage 1) - 0x95, 0x01, # Report Count (1 bytes) - 0x75, 0x10, # Report Size (16 bits/2 bytes) + 0x95, 0x08, # Report Count (1 bit) + 0x75, 0x02, # Report Size (16 bits/2 bytes) 0x91, 0x01, # Output (Data,Ary,Abs) 0xc0 # End Collection ]), @@ -108,37 +108,34 @@ class USBHIDInterface(HIDInterface): if report_data[1] == 0x00: # Command to set zero distance setZeroDistance() - print("A0: ZEROED") + printSerial("A0: ZEROED") elif report_data[1] > 0x00 and report_data[0] < 0x05: # Set units to send measurements in setUnits(getUnitsFromByte(report_data[1])) - print("A2: UNIT: "+reportUnits) + printSerial("A2: UNIT: "+reportUnits) elif report_data[1] == 0xAC: # Set ambient temperature in degrees C setAmbientTemp(report_data[2]) - print("A1: TEMP: "+ambientTempC) + printSerial("A1: TEMP: "+str(ambientTempC)) elif report_data[1] == 0x4D: errorDisplay(0x4D) - print("Soft resetting to MicroPython REPL, power cycle to undo. Goodbye for now!") + printSerial("Soft resetting to MicroPython REPL, power cycle to undo. Goodbye for now!") machine.reset() elif report_data[1] == 0x50: errorDisplay(0x50) - print("Entering firmware update mode, power cycle to undo. Goodbye for now!") + printSerial("Entering firmware update mode, power cycle to undo. Goodbye for now!") machine.bootloader() else: # Can't understand command send_data(b'\x02\x08\x00\x00\x00\x00\x00') - print("E8: Unsupported Command from Host") + printSerial("E8: Unsupported Command from Host") errorDisplay(8) except: send_data(b'\x02\x08\x00\x00\x00\x00\x00') - print("E8: Unsupported Command from Host") + printSerial("E8: Unsupported Command from Host") errorDisplay(8) def send_data(self, data): - #return - while self.busy(): - machine.idle() self.send_report(data) usbinterface = USBHIDInterface() @@ -151,9 +148,9 @@ zeroButtonPin = Pin(ZERO_BUTTON_PIN, Pin.IN, Pin.PULL_UP) unitsButtonPin = Pin(UNITS_BUTTON_PIN, Pin.IN, Pin.PULL_UP) bootDisplay(FIRMWARE_VERSION) -print(PROD) -print("Version " + FIRMWARE_VERSION) -print("Sensor: " + SENSOR_TYPE) +printSerial(PROD) +printSerial("Version " + FIRMWARE_VERSION) +printSerial("Sensor: " + SENSOR_TYPE) zeroDistance = 500 reportUnits = "in" @@ -166,7 +163,7 @@ def saveSettings(): with open('settings.json', 'w') as f: json.dump(jsondata, f) except: - print("E0: Could not save settings to flash memory.") + printSerial("E0: Could not save settings to flash memory.") def loadSettings(): global zeroDistance, reportUnits, ambientTempC @@ -178,15 +175,15 @@ def loadSettings(): ambientTempC = data["ambientTempC"] printConfig() except: - print("Warning: Could not load settings from flash memory. Saving current values instead.") + printSerial("Warning: Could not load settings from flash memory. Saving current values instead.") saveSettings() def printConfig(): - print("I0: Zero: ", end="") - print(zeroDistance, end="mm\n") - print("I1: Units: " + reportUnits) - print("I2: Temp C: ", end="") - print(getAmbientTemp()) + printSerial("I0: Zero: ", end="") + printSerial(zeroDistance, end="mm\n") + printSerial("I1: Units: " + reportUnits) + printSerial("I2: Temp C: ", end="") + printSerial(getAmbientTemp()) def getAmbientTemp(): if SENSOR_TYPE == "US-100": @@ -298,48 +295,48 @@ try: if unitNumber > 4: unitNumber = 1 setUnits(getUnitsFromByte(unitNumber)) - buffLine = getLineBuffer() # Read a command from the serial connection if available + buffLine = readlineSerial() # Read a command from the serial connection if available if buffLine: data = buffLine.strip().upper() try: if data == "": pass elif data == "ZERO": - print("A0: ZEROED") + printSerial("A0: ZEROED") setZeroDistance() elif data.startswith("TEMP:"): setAmbientTemp(data[5:]) - print("A1: TEMP: "+ambientTempC) + printSerial("A1: TEMP: "+ambientTempC) elif data.startswith("UNIT:"): setUnits(data[5:]) - print("A2: UNIT: "+reportUnits) + printSerial("A2: UNIT: "+reportUnits) elif data == "?": printConfig() elif data == "REPL": errorDisplay(0x4D) - print("REPL: Resetting to MicroPython REPL, power cycle to undo. Goodbye for now!") + printSerial("REPL: Resetting to MicroPython REPL, power cycle to undo. Goodbye for now!") sleep_us(500) machine.reset() break elif data == "UPDATE": errorDisplay(0x50) - print("FWUPD: Entering firmware update mode, power cycle to undo. Goodbye for now!") + printSerial("FWUPD: Entering firmware update mode, power cycle to undo. Goodbye for now!") sleep_us(500) machine.bootloader() break else: errorDisplay(8) - print("E8: Unsupported Command from Host: ", data) + printSerial("E8: Unsupported Command from Host: ", data) except: errorDisplay(8) - print("E8: Unsupported Command from Host") + printSerial("E8: Unsupported Command from Host") try: dist = getAverageDistanceMM() # Get distance to object if dist < 0: # distance measurement timed out, ultrasonic ping never came back? usbinterface.send_data(b'\x02\x01\x00\x00\x00\x00\x00') errorDisplay(1, "Sensor timeout") - print("E1: Sensor Timeout") + printSerial("E1: Sensor Timeout") continue size = zeroDistance - dist sizeInUnits = convertMMToUnits(size, reportUnits) @@ -348,19 +345,19 @@ try: # Under minimum accurate range usbinterface.send_data(b'\x02\x07\x00\x00\x00\x00\x00') errorDisplay(7) - print("E7: Under Minimum Range") + printSerial("E7: Under Minimum Range") continue if dist > SENSOR_MAX_MM: # Above maximum accurate range usbinterface.send_data(b'\x02\x06\x00\x00\x00\x00\x00') errorDisplay(6) - print("E6: Over Maximum Range") + printSerial("E6: Over Maximum Range") continue if abs(sizeInUnits) > 65535: # Value too large to fit in available bytes usbinterface.send_data(b'\x02\x09\x00\x00\x00\x00\x00') errorDisplay(9) - print("E9: Value Too Large, Use Different Units") + printSerial("E9: Value Too Large, Use Different Units") continue negativeByte = 0x00 @@ -373,7 +370,7 @@ try: # Within zero range, send zero usbinterface.send_data(b'\x02\x02' + bytes([getUnitsAsByte(reportUnits), negativeByte]) + b'\x00\x00\x00') sendToDisplay(0) - print("S2: Zero") + printSerial("S2: Zero") continue distanceBytes = math.floor(abs(sizeInUnits)).to_bytes(2, 'big') + round(abs(sizeInUnits) % 1 * 100).to_bytes(1, 'big') @@ -382,20 +379,20 @@ try: usbinterface.send_data(b'\x02' + bytes([statusByte, getUnitsAsByte(reportUnits), negativeByte]) + distanceBytes) if statusByte == 0x04: - print("S4: ", end="") + printSerial("S4: ", end="") elif statusByte == 0x05: - print("S5: ", end="") + printSerial("S5: ", end="") if size < 0: - print("-", end="") + printSerial("-", end="") - print(abs(round(sizeInUnits, 2)), end="") - print(reportUnits.lower(), end=" ") - print("RAW:" + str(dist) + "mm") + printSerial(abs(round(sizeInUnits, 2)), end="") + printSerial(reportUnits.lower(), end=" ") + printSerial("RAW:" + str(dist) + "mm") sendToDisplay(round(sizeInUnits, 2)) except DeltaError: usbinterface.send_data(b'\x02\x03\x00\x00\x00\x00\x00') sendToDisplay(999, True) - print("E3: Unstable") + printSerial("E3: Unstable") except KeyboardInterrupt: terminateThread = True clearDisplay() diff --git a/src/dimensioner/manifest.py b/src/dimensioner/manifest.py index e906c80..fe5ab70 100644 --- a/src/dimensioner/manifest.py +++ b/src/dimensioner/manifest.py @@ -1,6 +1,7 @@ # Build manifest for PostalPoint Parcel Dimensioner include("$(MPY_DIR)/ports/rp2/boards/manifest.py") require("usb-device-hid") +require("usb-device-cdc") require("ssd1306") module("config.py") module("dimensioner_utils.py")