Particle Mesh 101 for Dummies


New to programming. Where and/or how is the best way/or place to start to learn coding needed to enhance my Particle Mesh Projects? Github is great place to find existing code, but it’s all Greek until you learn the basics.


That’s a tough question.
Can you provide at least some frame of reference what you know about programming so far?
Beginning at the definitions of what variables and instructions are is definetly beyond the scope of this forum. For that kind of basics YouTube has some easy starter videos or if you are more the converntional type start with any simple “How To write C code” book for the fundamental concepts.


i found it helpful to read example code for projects posted on this forum and in the various tutorials. think of a project you would like to do and search either here or through google. once you find something , print it out. this gives you something to, as a suggestion, take various marking pens/pencils and identify the code structure and then follow the code flow. may be old school but this method has been useful to me over the years beyond only dealing with a code base on a monitor. although with large projects it’s not practical.


The start on 1 project should be simple. An input on an Argon Gateway > Xenon digital High > close a relay. At some point will need to build a smart phone app to bluetooth pair with an Argon or Xenon >digital Highs on end points > close relays.
2nd Project: Have built or assisted in building SCIP (Structural Concrete Insulated Panels) projects. The panels have been used for years but not much actually temperature data has been collected on the performance of the panels. The panels have a 3" to 5" of Expanded Polystyrene core with 1" to 1-1/2" of concrete sprayed to each side. Will be placing temperature probes in the outside and inside layer of concrete on either side of the EPS. Will also take temperature and humidity readings outside and inside the structure.


That should be doable with only the reference docs and the samples provided for each command

This would be digitalRead()

This is a two side effort
Gatewas: Mesh.publish()
Xenon: Mesh.subscribe()

is done via digitalWrite()

And the final part …

… is less of a programming challenge than an electronic one depending on the relay you intend to use.

This may need to be postponed for BT, but with a WiFi connected Argon you can already use the Particle app and a slightly modified version of Tinker to do that too.
Other options are there too, but for simple starts I’d go with Tinker.


End Project:
Gated Facility: Customer access the App with a screen button. Taps the button which bluetooths to the Argon and pairs from < 20ft away. Argon digital output to open the gate. While waiting for the gate to open Argon to Xenon end point on a street light pole with solar panel and marine battery power to turn on a CCTV camera.
Bluetooth because of the short range to the gate. Want customer to trigger app and wait for the gate to open to allow the cameras have time to wake up. Using Potter & Brumfield relay: 3-32vdc - 120vac. Tired a small relay board but terminals too small for wire needed.


@stovalldb, the BLE API is not available on mesh devices yet. Fixing setup issues and mesh stability is Particle’s prime focus right now. The full BLE API will be introduced once that is achieved. Everything else is possible if engineered correctly.


Surprised BLE is not available yet. Understand MESH is their focus. With BLE being around for so long, figured that was a low hurdle to plug in. Thought I remember in Mesh board set up using a smart phone, was using BLE.


@stovalldb, BLE is used for setting up devices. What is not yet available is the BLE API for users.


Solved the Access Entry System for now, with a VizPin System. BLE from Smart Phone pairs with their controller at the gate and paid for a year of VizPin service. Hope, long before this time next year I will have my Mesh boards and cloud data base up and running.
The other solution at the facility which I can tie into the VizPin trip to open the gate, is to close a contact on a Mesh board to turn on Video Cameras at the facility. Not interested in having the video cameras recording all the time, only 10 to 15 minutes after the gate has opened. Have been reading some of your exchanges on Time settings. Hope to budget some time over the next month too get further along learning C++ then work on ways to put all this together.


Found this page with something about a OpenThread type RSSI

Any idea when or if Particle will allow access to some kind of Mesh.RSSI() OpenThread seems to have OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL
built in that allows end-points to be configured to search for new routers if their RSSI is below a certain level. I would like a Mesh.RSSI() just to be able to manually test the signal strength and if needed move my Xenon to a better location.


Just got in C++ for Dummies to start on a Mesh Coding Journey. Didn’t realize it was 700+ pages. Good news, it’s got a good index so once I get down some of the basic starting code I should be able to jump to some of the small bits of code I will need for projects.
The book’s learning venue is using Code Blocks.
Will this create issues when moving the code to the mesh boards?


As long you really try to understand how the code in the individual blocks works before reusing them via copy/paste then you should be well enough equipped to make sense of the Particle Reference docs and apply your knowledge to extrapolate how to use and apply for you yet “unknown” functions.


Thanks for the help. Planned on checking the basics against Particle Reference Docs as I go.


Finally back to Mesh! Home repairs done for now! Interesting development. Subdivision now has fiber and didn’t function with old router so purchased TP-Link Deco M9 Router/Mesh/Home Automation unit. Dug out my Argon and Xenon to start over with project. By chance, checked the Deco M9 App and the Argon pupped up as a new device on the network. Deco M9 can work with Ifttt. Will be interested if that might fit into some of the things I can learn to do with Particle Mesh


First Project. Home speaker controller with Argon and relays. Had been testing tripping a single relay board with one of my Argons. It was working great so I order a couple relay boards, each with 4 inputs and relays. With a double ended TRS cable, cut and spliced the grounds together and split wires to right and left speakers to separate relays. Using 2 digital outputs through the Particle App and relays to turn on and off the speakers. My home has all the ceiling speaker wiring in and upstairs closet. Will now use the Argon to manage the speakers from the App.


Fiber new to neighborhood and just got plugged in. Old routers didn’t play nicely with Fiber so got the TP-Link Deco M9 WiFi Mesh units. Work great and having no issues connecting the Argons and Xenons.