element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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
Internet of Things
  • Technologies
  • More
Internet of Things
Blog Test LoRaWan Thing code ported for Raspberry Pico
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Internet of Things requires membership for participation - click to join
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Jan Cumps
  • Date Created: 25 Jun 2024 5:13 PM Date Created
  • Views 413 views
  • Likes 6 likes
  • Comments 1 comment
  • sub-1ghz
  • the things network
  • lorawan
  • pico
  • ttn
  • rp2040
Related
Recommended

Test LoRaWan Thing code ported for Raspberry Pico

Jan Cumps
Jan Cumps
25 Jun 2024

Semtech has example code for their LoRaWan SX1276 sub-1 GHz radio. I've used it with an MBED project in the past.
In this post, I'm trying to make their Arduino Shield work with an a RP2040. And have it send data to The Things Network.

image

components:

  • RP2040, e.g. a Raspberry Pico, or a XIAO Pico
  • SX1276 shield
  • sub-1 GHz antenna with sma connector
  • wire
  • optional: picoprobe

Connections made between XIAO RP2040 and Semtech shield:

image

software:

  • existing port of Semtech embed lib.
  • a working development setup, with the Pico C/C++ SDK

My goal was just to see if I could make the design talk to The Things Network. The short answer: yes, but software isn't ready for prime use.

I forked the Pico port on Github and configured it for XIAO. And for Europe's bandwidth of 868 MHz.
My fork only has a few changes:

  • I set Europe / 868 MHz as default
  • Pins adapted to a XIAO board. Check the original code if you want to use a Pico

image

What works:

  • project builds without problems
  • registering the thing with TTN APB protocol works
  • Data exchange works

image

What has issues:

  • registering with OTAA protocol: TTN sees and accepts the thing. But the thing doesn't notice it, and keeps sending join requests
  • after a run, the device is in a state that is not correct. Any future attempt to join fails. Unless you run one of its utilities that erases a part of Pico flash.
  • after a successful join, a limited set of uplinks (about 10) succeed. Then they start to fail.

image

This is a bit of a spotty blog. Some success, some failures. I spent a lot of time to reach this point. That leaves less time to  write beautiful articles.
But I don't want to let this effort go to waist. It can serve as my starting point, for the next time I try to get this working...

n.b.: related post, using the same software port:  Pico IoT LoRaWAN EasyNode 

  • Sign in to reply
  • shabaz
    shabaz 10 months ago

    Hi Jan,

    Great progress. Definitely an unusual issue, I can't think why it would stop after an amount of uplink messages (maybe TTN is throttling for some weird reason, e.g. thinks you're doing DOS). The stack source needs some TLC too, with a proper way to pause and restart it, and let the user save the variables (in Flash or otherwise) and not silently occupy a portion of the Flash as it does today, Anyway, hopefully anyone reading this who has also attempted it, will eventually chime in and offer some advice.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
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