I’ve been troubleshooting connection problems for a few hours on a Boron and though it may help others if I take some notes here of what I’ve been finding. Well, in truth, I’m posting this so I can find it again in a few months when I have forgotten it
The notes below pertain to an app that uses
if you’re not using that: ignore.
Everything here was tested using a custom instrumented build of DeviceOS 1.3.0_alpha.1. If you’re using a different version of DeviceOS, expect something different!
Also, this is about a Boron that is supposed to be a gateway. Some of it probably applies to an Argon configured as a gateway as well. Some of it probably also applies to a pure mesh node. YMWV!
Cellular.connect()is called to bring up the cell connection and later
Particle.connect()is called, the mesh is never enabled. That’s because
Cellular.connectstarts up networking but only enables the cell interface. Later,
Particle.connectsees that networking is enabled and doesn’t bother to enable other interfaces. So, if you call
XXX.connect()for some network, you have to call it also for the other networks you want enabled, don’t rely on
Particle.connect. However, if you just call
Particle.connectoff the bat then all interfaces are enabled. That’s probably good in a way, but confusing/inconsistent.
Mesh.connect()activates the Mesh connection if
Mesh.on()is a no-op. If you call
Mesh.off()to save power, don’t call
Mesh.on()to re-enable it. Call
Mesh.connect()instead. Obvious, right?
- The border router functionality is not enabled until the cloud can be contacted to query for permission, this happens in the NetworkManager. So if your GW comes up and can’t talk to particle’s servers but can connect to the internet it will not turn on the gateway feature, hence other mesh nodes won’t be able to connect to internet servers. If you don’t like that you probably could set
BorderRouterPermission::YESat line 124 of
- Do not base decisions on
XX.connecting()because that returns true if any interface is connecting or up. For example, after calling
Mesh.connect()you will see
Cellular.connecting()returning true. I had code like
if (!Mesh.connecting()) Mesh.connect()
if (!Cellular.connecting()) Cellular.connect()
and one of these connect calls never happened due to this “feature”.
- If you don’t call
Particle.connect()your boron (or argon?) will not act as a border router (gateway). This means that connected mesh devices cannot talk to other servers on the Internet (or to Particle).
May your connections work!