LoRaWan Functionality


I am running into some problems finding a Particle compatible LoRaWAN library. I would like to connect to MachineQ which is a LoRaWAN service from Comcast but which uses the same standard as the The Things Network.

I found a library for the Particle - LMIC and created a sketch using one of the examples provided. Here is a link to the Web IDE Project. The problem is that the code will not compile giving the following two errors:

Since this is a public library, I can’t edit the library to fix these. Any advice?

If someone has a Particle sketch for The Things Network or any other LoRa service, please let me know.



1 Like

Let me ping someone that might be able to help, @rickkas7, @ParticleD, or @mstanley are you able to assist?


Thank you as I would like to move my development back to Particle - on an Adafruit Feather now. Also, I suspect others will hit on the idea of Particle + LoRaWan with the new Mesh devices.




Hi Chip.

Not sure if you got this sorted but I had a similar need.
Let me preface this by stating i’m very much learning here so my working solution is likely more luck than talent but FWIW…

I pulled down the LMIC-Arduino library you referred to and replaced the hal source from here.

I also had to grab some other replacement source files to support the AU-915 frequency plan.

I then upload as a private library so I could use it with the Particle Web IDE.

Using this as the basis, I managed to get an RFM95W FeatherWing working with one of my Xenons.

This Xenon subscribes to another Xenon with a DHT11 (Grove Kit) publishing via the Mesh function and (after some payload manipulation) dumps a couple of metrics (temp / hum) up to The Things Network.

I’m guessing this is what you were also looking to achieve :slight_smile:
I also turned off the mesh gateway (Argon) and it appeared to still hang together - provided you can put up with the green flashing panic lights of course :wink:

If you haven’t already arrived at the same outcome - hope this helps you out.



Very cool you got this working on the Mesh devices! Your the first to do it and share on the forum.

Where is map of USA coverage of “The Things Network”?

Probably just first to share I’m tipping.
I’m from Australia and a few days over Christmas / NY in the mid 40 degree C made indoor activities like this more appealing… Overachievers like Chris Hemsworth and Hugh Jackman have promoted an entirely unrealistic portrayal of Aussie resilience :neutral_face:

Coverage for US is probably best checked here.

A general view of all active gateways is on the map at the bottom of the landing page for TTN.

1 Like


Thank you for responding and sorry it took me so long to look at this. This is excellent work and I hope to have the time to return my focus to this project soon.

I bought a bunch of the new Mesh boards but, probably need to wait for them to mature a bit before I start playing with them. In particular, all my devices live on limited power so Sleep is a must. Still, the combination of the Argon and LoRa feels very compelling to me. As I deploy my sensors in more State Parks, I can see the limitations of cellular.

Thanks, Chip

so essentially what you’ve built is a (particle) mesh to lorawan forwarder, right?
(consciously avoiding the word ‘gateway’ as this means something different in lorawan-world…) that’s great, i failed at it either while testing…

as what i would be desperately longing for is a particle-based lorawan gateway - like an electron or boron receiving packets via lora and forwarding it to a lorawan network (like TTN) - as this could make a really great solution for remote places where really low power consumption is essential.

still hoping,


I agree this is very cool. I was thinking about a different use for the Mesh part - installation and configuration. Imagine if you are installing these devices at a remote location. Using an app on your phone and connecting via bluetooth might be a better choice if the installation involves setting configurations or testing.



TTN coverage is spotty. But it is community driven so you are able to stand up your own gateways. Or even setup a private network using something like LoRa Server (from Cablelabs),

Or check in with Comcast’s machineQ or Senet’s network offerings.

@Chip … you have access to machineQ’s network? How did you find the enrollment process?

@th3zapp3r … why is mesh needed for your use case? Seems sensor + LoRaWAN end device directly uplinking over LoRaWAN would be simpler?

A bit of caution here. LoRaWAN’s sweet-spot is end-device upload of a few hundred bytes daily at long range (kms) and using little power at very low data rates. Frequently uplink-ing from the higher data rate mesh could easily overwhelm LoRaWAN.

1 Like


Yes, and it was fairly straightforward. The only issue is that there seems to be some slight differences between MachineQ and TTN which I have not yet pinned down. So, my device connects but not as quickly as I like.


Interesting. I did not realize that machineQ was already operating in your area.


Well, it is interesting.

  1. Short term, they don’t provide coverage in Raleigh but, they sent me a Gateway.

  2. Long term, MachineQ is owned by Comcast. According to Chris Gammel on the Amp Hour, Comcast plans to enable all their residential Cable modems to be MachineQ gateways so, coverage could expand quickly.


Yes, that confirms my understanding. A GW per Comcast residence, particularly in dense urban, will possibly enable sub 50 m LoRaWAN geolocation capability.


Did you happen to make your modified library public? If not, can you please do that, including any fixes to the example code? I’ve been trying to get the LMIC library to work and keep getting compile errors using the Particle Web IDE.

I do have the basic LoRa library working fine (RF9X-RK providing RH_RF95) but I want to get TTN working next. Having a functional example to start with would be very helpful.

1 Like

Old thread but FWIW:

To be able to compile and run and connect with TheThingsNetwork
on Particle Argon, I had to:

in src/lmic/config.h
//#define LMIC_PRINTF_TO Serial

in src/hal/hal.cpp
//#define _GNU_SOURCE 1 // For fopencookie
//#include <stdio.h>
//#undef _GNU_SOURCE
and removing the entire 46 line block starting around line 211 with
#if defined(LMIC_PRINTF_TO)
#if defined(AVR)
#endif // !defined(AVR)
#endif // defined(LMIC_PRINTF_TO)

Lastly, I used an Adafruit GPS featherwing (part 3133) and wired
CS - A
DI01 to D8 (this last connection is necessary to get the
sx1276 hoperf chip on the featherwing to be compatible with
TheThingsNetwork as per
See the section below
// Pin mapping
const lmic_pinmap lmic_pins
to see how these connections are programmed



Thank you for sharing. I may be taking another look at LoRA soon and will use your advice to help get started with the Gen 3 devices.