diff --git a/arduino-lora-vision-shield/CHANGELOG.md b/arduino-lora-vision-shield/CHANGELOG.md new file mode 100644 index 00000000..393db04c --- /dev/null +++ b/arduino-lora-vision-shield/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +## 1.0.0 - 2026-02-18 + +- First version of plugin \ No newline at end of file diff --git a/arduino-lora-vision-shield/LICENSE.md b/arduino-lora-vision-shield/LICENSE.md new file mode 100644 index 00000000..bffeef34 --- /dev/null +++ b/arduino-lora-vision-shield/LICENSE.md @@ -0,0 +1,7 @@ +Copyright 2026 Thinger.io + +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. \ No newline at end of file diff --git a/arduino-lora-vision-shield/README.md b/arduino-lora-vision-shield/README.md new file mode 100644 index 00000000..9bf2b112 --- /dev/null +++ b/arduino-lora-vision-shield/README.md @@ -0,0 +1,57 @@ +# Portenta Vision Shield LoRa® + +The Arduino Portenta Vision Shield LoRa® consists of a 320x320 pixels camera sensor and two onboard microphones for directional sound detection. It allows you to run embedded computer vision applications. The Vision Shield LoRa® has been designed to work with the Arduino Portenta H7. + +## Features + +- **Camera Sensor**: 320x320 pixels with high sensitivity 3.6μ BrightSense™ pixel technology +- **Audio Capture**: 2x MP34DT05 microphones for directional sound detection +- **LoRaWAN Connectivity**: 868/915 MHz ABZ-093 LoRa module +- **Power Supply**: 3.3V supplied by Portenta H7/C33 +- **Embedded Computer Vision**: Optimized for AI and machine learning applications at the edge + +## Use Cases + +- Visual inspection and quality control +- Predictive maintenance with image and audio analysis +- Security and surveillance applications +- Industrial automation with computer vision +- Environmental monitoring with image capture +- Edge AI applications combining vision and sound + +## Thinger.io Integration + +The Portenta Vision Shield LoRa® can be integrated with Thinger.io through LoRaWAN connectivity, enabling remote monitoring and control of computer vision applications with cloud-based data management. + +## Requirements + +A LoRaWAN server is required to communicate the Arduino Portenta Vision Shield LoRa® into Thinger.io, some options are: + +- [The Things Stack](https://www.thethingsindustries.com/stack/) +- [LORIOT](https://loriot.io/) +- [ChirpStack](https://www.chirpstack.io/) + +Alongside, the corresponding plugin for the selected LoRaWAN server needs to be installed in your Thinger.io instance. + +## Get Started + +### Installation + +Look for the plugin in the [Thinger.io Plugin Store](https://marketplace.thinger.io/) and install it in your Thinger.io instance. Once the plugin is installed a new Product will be created for this device. + +### Configuration + +The Product is already preconfigured, check that the auto provision prefix matches the one selected in your LoRaWAN server plugin in Thinger.io, or change it to your desire. + +### Usage + +Start sending uplinks for autoprovisioning devices and buckets. +This product also provides a predefined dashboard and downlinks. + +## Additional Resources + +Arduino resources can be found at: + +- [Portenta Vision Shield Documentation](https://docs.arduino.cc/tutorials/portenta-vision-shield/user-manual) +- [Datasheet](https://docs.arduino.cc/resources/datasheets/ASX00021-ASX00026-datasheet.pdf) +- [Thinger docs](https://docs.thinger.io) \ No newline at end of file diff --git a/arduino-lora-vision-shield/plugin.json b/arduino-lora-vision-shield/plugin.json new file mode 100644 index 00000000..3aaf9e09 --- /dev/null +++ b/arduino-lora-vision-shield/plugin.json @@ -0,0 +1,114 @@ +{ + "name": "arduino_lora_vision_shield", + "version": "1.0.0", + "description": "The Arduino Portenta Vision Shield LoRa® consists of a 320x320 pixels camera sensor and two onboard microphones for directional sound detection. It allows you to run embedded computer vision applications. The Vision Shield LoRa® has been designed to work ", + "author": "Thinger.io", + "license": "MIT", + "repository": { + "type": "git", + "url": "https://github.com/thinger-io/plugins.git", + "directory": "arduino-lora-vision-shield" + }, + "metadata": { + "name": "Arduino LORA-VISION-SHIELD", + "description": "The Arduino Portenta Vision Shield LoRa® consists of a 320x320 pixels camera sensor and two onboard microphones for directional sound detection. It allows you to run embedded computer vision applications. The Vision Shield LoRa® has been designed to work ", + "image": "assets/camera_shield1.png", + "category": "devices", + "vendor": "arduino" + }, + "resources": { + "products": [ + { + "description": "The Arduino Portenta Vision Shield LoRa® consists of a 320x320 pixels camera sensor and two onboard microphones for directional sound detection. It allows you to run embedded computer vision applications. The Vision Shield LoRa® has been designed to work ", + "enabled": true, + "name": "Arduino LORA-VISION-SHIELD", + "product": "arduino_lora_vision_shield", + "profile": { + "api": { + "downlink": { + "enabled": true, + "handle_connectivity": false, + "request": { + "data": { + "path": "/downlink", + "payload": "{\n \"data\" : \"{{payload.data=\"\"}}\",\n \"port\" : {{payload.port=85}},\n \"priority\": {{payload.priority=3}},\n \"confirmed\" : {{payload.confirmed=false}},\n \"uplink\" : {{property.uplink}} \n}", + "payload_function": "", + "payload_type": "", + "plugin": "{{property.uplink.source}}", + "target": "plugin_endpoint" + } + } + }, + "uplink": { + "device_id_resolver": "getId", + "enabled": true, + "handle_connectivity": true, + "request": { + "data": { + "payload": "{{payload}}", + "payload_function": "", + "payload_type": "source_payload", + "resource_stream": "uplink", + "target": "resource_stream" + } + } + } + }, + "autoprovisions": { + "device_autoprovisioning": { + "config": { + "mode": "pattern", + "pattern": "arduino-vision-.*" + }, + "enabled": true + } + }, + "buckets": { + "arduino_lora_vision_shield_data": { + "backend": "mongodb", + "data": { + "payload": "{{payload}}", + "payload_function": "decodeThingerUplink", + "payload_type": "source_payload", + "resource": "uplink", + "source": "resource", + "update": "events" + }, + "enabled": true, + "retention": { + "period": 3, + "unit": "months" + }, + "tags": [] + } + }, + "code": { + "code": "function decodeThingerUplink(thingerData) {\n // 0. If data has already been decoded, we will return it\n if (thingerData.decodedPayload) return thingerData.decodedPayload;\n \n // 1. Extract and Validate Input\n // We need 'payload' (hex string) and 'fPort' (integer)\n const hexPayload = thingerData.payload || \"\";\n const port = thingerData.fPort || 1;\n\n // 2. Convert Hex String to Byte Array\n const bytes = [];\n for (let i = 0; i < hexPayload.length; i += 2) {\n bytes.push(parseInt(hexPayload.substr(i, 2), 16));\n }\n\n // 3. Dynamic Function Detection and Execution\n \n // CASE A: (The Things Stack v3)\n if (typeof decodeUplink === 'function') {\n try {\n const input = {\n bytes: bytes,\n fPort: port\n };\n var result = decodeUplink(input);\n \n if (result.data) return result.data;\n\n return result; \n } catch (e) {\n console.error(\"Error inside decodeUplink:\", e);\n throw e;\n }\n }\n\n // CASE B: Legacy TTN (v2)\n else if (typeof Decoder === 'function') {\n try {\n return Decoder(bytes, port);\n } catch (e) {\n console.error(\"Error inside Decoder:\", e);\n throw e;\n }\n }\n\n // CASE C: No decoder found\n else {\n throw new Error(\"No compatible TTN decoder function (decodeUplink or Decoder) found in scope.\");\n }\n}\n\n\n// TTN decoder\n// This is used with the LoRa LED/ON off basic sketch\n// Please refer to https://create.arduino.cc/editor/FT-CONTENT/043f42fb-2b04-4cfb-a277-b1a3dd5366c2/preview\n\nvar LED_STATES = ['off', 'on']\n\nfunction decodeUplink(input) {\n var data = {};\n data.ledState = LED_STATES[input.bytes[0]];\n return {\n data: data,\n };\n}\n\nfunction encodeDownlink(input) {\n var i = LED_STATES.indexOf(input.data.ledState);\n if (i === -1) {\n return {\n errors: ['unknown led state'],\n };\n }\n return {\n bytes: [i],\n fPort: 1,\n };\n}\n\nfunction decodeDownlink(input) {\n return {\n data: {\n ledState: LED_STATES[input.bytes[0]]\n }\n }\n}\n", + "environment": "javascript", + "storage": "", + "version": "1.0" + }, + "properties": { + "uplink": { + "data": { + "payload": "{{payload}}", + "payload_function": "", + "payload_type": "source_payload", + "resource": "uplink", + "source": "resource", + "update": "events" + }, + "default": { + "source": "value" + }, + "enabled": true + } + } + }, + "_resources": { + "properties": [] + } + } + ] + } +} \ No newline at end of file