element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Save The Bees Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Save The Bees Design Challenge
  • More
  • Cancel
Save The Bees Design Challenge
Blog Bee Healthy - Blog 3: The Things Stack Setup
  • Blog
  • Forum
  • Documents
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Save The Bees Design Challenge to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ralphjy
  • Date Created: 13 Feb 2023 12:41 AM Date Created
  • Views 1054 views
  • Likes 14 likes
  • Comments 3 comments
  • save the bees
  • savethebeesch
  • the things stack
  • lorawan
Related
Recommended

Bee Healthy - Blog 3: The Things Stack Setup

ralphjy
ralphjy
13 Feb 2023

I plan to use The Things Network (TTN) as the cloud interface to my Node-Red Dashboard, so I needed to verify that it was working properly.  Back in 2019 I had won a Things Network Kickstarter Gateway in the Project14 IoT: In the Cloud contest.  Early last year I spent some time migrating the gateway from TTN V2 to V3 (The Things Stack).  I've had the gateway powered down the latter part of the year, so I powered it back up - but it failed to activate.

image

I tried all the normal troubleshooting steps - reset and re-entered all of the configuration info (Gateway ID, Gateway Key, WiFi info, Account Server), but could not get it to activate.  It was connecting to WiFi, but not connecting to The Things Stack.  I considered trying to activate over wired ethernet, but decided to try creating a new gateway in the console - and that worked!

You can see the gateway that I created last year and the new one (tslo) below:

image

And the new configuration below:

image

Gateway traffic:

image

Next, I need to create the application.  I am going to create a test flow from the sensor all the way through to the Node-Red Dashboard as a "pipe cleaner" so that everything is working before trying to incorporate the final hardware configuration.  I decided to use a Nicla Sense mounted as a shield on a MKR 1300 as the sensor.   In this configuration the boards communicate via I2C (Nicla Sense is the peripheral).  I also intend to try using the Nicla Vision on the same bus, but I haven't seen anyone do that before - so hopefully no surprises when I try that.

I discovered that I had a MKR 1310, so I'll use that instead of the MKR 1300.  When the hardware kit arrives, I'll use that MKR 1310 as a backup in case I need to separate the Nicla Sense and Nicla Vision (I'll elaborate on the hardware setup and device programming in a separate blog post). 

Here is the configuration setup of the Application on the Things Stack:

image

Add an end device (MKR 1310):

image

Connect to device through gateway:

image

Test case passing Temperature and Humidity readings from Nicla Sense (mounted on MKR 1310):

image

Add the MQTT integration to the application.  The Things Stack provides an MQTT Server that will manage the Uplink and Downlink payload and configuration data.

image

image

Create a new flow on Node-Red Server running on an RPi 4 on my LAN.  

image

Connect to TTN MQTT Server.  A secure connection would just require switching the Port to 8883.

image

Create a Javascript object from the payload JSON string.  This makes it easier to extract the sensor data from the payload.

image

The Node-Red Dashboard (haven't figured out how to left justify a single group in the window - there will be addtional groups in the final design).

image

So, the basic data flow is working.  I need to work on getting data for an ML model while I wait for the hardware kit.  Getting the model to work with the Nicla Vision is going to be the biggest challenge...

  • Sign in to reply
Parents
  • DAB
    DAB over 2 years ago

    Good start.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 2 years ago

    Good start.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube