You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/shields/portenta-vision-shield/tutorials/user-manual/content.md
+62-2Lines changed: 62 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -748,10 +748,70 @@ Run the script and the current date and time will be printed in the OpenMV IDE S
748
748
749
749
### LoRa® (ASX00026)
750
750
751
-
The **Vision Shield - LoRa®** can extend our project connectivity by leveraging it LoRa® module for long-range communication in remote areas with a lack of internet access.
751
+
The **Vision Shield - LoRa®** can extend our project connectivity by leveraging it LoRa® module for long-range communication in remote areas with a lack of internet access. Powered by the Murata CMWX1ZZABZ module which contains an STM32L0 processor along with a Semtech SX1276 Radio.
752
752
753
753

754
754
755
755
First, connect the Vision Shield - LoRa® to the Portenta H7. Attach the LoRa® antenna to its respective connector. Now connect the USB-C® cable to the Portenta H7 and your computer.
756
756
757
-
Now you are ready to test the connectivity with the following Python script. This example lets you connect to The Things Network using LoRaWAN® and send a `Hello World` message to it.
757
+
Now you are ready to test the connectivity with the following Python script. This example lets you connect to The Things Network using LoRaWAN® and send a `Hello World` message to it.
# You can catch individual errors like timeout, rx etc...
778
+
except LoraErrorTimeout as e:
779
+
print("Something went wrong; are you indoor? Move near a window and retry")
780
+
print("ErrorTimeout:", e)
781
+
except LoraErrorParam as e:
782
+
print("ErrorParam:", e)
783
+
784
+
print("Connected.")
785
+
lora.set_port(3)
786
+
787
+
try:
788
+
if lora.send_data("HeLoRA world!", True):
789
+
print("Message confirmed.")
790
+
else:
791
+
print("Message wasn't confirmed")
792
+
793
+
except LoraErrorTimeout as e:
794
+
print("ErrorTimeout:", e)
795
+
796
+
# Read downlink messages
797
+
whileTrue:
798
+
if lora.available():
799
+
data = lora.receive_data()
800
+
if data:
801
+
print("Port: "+ data["port"])
802
+
print("Data: "+ data["data"])
803
+
lora.poll()
804
+
sleep_ms(1000)
805
+
```
806
+
807
+
Find the frequency used in your country for The Things Network on this [list](https://www.thethingsnetwork.org/docs/lorawan/frequencies-by-country/) and modify the parameter in the script with the following function.
808
+
809
+
```python
810
+
lora = Lora(band=BAND_AU915, poll_ms=60000, debug=False) # change the band with yours e.g BAND_US915
0 commit comments