Advice for Setup of Particle Device

Hi All,

I am looking for some advice. We are using particle borons attached to a hardware device to collect data and send it to the cloud for our customers. The device collects data from sensors when an rfid tag is read. What have people found as the best way to troubleshoot their setups?

Have you set up special codes to troubleshoot that just constantly send data, so that the issue can be troubleshooted?If so, does this code stay on the device with the production code? Or do you flash a specific code to the device for setup and troubleshooting? Do you use publish statements to do this or do you plug in USB and test via serial link? Has anyone created an app like the particle tinker so that troubleshooting can be completed via mobile devices?

I realise these are very general questions, I’m just interested to see if people have any advice they think would be particularly helpful?

Thanks in advance.

You can use the Logging mechanism to put some debugging (and other log) code into your sources.
That code can stay in your code as you have control over the granularity/depth of your log via the different log levels `(LOG_LEVEL_ALL through to LOG_LEVEL_NONE).
When a log is not needed due to its level it shouldn’t be compiled in.

In addition to the stock SerialLogHandler there are also some custom logger available that may send the logs to a server or store them on an SD card and you can write your own loggers for whatever path you want.

1 Like

@StngBo by "constantly send data" I assume @ScruffR has anwsered your question with logging. But for your question on...

Perhaps take a look at Web Bluetooth UART Terminal In this post @RWB linked a gitlab repo with web code to do a BLE UART via web. There is even a sample webpage (Web Device CLI) up and running and you can actually use this on both ur PC and mobile to connect to a particle device via BLE if the particle is acting like a BLE UART peripheral.

Combine the web-device-cli page and https://docs.particle.io/tutorials/device-os/bluetooth-le/#uart-peripheral and you should be able to do serial connection via your phone or PC! Note on a PC you have to toggle a flag to get this to work (i.e. https://github.com/WebBluetoothCG/web-bluetooth/blob/master/implementation-status.md). Much better than an app in my opinion.

If you want to take it one step further, you can even write code to handle commands sent via serial and control your particle device via BLE. You could do something fancy like write some data to flash which upon reboot, sets the log levels that @ScruffR was mentioning.

2 Likes

Thanks for the quick replies @slacker89 and @ScruffR. Both of these suggestions will definitely be helpful in our project. I’ll go do some reading and testing with both of these suggestions.

@StngBo no problem. I’ve also just started developing a feature using BLE just a few weeks ago. I’ve gotten the web cli working on both Argons and Borons on device OS 1.4.4. Pretty much all of the code is in the BLE uart peripheral tutorial. So pretty easy.