Updated to hiabuto.net Faction Timer PCB V1.0

This commit is contained in:
2023-02-13 22:59:42 +01:00
parent 0b95cff140
commit 3ee276c189
31 changed files with 5807 additions and 518 deletions

View File

@@ -792,6 +792,48 @@
) )
) )
(footprint "Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder" (layer "F.Cu")
(tedit 5F68FEEE) (tstamp 0532a8d5-8c20-4738-8798-6e073ed5a8f0)
(at 136.398 97.536)
(descr "Resistor SMD 0805 (2012 Metric), square (rectangular) end terminal, IPC_7351 nominal with elongated pad for handsoldering. (Body size source: IPC-SM-782 page 72, https://www.pcb-3d.com/wordpress/wp-content/uploads/ipc-sm-782a_amendment_1_and_2.pdf), generated with kicad-footprint-generator")
(tags "resistor handsolder")
(property "Sheetfile" "DE-Timer.kicad_sch")
(property "Sheetname" "")
(path "/bb05515f-2e75-40e9-b955-d5a87d499885")
(attr smd)
(fp_text reference "R12" (at 0.016 1.778) (layer "F.SilkS")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 773a6110-b6de-4760-af86-4512c04abc39)
)
(fp_text value "4k7" (at 0 1.65) (layer "F.Fab")
(effects (font (size 1 1) (thickness 0.15)))
(tstamp 2084fbf6-0dc3-4639-afba-49154537d828)
)
(fp_text user "${REFERENCE}" (at 0 0) (layer "F.Fab")
(effects (font (size 0.5 0.5) (thickness 0.08)))
(tstamp f55956f3-d95f-480d-bdfe-9bf55073f81d)
)
(fp_line (start -0.227064 -0.735) (end 0.227064 -0.735) (layer "F.SilkS") (width 0.12) (tstamp 348a0c3a-4854-4149-8a7a-ae4295b639cb))
(fp_line (start -0.227064 0.735) (end 0.227064 0.735) (layer "F.SilkS") (width 0.12) (tstamp b54c3862-639e-4b03-9fc6-28e0c3c13c33))
(fp_line (start -1.85 -0.95) (end 1.85 -0.95) (layer "F.CrtYd") (width 0.05) (tstamp 1aba87f5-7751-4be0-b597-73a1c5598236))
(fp_line (start 1.85 -0.95) (end 1.85 0.95) (layer "F.CrtYd") (width 0.05) (tstamp 3f6a83ae-cff1-4c39-98be-8887d8ed4de6))
(fp_line (start 1.85 0.95) (end -1.85 0.95) (layer "F.CrtYd") (width 0.05) (tstamp 78cb5347-98db-40d1-8eea-cf17a6cf7a4d))
(fp_line (start -1.85 0.95) (end -1.85 -0.95) (layer "F.CrtYd") (width 0.05) (tstamp f1b1c833-6823-43af-b40b-5bbeb1279d5f))
(fp_line (start -1 0.625) (end -1 -0.625) (layer "F.Fab") (width 0.1) (tstamp 0ee362d6-46b8-4315-b742-5f777d4f9d69))
(fp_line (start 1 -0.625) (end 1 0.625) (layer "F.Fab") (width 0.1) (tstamp 28168752-56b0-4e7c-905e-5696ed3a23e6))
(fp_line (start 1 0.625) (end -1 0.625) (layer "F.Fab") (width 0.1) (tstamp dda26709-9540-42e6-9c7d-1d0e3f87b317))
(fp_line (start -1 -0.625) (end 1 -0.625) (layer "F.Fab") (width 0.1) (tstamp e117b9a3-4868-45c7-860c-7a0459b0683b))
(pad "1" smd roundrect (at -1 0) (size 1.2 1.4) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.208333)
(net 8 "CLK_DISP") (pintype "passive") (tstamp d1feff21-7eba-4b15-8720-b52f55c0ca51))
(pad "2" smd roundrect (at 1 0) (size 1.2 1.4) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.208333)
(net 3 "GND") (pintype "passive") (tstamp 63c354f3-3b88-4b5b-b208-34ffba3c13c5))
(model "${KICAD6_3DMODEL_DIR}/Resistor_SMD.3dshapes/R_0805_2012Metric.wrl"
(offset (xyz 0 0 0))
(scale (xyz 1 1 1))
(rotate (xyz 0 0 0))
)
)
(footprint "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" (layer "F.Cu") (footprint "Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical" (layer "F.Cu")
(tedit 59FED5CC) (tstamp 0df376e0-b3b8-4926-8318-ef70bcc43326) (tedit 59FED5CC) (tstamp 0df376e0-b3b8-4926-8318-ef70bcc43326)
(at 123.048 107.5365 90) (at 123.048 107.5365 90)
@@ -1675,6 +1717,7 @@
(segment (start 143.812 102.314) (end 145.8865 100.2395) (width 0.25) (layer "F.Cu") (net 3) (tstamp 0698aa85-a53c-4366-be01-d6c0dc2691d4)) (segment (start 143.812 102.314) (end 145.8865 100.2395) (width 0.25) (layer "F.Cu") (net 3) (tstamp 0698aa85-a53c-4366-be01-d6c0dc2691d4))
(segment (start 138.21 103.584) (end 136.002 103.584) (width 0.25) (layer "F.Cu") (net 3) (tstamp 06d12b55-0deb-4cd5-b61f-92d39be65add)) (segment (start 138.21 103.584) (end 136.002 103.584) (width 0.25) (layer "F.Cu") (net 3) (tstamp 06d12b55-0deb-4cd5-b61f-92d39be65add))
(segment (start 151.242 90.239) (end 149.029 90.239) (width 0.25) (layer "F.Cu") (net 3) (tstamp 07985846-c645-416c-a132-3b64067adc30)) (segment (start 151.242 90.239) (end 149.029 90.239) (width 0.25) (layer "F.Cu") (net 3) (tstamp 07985846-c645-416c-a132-3b64067adc30))
(segment (start 145.542 97.536) (end 145.8865 97.8805) (width 0.25) (layer "F.Cu") (net 3) (tstamp 0a6dc0ac-6cdc-4471-8ba5-9156bf4d1b52))
(segment (start 141.252 79.093) (end 142.212 79.093) (width 1.27) (layer "F.Cu") (net 3) (tstamp 0ade6874-9b5f-4958-953d-bd388d1d5d69)) (segment (start 141.252 79.093) (end 142.212 79.093) (width 1.27) (layer "F.Cu") (net 3) (tstamp 0ade6874-9b5f-4958-953d-bd388d1d5d69))
(segment (start 125.593 119.332) (end 125.593 115.6695) (width 1.27) (layer "F.Cu") (net 3) (tstamp 10864117-6b36-486c-9f98-4c445d9ff4e4)) (segment (start 125.593 119.332) (end 125.593 115.6695) (width 1.27) (layer "F.Cu") (net 3) (tstamp 10864117-6b36-486c-9f98-4c445d9ff4e4))
(segment (start 131.445 80.1795) (end 131.445 75.184) (width 0.25) (layer "F.Cu") (net 3) (tstamp 11e43be2-9e54-41ba-931e-b30f690e061d)) (segment (start 131.445 80.1795) (end 131.445 75.184) (width 0.25) (layer "F.Cu") (net 3) (tstamp 11e43be2-9e54-41ba-931e-b30f690e061d))
@@ -1688,9 +1731,10 @@
(segment (start 149.206 80.537) (end 148.6535 81.0895) (width 0.25) (layer "F.Cu") (net 3) (tstamp 2b8f0eea-4e0b-422d-9505-78b65c347caf)) (segment (start 149.206 80.537) (end 148.6535 81.0895) (width 0.25) (layer "F.Cu") (net 3) (tstamp 2b8f0eea-4e0b-422d-9505-78b65c347caf))
(segment (start 125.588 109.426) (end 125.588 107.5365) (width 1.27) (layer "F.Cu") (net 3) (tstamp 2c7c0bf9-b88b-4a29-99f5-e105fe40bded)) (segment (start 125.588 109.426) (end 125.588 107.5365) (width 1.27) (layer "F.Cu") (net 3) (tstamp 2c7c0bf9-b88b-4a29-99f5-e105fe40bded))
(segment (start 146.812 83.693) (end 146.812 87.249) (width 1.27) (layer "F.Cu") (net 3) (tstamp 2d233d57-736e-4e68-8e1d-101d5cda6c1c)) (segment (start 146.812 83.693) (end 146.812 87.249) (width 1.27) (layer "F.Cu") (net 3) (tstamp 2d233d57-736e-4e68-8e1d-101d5cda6c1c))
(segment (start 133.906 103.584) (end 126.764 103.584) (width 0.25) (layer "F.Cu") (net 3) (tstamp 2d500d3f-13e5-4bd0-99c6-9636b93ac1c0))
(segment (start 126.527 70.266) (end 131.445 75.184) (width 1.27) (layer "F.Cu") (net 3) (tstamp 2f32e74e-6d6d-450e-8f3d-b6fc4e70c684)) (segment (start 126.527 70.266) (end 131.445 75.184) (width 1.27) (layer "F.Cu") (net 3) (tstamp 2f32e74e-6d6d-450e-8f3d-b6fc4e70c684))
(segment (start 136.002 103.457) (end 133.208 106.251) (width 0.25) (layer "F.Cu") (net 3) (tstamp 2f9e97f9-4ef3-4859-ba35-2e4a77c29edd))
(segment (start 136.002 103.584) (end 136.002 103.457) (width 0.25) (layer "F.Cu") (net 3) (tstamp 318deff9-de96-46fd-a4d1-7f7398f1421b)) (segment (start 136.002 103.584) (end 136.002 103.457) (width 0.25) (layer "F.Cu") (net 3) (tstamp 318deff9-de96-46fd-a4d1-7f7398f1421b))
(segment (start 137.398 97.536) (end 145.542 97.536) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3658bfa0-d122-4245-af58-a0504ab2811c))
(segment (start 141.252 79.093) (end 142.24 78.105) (width 1.27) (layer "F.Cu") (net 3) (tstamp 37f5f4ac-be45-488c-a2e2-ce9453b7dc8a)) (segment (start 141.252 79.093) (end 142.24 78.105) (width 1.27) (layer "F.Cu") (net 3) (tstamp 37f5f4ac-be45-488c-a2e2-ce9453b7dc8a))
(segment (start 132.033489 128.634511) (end 125.683489 128.634511) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3c7f5046-d10b-4d23-aab6-4f126bf31037)) (segment (start 132.033489 128.634511) (end 125.683489 128.634511) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3c7f5046-d10b-4d23-aab6-4f126bf31037))
(segment (start 138.148 126.05) (end 134.618 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3e75e8db-7b92-4c17-a4b0-ddafce145c94)) (segment (start 138.148 126.05) (end 134.618 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp 3e75e8db-7b92-4c17-a4b0-ddafce145c94))
@@ -1702,13 +1746,12 @@
(segment (start 142.24 71.882) (end 143.764 70.358) (width 1.27) (layer "F.Cu") (net 3) (tstamp 50fd0d9e-f456-471d-8144-f18ffd98e314)) (segment (start 142.24 71.882) (end 143.764 70.358) (width 1.27) (layer "F.Cu") (net 3) (tstamp 50fd0d9e-f456-471d-8144-f18ffd98e314))
(segment (start 146.904 79.093) (end 145.841 79.093) (width 0.25) (layer "F.Cu") (net 3) (tstamp 523e0acc-da36-428b-9682-5bf2258a1e74)) (segment (start 146.904 79.093) (end 145.841 79.093) (width 0.25) (layer "F.Cu") (net 3) (tstamp 523e0acc-da36-428b-9682-5bf2258a1e74))
(segment (start 144.257 78.692) (end 144.257 77.231) (width 0.25) (layer "F.Cu") (net 3) (tstamp 5271f873-2fb7-4278-9720-80c1b44a3cfd)) (segment (start 144.257 78.692) (end 144.257 77.231) (width 0.25) (layer "F.Cu") (net 3) (tstamp 5271f873-2fb7-4278-9720-80c1b44a3cfd))
(segment (start 133.208 106.65751) (end 130.43951 109.426) (width 0.25) (layer "F.Cu") (net 3) (tstamp 53a3038a-4311-44af-b1de-145ca08b93f5))
(segment (start 131.176 80.4485) (end 129.94148 81.68302) (width 0.25) (layer "F.Cu") (net 3) (tstamp 5533e9b3-2d6c-4b75-911e-51b2214e8c06)) (segment (start 131.176 80.4485) (end 129.94148 81.68302) (width 0.25) (layer "F.Cu") (net 3) (tstamp 5533e9b3-2d6c-4b75-911e-51b2214e8c06))
(segment (start 148.6535 81.0895) (end 144.2085 81.0895) (width 0.25) (layer "F.Cu") (net 3) (tstamp 557811b1-db36-47ec-8846-7090e7f324b8)) (segment (start 148.6535 81.0895) (end 144.2085 81.0895) (width 0.25) (layer "F.Cu") (net 3) (tstamp 557811b1-db36-47ec-8846-7090e7f324b8))
(segment (start 142.636 77.231) (end 142.24 76.835) (width 0.25) (layer "F.Cu") (net 3) (tstamp 55f41b12-e993-400e-b5d0-cda0b9dc4c5f)) (segment (start 142.636 77.231) (end 142.24 76.835) (width 0.25) (layer "F.Cu") (net 3) (tstamp 55f41b12-e993-400e-b5d0-cda0b9dc4c5f))
(segment (start 125.593 115.6695) (end 125.588 115.6645) (width 1.27) (layer "F.Cu") (net 3) (tstamp 5778e10e-3347-4b63-bfde-51d8183229b0)) (segment (start 125.593 115.6695) (end 125.588 115.6645) (width 1.27) (layer "F.Cu") (net 3) (tstamp 5778e10e-3347-4b63-bfde-51d8183229b0))
(segment (start 126.764 103.584) (end 126.731 103.617) (width 0.25) (layer "F.Cu") (net 3) (tstamp 61f784f8-4260-4318-b71c-056f41635fa0))
(segment (start 138.21 125.988) (end 138.148 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp 683c5505-becc-45a5-88df-e0a72273db17)) (segment (start 138.21 125.988) (end 138.148 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp 683c5505-becc-45a5-88df-e0a72273db17))
(segment (start 133.208 106.251) (end 133.208 106.65751) (width 0.25) (layer "F.Cu") (net 3) (tstamp 6cccbe29-4636-4950-8c7b-7a8eb0b24cbc))
(segment (start 125.588 105.743) (end 126.731 104.6) (width 1.27) (layer "F.Cu") (net 3) (tstamp 6e739367-4d3f-484e-87ec-346cf8076b27)) (segment (start 125.588 105.743) (end 126.731 104.6) (width 1.27) (layer "F.Cu") (net 3) (tstamp 6e739367-4d3f-484e-87ec-346cf8076b27))
(segment (start 146.177 126.05) (end 138.148 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp 6efb220a-f32f-4fba-87c6-646bef2bf0cd)) (segment (start 146.177 126.05) (end 138.148 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp 6efb220a-f32f-4fba-87c6-646bef2bf0cd))
(segment (start 150.114 77.089) (end 150.495 77.47) (width 0.25) (layer "F.Cu") (net 3) (tstamp 6f79164a-ca63-4219-8918-281bfcb8510a)) (segment (start 150.114 77.089) (end 150.495 77.47) (width 0.25) (layer "F.Cu") (net 3) (tstamp 6f79164a-ca63-4219-8918-281bfcb8510a))
@@ -1719,10 +1762,12 @@
(segment (start 144.6435 75.1305) (end 145.841 75.1305) (width 0.25) (layer "F.Cu") (net 3) (tstamp 82f38568-7fb1-425d-8f24-893803ad0b80)) (segment (start 144.6435 75.1305) (end 145.841 75.1305) (width 0.25) (layer "F.Cu") (net 3) (tstamp 82f38568-7fb1-425d-8f24-893803ad0b80))
(segment (start 138.21 109.934) (end 138.21 125.988) (width 0.25) (layer "F.Cu") (net 3) (tstamp 874c0955-fee0-4f00-8350-8bbaa21b2b62)) (segment (start 138.21 109.934) (end 138.21 125.988) (width 0.25) (layer "F.Cu") (net 3) (tstamp 874c0955-fee0-4f00-8350-8bbaa21b2b62))
(segment (start 147.079 78.918) (end 146.904 79.093) (width 0.25) (layer "F.Cu") (net 3) (tstamp 8c7e68f0-f4ba-4cb7-81a9-4b3e2608b9ba)) (segment (start 147.079 78.918) (end 146.904 79.093) (width 0.25) (layer "F.Cu") (net 3) (tstamp 8c7e68f0-f4ba-4cb7-81a9-4b3e2608b9ba))
(segment (start 145.8865 97.8805) (end 145.8865 99.012) (width 0.25) (layer "F.Cu") (net 3) (tstamp 8fb5e374-d7a3-470d-8cec-f9682cdbaae9))
(segment (start 125.588 119.337) (end 125.593 119.332) (width 1.27) (layer "F.Cu") (net 3) (tstamp 90c4c72f-583b-4f3f-9010-af0e05aa12cf)) (segment (start 125.588 119.337) (end 125.593 119.332) (width 1.27) (layer "F.Cu") (net 3) (tstamp 90c4c72f-583b-4f3f-9010-af0e05aa12cf))
(segment (start 147.266 70.158) (end 147.924 69.5) (width 0.25) (layer "F.Cu") (net 3) (tstamp 941355d9-cc60-4d1c-bba6-4078a30529f4)) (segment (start 147.266 70.158) (end 147.924 69.5) (width 0.25) (layer "F.Cu") (net 3) (tstamp 941355d9-cc60-4d1c-bba6-4078a30529f4))
(segment (start 125.588 127.46) (end 125.588 123.777) (width 1.27) (layer "F.Cu") (net 3) (tstamp 94979294-58f1-45cf-861c-a1d9abf6b6a1)) (segment (start 125.588 127.46) (end 125.588 123.777) (width 1.27) (layer "F.Cu") (net 3) (tstamp 94979294-58f1-45cf-861c-a1d9abf6b6a1))
(segment (start 142.212 79.093) (end 144.2085 81.0895) (width 1.27) (layer "F.Cu") (net 3) (tstamp 9728f2ac-d18e-4e64-80f0-36bf86aa0357)) (segment (start 142.212 79.093) (end 144.2085 81.0895) (width 1.27) (layer "F.Cu") (net 3) (tstamp 9728f2ac-d18e-4e64-80f0-36bf86aa0357))
(segment (start 136.002 103.584) (end 133.906 103.584) (width 0.25) (layer "F.Cu") (net 3) (tstamp 9780d6ee-b4a2-44ea-907d-1bb30473759e))
(segment (start 146.812 88.022) (end 146.812 87.249) (width 0.25) (layer "F.Cu") (net 3) (tstamp 983eed90-32b1-432e-a36f-f9ca56bf3fa5)) (segment (start 146.812 88.022) (end 146.812 87.249) (width 0.25) (layer "F.Cu") (net 3) (tstamp 983eed90-32b1-432e-a36f-f9ca56bf3fa5))
(segment (start 138.21 101.044) (end 136.256 101.044) (width 0.25) (layer "F.Cu") (net 3) (tstamp 98417598-1ab4-4a61-b286-ed0798e8b269)) (segment (start 138.21 101.044) (end 136.256 101.044) (width 0.25) (layer "F.Cu") (net 3) (tstamp 98417598-1ab4-4a61-b286-ed0798e8b269))
(segment (start 125.588 107.5365) (end 125.588 105.743) (width 1.27) (layer "F.Cu") (net 3) (tstamp 9a22724d-c343-4a05-ba0a-0b9d4a310b4a)) (segment (start 125.588 107.5365) (end 125.588 105.743) (width 1.27) (layer "F.Cu") (net 3) (tstamp 9a22724d-c343-4a05-ba0a-0b9d4a310b4a))
@@ -1735,22 +1780,23 @@
(segment (start 125.588 123.777) (end 125.588 119.337) (width 1.27) (layer "F.Cu") (net 3) (tstamp c22b862f-8533-422e-a2e5-588b3d5a7475)) (segment (start 125.588 123.777) (end 125.588 119.337) (width 1.27) (layer "F.Cu") (net 3) (tstamp c22b862f-8533-422e-a2e5-588b3d5a7475))
(segment (start 134.224 86.82) (end 136.191 86.82) (width 0.25) (layer "F.Cu") (net 3) (tstamp c4043e6a-0020-47a2-9211-c104af00bff3)) (segment (start 134.224 86.82) (end 136.191 86.82) (width 0.25) (layer "F.Cu") (net 3) (tstamp c4043e6a-0020-47a2-9211-c104af00bff3))
(segment (start 125.588 111.204) (end 125.588 109.426) (width 1.27) (layer "F.Cu") (net 3) (tstamp c43dcb5f-cc72-43fb-8053-6b521bc1b8ee)) (segment (start 125.588 111.204) (end 125.588 109.426) (width 1.27) (layer "F.Cu") (net 3) (tstamp c43dcb5f-cc72-43fb-8053-6b521bc1b8ee))
(segment (start 126.731 104.6) (end 126.731 103.617) (width 1.27) (layer "F.Cu") (net 3) (tstamp cc64892a-d5a9-44c1-89f4-09cf9f503021))
(segment (start 150.114 76.454) (end 150.114 77.089) (width 0.25) (layer "F.Cu") (net 3) (tstamp cccdd42d-5b5e-4b2a-98fd-ac3fa5a22c14)) (segment (start 150.114 76.454) (end 150.114 77.089) (width 0.25) (layer "F.Cu") (net 3) (tstamp cccdd42d-5b5e-4b2a-98fd-ac3fa5a22c14))
(segment (start 151.746 78.918) (end 150.476 78.918) (width 0.25) (layer "F.Cu") (net 3) (tstamp cd158472-09e9-4d28-b5c9-17f0928cbaaa)) (segment (start 151.746 78.918) (end 150.476 78.918) (width 0.25) (layer "F.Cu") (net 3) (tstamp cd158472-09e9-4d28-b5c9-17f0928cbaaa))
(segment (start 150.495 77.47) (end 150.495 78.899) (width 0.25) (layer "F.Cu") (net 3) (tstamp cd904fde-884f-489c-bafe-13dcf58ca270)) (segment (start 150.495 77.47) (end 150.495 78.899) (width 0.25) (layer "F.Cu") (net 3) (tstamp cd904fde-884f-489c-bafe-13dcf58ca270))
(segment (start 130.43951 109.426) (end 125.588 109.426) (width 0.25) (layer "F.Cu") (net 3) (tstamp cfa64fce-20fc-46ed-9dd0-a3b4420cae68))
(segment (start 143.691 70.158) (end 147.266 70.158) (width 0.25) (layer "F.Cu") (net 3) (tstamp d0139650-17d9-4c98-a5c3-f6a1511f85f6)) (segment (start 143.691 70.158) (end 147.266 70.158) (width 0.25) (layer "F.Cu") (net 3) (tstamp d0139650-17d9-4c98-a5c3-f6a1511f85f6))
(segment (start 129.94148 81.68302) (end 129.94148 85.38752) (width 0.25) (layer "F.Cu") (net 3) (tstamp d396caf5-01cc-4a06-9ddc-e6a0fc3d554e)) (segment (start 129.94148 81.68302) (end 129.94148 85.38752) (width 0.25) (layer "F.Cu") (net 3) (tstamp d396caf5-01cc-4a06-9ddc-e6a0fc3d554e))
(segment (start 149.206 78.918) (end 149.206 80.537) (width 0.25) (layer "F.Cu") (net 3) (tstamp d98a7323-aa7c-4405-9d4a-281fb6a15d87)) (segment (start 149.206 78.918) (end 149.206 80.537) (width 0.25) (layer "F.Cu") (net 3) (tstamp d98a7323-aa7c-4405-9d4a-281fb6a15d87))
(segment (start 135.354 79.093) (end 141.252 79.093) (width 1.27) (layer "F.Cu") (net 3) (tstamp d9969fbf-35d2-4e51-8af9-4be7ea6a102a)) (segment (start 135.354 79.093) (end 141.252 79.093) (width 1.27) (layer "F.Cu") (net 3) (tstamp d9969fbf-35d2-4e51-8af9-4be7ea6a102a))
(segment (start 144.257 77.231) (end 144.257 75.517) (width 0.25) (layer "F.Cu") (net 3) (tstamp da1c16cc-1801-43db-8f21-2fdcbd2ffae7)) (segment (start 144.257 77.231) (end 144.257 75.517) (width 0.25) (layer "F.Cu") (net 3) (tstamp da1c16cc-1801-43db-8f21-2fdcbd2ffae7))
(segment (start 136.002 103.457) (end 136.002 102.314) (width 0.25) (layer "F.Cu") (net 3) (tstamp da6e969a-a7a5-4e44-82d9-53a2ce63fa18)) (segment (start 136.002 103.457) (end 136.002 102.314) (width 0.25) (layer "F.Cu") (net 3) (tstamp da6e969a-a7a5-4e44-82d9-53a2ce63fa18))
(segment (start 126.731 104.6) (end 126.731 96.774) (width 1.27) (layer "F.Cu") (net 3) (tstamp dc8b6ee7-5d38-4f57-a54a-260f90631f2c))
(segment (start 136.191 88.09) (end 136.191 86.82) (width 0.25) (layer "F.Cu") (net 3) (tstamp e5497ff5-dd81-4501-b59e-6f0bc9362090)) (segment (start 136.191 88.09) (end 136.191 86.82) (width 0.25) (layer "F.Cu") (net 3) (tstamp e5497ff5-dd81-4501-b59e-6f0bc9362090))
(segment (start 151.242 92.281) (end 151.242 90.239) (width 0.25) (layer "F.Cu") (net 3) (tstamp e5c4563f-a400-4007-8c74-6b8dc25b545e)) (segment (start 151.242 92.281) (end 151.242 90.239) (width 0.25) (layer "F.Cu") (net 3) (tstamp e5c4563f-a400-4007-8c74-6b8dc25b545e))
(segment (start 134.618 126.05) (end 132.033489 128.634511) (width 0.25) (layer "F.Cu") (net 3) (tstamp e6fe756d-fab0-4dc6-836f-fd03e1074a05)) (segment (start 134.618 126.05) (end 132.033489 128.634511) (width 0.25) (layer "F.Cu") (net 3) (tstamp e6fe756d-fab0-4dc6-836f-fd03e1074a05))
(segment (start 151.877 94.55) (end 151.877 92.916) (width 0.25) (layer "F.Cu") (net 3) (tstamp e75059b0-e839-4461-b716-10520d0fc841)) (segment (start 151.877 94.55) (end 151.877 92.916) (width 0.25) (layer "F.Cu") (net 3) (tstamp e75059b0-e839-4461-b716-10520d0fc841))
(segment (start 151.257 126.05) (end 148.717 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp eca26540-b5eb-4d97-a381-8d8d9abb3016)) (segment (start 151.257 126.05) (end 148.717 126.05) (width 0.25) (layer "F.Cu") (net 3) (tstamp eca26540-b5eb-4d97-a381-8d8d9abb3016))
(segment (start 133.858 103.632) (end 133.906 103.584) (width 0.25) (layer "F.Cu") (net 3) (tstamp ee44316b-709e-4216-8ce9-f851f8b5a8a8))
(segment (start 126.731 103.617) (end 126.731 96.774) (width 1.27) (layer "F.Cu") (net 3) (tstamp f074aba2-d7ac-413c-b6e2-7c23a04133a5))
(segment (start 142.24 78.105) (end 142.24 76.835) (width 1.27) (layer "F.Cu") (net 3) (tstamp f08b7a13-6602-4e2b-af41-f25ffa9d0be4)) (segment (start 142.24 78.105) (end 142.24 76.835) (width 1.27) (layer "F.Cu") (net 3) (tstamp f08b7a13-6602-4e2b-af41-f25ffa9d0be4))
(segment (start 150.476 78.918) (end 149.206 78.918) (width 0.25) (layer "F.Cu") (net 3) (tstamp f1b99660-8f8f-4ba4-a615-91cb0be8ce35)) (segment (start 150.476 78.918) (end 149.206 78.918) (width 0.25) (layer "F.Cu") (net 3) (tstamp f1b99660-8f8f-4ba4-a615-91cb0be8ce35))
(segment (start 143.764 70.358) (end 143.691 70.285) (width 1.27) (layer "F.Cu") (net 3) (tstamp f4b5a2c3-da51-4603-b28c-bc7691f10604)) (segment (start 143.764 70.358) (end 143.691 70.285) (width 1.27) (layer "F.Cu") (net 3) (tstamp f4b5a2c3-da51-4603-b28c-bc7691f10604))
@@ -1861,8 +1907,10 @@
(segment (start 132.056961 90.227432) (end 133.019914 89.26448) (width 0.25) (layer "B.Cu") (net 7) (tstamp 7c90e04e-e244-40ae-a026-fe39dba8f6a0)) (segment (start 132.056961 90.227432) (end 133.019914 89.26448) (width 0.25) (layer "B.Cu") (net 7) (tstamp 7c90e04e-e244-40ae-a026-fe39dba8f6a0))
(segment (start 139.37748 89.26448) (end 141.151 91.038) (width 0.25) (layer "B.Cu") (net 7) (tstamp cb8ab192-b535-4155-9362-d611da882d48)) (segment (start 139.37748 89.26448) (end 141.151 91.038) (width 0.25) (layer "B.Cu") (net 7) (tstamp cb8ab192-b535-4155-9362-d611da882d48))
(segment (start 128.128 107.5365) (end 128.852991 106.811509) (width 0.25) (layer "B.Cu") (net 7) (tstamp d7a19547-c6a0-4914-85ae-e580f1795a0d)) (segment (start 128.128 107.5365) (end 128.852991 106.811509) (width 0.25) (layer "B.Cu") (net 7) (tstamp d7a19547-c6a0-4914-85ae-e580f1795a0d))
(segment (start 133.6985 107.5365) (end 133.858 107.696) (width 0.25) (layer "F.Cu") (net 8) (tstamp 6d869c35-f48b-45fb-9e33-550c174c3c2f))
(segment (start 135.398 97.536) (end 133.858 97.536) (width 0.25) (layer "F.Cu") (net 8) (tstamp d654a0dd-a4e8-435e-a3dc-34750807e3bc))
(via (at 133.858 97.536) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 8) (tstamp 55979b86-acbc-4334-b6e2-ded57f9cb864))
(segment (start 130.668 115.6645) (end 130.6525 115.6645) (width 0.25) (layer "B.Cu") (net 8) (tstamp 0da6e249-2305-4518-bf93-cc9ccae612e5)) (segment (start 130.668 115.6645) (end 130.6525 115.6645) (width 0.25) (layer "B.Cu") (net 8) (tstamp 0da6e249-2305-4518-bf93-cc9ccae612e5))
(segment (start 133.105519 101.373073) (end 133.105519 93.441777) (width 0.25) (layer "B.Cu") (net 8) (tstamp 19415055-5e7b-470c-aef0-d28867224113))
(segment (start 133.662776 92.88452) (end 141.84448 92.88452) (width 0.25) (layer "B.Cu") (net 8) (tstamp 2ab4147c-5e37-45aa-b469-1ae5cc32940e)) (segment (start 133.662776 92.88452) (end 141.84448 92.88452) (width 0.25) (layer "B.Cu") (net 8) (tstamp 2ab4147c-5e37-45aa-b469-1ae5cc32940e))
(segment (start 130.6525 115.6645) (end 129.901551 116.415449) (width 0.25) (layer "B.Cu") (net 8) (tstamp 43939e2e-66ff-4164-be70-e001193f7dd1)) (segment (start 130.6525 115.6645) (end 129.901551 116.415449) (width 0.25) (layer "B.Cu") (net 8) (tstamp 43939e2e-66ff-4164-be70-e001193f7dd1))
(segment (start 129.901551 108.302949) (end 129.901551 114.898051) (width 0.25) (layer "B.Cu") (net 8) (tstamp 47312587-0635-42aa-b616-4884c25f5d71)) (segment (start 129.901551 108.302949) (end 129.901551 114.898051) (width 0.25) (layer "B.Cu") (net 8) (tstamp 47312587-0635-42aa-b616-4884c25f5d71))
@@ -1872,9 +1920,13 @@
(segment (start 130.668 107.5365) (end 130.668 107.521) (width 0.25) (layer "B.Cu") (net 8) (tstamp 90e90294-66c8-4609-bfb0-8ff86480f89d)) (segment (start 130.668 107.5365) (end 130.668 107.521) (width 0.25) (layer "B.Cu") (net 8) (tstamp 90e90294-66c8-4609-bfb0-8ff86480f89d))
(segment (start 129.901551 123.010551) (end 130.668 123.777) (width 0.25) (layer "B.Cu") (net 8) (tstamp a0763d0e-179e-4e33-96a6-a7c1fed1e92b)) (segment (start 129.901551 123.010551) (end 130.668 123.777) (width 0.25) (layer "B.Cu") (net 8) (tstamp a0763d0e-179e-4e33-96a6-a7c1fed1e92b))
(segment (start 133.105519 93.441777) (end 133.662776 92.88452) (width 0.25) (layer "B.Cu") (net 8) (tstamp a2f553d7-6fab-4e5f-9980-3d30da6e00f2)) (segment (start 133.105519 93.441777) (end 133.662776 92.88452) (width 0.25) (layer "B.Cu") (net 8) (tstamp a2f553d7-6fab-4e5f-9980-3d30da6e00f2))
(segment (start 133.858 97.536) (end 133.105519 96.783519) (width 0.25) (layer "B.Cu") (net 8) (tstamp ab237cac-d232-4700-9f12-db45cc70040c))
(segment (start 129.901551 106.754551) (end 129.901551 104.577041) (width 0.25) (layer "B.Cu") (net 8) (tstamp aeb9fb16-f6db-4390-9129-2378f922d8fe)) (segment (start 129.901551 106.754551) (end 129.901551 104.577041) (width 0.25) (layer "B.Cu") (net 8) (tstamp aeb9fb16-f6db-4390-9129-2378f922d8fe))
(segment (start 133.105519 101.373073) (end 133.105519 98.288481) (width 0.25) (layer "B.Cu") (net 8) (tstamp bb34cb8b-8eb4-468f-8bfa-2fbe3446fa35))
(segment (start 133.105519 96.783519) (end 133.105519 93.441777) (width 0.25) (layer "B.Cu") (net 8) (tstamp c262f517-002c-4048-9f64-bf4db62625b4))
(segment (start 141.84448 92.88452) (end 143.691 91.038) (width 0.25) (layer "B.Cu") (net 8) (tstamp c2f62722-6a25-4e24-a3b6-49be9d7b375c)) (segment (start 141.84448 92.88452) (end 143.691 91.038) (width 0.25) (layer "B.Cu") (net 8) (tstamp c2f62722-6a25-4e24-a3b6-49be9d7b375c))
(segment (start 129.901551 114.898051) (end 130.668 115.6645) (width 0.25) (layer "B.Cu") (net 8) (tstamp dafc59ad-0d94-420c-a77b-677eb6ae09a2)) (segment (start 129.901551 114.898051) (end 130.668 115.6645) (width 0.25) (layer "B.Cu") (net 8) (tstamp dafc59ad-0d94-420c-a77b-677eb6ae09a2))
(segment (start 133.105519 98.288481) (end 133.858 97.536) (width 0.25) (layer "B.Cu") (net 8) (tstamp df457be3-eca7-4c79-820a-3339d1aff598))
(segment (start 130.668 107.5365) (end 129.901551 108.302949) (width 0.25) (layer "B.Cu") (net 8) (tstamp e94b33c6-1f1d-459f-a491-0549f0fc9dbf)) (segment (start 130.668 107.5365) (end 129.901551 108.302949) (width 0.25) (layer "B.Cu") (net 8) (tstamp e94b33c6-1f1d-459f-a491-0549f0fc9dbf))
(segment (start 135.80648 107.20852) (end 136.891 106.124) (width 0.25) (layer "F.Cu") (net 9) (tstamp 0fb2e527-801c-47a0-9913-476dad035ce9)) (segment (start 135.80648 107.20852) (end 136.891 106.124) (width 0.25) (layer "F.Cu") (net 9) (tstamp 0fb2e527-801c-47a0-9913-476dad035ce9))
(segment (start 136.891 106.124) (end 138.21 106.124) (width 0.25) (layer "F.Cu") (net 9) (tstamp 460d5c5f-4c06-4b71-9ead-e35af3565ac8)) (segment (start 136.891 106.124) (end 138.21 106.124) (width 0.25) (layer "F.Cu") (net 9) (tstamp 460d5c5f-4c06-4b71-9ead-e35af3565ac8))
@@ -2058,14 +2110,15 @@
(segment (start 148.142 77.093) (end 145.841 77.093) (width 0.25) (layer "F.Cu") (net 29) (tstamp 342ab53e-e938-420a-af91-4d4126630780)) (segment (start 148.142 77.093) (end 145.841 77.093) (width 0.25) (layer "F.Cu") (net 29) (tstamp 342ab53e-e938-420a-af91-4d4126630780))
(segment (start 149.206 76.029) (end 148.142 77.093) (width 0.25) (layer "F.Cu") (net 29) (tstamp 98854940-3d0b-420d-b91e-78e7b73654ad)) (segment (start 149.206 76.029) (end 148.142 77.093) (width 0.25) (layer "F.Cu") (net 29) (tstamp 98854940-3d0b-420d-b91e-78e7b73654ad))
(segment (start 149.206 73.768) (end 149.206 76.029) (width 0.25) (layer "F.Cu") (net 29) (tstamp ca3bfd12-a47a-49d0-a984-db6af30b3c2f)) (segment (start 149.206 73.768) (end 149.206 76.029) (width 0.25) (layer "F.Cu") (net 29) (tstamp ca3bfd12-a47a-49d0-a984-db6af30b3c2f))
(segment (start 134.922 97.33) (end 134.922 99.012) (width 0.635) (layer "F.Cu") (net 30) (tstamp 209d7820-efbd-454a-b76b-41c2d9718f3e))
(segment (start 124.191 104.219) (end 124.191 96.774) (width 1.27) (layer "F.Cu") (net 30) (tstamp 20b7f426-62be-4071-957b-edcce576828c)) (segment (start 124.191 104.219) (end 124.191 96.774) (width 1.27) (layer "F.Cu") (net 30) (tstamp 20b7f426-62be-4071-957b-edcce576828c))
(segment (start 123.048 107.5365) (end 123.048 105.362) (width 1.27) (layer "F.Cu") (net 30) (tstamp 39ca5c04-968b-4b9b-a780-afff0b19dc4a)) (segment (start 123.048 107.5365) (end 123.048 105.362) (width 1.27) (layer "F.Cu") (net 30) (tstamp 39ca5c04-968b-4b9b-a780-afff0b19dc4a))
(segment (start 133.048 99.012) (end 131.318 97.282) (width 0.635) (layer "F.Cu") (net 30) (tstamp 6a6f3d48-11cb-4b14-bfb5-d04e612fd1c0))
(segment (start 123.048 115.6645) (end 123.048 123.777) (width 1.27) (layer "F.Cu") (net 30) (tstamp 6a71434d-4657-484d-ab26-a0d1a903bf70)) (segment (start 123.048 115.6645) (end 123.048 123.777) (width 1.27) (layer "F.Cu") (net 30) (tstamp 6a71434d-4657-484d-ab26-a0d1a903bf70))
(segment (start 131.016 93.424) (end 134.922 97.33) (width 0.635) (layer "F.Cu") (net 30) (tstamp 772e0cfb-85f2-4efb-8d57-2e113da23ae8)) (segment (start 130.096 93.424) (end 125.969 93.424) (width 0.635) (layer "F.Cu") (net 30) (tstamp 7f461c37-e728-45fd-b8bc-e159b454994a))
(segment (start 125.969 93.424) (end 131.016 93.424) (width 0.635) (layer "F.Cu") (net 30) (tstamp c16a4765-332b-47cb-a061-757f430a1246)) (segment (start 143.876 99.012) (end 133.048 99.012) (width 0.635) (layer "F.Cu") (net 30) (tstamp a4d03ba8-b1cd-45f7-9b42-3963837d63e2))
(segment (start 131.318 97.282) (end 131.318 94.646) (width 0.635) (layer "F.Cu") (net 30) (tstamp c8e02e2e-f89a-4169-ae1f-b1e67930d87c))
(segment (start 131.318 94.646) (end 130.096 93.424) (width 0.635) (layer "F.Cu") (net 30) (tstamp d6181c55-40b4-4e67-95d2-76d6790c4b9e))
(segment (start 123.048 105.362) (end 124.191 104.219) (width 1.27) (layer "F.Cu") (net 30) (tstamp d80101e0-eaf3-4663-836c-d4dd096da437)) (segment (start 123.048 105.362) (end 124.191 104.219) (width 1.27) (layer "F.Cu") (net 30) (tstamp d80101e0-eaf3-4663-836c-d4dd096da437))
(segment (start 134.922 99.012) (end 143.876 99.012) (width 0.635) (layer "F.Cu") (net 30) (tstamp f7bc2ad1-1fa0-4622-bdbf-c0330ab40d12))
(segment (start 123.048 107.5365) (end 123.048 115.6645) (width 1.27) (layer "F.Cu") (net 30) (tstamp fef14155-853e-469a-9c30-0d4bb2b40eb9)) (segment (start 123.048 107.5365) (end 123.048 115.6645) (width 1.27) (layer "F.Cu") (net 30) (tstamp fef14155-853e-469a-9c30-0d4bb2b40eb9))
(via (at 125.969 93.424) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 30) (tstamp 501202a1-a3be-4c12-ae41-715a1c3c1d3d)) (via (at 125.969 93.424) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 30) (tstamp 501202a1-a3be-4c12-ae41-715a1c3c1d3d))
(via (at 143.876 99.012) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 30) (tstamp f8fac2d5-c81b-423b-a134-6fa6c3637d87)) (via (at 143.876 99.012) (size 0.8) (drill 0.4) (layers "F.Cu" "B.Cu") (net 30) (tstamp f8fac2d5-c81b-423b-a134-6fa6c3637d87))
@@ -3140,10 +3193,13 @@
(xy 146.360265 107.179055) (xy 146.360265 107.179055)
(xy 146.3575 107.20277) (xy 146.3575 107.20277)
(xy 146.3575 107.58523) (xy 146.3575 107.58523)
(xy 146.357941 107.588934)
(xy 146.357941 107.588938)
(xy 146.359202 107.599533)
(xy 146.360379 107.609424) (xy 146.360379 107.609424)
(xy 146.364214 107.618059) (xy 146.364214 107.618059)
(xy 146.364215 107.618061) (xy 146.364215 107.618061)
(xy 146.397435 107.692851) (xy 146.393428 107.683829)
(xy 146.402343 107.7039) (xy 146.402343 107.7039)
(xy 146.475506 107.776935) (xy 146.475506 107.776935)
(xy 146.570055 107.818735) (xy 146.570055 107.818735)
@@ -3301,7 +3357,7 @@
(xy 152.47823 107.775) (xy 152.47823 107.775)
(xy 152.459524 107.584217) (xy 152.459524 107.584217)
(xy 152.404117 107.400701) (xy 152.404117 107.400701)
(xy 152.378142 107.35185) (xy 152.375864 107.347565)
(xy 152.317014 107.236884) (xy 152.317014 107.236884)
(xy 152.317012 107.236881) (xy 152.317012 107.236881)
(xy 152.31412 107.231442) (xy 152.31412 107.231442)
@@ -3600,12 +3656,10 @@
(xy 153.584766 97.661686) (xy 153.584766 97.661686)
(xy 153.584768 97.661684) (xy 153.584768 97.661684)
(xy 153.595083 97.654792) (xy 153.595083 97.654792)
(xy 153.609639 97.633008)
(xy 153.643995 97.581589)
(xy 153.65089 97.57127) (xy 153.65089 97.57127)
(xy 153.65331 97.559103) (xy 153.654821 97.551509)
(xy 153.653311 97.559101)
(xy 153.657114 97.53998)
(xy 153.657114 97.539979)
(xy 153.668067 97.484919)
(xy 153.670488 97.472749) (xy 153.670488 97.472749)
(xy 153.667961 97.460045) (xy 153.667961 97.460045)
(xy 153.66554 97.435463) (xy 153.66554 97.435463)
@@ -4200,11 +4254,9 @@
(xy 149.474705 99.398923) (xy 149.474705 99.398923)
(xy 149.482332 99.395764) (xy 149.482332 99.395764)
(xy 149.482335 99.395763) (xy 149.482335 99.395763)
(xy 149.549493 99.367945) (xy 149.538865 99.372347)
(xy 149.603026 99.345771) (xy 149.603026 99.345771)
(xy 149.713218 99.261218) (xy 149.713218 99.261218)
(xy 149.73336 99.234969)
(xy 149.792744 99.157577)
(xy 149.797771 99.151026) (xy 149.797771 99.151026)
(xy 149.850923 99.022705) (xy 149.850923 99.022705)
(xy 149.869052 98.885) (xy 149.869052 98.885)
@@ -4241,7 +4293,7 @@
(xy 149.594222 97.659615) (xy 149.594222 97.659615)
(xy 149.601578 97.652247) (xy 149.601578 97.652247)
(xy 149.656769 97.539339) (xy 149.656769 97.539339)
(xy 149.666462 97.472898) (xy 149.658451 97.527812)
(xy 149.66684 97.470307) (xy 149.66684 97.470307)
(xy 149.66684 97.470303) (xy 149.66684 97.470303)
(xy 149.6675 97.465781) (xy 149.6675 97.465781)
@@ -4443,8 +4495,8 @@
(xy 148.570096 97.8075) (xy 148.570096 97.8075)
(xy 148.638217 97.827502) (xy 148.638217 97.827502)
(xy 148.68471 97.881158) (xy 148.68471 97.881158)
(xy 148.693675 97.908915) (xy 148.693671 97.908897)
(xy 148.699105 97.936214) (xy 148.694332 97.912218)
(xy 148.70215 97.951521) (xy 148.70215 97.951521)
(xy 148.709044 97.961838) (xy 148.709044 97.961838)
(xy 148.709044 97.961839) (xy 148.709044 97.961839)
@@ -4475,10 +4527,13 @@
(xy 148.670336 98.459347) (xy 148.670336 98.459347)
(xy 148.669207 98.451676) (xy 148.669207 98.451676)
(xy 148.665578 98.427021) (xy 148.665578 98.427021)
(xy 148.627192 98.348838) (xy 148.61691 98.327897)
(xy 148.61478 98.323558) (xy 148.61478 98.323558)
(xy 148.614779 98.323557) (xy 148.614779 98.323557)
(xy 148.61019 98.31421) (xy 148.61019 98.31421)
(xy 148.533677 98.23783)
(xy 148.528616 98.232778)
(xy 148.528615 98.232778)
(xy 148.521247 98.225422) (xy 148.521247 98.225422)
(xy 148.436779 98.184133) (xy 148.436779 98.184133)
(xy 148.417124 98.174525) (xy 148.417124 98.174525)
@@ -4498,8 +4553,10 @@
(xy 147.40121 98.22581) (xy 147.40121 98.22581)
(xy 147.393852 98.23318) (xy 147.393852 98.23318)
(xy 147.393853 98.23318) (xy 147.393853 98.23318)
(xy 147.352232 98.274874) (xy 147.337312 98.28982)
(xy 147.312422 98.314753) (xy 147.312422 98.314753)
(xy 147.294262 98.351905)
(xy 147.263803 98.414217)
(xy 147.257231 98.427661) (xy 147.257231 98.427661)
(xy 147.25582 98.437336) (xy 147.25582 98.437336)
(xy 147.255819 98.437338) (xy 147.255819 98.437338)
@@ -6380,6 +6437,48 @@
(xy 131.625821 107.754112) (xy 131.625821 107.754112)
(xy 131.649847 107.563925) (xy 131.649847 107.563925)
(xy 131.65023 107.5365) (xy 131.65023 107.5365)
(xy 133.441052 107.5365)
(xy 133.46065 107.63502)
(xy 133.467546 107.64534)
(xy 133.467546 107.645341)
(xy 133.470244 107.649379)
(xy 133.50237 107.697459)
(xy 133.697041 107.89213)
(xy 133.702184 107.895566)
(xy 133.702187 107.895569)
(xy 133.749161 107.926956)
(xy 133.759479 107.93385)
(xy 133.771647 107.93627)
(xy 133.771648 107.936271)
(xy 133.845829 107.951027)
(xy 133.858 107.953448)
(xy 133.87017 107.951027)
(xy 133.94435 107.936271)
(xy 133.95652 107.93385)
(xy 134.001848 107.903563)
(xy 134.029726 107.884935)
(xy 134.040042 107.878042)
(xy 134.046935 107.867726)
(xy 134.088956 107.804838)
(xy 134.088957 107.804837)
(xy 134.09585 107.79452)
(xy 134.115448 107.696)
(xy 134.106174 107.649379)
(xy 134.098271 107.609648)
(xy 134.09827 107.609647)
(xy 134.09585 107.597479)
(xy 134.088956 107.587161)
(xy 134.057569 107.540187)
(xy 134.057566 107.540184)
(xy 134.05413 107.535041)
(xy 133.859459 107.34037)
(xy 133.79702 107.29865)
(xy 133.6985 107.279052)
(xy 133.59998 107.29865)
(xy 133.516457 107.354457)
(xy 133.46065 107.43798)
(xy 133.441052 107.5365)
(xy 131.65023 107.5365)
(xy 131.631524 107.345717) (xy 131.631524 107.345717)
(xy 131.576117 107.162201) (xy 131.576117 107.162201)
(xy 131.531858 107.078962) (xy 131.531858 107.078962)
@@ -6431,7 +6530,7 @@
(xy 129.765198 107.149558) (xy 129.765198 107.149558)
(xy 129.763337 107.155425) (xy 129.763337 107.155425)
(xy 129.763336 107.155427) (xy 129.763336 107.155427)
(xy 129.723938 107.279624) (xy 129.713316 107.313109)
(xy 129.707234 107.332283) (xy 129.707234 107.332283)
(xy 129.685866 107.522786) (xy 129.685866 107.522786)
(xy 129.108885 107.522786) (xy 129.108885 107.522786)
@@ -6486,7 +6585,7 @@
(xy 127.225198 107.149558) (xy 127.225198 107.149558)
(xy 127.223337 107.155425) (xy 127.223337 107.155425)
(xy 127.223336 107.155427) (xy 127.223336 107.155427)
(xy 127.183938 107.279624) (xy 127.173316 107.313109)
(xy 127.167234 107.332283) (xy 127.167234 107.332283)
(xy 127.145866 107.522786) (xy 127.145866 107.522786)
(xy 124.0255 107.522786) (xy 124.0255 107.522786)
@@ -7172,9 +7271,12 @@
(xy 128.394706 97.942623) (xy 128.394706 97.942623)
(xy 128.398477 97.961578) (xy 128.398477 97.961578)
(xy 128.400898 97.973748) (xy 128.400898 97.973748)
(xy 128.407791 97.984065)
(xy 128.407792 97.984066)
(xy 128.418393 97.999931)
(xy 128.429078 98.015922) (xy 128.429078 98.015922)
(xy 128.439394 98.022815) (xy 128.439394 98.022815)
(xy 128.458943 98.035877) (xy 128.460788 98.03711)
(xy 128.471252 98.044102) (xy 128.471252 98.044102)
(xy 128.483422 98.046523) (xy 128.483422 98.046523)
(xy 128.502377 98.050294) (xy 128.502377 98.050294)
@@ -7185,9 +7287,12 @@
(xy 130.039623 98.050294) (xy 130.039623 98.050294)
(xy 130.058578 98.046523) (xy 130.058578 98.046523)
(xy 130.070748 98.044102) (xy 130.070748 98.044102)
(xy 130.083058 98.035877) (xy 130.081213 98.03711)
(xy 130.102606 98.022815) (xy 130.102606 98.022815)
(xy 130.112922 98.015922) (xy 130.112922 98.015922)
(xy 130.123607 97.999931)
(xy 130.134208 97.984066)
(xy 130.134209 97.984065)
(xy 130.141102 97.973748) (xy 130.141102 97.973748)
(xy 130.143523 97.961578) (xy 130.143523 97.961578)
(xy 130.147294 97.942623) (xy 130.147294 97.942623)
@@ -7288,72 +7393,54 @@
(xy 128.782164 93.946616) (xy 128.782164 93.946616)
(xy 128.826791 93.891399) (xy 128.826791 93.891399)
(xy 128.898504 93.869) (xy 128.898504 93.869)
(xy 130.779485 93.869) (xy 129.859485 93.869)
(xy 130.847606 93.889002) (xy 129.927606 93.889002)
(xy 130.86858 93.905905) (xy 129.94858 93.905905)
(xy 134.440095 97.47742) (xy 130.836095 94.79342)
(xy 134.474121 97.539732) (xy 130.870121 94.855732)
(xy 134.477 97.566515) (xy 130.873 94.882515)
(xy 134.477 98.94658) (xy 130.873 97.248113)
(xy 134.475684 98.958082) (xy 130.872127 97.262923)
(xy 134.476227 98.958125) (xy 130.868196 97.296136)
(xy 134.475488 98.967514) (xy 130.869888 97.305399)
(xy 134.473361 98.976691) (xy 130.878605 97.353126)
(xy 134.474026 98.986087) (xy 130.879255 97.357034)
(xy 134.474026 98.98609) (xy 130.887868 97.414326)
(xy 134.476685 99.023637) (xy 130.890956 97.420757)
(xy 134.477 99.032536) (xy 130.892237 97.427771)
(xy 134.477 99.045431) (xy 130.909606 97.461208)
(xy 134.477698 99.050074) (xy 130.918944 97.479184)
(xy 134.477698 99.050075) (xy 130.920713 97.482724)
(xy 134.478585 99.055973) (xy 130.945792 97.534952)
(xy 134.47967 99.065799) (xy 130.950634 97.54019)
(xy 134.482812 99.11017) (xy 130.953921 97.546518)
(xy 134.48621 99.118954) (xy 130.958184 97.551509)
(xy 134.488026 99.127079) (xy 130.994963 97.588288)
(xy 134.490468 99.135017) (xy 130.998392 97.591854)
(xy 134.491868 99.144326) (xy 131.036625 97.633214)
(xy 134.495944 99.152814) (xy 131.042919 97.63687)
(xy 134.511121 99.18442) (xy 131.048922 97.642247)
(xy 134.515049 99.193497) (xy 132.709373 99.302698)
(xy 134.531093 99.234969) (xy 132.719228 99.313787)
(xy 134.536922 99.242364) (xy 132.739936 99.340055)
(xy 134.541037 99.249578) (xy 132.787649 99.373031)
(xy 134.545714 99.25646) (xy 132.790737 99.375237)
(xy 134.549792 99.264952) (xy 132.837419 99.409718)
(xy 134.556186 99.271869) (xy 132.84415 99.412082)
(xy 134.57998 99.29761) (xy 132.850016 99.416136)
(xy 134.586403 99.305131) (xy 132.905234 99.433599)
(xy 134.608101 99.332654) (xy 132.908975 99.434847)
(xy 134.613936 99.340055) (xy 132.954786 99.450935)
(xy 134.621687 99.345412) (xy 132.954791 99.450936)
(xy 134.627741 99.351097) (xy 132.963673 99.454055)
(xy 134.634231 99.356297) (xy 132.970802 99.454335)
(xy 134.640625 99.363214) (xy 132.9776 99.456485)
(xy 134.648766 99.367943) (xy 132.984143 99.457)
(xy 134.648769 99.367945) (xy 133.036158 99.457)
(xy 134.679088 99.385556) (xy 133.041104 99.457097)
(xy 134.687439 99.390856) (xy 133.097383 99.459308)
(xy 134.724016 99.416136) (xy 133.104418 99.457443)
(xy 134.732998 99.418976) (xy 133.112464 99.457)
(xy 134.74047 99.422637)
(xy 134.748191 99.425694)
(xy 134.756334 99.430424)
(xy 134.769273 99.433423)
(xy 134.799671 99.440469)
(xy 134.809215 99.44308)
(xy 134.8516 99.456485)
(xy 134.858143 99.457)
(xy 134.860612 99.457)
(xy 134.8612 99.457023)
(xy 134.868111 99.457951)
(xy 134.868125 99.457773)
(xy 134.877514 99.458512)
(xy 134.886691 99.460639)
(xy 134.896087 99.459974)
(xy 134.89609 99.459974)
(xy 134.933637 99.457315)
(xy 134.942536 99.457)
(xy 143.551052 99.457) (xy 143.551052 99.457)
(xy 143.609968 99.472787) (xy 143.609968 99.472787)
(xy 143.609974 99.472771) (xy 143.609974 99.472771)
@@ -7514,62 +7601,275 @@
(xy 143.609974 98.551229) (xy 143.609974 98.551229)
(xy 143.609968 98.551213) (xy 143.609968 98.551213)
(xy 143.551052 98.567) (xy 143.551052 98.567)
(xy 135.493 98.567) (xy 138.189485 98.567)
(xy 135.424879 98.546998) (xy 138.121364 98.546998)
(xy 135.378386 98.493342) (xy 138.074871 98.493342)
(xy 135.367 98.441) (xy 138.064767 98.423068)
(xy 135.367 97.363887) (xy 138.094261 98.358488)
(xy 135.367873 97.349077) (xy 138.10039 98.351905)
(xy 135.370697 97.325217) (xy 138.113428 98.338867)
(xy 135.371804 97.315864) (xy 138.189246 98.237704)
(xy 135.366027 97.284233) (xy 138.197778 98.222118)
(xy 135.361396 97.258874) (xy 138.242533 98.102735)
(xy 135.360746 97.25497) (xy 138.246158 98.08749)
(xy 135.353532 97.206985) (xy 138.251631 98.037108)
(xy 135.353532 97.206984) (xy 138.252 98.030294)
(xy 135.352132 97.197674) (xy 138.252 97.808115)
(xy 135.349044 97.191244) (xy 138.247525 97.792876)
(xy 135.347763 97.184228) (xy 138.246135 97.791671)
(xy 135.321053 97.132809) (xy 138.238452 97.79)
(xy 135.31929 97.12928) (xy 136.562116 97.79)
(xy 135.298286 97.08554) (xy 136.546877 97.794475)
(xy 135.298285 97.085539) (xy 136.545672 97.795865)
(xy 135.294208 97.077048) (xy 136.544001 97.803548)
(xy 135.289366 97.07181) (xy 136.544001 98.030292)
(xy 135.286079 97.065482) (xy 136.54437 98.03711)
(xy 135.281816 97.060491) (xy 136.549841 98.087482)
(xy 135.245037 97.023712) (xy 136.55347 98.102741)
(xy 135.241608 97.020146) (xy 136.598222 98.222118)
(xy 135.20977 96.985704) (xy 136.606754 98.237704)
(xy 135.203375 96.978786) (xy 136.682572 98.338867)
(xy 135.197081 96.97513) (xy 136.69561 98.351905)
(xy 135.191078 96.969753) (xy 136.729636 98.414217)
(xy 131.354627 93.133302) (xy 136.724571 98.485032)
(xy 131.344772 93.122213) (xy 136.682024 98.541868)
(xy 131.344708 93.122132) (xy 136.615504 98.566679)
(xy 131.324064 93.095945) (xy 136.606515 98.567)
(xy 131.316317 93.09059) (xy 135.963779 98.567)
(xy 131.316315 93.090589) (xy 135.895658 98.546998)
(xy 131.276419 93.063016) (xy 135.849165 98.493342)
(xy 131.273196 93.060713) (xy 135.839061 98.423068)
(xy 131.23416 93.03188) (xy 135.868555 98.358488)
(xy 131.226581 93.026282) (xy 135.908248 98.327897)
(xy 131.21985 93.023918) (xy 135.951109 98.306853)
(xy 131.213984 93.019864) (xy 135.97079 98.29719)
(xy 131.158766 93.002401) (xy 136.030172 98.237704)
(xy 131.155025 93.001153) (xy 136.052222 98.215616)
(xy 131.109214 92.985065) (xy 136.052222 98.215615)
(xy 131.109209 92.985064) (xy 136.059578 98.208247)
(xy 131.100327 92.981945) (xy 136.096729 98.132244)
(xy 131.093198 92.981665) (xy 136.110475 98.104124)
(xy 131.0864 92.979515) (xy 136.110475 98.104123)
(xy 131.079857 92.979) (xy 136.114769 98.095339)
(xy 131.027841 92.979) (xy 136.118907 98.066974)
(xy 131.022895 92.978903) (xy 136.12484 98.026307)
(xy 131.022633 92.978893) (xy 136.12484 98.026303)
(xy 130.966616 92.976692) (xy 136.1255 98.021781)
(xy 130.959581 92.978557) (xy 136.125499 97.263885)
(xy 130.951535 92.979) (xy 136.544 97.263885)
(xy 136.548475 97.279124)
(xy 136.549865 97.280329)
(xy 136.557548 97.282)
(xy 137.125885 97.282)
(xy 137.141124 97.277525)
(xy 137.142329 97.276135)
(xy 137.144 97.268452)
(xy 137.144 97.263885)
(xy 137.652 97.263885)
(xy 137.656475 97.279124)
(xy 137.657865 97.280329)
(xy 137.665548 97.282)
(xy 138.233884 97.282)
(xy 138.249123 97.277525)
(xy 138.250328 97.276135)
(xy 138.251999 97.268452)
(xy 138.251999 97.041708)
(xy 138.25163 97.03489)
(xy 138.246159 96.984518)
(xy 138.24253 96.969259)
(xy 138.197778 96.849882)
(xy 138.189246 96.834296)
(xy 138.113428 96.733133)
(xy 138.100867 96.720572)
(xy 137.999704 96.644754)
(xy 137.984118 96.636222)
(xy 137.864735 96.591467)
(xy 137.84949 96.587842)
(xy 137.799108 96.582369)
(xy 137.792294 96.582)
(xy 137.670115 96.582)
(xy 137.654876 96.586475)
(xy 137.653671 96.587865)
(xy 137.652 96.595548)
(xy 137.652 97.263885)
(xy 137.144 97.263885)
(xy 137.144 96.600116)
(xy 137.139525 96.584877)
(xy 137.138135 96.583672)
(xy 137.130452 96.582001)
(xy 137.003708 96.582001)
(xy 136.99689 96.58237)
(xy 136.946518 96.587841)
(xy 136.931259 96.59147)
(xy 136.811882 96.636222)
(xy 136.796296 96.644754)
(xy 136.695133 96.720572)
(xy 136.682572 96.733133)
(xy 136.606754 96.834296)
(xy 136.598222 96.849882)
(xy 136.553467 96.969265)
(xy 136.549842 96.98451)
(xy 136.544369 97.034892)
(xy 136.544 97.041706)
(xy 136.544 97.263885)
(xy 136.125499 97.263885)
(xy 136.125499 97.05022)
(xy 136.114578 96.976021)
(xy 136.087583 96.921038)
(xy 136.06378 96.872558)
(xy 136.063779 96.872557)
(xy 136.05919 96.86321)
(xy 135.970247 96.774422)
(xy 135.885779 96.733133)
(xy 135.866124 96.723525)
(xy 135.866123 96.723525)
(xy 135.857339 96.719231)
(xy 135.847664 96.71782)
(xy 135.847662 96.717819)
(xy 135.788307 96.70916)
(xy 135.788303 96.70916)
(xy 135.783781 96.7085)
(xy 135.399471 96.7085)
(xy 135.01222 96.708501)
(xy 134.938021 96.719422)
(xy 134.883038 96.746417)
(xy 134.834558 96.77022)
(xy 134.834557 96.770221)
(xy 134.82521 96.77481)
(xy 134.736422 96.863753)
(xy 134.681231 96.976661)
(xy 134.67982 96.986336)
(xy 134.679819 96.986338)
(xy 134.671191 97.045485)
(xy 134.6705 97.050219)
(xy 134.6705 97.1575)
(xy 134.650498 97.225621)
(xy 134.596842 97.272114)
(xy 134.5445 97.2835)
(xy 134.391287 97.2835)
(xy 134.323166 97.263498)
(xy 134.291324 97.234204)
(xy 134.239241 97.166328)
(xy 134.234218 97.159782)
(xy 134.124026 97.075229)
(xy 134.053738 97.046115)
(xy 134.003335 97.025237)
(xy 134.003332 97.025236)
(xy 133.995705 97.022077)
(xy 133.858 97.003948)
(xy 133.720295 97.022077)
(xy 133.712668 97.025236)
(xy 133.712665 97.025237)
(xy 133.662262 97.046115)
(xy 133.591974 97.075229)
(xy 133.481782 97.159782)
(xy 133.397229 97.269974)
(xy 133.382556 97.305399)
(xy 133.350407 97.383014)
(xy 133.344077 97.398295)
(xy 133.342999 97.406483)
(xy 133.341381 97.418772)
(xy 133.325948 97.536)
(xy 133.327026 97.544188)
(xy 133.341324 97.65279)
(xy 133.344077 97.673705)
(xy 133.397229 97.802026)
(xy 133.481782 97.912218)
(xy 133.591974 97.996771)
(xy 133.613304 98.005606)
(xy 133.712665 98.046763)
(xy 133.712668 98.046764)
(xy 133.720295 98.049923)
(xy 133.728483 98.051001)
(xy 133.780971 98.057911)
(xy 133.858 98.068052)
(xy 133.866188 98.066974)
(xy 133.987517 98.051001)
(xy 133.995705 98.049923)
(xy 134.003332 98.046764)
(xy 134.003335 98.046763)
(xy 134.102696 98.005606)
(xy 134.124026 97.996771)
(xy 134.234218 97.912218)
(xy 134.239241 97.905672)
(xy 134.291324 97.837796)
(xy 134.348662 97.795929)
(xy 134.391287 97.7885)
(xy 134.544501 97.7885)
(xy 134.612622 97.808502)
(xy 134.659115 97.862158)
(xy 134.670501 97.9145)
(xy 134.670501 98.02178)
(xy 134.681422 98.095979)
(xy 134.701042 98.135939)
(xy 134.731951 98.198893)
(xy 134.73681 98.20879)
(xy 134.765901 98.23783)
(xy 134.81345 98.285296)
(xy 134.825753 98.297578)
(xy 134.860889 98.314753)
(xy 134.88758 98.3278)
(xy 134.939996 98.375686)
(xy 134.958203 98.444309)
(xy 134.936419 98.511881)
(xy 134.881561 98.556949)
(xy 134.832246 98.567)
(xy 133.284515 98.567)
(xy 133.216394 98.546998)
(xy 133.19542 98.530095)
(xy 131.799905 97.13458)
(xy 131.765879 97.072268)
(xy 131.763 97.045485)
(xy 131.763 94.679887)
(xy 131.763873 94.665077)
(xy 131.766697 94.641216)
(xy 131.767804 94.631864)
(xy 131.757393 94.574859)
(xy 131.756745 94.570966)
(xy 131.749532 94.522988)
(xy 131.748132 94.513674)
(xy 131.745044 94.507243)
(xy 131.743763 94.500229)
(xy 131.717056 94.448815)
(xy 131.715287 94.445275)
(xy 131.694288 94.401544)
(xy 131.694287 94.401543)
(xy 131.690208 94.393048)
(xy 131.685366 94.38781)
(xy 131.682079 94.381482)
(xy 131.677816 94.376491)
(xy 131.641037 94.339712)
(xy 131.637608 94.336146)
(xy 131.60577 94.301704)
(xy 131.599375 94.294786)
(xy 131.593081 94.29113)
(xy 131.587078 94.285753)
(xy 130.434627 93.133302)
(xy 130.424772 93.122213)
(xy 130.424708 93.122132)
(xy 130.404064 93.095945)
(xy 130.396317 93.09059)
(xy 130.396315 93.090589)
(xy 130.356419 93.063016)
(xy 130.353196 93.060713)
(xy 130.31416 93.03188)
(xy 130.306581 93.026282)
(xy 130.29985 93.023918)
(xy 130.293984 93.019864)
(xy 130.238766 93.002401)
(xy 130.235025 93.001153)
(xy 130.189214 92.985065)
(xy 130.189209 92.985064)
(xy 130.180327 92.981945)
(xy 130.173198 92.981665)
(xy 130.1664 92.979515)
(xy 130.159857 92.979)
(xy 130.107841 92.979)
(xy 130.102895 92.978903)
(xy 130.102633 92.978893)
(xy 130.046616 92.976692)
(xy 130.039581 92.978557)
(xy 130.031535 92.979)
(xy 126.293948 92.979) (xy 126.293948 92.979)
(xy 126.235032 92.963213) (xy 126.235032 92.963213)
(xy 126.235026 92.963229) (xy 126.235026 92.963229)
@@ -8070,7 +8370,7 @@
(xy 147.594222 97.659615) (xy 147.594222 97.659615)
(xy 147.601578 97.652247) (xy 147.601578 97.652247)
(xy 147.656769 97.539339) (xy 147.656769 97.539339)
(xy 147.666462 97.472898) (xy 147.658451 97.527812)
(xy 147.66684 97.470307) (xy 147.66684 97.470307)
(xy 147.66684 97.470303) (xy 147.66684 97.470303)
(xy 147.6675 97.465781) (xy 147.6675 97.465781)
@@ -14385,7 +14685,7 @@
(xy 123.487924 97.707664) (xy 123.487924 97.707664)
(xy 123.618921 97.84619) (xy 123.618921 97.84619)
(xy 123.624564 97.850025) (xy 123.624564 97.850025)
(xy 123.706591 97.90577) (xy 123.72347 97.917241)
(xy 123.77661 97.953355) (xy 123.77661 97.953355)
(xy 123.782939 97.955887) (xy 123.782939 97.955887)
(xy 123.782942 97.955888) (xy 123.782942 97.955888)
@@ -14455,7 +14755,7 @@
(xy 128.400898 97.973748) (xy 128.400898 97.973748)
(xy 128.407791 97.984065) (xy 128.407791 97.984065)
(xy 128.407792 97.984066) (xy 128.407792 97.984066)
(xy 128.422185 98.005606) (xy 128.418393 97.999931)
(xy 128.429078 98.015922) (xy 128.429078 98.015922)
(xy 128.471252 98.044102) (xy 128.471252 98.044102)
(xy 128.483422 98.046523) (xy 128.483422 98.046523)
@@ -14468,7 +14768,7 @@
(xy 130.058578 98.046523) (xy 130.058578 98.046523)
(xy 130.070748 98.044102) (xy 130.070748 98.044102)
(xy 130.112922 98.015922) (xy 130.112922 98.015922)
(xy 130.119815 98.005606) (xy 130.123607 97.999931)
(xy 130.134208 97.984066) (xy 130.134208 97.984066)
(xy 130.134209 97.984065) (xy 130.134209 97.984065)
(xy 130.141102 97.973748) (xy 130.141102 97.973748)
@@ -16129,6 +16429,48 @@
(xy 133.362967 101.373073) (xy 133.362967 101.373073)
(xy 133.36044 101.360369) (xy 133.36044 101.360369)
(xy 133.358019 101.335787) (xy 133.358019 101.335787)
(xy 133.358019 98.44526)
(xy 133.378021 98.377139)
(xy 133.394924 98.356165)
(xy 133.659454 98.091635)
(xy 133.721766 98.057609)
(xy 133.764995 98.055808)
(xy 133.849812 98.066974)
(xy 133.858 98.068052)
(xy 133.866188 98.066974)
(xy 133.987517 98.051001)
(xy 133.995705 98.049923)
(xy 134.003332 98.046764)
(xy 134.003335 98.046763)
(xy 134.102696 98.005606)
(xy 134.124026 97.996771)
(xy 134.234218 97.912218)
(xy 134.318771 97.802026)
(xy 134.361382 97.699154)
(xy 134.368763 97.681335)
(xy 134.368764 97.681332)
(xy 134.371923 97.673705)
(xy 134.390052 97.536)
(xy 134.371923 97.398295)
(xy 134.366321 97.384769)
(xy 134.345347 97.334135)
(xy 134.318771 97.269974)
(xy 134.234218 97.159782)
(xy 134.124026 97.075229)
(xy 134.04764 97.043589)
(xy 134.003335 97.025237)
(xy 134.003332 97.025236)
(xy 133.995705 97.022077)
(xy 133.951004 97.016192)
(xy 133.866188 97.005026)
(xy 133.858 97.003948)
(xy 133.849812 97.005026)
(xy 133.764995 97.016192)
(xy 133.694846 97.005252)
(xy 133.659454 96.980365)
(xy 133.394924 96.715835)
(xy 133.360898 96.653523)
(xy 133.358019 96.62674)
(xy 133.358019 93.598556) (xy 133.358019 93.598556)
(xy 133.378021 93.530435) (xy 133.378021 93.530435)
(xy 133.394924 93.509461) (xy 133.394924 93.509461)

View File

@@ -384,7 +384,7 @@
"idf": "", "idf": "",
"netlist": "", "netlist": "",
"specctra_dsn": "", "specctra_dsn": "",
"step": "", "step": "DE-Timer.step",
"vrml": "" "vrml": ""
}, },
"page_layout_descr_file": "" "page_layout_descr_file": ""

View File

@@ -0,0 +1,30 @@
#ifndef _LORA_MESSAGES_H_
#define _LORA_MESSAGES_H_
#define MESSAGES_VERSION 1.0
#include <stdint.h>
typedef char MessageType_t[8];
typedef uint16_t NodeID_t;
typedef struct
{
NodeID_t nodeid;
uint32_t millis;
uint8_t faction_active;
uint32_t faction_1_timer;
uint32_t faction_2_timer;
uint32_t faction_3_timer;
} __attribute__((packed)) MessageStatus_t;
typedef struct
{
NodeID_t nodeid;
bool gpsfix;
double latitude;
double longitude;
double altitude;
} __attribute__((packed)) MessagePosition_t;
#endif

View File

@@ -0,0 +1 @@
resources export-ignore

View File

@@ -0,0 +1 @@
{"type": "library", "name": "EByte LoRa E220 library", "version": "1.0.6", "spec": {"owner": "xreef", "id": 13661, "name": "EByte LoRa E220 library", "requirements": null, "uri": null}}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>LoRa_E220_Series_Library</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@@ -0,0 +1,35 @@
/*
* EBYTE LoRa E220 Series
* https://www.mischianti.org/category/my-libraries/lora-e22-devices/
*
* The MIT License (MIT)
*
* Copyright (c) 2019 Renzo Mischianti www.mischianti.org All right reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef EBYTE_LORA_E220_LIBRARY_H
#define EBYTE_LORA_E220_LIBRARY_H
#include "LoRa_E220.h"
#endif
#pragma once

View File

@@ -0,0 +1,24 @@
The MIT License (MIT)
Copyright (c) 2017 Renzo Mischianti www.mischianti.org All right reserved.
You may copy, alter and reuse this code in any way you like, but please leave
reference to www.mischianti.org in your comments if you redistribute this code.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,401 @@
/*
* EBYTE LoRa E220 Series
*
* AUTHOR: Renzo Mischianti
* VERSION: 1.0.6
*
* https://www.mischianti.org
*
* The MIT License (MIT)
*
* Copyright (c) 2022 Renzo Mischianti www.mischianti.org All right reserved.
*
* You may copy, alter and reuse this code in any way you like, but please leave
* reference to www.mischianti.org in your comments if you redistribute this code.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#ifndef LoRa_E220_h
#define LoRa_E220_h
#if !defined(ARDUINO_ARCH_STM32) && !defined(ESP32) && !defined(ARDUINO_ARCH_SAMD) && !defined(ARDUINO_ARCH_MBED) && !defined(__STM32F1__) && !defined(__STM32F4__)
#define ACTIVATE_SOFTWARE_SERIAL
#endif
#if defined(ESP32)
#define HARDWARE_SERIAL_SELECTABLE_PIN
#endif
#ifdef ACTIVATE_SOFTWARE_SERIAL
#include <SoftwareSerial.h>
#endif
#include <includes/statesNaming.h>
#if ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#define MAX_SIZE_TX_PACKET 200
// Uncomment to enable printing out nice debug messages.
//#define LoRa_E220_DEBUG
// Define where debug output will be printed.
#define DEBUG_PRINTER Serial
// Setup debug printing macros.
#ifdef LoRa_E220_DEBUG
#define DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); }
#define DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); }
#else
#define DEBUG_PRINT(...) {}
#define DEBUG_PRINTLN(...) {}
#endif
enum MODE_TYPE {
MODE_0_NORMAL = 0,
MODE_0_TRANSMISSION = 0,
MODE_1_WOR_TRANSMITTER = 1,
MODE_1_WOR = 1,
MODE_2_WOR_RECEIVER = 2,
MODE_2_POWER_SAVING = 2,
MODE_3_CONFIGURATION = 3,
MODE_3_PROGRAM = 3,
MODE_3_SLEEP = 3,
MODE_INIT = 0xFF
};
enum PROGRAM_COMMAND {
WRITE_CFG_PWR_DWN_SAVE = 0xC0,
READ_CONFIGURATION = 0xC1,
WRITE_CFG_PWR_DWN_LOSE = 0xC2,
WRONG_FORMAT = 0xFF,
RETURNED_COMMAND = 0xC1,
SPECIAL_WIFI_CONF_COMMAND = 0xCF
};
enum REGISTER_ADDRESS {
REG_ADDRESS_CFG = 0x00,
REG_ADDRESS_SPED = 0x02,
REG_ADDRESS_TRANS_MODE = 0x03,
REG_ADDRESS_CHANNEL = 0x04,
REG_ADDRESS_OPTION = 0x05,
REG_ADDRESS_CRYPT = 0x06,
REG_ADDRESS_PID = 0x08
};
enum PACKET_LENGHT {
PL_CONFIGURATION = 0x08,
PL_SPED = 0x01,
PL_OPTION = 0x01,
PL_TRANSMISSION_MODE= 0x01,
PL_CHANNEL = 0x01,
PL_CRYPT = 0x02,
PL_PID = 0x03
};
#pragma pack(push, 1)
struct Speed {
uint8_t airDataRate :3; //bit 0-2
String getAirDataRateDescription() {
return getAirDataRateDescriptionByParams(this->airDataRate);
}
uint8_t uartParity :2; //bit 3-4
String getUARTParityDescription() {
return getUARTParityDescriptionByParams(this->uartParity);
}
uint8_t uartBaudRate :3; //bit 5-7
String getUARTBaudRateDescription() {
return getUARTBaudRateDescriptionByParams(this->uartBaudRate);
}
};
struct TransmissionMode {
byte WORPeriod :3; //bit 2,1,0
String getWORPeriodByParamsDescription() {
return getWORPeriodByParams(this->WORPeriod);
}
byte reserved2 :1; //bit 3
byte enableLBT :1; //bit 4
String getLBTEnableByteDescription() {
return getLBTEnableByteByParams(this->enableLBT);
}
byte reserved :1; //bit 5
byte fixedTransmission :1; //bit 6
String getFixedTransmissionDescription() {
return getFixedTransmissionDescriptionByParams(this->fixedTransmission);
}
byte enableRSSI :1; //bit 7
String getRSSIEnableByteDescription() {
return getRSSIEnableByteByParams(this->enableRSSI);
}
};
struct Option {
uint8_t transmissionPower :2; //bit 0-1
String getTransmissionPowerDescription() {
return getTransmissionPowerDescriptionByParams(this->transmissionPower);
}
uint8_t reserved :3; //bit 2-4
uint8_t RSSIAmbientNoise :1; //bit 5
String getRSSIAmbientNoiseEnable() {
return getRSSIAmbientNoiseEnableByParams(this->RSSIAmbientNoise);
}
uint8_t subPacketSetting :2; //bit 6-7
String getSubPacketSetting() {
return getSubPacketSettingByParams(this->subPacketSetting);
}
};
struct Crypt {
byte CRYPT_H = 0;
byte CRYPT_L = 0;
};
struct Configuration {
byte COMMAND = 0;
byte STARTING_ADDRESS = 0;
byte LENGHT = 0;
byte ADDH = 0;
byte ADDL = 0;
struct Speed SPED;
struct Option OPTION;
byte CHAN = 0;
String getChannelDescription() {
return String(this->CHAN + OPERATING_FREQUENCY) + F("MHz");
}
struct TransmissionMode TRANSMISSION_MODE;
struct Crypt CRYPT;
};
struct ModuleInformation {
byte COMMAND = 0;
byte STARTING_ADDRESS = 0;
byte LENGHT = 0;
byte model = 0;
byte version = 0;
byte features = 0;
};
struct ResponseStatus {
Status code;
String getResponseDescription() {
return getResponseDescriptionByParams(this->code);
}
};
struct ResponseStructContainer {
void *data;
byte rssi;
ResponseStatus status;
void close() {
free(this->data);
}
};
struct ResponseContainer {
String data;
byte rssi;
ResponseStatus status;
};
struct ConfigurationMessage
{
byte specialCommand1 = 0xCF;
byte specialCommand2 = 0xCF;
unsigned char message[];
};
//struct FixedStransmission {
// byte ADDL = 0;
// byte ADDH = 0;
// byte CHAN = 0;
// void *message;
//};
#pragma pack(pop)
class LoRa_E220 {
public:
#ifdef ACTIVATE_SOFTWARE_SERIAL
LoRa_E220(byte txE220pin, byte rxE220pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
LoRa_E220(byte txE220pin, byte rxE220pin, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
LoRa_E220(byte txE220pin, byte rxE220pin, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
#endif
LoRa_E220(HardwareSerial* serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
LoRa_E220(HardwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
LoRa_E220(HardwareSerial* serial, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
#ifdef HARDWARE_SERIAL_SELECTABLE_PIN
LoRa_E220(byte txE220pin, byte rxE220pin, HardwareSerial* serial, UART_BPS_RATE bpsRate, uint32_t serialConfig = SERIAL_8N1);
LoRa_E220(byte txE220pin, byte rxE220pin, HardwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate, uint32_t serialConfig = SERIAL_8N1);
LoRa_E220(byte txE220pin, byte rxE220pin, HardwareSerial* serial, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate, uint32_t serialConfig = SERIAL_8N1);
#endif
#ifdef ACTIVATE_SOFTWARE_SERIAL
LoRa_E220(SoftwareSerial* serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
LoRa_E220(SoftwareSerial* serial, byte auxPin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
LoRa_E220(SoftwareSerial* serial, byte auxPin, byte m0Pin, byte m1Pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600);
#endif
// LoRa_E220(byte txE220pin, byte rxE220pin, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, MODE_TYPE mode = MODE_0_NORMAL);
// LoRa_E220(HardwareSerial* serial = &Serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, MODE_TYPE mode = MODE_0_NORMAL);
// LoRa_E220(SoftwareSerial* serial, UART_BPS_RATE bpsRate = UART_BPS_RATE_9600, MODE_TYPE mode = MODE_0_NORMAL);
bool begin();
Status setMode(MODE_TYPE mode);
MODE_TYPE getMode();
ResponseStructContainer getConfiguration();
ResponseStatus setConfiguration(Configuration configuration, PROGRAM_COMMAND saveType = WRITE_CFG_PWR_DWN_LOSE);
ResponseStructContainer getModuleInformation();
ResponseStatus resetModule();
ResponseStatus sendMessage(const void *message, const uint8_t size);
ResponseContainer receiveMessageUntil(char delimiter = '\0');
ResponseStructContainer receiveMessage(const uint8_t size);
ResponseStructContainer receiveMessageRSSI(const uint8_t size);
ResponseStructContainer receiveMessageComplete(const uint8_t size, bool enableRSSI);
ResponseContainer receiveMessageComplete(bool enableRSSI);
ResponseStatus sendMessage(const String message);
ResponseContainer receiveMessage();
ResponseContainer receiveMessageRSSI();
ResponseStatus sendFixedMessage(byte ADDH, byte ADDL, byte CHAN, const String message);
ResponseStatus sendFixedMessage(byte ADDH,byte ADDL, byte CHAN, const void *message, const uint8_t size);
ResponseStatus sendBroadcastFixedMessage(byte CHAN, const void *message, const uint8_t size);
ResponseStatus sendBroadcastFixedMessage(byte CHAN, const String message);
ResponseContainer receiveInitialMessage(const uint8_t size);
ResponseStatus sendConfigurationMessage( byte ADDH,byte ADDL, byte CHAN, Configuration *configuration, PROGRAM_COMMAND programCommand = WRITE_CFG_PWR_DWN_SAVE);
int available();
void (*setMPins)(int, int);
private:
HardwareSerial* hs;
#ifdef ACTIVATE_SOFTWARE_SERIAL
SoftwareSerial* ss;
#endif
bool isSoftwareSerial = true;
int8_t txE220pin = -1;
int8_t rxE220pin = -1;
int8_t auxPin = -1;
#ifdef HARDWARE_SERIAL_SELECTABLE_PIN
uint32_t serialConfig = SERIAL_8N1;
#endif
int8_t m0Pin = -1;
int8_t m1Pin = -1;
unsigned long halfKeyloqKey = 0x06660708;
unsigned long encrypt(unsigned long data);
unsigned long decrypt(unsigned long data);
UART_BPS_RATE bpsRate = UART_BPS_RATE_9600;
struct NeedsStream {
template<typename T>
void begin(T &t, uint32_t baud) {
DEBUG_PRINTLN("Begin ");
t.setTimeout(500);
t.begin(baud);
stream = &t;
}
#ifdef HARDWARE_SERIAL_SELECTABLE_PIN
// template< typename T >
// void begin( T &t, uint32_t baud, SerialConfig config ){
// DEBUG_PRINTLN("Begin ");
// t.setTimeout(500);
// t.begin(baud, config);
// stream = &t;
// }
//
template< typename T >
void begin( T &t, uint32_t baud, uint32_t config ) {
DEBUG_PRINTLN("Begin ");
t.setTimeout(500);
t.begin(baud, config);
stream = &t;
}
template< typename T >
void begin( T &t, uint32_t baud, uint32_t config, int8_t txE220pin, int8_t rxE220pin ) {
DEBUG_PRINTLN("Begin ");
t.setTimeout(500);
t.begin(baud, config, txE220pin, rxE220pin);
stream = &t;
}
#endif
void listen() {}
Stream *stream;
};
NeedsStream serialDef;
MODE_TYPE mode = MODE_0_NORMAL;
void managedDelay(unsigned long timeout);
Status waitCompleteResponse(unsigned long timeout = 1000, unsigned int waitNoAux = 100);
void flush();
void cleanUARTBuffer();
Status sendStruct(void *structureManaged, uint16_t size_);
Status receiveStruct(void *structureManaged, uint16_t size_);
void writeProgramCommand(PROGRAM_COMMAND cmd, REGISTER_ADDRESS addr, PACKET_LENGHT pl);
RESPONSE_STATUS checkUARTConfiguration(MODE_TYPE mode);
#ifdef LoRa_E220_DEBUG
void printParameters(struct Configuration *configuration);
#endif
};
#endif

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,138 @@
/*
* LoRa E220
* Get configuration.
* You must uncommend the correct constructor.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or 3.3v) ----- 19 (or 3.3v) ----- 4 (or 3.3v) ----- 2 (or 3.3v) ----- 10 (or 3.3v) ----- PB0 (or 3.3v) ----- 7 Volt div (or 3.3v)
* M1 ----- D6 (or 3.3v) ----- 21 (or 3.3v) ----- 6 (or 3.3v) ----- 4 (or 3.3v) ----- 11 (or 3.3v) ----- PB10 (or 3.3v) ----- 6 Volt div (or 3.3v)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation);
void setup() {
Serial.begin(9600);
while(!Serial){};
delay(500);
Serial.println();
// Startup all pins and UART
e220ttl.begin();
ResponseStructContainer c;
c = e220ttl.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
printParameters(configuration);
ResponseStructContainer cMi;
cMi = e220ttl.getModuleInformation();
// It's important get information pointer before all other operation
ModuleInformation mi = *(ModuleInformation*)cMi.data;
Serial.println(cMi.status.getResponseDescription());
Serial.println(cMi.status.code);
printModuleInformation(mi);
}
void loop() {
}
void printParameters(struct Configuration configuration) {
Serial.println("----------------------------------------");
Serial.print(F("HEAD : ")); Serial.print(configuration.COMMAND, HEX);Serial.print(" ");Serial.print(configuration.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(configuration.LENGHT, HEX);
Serial.println(F(" "));
Serial.print(F("AddH : ")); Serial.println(configuration.ADDH, HEX);
Serial.print(F("AddL : ")); Serial.println(configuration.ADDL, HEX);
Serial.println(F(" "));
Serial.print(F("Chan : ")); Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription());
Serial.println(F(" "));
Serial.print(F("SpeedParityBit : ")); Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription());
Serial.print(F("SpeedUARTDatte : ")); Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRateDescription());
Serial.print(F("SpeedAirDataRate : ")); Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRateDescription());
Serial.println(F(" "));
Serial.print(F("OptionSubPacketSett: ")); Serial.print(configuration.OPTION.subPacketSetting, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getSubPacketSetting());
Serial.print(F("OptionTranPower : ")); Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());
Serial.print(F("OptionRSSIAmbientNo: ")); Serial.print(configuration.OPTION.RSSIAmbientNoise, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getRSSIAmbientNoiseEnable());
Serial.println(F(" "));
Serial.print(F("TransModeWORPeriod : ")); Serial.print(configuration.TRANSMISSION_MODE.WORPeriod, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription());
Serial.print(F("TransModeEnableLBT : ")); Serial.print(configuration.TRANSMISSION_MODE.enableLBT, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription());
Serial.print(F("TransModeEnableRSSI: ")); Serial.print(configuration.TRANSMISSION_MODE.enableRSSI, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription());
Serial.print(F("TransModeFixedTrans: ")); Serial.print(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription());
Serial.println("----------------------------------------");
}
void printModuleInformation(struct ModuleInformation moduleInformation) {
Serial.println("----------------------------------------");
Serial.print(F("HEAD: ")); Serial.print(moduleInformation.COMMAND, HEX);Serial.print(" ");Serial.print(moduleInformation.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(moduleInformation.LENGHT, DEC);
Serial.print(F("Model no.: ")); Serial.println(moduleInformation.model, HEX);
Serial.print(F("Version : ")); Serial.println(moduleInformation.version, HEX);
Serial.print(F("Features : ")); Serial.println(moduleInformation.features, HEX);
Serial.println("----------------------------------------");
}

View File

@@ -0,0 +1,417 @@
/*
* LoRa E220
* Set configuration.
*
* You must uncommend the correct constructor.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or 3.3v) ----- 19 (or 3.3v) ----- 4 (or 3.3v) ----- 2 (or 3.3v) ----- 10 (or 3.3v) ----- PB0 (or 3.3v) ----- 7 Volt div (or 3.3v)
* M1 ----- D6 (or 3.3v) ----- 21 (or 3.3v) ----- 6 (or 3.3v) ----- 4 (or 3.3v) ----- 11 (or 3.3v) ----- PB10 (or 3.3v) ----- 6 Volt div (or 3.3v)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation);
void setup() {
Serial.begin(9600);
while(!Serial){};
delay(500);
Serial.println();
// Startup all pins and UART
e220ttl.begin();
ResponseStructContainer c;
c = e220ttl.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
printParameters(configuration);
// ----------------------- DEFAULT TRANSPARENT -----------------------
configuration.ADDL = 0x03; // First part of address
configuration.ADDH = 0x00; // Second part
configuration.CHAN = 23; // Communication channel
configuration.SPED.uartBaudRate = UART_BPS_9600; // Serial baud rate
configuration.SPED.airDataRate = AIR_DATA_RATE_010_24; // Air baud rate
configuration.SPED.uartParity = MODE_00_8N1; // Parity bit
configuration.OPTION.subPacketSetting = SPS_200_00; // Packet size
configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED; // Need to send special command
configuration.OPTION.transmissionPower = POWER_22; // Device power
configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED; // Enable RSSI info
configuration.TRANSMISSION_MODE.fixedTransmission = FT_TRANSPARENT_TRANSMISSION; // Enable repeater mode
configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED; // Check interference
configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011; // WOR timing
// ----------------------- DEFAULT TRANSPARENT WITH RSSI -----------------------
// configuration.ADDL = 0x03;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_TRANSPARENT_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- FIXED SENDER -----------------------
// configuration.ADDL = 0x02;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
//
// ----------------------- FIXED RECEIVER -----------------------
// configuration.ADDL = 0x03;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- FIXED SENDER RSSI -----------------------
// configuration.ADDL = 0x02;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
//
// ----------------------- FIXED RECEIVER RSSI -----------------------
// configuration.ADDL = 0x03;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
//
// ----------------------- WOR SENDER -----------------------
// configuration.ADDL = 0x02;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
//
// ----------------------- WOR RECEIVER -----------------------
// configuration.ADDL = 0x03;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- BROADCAST MESSAGE 1 -----------------------
// configuration.ADDL = 0x04;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- BROADCAST MESSAGE 2 -----------------------
// configuration.ADDL = 0x05;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- BROADCAST MESSAGE 3 -----------------------
// configuration.ADDL = 0x06;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- BROADCAST MESSAGE RSSI 1 -----------------------
// configuration.ADDL = 0x04;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- BROADCAST MESSAGE RSSI 2 -----------------------
// configuration.ADDL = 0x05;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- BROADCAST MESSAGE RSSI 3 -----------------------
// configuration.ADDL = 0x06;
// configuration.ADDH = 0x00;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// ----------------------- MONITORING -----------------------
// configuration.ADDL = BROADCAST_ADDRESS;
// configuration.ADDH = BROADCAST_ADDRESS;
//
// configuration.CHAN = 23;
//
// configuration.SPED.uartBaudRate = UART_BPS_9600;
// configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
// configuration.SPED.uartParity = MODE_00_8N1;
//
// configuration.OPTION.subPacketSetting = SPS_200_00;
// configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_DISABLED;
// configuration.OPTION.transmissionPower = POWER_22;
//
// configuration.TRANSMISSION_MODE.enableRSSI = RSSI_DISABLED;
// configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
// configuration.TRANSMISSION_MODE.enableLBT = LBT_DISABLED;
// configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// Set configuration changed and set to not hold the configuration
ResponseStatus rs = e220ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_SAVE);
Serial.println(rs.getResponseDescription());
Serial.println(rs.code);
c = e220ttl.getConfiguration();
// It's important get configuration pointer before all other operation
configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
printParameters(configuration);
c.close();
}
void loop() {
}
void printParameters(struct Configuration configuration) {
DEBUG_PRINTLN("----------------------------------------");
DEBUG_PRINT(F("HEAD : ")); DEBUG_PRINT(configuration.COMMAND, HEX);DEBUG_PRINT(" ");DEBUG_PRINT(configuration.STARTING_ADDRESS, HEX);DEBUG_PRINT(" ");DEBUG_PRINTLN(configuration.LENGHT, HEX);
DEBUG_PRINTLN(F(" "));
DEBUG_PRINT(F("AddH : ")); DEBUG_PRINTLN(configuration.ADDH, HEX);
DEBUG_PRINT(F("AddL : ")); DEBUG_PRINTLN(configuration.ADDL, HEX);
DEBUG_PRINTLN(F(" "));
DEBUG_PRINT(F("Chan : ")); DEBUG_PRINT(configuration.CHAN, DEC); DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.getChannelDescription());
DEBUG_PRINTLN(F(" "));
DEBUG_PRINT(F("SpeedParityBit : ")); DEBUG_PRINT(configuration.SPED.uartParity, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.SPED.getUARTParityDescription());
DEBUG_PRINT(F("SpeedUARTDatte : ")); DEBUG_PRINT(configuration.SPED.uartBaudRate, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.SPED.getUARTBaudRateDescription());
DEBUG_PRINT(F("SpeedAirDataRate : ")); DEBUG_PRINT(configuration.SPED.airDataRate, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.SPED.getAirDataRateDescription());
DEBUG_PRINTLN(F(" "));
DEBUG_PRINT(F("OptionSubPacketSett: ")); DEBUG_PRINT(configuration.OPTION.subPacketSetting, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.OPTION.getSubPacketSetting());
DEBUG_PRINT(F("OptionTranPower : ")); DEBUG_PRINT(configuration.OPTION.transmissionPower, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.OPTION.getTransmissionPowerDescription());
DEBUG_PRINT(F("OptionRSSIAmbientNo: ")); DEBUG_PRINT(configuration.OPTION.RSSIAmbientNoise, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.OPTION.getRSSIAmbientNoiseEnable());
DEBUG_PRINTLN(F(" "));
DEBUG_PRINT(F("TransModeWORPeriod : ")); DEBUG_PRINT(configuration.TRANSMISSION_MODE.WORPeriod, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription());
DEBUG_PRINT(F("TransModeEnableLBT : ")); DEBUG_PRINT(configuration.TRANSMISSION_MODE.enableLBT, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription());
DEBUG_PRINT(F("TransModeEnableRSSI: ")); DEBUG_PRINT(configuration.TRANSMISSION_MODE.enableRSSI, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription());
DEBUG_PRINT(F("TransModeFixedTrans: ")); DEBUG_PRINT(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);DEBUG_PRINT(" -> "); DEBUG_PRINTLN(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription());
DEBUG_PRINTLN("----------------------------------------");
}
void printModuleInformation(struct ModuleInformation moduleInformation) {
Serial.println("----------------------------------------");
DEBUG_PRINT(F("HEAD: ")); DEBUG_PRINT(moduleInformation.COMMAND, HEX);DEBUG_PRINT(" ");DEBUG_PRINT(moduleInformation.STARTING_ADDRESS, HEX);DEBUG_PRINT(" ");DEBUG_PRINTLN(moduleInformation.LENGHT, DEC);
Serial.print(F("Model no.: ")); Serial.println(moduleInformation.model, HEX);
Serial.print(F("Version : ")); Serial.println(moduleInformation.version, HEX);
Serial.print(F("Features : ")); Serial.println(moduleInformation.features, HEX);
Serial.println("----------------------------------------");
}

View File

@@ -0,0 +1,115 @@
/*
* EBYTE LoRa E220
* send a transparent message, you must check that the transmitter and receiver have the same
* CHANNEL ADDL and ADDH
*
* Pay attention e220 support RSSI, if you want use that functionality you must enable RSSI on configuration
* configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
*
* and uncomment #define ENABLE_RSSI true in this sketch
*
* You must uncommend the correct constructor.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- 10 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
#define ENABLE_RSSI true
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
// If you have ever change configuration you must restore It
Serial.println("Hi, I'm going to send message!");
// Send message
ResponseStatus rs = e220ttl.sendMessage("Hello, world?");
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
if (e220ttl.available()>1) {
// read the String message
#ifdef ENABLE_RSSI
ResponseContainer rc = e220ttl.receiveMessageRSSI();
#else
ResponseContainer rc = e220ttl.receiveMessage();
#endif
// Is something goes wrong print error
if (rc.status.code!=1){
Serial.println(rc.status.getResponseDescription());
}else{
// Print the data received
Serial.println(rc.status.getResponseDescription());
Serial.println(rc.data);
#ifdef ENABLE_RSSI
Serial.print("RSSI: "); Serial.println(rc.rssi, DEC);
#endif
}
}
if (Serial.available()) {
String input = Serial.readString();
e220ttl.sendMessage(input);
}
}

View File

@@ -0,0 +1,168 @@
/*
* EBYTE LoRa E220
* Send a string message to a fixed point ADDH ADDL CHAN
*
* You must configure 2 device: one as SENDER (with FIXED SENDER config) and uncomment the relative
* define with the correct DESTINATION_ADDL, and one as RECEIVER (with FIXED RECEIVER config)
* and uncomment the relative define with the correct DESTINATION_ADDL.
*
* Write a string on serial monitor or reset to resend default value.
*
* Pai attention e220 support RSSI, if you want use that functionality you must enable RSSI on configuration
* configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
*
* and uncomment #define ENABLE_RSSI true in this sketch
*
* You must uncommend the correct constructor.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- 10 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
// With FIXED SENDER configuration
// #define DESTINATION_ADDL 3
// With FIXED RECEIVER configuration
#define DESTINATION_ADDL 2
// If you want use RSSI uncomment //#define ENABLE_RSSI true
// and use relative configuration with RSSI enabled
//#define ENABLE_RSSI true
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void printParameters(struct Configuration configuration);
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
ResponseStructContainer c;
c = e220ttl.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration*) c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
printParameters(configuration);
c.close();
Serial.println("Hi, I'm going to send message!");
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, "Hello, world?");
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
if (e220ttl.available()>1) {
// read the String message
#ifdef ENABLE_RSSI
ResponseContainer rc = e220ttl.receiveMessageRSSI();
#else
ResponseContainer rc = e220ttl.receiveMessage();
#endif
// Is something goes wrong print error
if (rc.status.code!=1){
Serial.println(rc.status.getResponseDescription());
}else{
// Print the data received
Serial.println(rc.status.getResponseDescription());
Serial.println(rc.data);
#ifdef ENABLE_RSSI
Serial.print("RSSI: "); Serial.println(rc.rssi, DEC);
#endif
}
}
if (Serial.available()) {
String input = Serial.readString();
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, input);
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
}
void printParameters(struct Configuration configuration) {
Serial.println("----------------------------------------");
Serial.print(F("HEAD : ")); Serial.print(configuration.COMMAND, HEX);Serial.print(" ");Serial.print(configuration.STARTING_ADDRESS, HEX);Serial.print(" ");Serial.println(configuration.LENGHT, HEX);
Serial.println(F(" "));
Serial.print(F("AddH : ")); Serial.println(configuration.ADDH, HEX);
Serial.print(F("AddL : ")); Serial.println(configuration.ADDL, HEX);
Serial.println(F(" "));
Serial.print(F("Chan : ")); Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription());
Serial.println(F(" "));
Serial.print(F("SpeedParityBit : ")); Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription());
Serial.print(F("SpeedUARTDatte : ")); Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRateDescription());
Serial.print(F("SpeedAirDataRate : ")); Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRateDescription());
Serial.println(F(" "));
Serial.print(F("OptionSubPacketSett: ")); Serial.print(configuration.OPTION.subPacketSetting, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getSubPacketSetting());
Serial.print(F("OptionTranPower : ")); Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());
Serial.print(F("OptionRSSIAmbientNo: ")); Serial.print(configuration.OPTION.RSSIAmbientNoise, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getRSSIAmbientNoiseEnable());
Serial.println(F(" "));
Serial.print(F("TransModeWORPeriod : ")); Serial.print(configuration.TRANSMISSION_MODE.WORPeriod, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription());
Serial.print(F("TransModeEnableLBT : ")); Serial.print(configuration.TRANSMISSION_MODE.enableLBT, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription());
Serial.print(F("TransModeEnableRSSI: ")); Serial.print(configuration.TRANSMISSION_MODE.enableRSSI, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription());
Serial.print(F("TransModeFixedTrans: ")); Serial.print(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription());
Serial.println("----------------------------------------");
}

View File

@@ -0,0 +1,149 @@
/*
* EBYTE LoRa E220
* send a structured message to the device that have ADDH ADDL CHAN -> 0 DESTINATION_ADDL 23
*
* write the int humidity value on serial (or reset device that send default message)
*
* You must configure 2 device: one as SENDER (with FIXED SENDER config) and uncomment the relative
* define with the correct DESTINATION_ADDL, and one as RECEIVER (with FIXED RECEIVER config)
* and uncomment the relative define with the correct DESTINATION_ADDL.
*
* Write a string on serial monitor or reset to resend default value.
*
* Pay attention e220 support RSSI, if you want use that functionality you must enable RSSI on configuration
* configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
*
* and uncomment #define ENABLE_RSSI true in this sketch
*
* You must uncommend the correct constructor and set the correct AUX_PIN define.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- 10 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
// With FIXED SENDER configuration
#define DESTINATION_ADDL 3
#define ROOM "Kitchen"
// With FIXED RECEIVER configuration
//#define DESTINATION_ADDL 2
//#define ROOM "Bath"
// If you want use RSSI uncomment //#define ENABLE_RSSI true
// and use relative configuration with RSSI enabled
// #define ENABLE_RSSI true
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
//LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
struct Message {
char type[5];
char message[8];
float temperature;
};
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
Serial.println("Hi, I'm going to send message!");
struct Message message = {"TEMP", ROOM, 19.2};
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, &message, sizeof(Message));
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
if (e220ttl.available()>1) {
// read the String message
#ifdef ENABLE_RSSI
ResponseStructContainer rsc = e220ttl.receiveMessageRSSI(sizeof(Message));
#else
ResponseStructContainer rsc = e220ttl.receiveMessage(sizeof(Message));
#endif
// Is something goes wrong print error
if (rsc.status.code!=1){
Serial.println(rsc.status.getResponseDescription());
}else{
// Print the data received
Serial.println(rsc.status.getResponseDescription());
struct Message message = *(Message*) rsc.data;
Serial.println(message.type);
Serial.println(message.message);
Serial.println(message.temperature);
#ifdef ENABLE_RSSI
Serial.print("RSSI: "); Serial.println(rsc.rssi, DEC);
#endif
}
}
if (Serial.available()) {
struct Message message = { "TEMP", ROOM, 0 };
message.temperature = Serial.parseFloat();
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, &message, sizeof(Message));
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
}

View File

@@ -0,0 +1,188 @@
/*
* EBYTE LoRa E220
* send a structured message to the device that have ADDH ADDL CHAN -> 0 DESTINATION_ADDL 23
*
* The receiver read the first part of the packet and undestand the type.
* If the type is HUMI read the message and the humidity as int
* else read the temperature as float.
* I use byte array because some microcontroller can have different size for float
*
* You must configure 2 device: one as SENDER (with FIXED SENDER config) and uncomment the relative
* define with the correct DESTINATION_ADDL, and one as RECEIVER (with FIXED RECEIVER config)
* and uncomment the relative define with the correct DESTINATION_ADDL.
*
* Write a string on serial monitor or reset to resend default value.
*
* You must uncommend the correct constructor and set the correct AUX_PIN define.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- 10 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
#define MESSAGE_TYPE "HUMI"
// With FIXED SENDER configuration
//#define DESTINATION_ADDL 3
//#define ROOM "Kitchen"
// With FIXED RECEIVER configuration
#define DESTINATION_ADDL 2
#define ROOM "Bathroo"
// If you want use RSSI uncomment //#define ENABLE_RSSI true
// and use relative configuration with RSSI enabled
// #define ENABLE_RSSI true
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
//LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
struct MessageTemperature {
char type[5];
char message[8];
byte temperature[4];
};
struct MessageHumidity {
char type[5];
char message[8];
byte humidity;
};
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
Serial.println("Hi, I'm going to send message!");
struct MessageHumidity message = { "HUMI", ROOM, 80 };
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, &message, sizeof(MessageHumidity));
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
struct MessageTemperature messageT = { "TEMP", ROOM, 0 };
*(float*)(messageT.temperature) = 19.2;
// Send message
ResponseStatus rsT = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, &messageT, sizeof(MessageTemperature));
// Check If there is some problem of succesfully send
Serial.println(rsT.getResponseDescription());
}
void loop() {
// If something available
if (e220ttl.available() > 1) {
// read the String message
char type[5]; // first part of structure
ResponseContainer rs = e220ttl.receiveInitialMessage(sizeof(type));
String typeStr = rs.data;
// Is something goes wrong print error
if (rs.status.code != 1) {
Serial.println(rs.status.getResponseDescription());
} else {
Serial.println(typeStr);
if (typeStr == "TEMP") {
struct MessageTemperaturePartial {
char message[8];
byte temperature[4];
};
ResponseStructContainer rsc = e220ttl.receiveMessage( sizeof(MessageTemperaturePartial));
struct MessageTemperaturePartial message = *(MessageTemperaturePartial*) rsc.data;
Serial.println(*(float*)(message.temperature));
Serial.println(message.message);
rsc.close();
} else if (typeStr == "HUMI") {
struct MessageHumidityPartial {
char message[8];
byte humidity;
};
ResponseStructContainer rsc = e220ttl.receiveMessage(sizeof(MessageHumidityPartial));
struct MessageHumidityPartial message = *(MessageHumidityPartial*) rsc.data;
Serial.println(message.humidity);
Serial.println(message.message);
rsc.close();
} else {
Serial.println("Something goes wrong!!");
}
}
}
if (Serial.available()) {
if (MESSAGE_TYPE == "HUMI") {
struct MessageHumidity message = { "HUMI", ROOM, 0 };
message.humidity = Serial.parseInt();
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, &message, sizeof(MessageHumidity));
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
} else {
struct MessageTemperature message = { "TEMP", ROOM, 0 };
*(float*)(message.temperature) = Serial.parseFloat();
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, &message, sizeof(MessageTemperature));
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
}
}

View File

@@ -0,0 +1,111 @@
/*
* EBYTE LoRa E220
* Send wake up WOR message to a device in Sleep (WOR transmitter)
*
* You must configure the address with 0 3 23 (FIXED SENDER configuration)
* and pay attention that WOR period must be the same of receiver
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or 3.3v) ----- 19 (or 3.3v) ----- 4 (or 3.3v) ----- 2 (or 3.3v) ----- 10 (or 3.3v) ----- PB0 (or 3.3v) ----- 7 Volt div (or 3.3v)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
// With FIXED SENDER configuration
#define DESTINATION_ADDL 3
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
e220ttl.setMode(MODE_1_WOR_TRANSMITTER);
Serial.println("Hi, I'm going to send WOR message!");
// Send message
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, "Hello, world? WOR!");
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
// e220ttl.setMode(MODE_0_NORMAL);
}
void loop() {
// If something available
if (e220ttl.available()>1) {
// read the String message
ResponseContainer rc = e220ttl.receiveMessage();
// Is something goes wrong print error
if (rc.status.code!=1){
Serial.println(rc.status.getResponseDescription());
}else{
// Print the data received
Serial.println(rc.status.getResponseDescription());
Serial.println(rc.data);
}
}
if (Serial.available()) {
String input = Serial.readString();
ResponseStatus rs = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, input);
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
}

View File

@@ -0,0 +1,137 @@
/*
* EBYTE LoRa E220
* Stay in sleep mode and wait a wake up WOR message
*
* You must configure the address with 0 2 23 (FIXED RECEIVER configuration)
* and pay attention that WOR period must be the same of sender
*
* You must uncommend the correct constructor and set the correct AUX_PIN define.
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or 3.3v) ----- 21 (or 3.3v) ----- 6 (or 3.3v) ----- 4 (or 3.3v) ----- PB10 (or 3.3v) ----- 6 Volt div (or 3.3v)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
// With FIXED RECEIVER configuration
#define DESTINATION_ADDL 2
#define AUX_PIN 15
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
bool interruptExecuted = false;
#ifdef ESP32
void IRAM_ATTR wakeUp() {
// Do not use Serial on interrupt callback
interruptExecuted = true;
detachInterrupt(AUX_PIN);
}
#elif define(ESP8266)
ICACHE_RAM_ATTR void wakeUp() {
// Do not use Serial on interrupt callback
interruptExecuted = true;
detachInterrupt(AUX_PIN);
}
#else
void wakeUp() {
// Do not use Serial on interrupt callback
interruptExecuted = true;
detachInterrupt(AUX_PIN);
}
#endif
//The setup function is called once at startup of the sketch
void setup() {
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB
}
delay(100);
e220ttl.begin();
e220ttl.setMode(MODE_2_WOR_RECEIVER);
delay(1000);
Serial.println();
Serial.println("Start sleep!");
delay(100);
attachInterrupt(AUX_PIN, wakeUp, FALLING);
}
// The loop function is called in an endless loop
void loop() {
if (e220ttl.available() > 1) {
Serial.println("Message arrived!");
ResponseContainer rs = e220ttl.receiveMessage();
// First of all get the data
String message = rs.data;
Serial.println(rs.status.getResponseDescription());
Serial.println(message);
// Work only with full connection
e220ttl.setMode(MODE_0_NORMAL);
delay(1000);
ResponseStatus rsSend = e220ttl.sendFixedMessage(0, DESTINATION_ADDL, 23, "We have received the message!");
// Check If there is some problem of succesfully send
Serial.println(rsSend.getResponseDescription());
}
if(interruptExecuted) {
Serial.println("WakeUp Callback, AUX pin go LOW and start receive message!");
Serial.flush();
interruptExecuted = false;
}
}

View File

@@ -0,0 +1,105 @@
/*
* EBYTE LoRa E220
*
* Receive messages on CHANNEL 23
* Uncomment #define ENABLE_RSSI true in this sketch
* if the sender send RSSI also
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- 10 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
// If you want use RSSI uncomment
//#define ENABLE_RSSI true
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
//LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
Serial.println("Start receiving!");
}
void loop() {
// If something available
if (e220ttl.available()>1) {
Serial.println("Message received!");
// read the String message
#ifdef ENABLE_RSSI
ResponseContainer rc = e220ttl.receiveMessageRSSI();
#else
ResponseContainer rc = e220ttl.receiveMessage();
#endif
// Is something goes wrong print error
if (rc.status.code!=1){
Serial.println(rc.status.getResponseDescription());
}else{
// Print the data received
Serial.println(rc.status.getResponseDescription());
Serial.println(rc.data);
#ifdef ENABLE_RSSI
Serial.print("RSSI: "); Serial.println(rc.rssi, DEC);
#endif
}
}
}

View File

@@ -0,0 +1,128 @@
/*
* EBYTE LoRa E220
*
* Send a string message to all devices of the Channel CHAN 23
*
* Write a string on serial monitor or reset to send the string to all device on channel 23.
*
* Send a fixed message, you must check that the transmitter and receiver have different
* ADDL or ADDH, check the configuration down
*
* For the test you can use
* - BROADCAST MESSAGE 1
* - BROADCAST MESSAGE 2
* - BROADCAST MESSAGE 3
*
* Pai attention e220 support RSSI, if you want use that functionality you must enable RSSI on configuration
* configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
*
* and uncomment #define ENABLE_RSSI true in this sketch
*
* by Renzo Mischianti <https://www.mischianti.org>
*
* https://www.mischianti.org
*
* E220 ----- WeMos D1 mini ----- esp32 ----- Arduino Nano 33 IoT ----- Arduino MKR ----- Raspberry Pi Pico ----- stm32 ----- ArduinoUNO
* M0 ----- D7 (or GND) ----- 19 (or GND) ----- 4 (or GND) ----- 2 (or GND) ----- 10 (or GND) ----- PB0 (or GND) ----- 7 Volt div (or GND)
* M1 ----- D6 (or GND) ----- 21 (or GND) ----- 6 (or GND) ----- 4 (or GND) ----- 11 (or GND) ----- PB10 (or GND) ----- 6 Volt div (or GND)
* TX ----- D3 (PullUP) ----- TX2 (PullUP) ----- TX1 (PullUP) ----- 14 (PullUP) ----- 8 (PullUP) ----- PA2 TX2 (PullUP) ----- 4 (PullUP)
* RX ----- D4 (PullUP) ----- RX2 (PullUP) ----- RX1 (PullUP) ----- 13 (PullUP) ----- 9 (PullUP) ----- PA3 RX2 (PullUP) ----- 5 Volt div (PullUP)
* AUX ----- D5 (PullUP) ----- 18 (PullUP) ----- 2 (PullUP) ----- 0 (PullUP) ----- 2 (PullUP) ----- PA0 (PullUP) ----- 3 (PullUP)
* VCC ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v ----- 3.3v/5v
* GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND ----- GND
*
*/
// If you want use RSSI uncomment //#define ENABLE_RSSI true
// and use relative configuration with RSSI enabled
//#define ENABLE_RSSI true
#include "Arduino.h"
#include "LoRa_E220.h"
// ---------- esp8266 pins --------------
//LoRa_E220 e220ttl(RX, TX, AUX, M0, M1); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
LoRa_E220 e220ttl(D3, D4, D5, D7, D6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(D2, D3); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, D5, D7, D6); // AUX M0 M1
// -------------------------------------
// ---------- Arduino pins --------------
//LoRa_E220 e220ttl(4, 5, 3, 7, 6); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
//LoRa_E220 e220ttl(4, 5); // Config without connect AUX and M0 M1
//#include <SoftwareSerial.h>
//SoftwareSerial mySerial(4, 5); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX
//LoRa_E220 e220ttl(&mySerial, 3, 7, 6); // AUX M0 M1
// -------------------------------------
// ------------- Arduino Nano 33 IoT -------------
// LoRa_E220 e220ttl(&Serial1, 2, 4, 6); // RX AUX M0 M1
// -------------------------------------------------
// ------------- Arduino MKR WiFi 1010 -------------
// LoRa_E220 e220ttl(&Serial1, 0, 2, 4); // RX AUX M0 M1
// -------------------------------------------------
// ---------- esp32 pins --------------
// LoRa_E220 e220ttl(&Serial2, 15, 21, 19); // RX AUX M0 M1
//LoRa_E220 e220ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e220 TX, esp32 TX --> e220 RX AUX M0 M1
// -------------------------------------
// ---------- Raspberry PI Pico pins --------------
// LoRa_E220 e220ttl(&Serial2, 2, 10, 11); // RX AUX M0 M1
// -------------------------------------
// ---------------- STM32 --------------------
//HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX)
//LoRa_E220 e220ttl(&Serial2, PA0, PB0, PB10); // RX AUX M0 M1
// -------------------------------------------------
void setup() {
Serial.begin(9600);
delay(500);
// Startup all pins and UART
e220ttl.begin();
Serial.println("Hi, I'm going to send message!");
// Send message
ResponseStatus rs = e220ttl.sendBroadcastFixedMessage(23, "Hello, world?");
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
void loop() {
// If something available
if (e220ttl.available()>1) {
// read the String message
#ifdef ENABLE_RSSI
ResponseContainer rc = e220ttl.receiveMessageRSSI();
#else
ResponseContainer rc = e220ttl.receiveMessage();
#endif
// Is something goes wrong print error
if (rc.status.code!=1){
Serial.println(rc.status.getResponseDescription());
}else{
// Print the data received
Serial.println(rc.status.getResponseDescription());
Serial.println(rc.data);
#ifdef ENABLE_RSSI
Serial.print("RSSI: "); Serial.println(rc.rssi, DEC);
#endif
}
}
if (Serial.available()) {
String input = Serial.readString();
ResponseStatus rs = e220ttl.sendBroadcastFixedMessage(23, input);
// Check If there is some problem of succesfully send
Serial.println(rs.getResponseDescription());
}
}

View File

@@ -0,0 +1,461 @@
#include "Arduino.h"
#ifdef FREQUENCY_433
#define OPERATING_FREQUENCY 410
#elif defined(FREQUENCY_400)
#define OPERATING_FREQUENCY 410
#elif defined(FREQUENCY_230)
#define OPERATING_FREQUENCY 220
#elif defined(FREQUENCY_868)
#define OPERATING_FREQUENCY 850
#elif defined(FREQUENCY_915)
#define OPERATING_FREQUENCY 850
#else
#define OPERATING_FREQUENCY 410
#endif
#define BROADCAST_ADDRESS 255
typedef enum RESPONSE_STATUS {
#ifndef ARDUINO_ARCH_STM32
SUCCESS = 1,
#endif
E220_SUCCESS = 1,
ERR_E220_UNKNOWN, /* something shouldn't happened */
ERR_E220_NOT_SUPPORT,
ERR_E220_NOT_IMPLEMENT,
ERR_E220_NOT_INITIAL,
ERR_E220_INVALID_PARAM,
ERR_E220_DATA_SIZE_NOT_MATCH,
ERR_E220_BUF_TOO_SMALL,
ERR_E220_TIMEOUT,
ERR_E220_HARDWARE,
ERR_E220_HEAD_NOT_RECOGNIZED,
ERR_E220_NO_RESPONSE_FROM_DEVICE,
ERR_E220_WRONG_UART_CONFIG,
ERR_E220_WRONG_FORMAT,
ERR_E220_PACKET_TOO_BIG
} Status;
static String getResponseDescriptionByParams(byte status){
switch (status)
{
case E220_SUCCESS:
return F("Success");
break;
case ERR_E220_UNKNOWN:
return F("Unknown");
break;
case ERR_E220_NOT_SUPPORT:
return F("Not support!");
break;
case ERR_E220_NOT_IMPLEMENT:
return F("Not implement");
break;
case ERR_E220_NOT_INITIAL:
return F("Not initial!");
break;
case ERR_E220_INVALID_PARAM:
return F("Invalid param!");
break;
case ERR_E220_DATA_SIZE_NOT_MATCH:
return F("Data size not match!");
break;
case ERR_E220_BUF_TOO_SMALL:
return F("Buff too small!");
break;
case ERR_E220_TIMEOUT:
return F("Timeout!!");
break;
case ERR_E220_HARDWARE:
return F("Hardware error!");
break;
case ERR_E220_HEAD_NOT_RECOGNIZED:
return F("Save mode returned not recognized!");
break;
case ERR_E220_NO_RESPONSE_FROM_DEVICE:
return F("No response from device! (Check wiring)");
break;
case ERR_E220_WRONG_UART_CONFIG:
return F("Wrong UART configuration! (BPS must be 9600 for configuration)");
break;
case ERR_E220_PACKET_TOO_BIG:
return F("The device support only 200byte of data transmission!");
break;
default:
return F("Invalid status!");
}
}
enum UART_PARITY
{
MODE_00_8N1 = 0b00,
MODE_01_8O1 = 0b01,
MODE_10_8E1 = 0b10,
MODE_11_8N1 = 0b11
};
static String getUARTParityDescriptionByParams(byte uartParity){
switch (uartParity)
{
case MODE_00_8N1:
return F("8N1 (Default)");
break;
case MODE_01_8O1:
return F("8O1");
break;
case MODE_10_8E1:
return F("8E1");
break;
case MODE_11_8N1:
return F("8N1 (equal to 00");
break;
default:
return F("Invalid UART Parity!");
}
}
enum UART_BPS_TYPE
{
UART_BPS_1200 = 0b000,
UART_BPS_2400 = 0b001,
UART_BPS_4800 = 0b010,
UART_BPS_9600 = 0b011,
UART_BPS_19200 = 0b100,
UART_BPS_38400 = 0b101,
UART_BPS_57600 = 0b110,
UART_BPS_115200 = 0b111
};
enum UART_BPS_RATE
{
UART_BPS_RATE_1200 = 1200,
UART_BPS_RATE_2400 = 2400,
UART_BPS_RATE_4800 = 4800,
UART_BPS_RATE_9600 = 9600,
UART_BPS_RATE_19200 = 19200,
UART_BPS_RATE_38400 = 38400,
UART_BPS_RATE_57600 = 57600,
UART_BPS_RATE_115200 = 115200
};
static String getUARTBaudRateDescriptionByParams(byte uartBaudRate)
{
switch (uartBaudRate)
{
case UART_BPS_1200:
return F("1200bps");
break;
case UART_BPS_2400:
return F("2400bps");
break;
case UART_BPS_4800:
return F("4800bps");
break;
case UART_BPS_9600:
return F("9600bps (default)");
break;
case UART_BPS_19200:
return F("19200bps");
break;
case UART_BPS_38400:
return F("38400bps");
break;
case UART_BPS_57600:
return F("57600bps");
break;
case UART_BPS_115200:
return F("115200bps");
break;
default:
return F("Invalid UART Baud Rate!");
}
}
enum AIR_DATA_RATE
{
AIR_DATA_RATE_000_24 = 0b000,
AIR_DATA_RATE_001_24 = 0b001,
AIR_DATA_RATE_010_24 = 0b010,
AIR_DATA_RATE_011_48 = 0b011,
AIR_DATA_RATE_100_96 = 0b100,
AIR_DATA_RATE_101_192 = 0b101,
AIR_DATA_RATE_110_384 = 0b110,
AIR_DATA_RATE_111_625 = 0b111
};
static String getAirDataRateDescriptionByParams(byte airDataRate)
{
switch (airDataRate)
{
case AIR_DATA_RATE_000_24:
return F("2.4kbps");
break;
case AIR_DATA_RATE_001_24:
return F("2.4kbps");
break;
case AIR_DATA_RATE_010_24:
return F("2.4kbps (default)");
break;
case AIR_DATA_RATE_011_48:
return F("4.8kbps");
break;
case AIR_DATA_RATE_100_96:
return F("9.6kbps");
break;
case AIR_DATA_RATE_101_192:
return F("19.2kbps");
break;
case AIR_DATA_RATE_110_384:
return F("38.4kbps");
break;
case AIR_DATA_RATE_111_625:
return F("62.5kbps");
break;
default:
return F("Invalid Air Data Rate!");
}
}
enum SUB_PACKET_SETTING {
SPS_200_00 = 0b00,
SPS_128_01 = 0b01,
SPS_064_10 = 0b10,
SPS_032_11 = 0b11
};
static String getSubPacketSettingByParams(byte subPacketSetting)
{
switch (subPacketSetting)
{
case SPS_200_00:
return F("200bytes (default)");
break;
case SPS_128_01:
return F("128bytes");
break;
case SPS_064_10:
return F("64bytes");
break;
case SPS_032_11:
return F("32bytes");
break;
default:
return F("Invalid Sub Packet Setting!");
}
}
enum RSSI_AMBIENT_NOISE_ENABLE {
RSSI_AMBIENT_NOISE_ENABLED = 0b1,
RSSI_AMBIENT_NOISE_DISABLED = 0b0
};
static String getRSSIAmbientNoiseEnableByParams(byte rssiAmbientNoiseEnabled)
{
switch (rssiAmbientNoiseEnabled)
{
case RSSI_AMBIENT_NOISE_ENABLED:
return F("Enabled");
break;
case RSSI_AMBIENT_NOISE_DISABLED:
return F("Disabled (default)");
break;
default:
return F("Invalid RSSI Ambient Noise enabled!");
}
}
enum WOR_PERIOD {
WOR_500_000 = 0b000,
WOR_1000_001 = 0b001,
WOR_1500_010 = 0b010,
WOR_2000_011 = 0b011,
WOR_2500_100 = 0b100,
WOR_3000_101 = 0b101,
WOR_3500_110 = 0b110,
WOR_4000_111 = 0b111
};
static String getWORPeriodByParams(byte WORPeriod)
{
switch (WORPeriod)
{
case WOR_500_000:
return F("500ms");
break;
case WOR_1000_001:
return F("1000ms");
break;
case WOR_1500_010:
return F("1500ms");
break;
case WOR_2000_011:
return F("2000ms (default)");
break;
case WOR_2500_100:
return F("2500ms");
break;
case WOR_3000_101:
return F("3000ms");
break;
case WOR_3500_110:
return F("3500ms");
break;
case WOR_4000_111:
return F("4000ms");
break;
default:
return F("Invalid WOR period!");
}
}
enum LBT_ENABLE_BYTE {
LBT_ENABLED = 0b1,
LBT_DISABLED = 0b0
};
static String getLBTEnableByteByParams(byte LBTEnableByte)
{
switch (LBTEnableByte)
{
case LBT_ENABLED:
return F("Enabled");
break;
case LBT_DISABLED:
return F("Disabled (default)");
break;
default:
return F("Invalid LBT enable byte!");
}
}
enum RSSI_ENABLE_BYTE {
RSSI_ENABLED = 0b1,
RSSI_DISABLED = 0b0
};
static String getRSSIEnableByteByParams(byte RSSIEnableByte)
{
switch (RSSIEnableByte)
{
case RSSI_ENABLED:
return F("Enabled");
break;
case RSSI_DISABLED:
return F("Disabled (default)");
break;
default:
return F("Invalid RSSI enable byte!");
}
}
enum FIDEX_TRANSMISSION
{
FT_TRANSPARENT_TRANSMISSION = 0b0,
FT_FIXED_TRANSMISSION = 0b1
};
static String getFixedTransmissionDescriptionByParams(byte fixedTransmission)
{
switch (fixedTransmission)
{
case FT_TRANSPARENT_TRANSMISSION:
return F("Transparent transmission (default)");
break;
case FT_FIXED_TRANSMISSION:
return F("Fixed transmission (first three bytes can be used as high/low address and channel)");
break;
default:
return F("Invalid fixed transmission param!");
}
}
#ifdef E220_22
enum TRANSMISSION_POWER
{
POWER_22 = 0b00,
POWER_17 = 0b01,
POWER_13 = 0b10,
POWER_10 = 0b11
};
static String getTransmissionPowerDescriptionByParams(byte transmissionPower)
{
switch (transmissionPower)
{
case POWER_22:
return F("22dBm (Default)");
break;
case POWER_17:
return F("17dBm");
break;
case POWER_13:
return F("13dBm");
break;
case POWER_10:
return F("10dBm");
break;
default:
return F("Invalid transmission power param");
}
}
#elif defined(E220_30)
enum TRANSMISSION_POWER
{
POWER_30 = 0b00,
POWER_27 = 0b01,
POWER_24 = 0b10,
POWER_21 = 0b11
};
static String getTransmissionPowerDescriptionByParams(byte transmissionPower)
{
switch (transmissionPower)
{
case POWER_30:
return F("30dBm (Default)");
break;
case POWER_27:
return F("27dBm");
break;
case POWER_24:
return F("24dBm");
break;
case POWER_21:
return F("21dBm");
break;
default:
return F("Invalid transmission power param");
}
}
#else
enum TRANSMISSION_POWER
{
POWER_22 = 0b00,
POWER_17 = 0b01,
POWER_13 = 0b10,
POWER_10 = 0b11
};
static String getTransmissionPowerDescriptionByParams(byte transmissionPower)
{
switch (transmissionPower)
{
case POWER_22:
return F("22dBm (Default)");
break;
case POWER_17:
return F("17dBm");
break;
case POWER_13:
return F("13dBm");
break;
case POWER_10:
return F("10dBm");
break;
default:
return F("Invalid transmission power param");
}
}
#endif

View File

@@ -0,0 +1,30 @@
###########################################
# Syntax Coloring Map For LoRa_E32_Series-library
###########################################
###########################################
# Datatypes (KEYWORD1)
###########################################
LoRa_E220 KEYWORD1
###########################################
# Methods and Functions (KEYWORD2)
###########################################
begin KEYWORD2
getConfiguration KEYWORD2
setConfiguration KEYWORD2
getModuleInformation KEYWORD2
printParameters KEYWORD2
resetModule KEYWORD2
sendMessage KEYWORD2
receiveMessage KEYWORD2
sendFixedMessage KEYWORD2
sendBroadcastFixedMessage KEYWORD2
receiveInitialMessage KEYWORD2

View File

@@ -0,0 +1,11 @@
name=EByte LoRa E220 library
version=1.0.6
author=Renzo Mischianti <renzo.mischianti@gmail.com>
maintainer=Renzo Mischianti <renzo.mischianti@gmail.com>
sentence=LoRa EBYTE E220 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico. LLCC68
paragraph=Ebyte E220 LoRa (Long Range) library device very cheap and very long range (from 5Km to 10Km). Arduino LoRa EBYTE E220 device library complete and tested with Arduino, esp8266, esp32, STM32 and Raspberry Pi Pico. LLCC68
category=Communication
url=https://www.mischianti.org/category/my-libraries/ebyte-lora-e22-devices/
repository=https://github.com/xreef/EByte_LoRa_E220_Series_Library
architectures=*
includes=LoRa_E220.h

View File

@@ -13,13 +13,14 @@ extra_configs =
wifi_credentials.ini wifi_credentials.ini
[env:de-timer] [env:de-timer]
platform = espressif32 platform = espressif8266
board = ttgo-lora32-v1 framework = arduino
board = d1_mini
board_build.filesystem = littlefs board_build.filesystem = littlefs
;board_build.f_flash = 80000000L ;board_build.f_flash = 80000000L
;board_build.ldscript = eagle.flash.4m1m.ld ;board_build.ldscript = eagle.flash.4m1m.ld
monitor_filters = esp32_exception_decoder monitor_filters = esp8266_exception_decoder
monitor_speed = 115200 monitor_speed = 115200
upload_protocol = esptool upload_protocol = esptool
@@ -30,7 +31,6 @@ upload_speed = 921600
; --auth=${wifi_cred.admin_password} ; --auth=${wifi_cred.admin_password}
build_type = debug build_type = debug
build_flags= build_flags=
!python git_rev_macro.py !python git_rev_macro.py
-DSERIAL_DEBUG -DSERIAL_DEBUG
@@ -46,16 +46,14 @@ build_flags=
-DFACTION_2_NAME='"MILIZ"' -DFACTION_2_NAME='"MILIZ"'
-DFACTION_3_NAME='"KGG"' -DFACTION_3_NAME='"KGG"'
framework = arduino
lib_deps = lib_deps =
smougenot/TM1637@0.0.0-alpha+sha.9486982048 ;xreef/EByte LoRa E220 library@^1.0.6 ;made Lib local, due to changes for I2C-controller M0,M1-Pins
;me-no-dev/ESP Async WebServer @ ^1.2.3 ; local version included due to bug sstaub/Ticker@^4.4.0
me-no-dev/AsyncTCP @ ^1.1.1 robtillaart/PCF8574 @ ^0.3.7
sstaub/Ticker @ ^4.2.0
adafruit/Adafruit INA219 @ ^1.1.1 adafruit/Adafruit INA219 @ ^1.1.1
plerup/EspSoftwareSerial @ 6.8.5 ; needed exactly this Version as newer ones have Problems with compiling
smougenot/TM1637@0.0.0-alpha+sha.9486982048
me-no-dev/ESPAsyncTCP @ ^1.2.2
robtillaart/I2C_EEPROM @ ^1.5.2 robtillaart/I2C_EEPROM @ ^1.5.2
sandeepmistry/LoRa @ ^0.8.0 sandeepmistry/LoRa @ ^0.8.0
adafruit/Adafruit SSD1306 @ ^2.4.0
adafruit/Adafruit GFX Library @ ^1.10.1
adafruit/Adafruit BusIO @ ^1.5.0
bblanchon/ArduinoJson @ ^6.19.4 bblanchon/ArduinoJson @ ^6.19.4

View File

@@ -1,25 +1,41 @@
#ifndef _COMMON_H_ #ifndef _COMMON_H_
#define _COMMON_H_ #define _COMMON_H_
#include <stdint.h>
#define Q(x) #x #define Q(x) #x
#define QUOTE(x) Q(x) #define QUOTE(x) Q(x)
// Module connection pins (ESP GPIO-Nums) #define TRUE 1
#define CLK 12 #define FALSE 0
#define DIO_FAC_1_7SEG 13
#define DIO_FAC_2_7SEG 17
#define DIO_FAC_3_7SEG 21
#define DIO_FAC_1_TRG 36 #define HOST_NAME "AirsoftTimer_%08X"
#define GPIO_LORA_TX D3
#define GPIO_LORA_RX D4
#define GPIO_LORA_AUX D0
#define GPIO_7SEG_EN_FAC1 D5
#define GPIO_7SEG_EN_FAC2 D6
#define GPIO_7SEG_EN_FAC3 D7
#define GPIO_7SEG_CLK D8
#define I2C_IO_BTN_FAC1 0
#define FAC_1_TRG_PRESSED LOW #define FAC_1_TRG_PRESSED LOW
#define DIO_FAC_2_TRG 37 #define I2C_IO_BTN_FAC2 1
#define FAC_2_TRG_PRESSED LOW #define FAC_2_TRG_PRESSED LOW
#define DIO_FAC_3_TRG 38 #define I2C_IO_BTN_FAC3 2
#define FAC_3_TRG_PRESSED LOW #define FAC_3_TRG_PRESSED LOW
#ifndef HOST_NAME #define I2C_IO_LORA_M0 4
#define HOST_NAME "DE_Timer_%06X" // Use printf-Formatting - Chip-ID (uin32_t) will be added #define I2C_IO_LORA_M1 3
#endif
#define EEPROM_TYPE 24LC64
#define I2C_IO_ADDRESS 0x38
#define I2C_POWER_ADDRESS 0x40
#define I2C_EEPROM_ADDRESS 0x50
#ifndef OTA_DELAY #ifndef OTA_DELAY
#define OTA_DELAY 50 // ticks -> 10ms / tick #define OTA_DELAY 50 // ticks -> 10ms / tick

View File

@@ -1,20 +0,0 @@
#include "lora_net.h"
uint8_t LoRa_Init()
{
uint8_t success = false;
// SPI LoRa pins
SPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_SS);
// setup LoRa transceiver module
LoRa.setPins(LORA_SS, LORA_RST, LORA_DIO0);
if (!LoRa.begin(LORA_BAND))
{
Serial.println("Starting LoRa failed!");
success = false;
}
Serial.println("LoRa Initializing OK!");
success = true;
return success;
}

View File

@@ -1,23 +0,0 @@
#ifndef _LORA_NET_H_
#define _LORA_NET_H_
#include <Arduino.h>
#include <SPI.h>
#include <LoRa.h>
// define the pins used by the LoRa transceiver module
#define LORA_SCK 5
#define LORA_MISO 19
#define LORA_MOSI 27
#define LORA_SS 18
#define LORA_RST 14
#define LORA_DIO0 26
// 433E6 for Asia
// 866E6 for Europe
// 915E6 for North America
#define LORA_BAND 8681E5
uint8_t LoRa_Init();
#endif

View File

@@ -1,26 +1,29 @@
#define FREQUENCY_868
#include <Arduino.h> #include <Arduino.h>
#include <TM1637Display.h> #include <TM1637Display.h>
#include <Ticker.h> #include <Ticker.h>
#include <DNSServer.h> #include <DNSServer.h>
#include <WiFi.h> #include <ESP8266WiFi.h>
#include <AsyncTCP.h> #include <ESPAsyncTCP.h>
#include <ESPmDNS.h> #include <ESP8266mDNS.h>
#include <ArduinoOTA.h> #include <ArduinoOTA.h>
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
#include <LittleFS.h> #include <LittleFS.h>
#include <PCF8574.h>
#include <Wire.h> #include <Wire.h>
#include <Adafruit_INA219.h> #include <Adafruit_INA219.h>
#include <ArduinoJson.h> #include <ArduinoJson.h>
#include <LoRa_E220.h>
// local includes // local includes
#include "lora_messages.h"
#include "defaults.h" #include "defaults.h"
#include "webui.h" #include "webui.h"
#include "config.h" #include "config.h"
#include "globals.h" #include "globals.h"
#include "dtc.h" #include "dtc.h"
#include "common.h" #include "common.h"
#include "lora_net.h"
#include "oled_display.h"
#ifdef WIFI_CLIENT #ifdef WIFI_CLIENT
#include <WiFiMulti.h> #include <WiFiMulti.h>
@@ -32,41 +35,46 @@ const uint32_t connectTimeoutMs = 5000;
WiFiMulti wifiMulti; WiFiMulti wifiMulti;
#endif #endif
void SevenSeg_Output(); PCF8574 i2c_io(I2C_IO_ADDRESS);
void FactionTicker_callback();
void inputGetterTicker_callback();
void powerMonitorTicker_callback();
void EEPROMCyclicPDS_callback();
void toggleWiFiAP(boolean shutdown = false);
void SystemShutdown();
void SetBatteryType(batteryType_t type);
void ProcessKeyCombos();
void OverrideDisplay(const uint8_t *message, uint32_t time);
void LoRaPublish_callback();
#ifdef WIFI_CLIENT
void wifiMaintainConnectionTicker_callback();
Ticker WiFiMaintainConnectionTicker(wifiMaintainConnectionTicker_callback, 1000, 0, MILLIS);
#endif
uint32_t getESPChipID();
TM1637Display disp_FAC_1(CLK, DIO_FAC_1_7SEG);
TM1637Display disp_FAC_2(CLK, DIO_FAC_2_7SEG);
TM1637Display disp_FAC_3(CLK, DIO_FAC_3_7SEG);
Adafruit_INA219 ina219; Adafruit_INA219 ina219;
LoRa_E220 e220ttl(GPIO_LORA_TX, GPIO_LORA_RX, GPIO_LORA_AUX, 3, 4); // Arduino RX <-- e220 TX, Arduino TX --> e220 RX AUX M0 M1
TM1637Display disp_FAC_1(GPIO_7SEG_CLK, GPIO_7SEG_EN_FAC1);
TM1637Display disp_FAC_2(GPIO_7SEG_CLK, GPIO_7SEG_EN_FAC2);
TM1637Display disp_FAC_3(GPIO_7SEG_CLK, GPIO_7SEG_EN_FAC3);
#ifdef CAPTIVE #ifdef CAPTIVE
DNSServer dnsServer; DNSServer dnsServer;
#endif #endif
AsyncWebServer server(80); AsyncWebServer server(80);
Ticker FactionTicker(FactionTicker_callback, 1000, 0, MILLIS); void printParameters(struct Configuration configuration);
Ticker InputGetterTicker(inputGetterTicker_callback, 250, 0, MILLIS); void printModuleInformation(struct ModuleInformation moduleInformation);
Ticker PowerMonitorTicker(powerMonitorTicker_callback, 5000, 0, MILLIS); void displayInfo();
Ticker EEPROMCyclicPDSTicker(EEPROMCyclicPDS_callback, 60000, 0, MILLIS); void SevenSeg_Output();
Ticker LoRaPublishTicker(LoRaPublish_callback, 60000, 0, MILLIS); void toggleWiFiAP(boolean shutdown = false);
void SystemShutdown();
void SetBatteryType(batteryType_t type);
void ProcessKeyCombos(bool *btnState);
void OverrideDisplay(const uint8_t *message, uint32_t time);
void tmrCallback_StatusSender();
Ticker tmrStatusSender(tmrCallback_StatusSender, 30000, 0, MILLIS);
void tmrCallback_PowerMonitor();
Ticker tmrPowerMonitor(tmrCallback_PowerMonitor, 10000, 0, MILLIS);
void tmrCallback_FactionTicker();
Ticker tmrFactionTicker(tmrCallback_FactionTicker, 1000, 0, MILLIS);
void tmrCallback_InputGetter();
Ticker tmrInputGetter(tmrCallback_InputGetter, 250, 0, MILLIS);
void tmrCallback_EEPROMCyclicPDS();
Ticker tmrEEPROMCyclicPDS(tmrCallback_EEPROMCyclicPDS, 60000, 0, MILLIS);
#ifdef WIFI_CLIENT
void tmrCallback_WiFiMaintainConnection();
Ticker tmrWiFiMaintainConnection(tmrCallback_WiFiMaintainConnection, 1000, 0, MILLIS);
#endif
uint32_t getESPChipID();
uint8_t Faction_1_dot = 0; uint8_t Faction_1_dot = 0;
uint8_t Faction_2_dot = 0; uint8_t Faction_2_dot = 0;
@@ -84,35 +92,92 @@ const uint8_t sevenSeg_ota[] = {0x3F, 0x78, 0x77, 0x00};
const uint8_t sevenSeg_flsh[] = {0x71, 0x38, 0x6D, 0x76}; const uint8_t sevenSeg_flsh[] = {0x71, 0x38, 0x6D, 0x76};
const uint8_t sevenSeg_file[] = {0x71, 0x30, 0x38, 0x79}; const uint8_t sevenSeg_file[] = {0x71, 0x30, 0x38, 0x79};
void setMPins_Helper(int pin, int status)
{
i2c_io.write(pin, status);
}
void setup() void setup()
{ {
setCpuFrequencyMhz(80); system_update_cpu_freq(SYS_CPU_80MHZ);
WiFi.setAutoReconnect(false);
WiFi.persistent(false);
WiFi.disconnect();
Serial.begin(115200); Serial.begin(115200);
Serial.print("\n\n\n"); Serial.print("\n\n\n");
strcpy(globals.DeviceName, DEVICE_NAME);
snprintf(globals.DeviceName_ID, 42, "%s_%08X", globals.DeviceName, getESPChipID());
if (LoRa_Init())
LoRaPublishTicker.start();
OLED_Init();
pinMode(DIO_FAC_1_TRG, INPUT_PULLUP);
pinMode(DIO_FAC_2_TRG, INPUT_PULLUP);
pinMode(DIO_FAC_3_TRG, INPUT_PULLUP);
#ifdef SERIAL_DEBUG #ifdef SERIAL_DEBUG
Serial.setDebugOutput(true); Serial.setDebugOutput(true);
#endif #endif
if (ina219.begin()) WiFi.persistent(false);
PowerMonitorTicker.start(); WiFi.disconnect();
strcpy(globals.DeviceName, DEVICE_NAME);
snprintf(globals.DeviceName_ID, 42, "%s_%08X", globals.DeviceName, getESPChipID());
if (i2c_io.begin())
{
Serial.printf("Initialized PCF8574-GPIO at Address 0x%02X\n", I2C_IO_ADDRESS);
}
else else
Serial.println("Failed to find INA219 chip"); {
Serial.print("PCF8574-GPIO not Initialized\n");
}
if (ina219.begin())
{
Serial.printf("Initialized INA219-Powermonitor at Address 0x%02X\n", I2C_POWER_ADDRESS);
tmrPowerMonitor.start();
}
else
{
Serial.print("INA219 not Initialized\n");
}
e220ttl.setMPins = &setMPins_Helper;
e220ttl.begin();
ResponseStructContainer c;
c = e220ttl.getConfiguration();
// It's important get configuration pointer before all other operation
Configuration configuration = *(Configuration *)c.data;
Serial.println(c.status.getResponseDescription());
Serial.println(c.status.code);
ResponseStructContainer cMi;
cMi = e220ttl.getModuleInformation();
// It's important get information pointer before all other operation
ModuleInformation mi = *(ModuleInformation *)cMi.data;
Serial.println(cMi.status.getResponseDescription());
Serial.println(cMi.status.code);
// ----------------------- DEFAULT TRANSPARENT WITH RSSI -----------------------
configuration.ADDL = 0x02;
configuration.ADDH = 0x00;
configuration.CHAN = 23;
configuration.SPED.uartBaudRate = UART_BPS_9600;
configuration.SPED.airDataRate = AIR_DATA_RATE_010_24;
configuration.SPED.uartParity = MODE_00_8N1;
configuration.OPTION.subPacketSetting = SPS_200_00;
configuration.OPTION.RSSIAmbientNoise = RSSI_AMBIENT_NOISE_ENABLED;
configuration.OPTION.transmissionPower = POWER_22;
configuration.TRANSMISSION_MODE.enableRSSI = RSSI_ENABLED;
configuration.TRANSMISSION_MODE.fixedTransmission = FT_FIXED_TRANSMISSION;
configuration.TRANSMISSION_MODE.enableLBT = LBT_ENABLED;
configuration.TRANSMISSION_MODE.WORPeriod = WOR_2000_011;
// Set configuration changed and set to not hold the configuration
ResponseStatus rs = e220ttl.setConfiguration(configuration, WRITE_CFG_PWR_DWN_LOSE);
Serial.println(rs.getResponseDescription());
Serial.println(rs.code);
c.close();
printParameters(configuration);
tmrStatusSender.start();
LittleFS.begin(); LittleFS.begin();
@@ -120,11 +185,13 @@ void setup()
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
WiFi.setHostname(globals.DeviceName_ID); WiFi.setHostname(globals.DeviceName_ID);
wifiMulti.addAP(QUOTE(WIFI_SSID), QUOTE(WIFI_PASSWORD)); wifiMulti.addAP(QUOTE(WIFI_SSID), QUOTE(WIFI_PASSWORD));
WiFiMaintainConnectionTicker.start(); tmrWiFiMaintainConnection.start();
#else #else
WiFi.mode(WIFI_AP); WiFi.mode(WIFI_AP);
WiFi.begin(QUOTE(DEVICE_NAME), QUOTE(WIFI_AP_PASSWORD)); WiFi.begin(QUOTE(DEVICE_NAME), QUOTE(WIFI_AP_PASSWORD));
WiFi.setSleep(true); #if defined(ESP32)
WiFi.sleep(true);
#endif
WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_OFF);
#endif #endif
@@ -183,29 +250,47 @@ void setup()
initWebUI(); initWebUI();
EEPROMCyclicPDSTicker.start(); tmrEEPROMCyclicPDS.start();
FactionTicker.start(); tmrFactionTicker.start();
InputGetterTicker.start(); tmrInputGetter.start();
Serial.println("Setup Done"); Serial.println("Setup Done");
} }
void loop() void loop()
{ {
EEPROMCyclicPDSTicker.update(); if (e220ttl.available() > 1)
FactionTicker.update(); {
InputGetterTicker.update(); ResponseContainer rc = e220ttl.receiveMessageRSSI();
PowerMonitorTicker.update(); // Is something goes wrong print error
LoRaPublishTicker.update(); if (rc.status.code != 1)
{
Serial.println(rc.status.getResponseDescription());
}
else
{
// Print the data received
Serial.println(rc.status.getResponseDescription());
Serial.println(rc.data);
Serial.print("RSSI: ");
Serial.println(rc.rssi, DEC);
}
}
tmrEEPROMCyclicPDS.update();
tmrFactionTicker.update();
tmrInputGetter.update();
ArduinoOTA.handle(); ArduinoOTA.handle();
SevenSeg_Output(); SevenSeg_Output();
EEPROM_Process(); EEPROM_Process();
OLED_Process();
tmrStatusSender.update();
tmrPowerMonitor.update();
#ifdef CAPTIVE #ifdef CAPTIVE
dnsServer.processNextRequest(); dnsServer.processNextRequest();
#endif #endif
#ifdef WIFI_CLIENT #ifdef WIFI_CLIENT
WiFiMaintainConnectionTicker.update(); tmrWiFiMaintainConnection.update();
#endif #endif
if (globals.systemStatus == sysStat_Shutdown) if (globals.systemStatus == sysStat_Shutdown)
SystemShutdown(); SystemShutdown();
@@ -259,7 +344,7 @@ void SevenSeg_Output()
} }
} }
void FactionTicker_callback() void tmrCallback_FactionTicker()
{ {
switch (PersistenceData.activeFaction) switch (PersistenceData.activeFaction)
{ {
@@ -289,15 +374,31 @@ void FactionTicker_callback()
} }
} }
void inputGetterTicker_callback() void tmrCallback_InputGetter()
{ {
ProcessKeyCombos(); static bool btnState[3];
static bool btnlastState[3];
btnState[0] = i2c_io.readButton(I2C_IO_BTN_FAC1);
btnState[1] = i2c_io.readButton(I2C_IO_BTN_FAC2);
btnState[2] = i2c_io.readButton(I2C_IO_BTN_FAC3);
ProcessKeyCombos(btnState);
for (int i = 0; i < sizeof(btnState); i++)
{
if (btnlastState[i] != btnState[i])
{
btnlastState[i] = btnState[i];
Serial.printf("Button %d changed to %d\n", i, btnState[i]);
}
}
uint8_t keysPressed = 0; uint8_t keysPressed = 0;
keysPressed = +digitalRead(DIO_FAC_1_TRG) == FAC_1_TRG_PRESSED ? 1 : 0; keysPressed = +btnState[0] == FAC_1_TRG_PRESSED ? 1 : 0;
keysPressed = +digitalRead(DIO_FAC_2_TRG) == FAC_2_TRG_PRESSED ? 1 : 0; keysPressed = +btnState[1] == FAC_2_TRG_PRESSED ? 1 : 0;
keysPressed = +digitalRead(DIO_FAC_3_TRG) == FAC_3_TRG_PRESSED ? 1 : 0; keysPressed = +btnState[2] == FAC_3_TRG_PRESSED ? 1 : 0;
if (keysPressed > 1) if (keysPressed > 1)
{ {
@@ -306,17 +407,103 @@ void inputGetterTicker_callback()
return; return;
} }
if (digitalRead(DIO_FAC_1_TRG) == FAC_1_TRG_PRESSED) if (btnState[0] == FAC_1_TRG_PRESSED)
PersistenceData.activeFaction = FACTION_1; PersistenceData.activeFaction = FACTION_1;
if (digitalRead(DIO_FAC_2_TRG) == FAC_2_TRG_PRESSED) if (btnState[1] == FAC_2_TRG_PRESSED)
PersistenceData.activeFaction = FACTION_2; PersistenceData.activeFaction = FACTION_2;
if (digitalRead(DIO_FAC_3_TRG) == FAC_3_TRG_PRESSED) if (btnState[2] == FAC_3_TRG_PRESSED)
PersistenceData.activeFaction = FACTION_3; PersistenceData.activeFaction = FACTION_3;
} }
void powerMonitorTicker_callback() void printParameters(struct Configuration configuration)
{
Serial.println("----------------------------------------");
Serial.print(F("HEAD : "));
Serial.print(configuration.COMMAND, HEX);
Serial.print(" ");
Serial.print(configuration.STARTING_ADDRESS, HEX);
Serial.print(" ");
Serial.println(configuration.LENGHT, HEX);
Serial.println(F(" "));
Serial.print(F("AddH : "));
Serial.println(configuration.ADDH, HEX);
Serial.print(F("AddL : "));
Serial.println(configuration.ADDL, HEX);
Serial.println(F(" "));
Serial.print(F("Chan : "));
Serial.print(configuration.CHAN, DEC);
Serial.print(" -> ");
Serial.println(configuration.getChannelDescription());
Serial.println(F(" "));
Serial.print(F("SpeedParityBit : "));
Serial.print(configuration.SPED.uartParity, BIN);
Serial.print(" -> ");
Serial.println(configuration.SPED.getUARTParityDescription());
Serial.print(F("SpeedUARTDatte : "));
Serial.print(configuration.SPED.uartBaudRate, BIN);
Serial.print(" -> ");
Serial.println(configuration.SPED.getUARTBaudRateDescription());
Serial.print(F("SpeedAirDataRate : "));
Serial.print(configuration.SPED.airDataRate, BIN);
Serial.print(" -> ");
Serial.println(configuration.SPED.getAirDataRateDescription());
Serial.println(F(" "));
Serial.print(F("OptionSubPacketSett: "));
Serial.print(configuration.OPTION.subPacketSetting, BIN);
Serial.print(" -> ");
Serial.println(configuration.OPTION.getSubPacketSetting());
Serial.print(F("OptionTranPower : "));
Serial.print(configuration.OPTION.transmissionPower, BIN);
Serial.print(" -> ");
Serial.println(configuration.OPTION.getTransmissionPowerDescription());
Serial.print(F("OptionRSSIAmbientNo: "));
Serial.print(configuration.OPTION.RSSIAmbientNoise, BIN);
Serial.print(" -> ");
Serial.println(configuration.OPTION.getRSSIAmbientNoiseEnable());
Serial.println(F(" "));
Serial.print(F("TransModeWORPeriod : "));
Serial.print(configuration.TRANSMISSION_MODE.WORPeriod, BIN);
Serial.print(" -> ");
Serial.println(configuration.TRANSMISSION_MODE.getWORPeriodByParamsDescription());
Serial.print(F("TransModeEnableLBT : "));
Serial.print(configuration.TRANSMISSION_MODE.enableLBT, BIN);
Serial.print(" -> ");
Serial.println(configuration.TRANSMISSION_MODE.getLBTEnableByteDescription());
Serial.print(F("TransModeEnableRSSI: "));
Serial.print(configuration.TRANSMISSION_MODE.enableRSSI, BIN);
Serial.print(" -> ");
Serial.println(configuration.TRANSMISSION_MODE.getRSSIEnableByteDescription());
Serial.print(F("TransModeFixedTrans: "));
Serial.print(configuration.TRANSMISSION_MODE.fixedTransmission, BIN);
Serial.print(" -> ");
Serial.println(configuration.TRANSMISSION_MODE.getFixedTransmissionDescription());
Serial.println("----------------------------------------");
}
void tmrCallback_StatusSender()
{
struct
{
MessageType_t type = "STATUS";
MessageStatus_t status;
} __attribute__((packed)) sendStatus;
sendStatus.status.nodeid = 0x0002;
sendStatus.status.millis = millis();
sendStatus.status.faction_active = 1;
sendStatus.status.faction_1_timer = 0xBBBBBBBB;
sendStatus.status.faction_2_timer = 0xCCCCCCCC;
sendStatus.status.faction_3_timer = 0xDDDDDDDD;
ResponseStatus rs = e220ttl.sendFixedMessage(0xFF, 0xFF, 23, (byte *)&sendStatus, sizeof(sendStatus));
Serial.println(rs.getResponseDescription());
}
void tmrCallback_PowerMonitor()
{ {
// loadvoltage and percentage is global, because of battery Monitoring // loadvoltage and percentage is global, because of battery Monitoring
@@ -326,15 +513,15 @@ void powerMonitorTicker_callback()
const int bat_max_3s = 1260; const int bat_max_3s = 1260;
float shuntvoltage = 0; float shuntvoltage = 0;
float current_mA = 0; //float current_mA = 0;
float busvoltage = 0; float busvoltage = 0;
float power_mW = 0; //float power_mW = 0;
int battery_level = 0; int battery_level = 0;
shuntvoltage = ina219.getShuntVoltage_mV(); shuntvoltage = ina219.getShuntVoltage_mV();
busvoltage = ina219.getBusVoltage_V(); busvoltage = ina219.getBusVoltage_V();
current_mA = ina219.getCurrent_mA(); //current_mA = ina219.getCurrent_mA();
power_mW = ina219.getPower_mW(); //power_mW = ina219.getPower_mW();
globals.loadvoltage = busvoltage + (shuntvoltage / 1000); globals.loadvoltage = busvoltage + (shuntvoltage / 1000);
switch (ConfigData.batteryType) switch (ConfigData.batteryType)
{ {
@@ -359,13 +546,13 @@ void powerMonitorTicker_callback()
// Serial.printf("Power: %f mW\n", power_mW); // Serial.printf("Power: %f mW\n", power_mW);
} }
void EEPROMCyclicPDS_callback() void tmrCallback_EEPROMCyclicPDS()
{ {
StorePersistence_EEPROM(); StorePersistence_EEPROM();
} }
#ifdef WIFI_CLIENT #ifdef WIFI_CLIENT
void wifiMaintainConnectionTicker_callback() void tmrCallback_WiFiMaintainConnection()
{ {
static uint32_t WiFiFailCount = 0; static uint32_t WiFiFailCount = 0;
const uint32_t WiFiFailMax = 20; const uint32_t WiFiFailMax = 20;
@@ -390,7 +577,7 @@ void toggleWiFiAP(boolean shutdown)
{ {
WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_OFF);
#ifdef WIFI_CLIENT #ifdef WIFI_CLIENT
WiFiMaintainConnectionTicker.stop(); tmrWiFiMaintainConnection.stop();
#endif #endif
} }
else if (shutdown == false) else if (shutdown == false)
@@ -399,7 +586,7 @@ void toggleWiFiAP(boolean shutdown)
WiFi.softAPConfig(IPAddress(WIFI_AP_IP_GW), IPAddress(WIFI_AP_IP_GW), IPAddress(255, 255, 255, 0)); WiFi.softAPConfig(IPAddress(WIFI_AP_IP_GW), IPAddress(WIFI_AP_IP_GW), IPAddress(255, 255, 255, 0));
WiFi.softAP(globals.DeviceName_ID, QUOTE(WIFI_AP_PASSWORD)); WiFi.softAP(globals.DeviceName_ID, QUOTE(WIFI_AP_PASSWORD));
#ifdef WIFI_CLIENT #ifdef WIFI_CLIENT
WiFiMaintainConnectionTicker.stop(); tmrWiFiMaintainConnection.stop();
#endif #endif
} }
} }
@@ -420,7 +607,27 @@ void SetBatteryType(batteryType_t type)
} }
} }
void ProcessKeyCombos() void OverrideDisplay(const uint8_t *message, uint32_t time)
{
DisplayOverrideFlag = millis() + time;
DisplayOverrideValue = (uint8_t *)message;
}
uint32_t getESPChipID()
{
#if defined(ESP8266)
return ESP.getChipId();
#elif defined(ESP32)
uint32_t chipId;
for (int i = 0; i < 17; i = i + 8)
{
chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
}
return chipId;
#endif
}
void ProcessKeyCombos(bool *btnState)
{ {
typedef enum typedef enum
{ {
@@ -434,32 +641,32 @@ void ProcessKeyCombos()
static uint8_t keyCount_Fac2 = 0; static uint8_t keyCount_Fac2 = 0;
static keyStatus_t keyStatus_Fac3 = KEY_RELEASED; static keyStatus_t keyStatus_Fac3 = KEY_RELEASED;
if (digitalRead(DIO_FAC_3_TRG) == FAC_3_TRG_PRESSED) if (btnState[2] == FAC_3_TRG_PRESSED)
{ {
keyStatus_Fac3 = KEY_PRESSED; keyStatus_Fac3 = KEY_PRESSED;
// Process FactionKey 1 ComboCounter // Process FactionKey 1 ComboCounter
if (digitalRead(DIO_FAC_1_TRG) == FAC_1_TRG_PRESSED && keyStatus_Fac1 == KEY_RELEASED) if (btnState[0] == FAC_1_TRG_PRESSED && keyStatus_Fac1 == KEY_RELEASED)
{ {
keyStatus_Fac1 = KEY_PRESSED; keyStatus_Fac1 = KEY_PRESSED;
keyCount_Fac1++; keyCount_Fac1++;
} }
if (digitalRead(DIO_FAC_1_TRG) != FAC_1_TRG_PRESSED) if (btnState[0] != FAC_1_TRG_PRESSED)
keyStatus_Fac1 = KEY_RELEASED; keyStatus_Fac1 = KEY_RELEASED;
// Process FactionKey 2 ComboCounter // Process FactionKey 2 ComboCounter
if (digitalRead(DIO_FAC_2_TRG) == FAC_2_TRG_PRESSED && keyStatus_Fac2 == KEY_RELEASED) if (btnState[1] == FAC_2_TRG_PRESSED && keyStatus_Fac2 == KEY_RELEASED)
{ {
keyStatus_Fac2 = KEY_PRESSED; keyStatus_Fac2 = KEY_PRESSED;
keyCount_Fac2++; keyCount_Fac2++;
} }
if (digitalRead(DIO_FAC_2_TRG) != FAC_2_TRG_PRESSED) if (btnState[1] != FAC_2_TRG_PRESSED)
keyStatus_Fac2 = KEY_RELEASED; keyStatus_Fac2 = KEY_RELEASED;
} }
if (digitalRead(DIO_FAC_3_TRG) != FAC_3_TRG_PRESSED && keyStatus_Fac3 == KEY_PRESSED) if (btnState[2] != FAC_3_TRG_PRESSED && keyStatus_Fac3 == KEY_PRESSED)
{ {
Serial.printf("KeyCombo 1: %d | 2: %d\n", keyCount_Fac1, keyCount_Fac2); Serial.printf("KeyCombo 1: %d | 2: %d\n", keyCount_Fac1, keyCount_Fac2);
@@ -477,37 +684,3 @@ void ProcessKeyCombos()
keyStatus_Fac3 = KEY_RELEASED; keyStatus_Fac3 = KEY_RELEASED;
} }
} }
void OverrideDisplay(const uint8_t *message, uint32_t time)
{
DisplayOverrideFlag = millis() + time;
DisplayOverrideValue = (uint8_t *)message;
}
uint32_t getESPChipID()
{
uint32_t chipId;
for (int i = 0; i < 17; i = i + 8)
{
chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i;
}
return chipId;
}
#
void LoRaPublish_callback()
{
StaticJsonDocument<200> doc;
doc["lipo"] = globals.battery_level;
doc["afact"] = PersistenceData.activeFaction;
doc["fac1"] = PersistenceData.faction_1_timer;
doc["fac2"] = PersistenceData.faction_2_timer;
doc["fac3"] = PersistenceData.faction_3_timer;
LoRa.beginPacket();
serializeJson(doc, LoRa);
LoRa.endPacket();
Serial.printf("Sendet LoRa-Status Package\n");
}

View File

@@ -4,11 +4,12 @@
#include <Arduino.h> #include <Arduino.h>
#include <FS.h> #include <FS.h>
#include <LittleFS.h> #include <LittleFS.h>
#include <AsyncTCP.h> #include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h> #include <ESPAsyncWebServer.h>
#include "config.h" #include "config.h"
#include "globals.h" #include "globals.h"
#include "dtc.h" #include "dtc.h"
#include "defaults.h"
void initWebUI(); void initWebUI();

View File

@@ -1,5 +1,5 @@
This directory is intended for PlatformIO Unit Testing and project tests. This directory is intended for PlatformIO Test Runner and project tests.
Unit Testing is a software testing method by which individual units of Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated source code, sets of one or more MCU program modules together with associated
@@ -8,4 +8,4 @@ determine whether they are fit for use. Unit testing finds problems early
in the development cycle. in the development cycle.
More information about PlatformIO Unit Testing: More information about PlatformIO Unit Testing:
- https://docs.platformio.org/page/plus/unit-testing.html - https://docs.platformio.org/en/latest/advanced/unit-testing/index.html