Hello,
Is there a limit on the number of projects I can define in Notehub? I am deploying remote monitoring systems and each deployment has a unique set of variable values that must be defined at the time of the system is set up. My concern is that during a power outage, because the Swan has no easily available on-board memory like EEPROM, the values will be lost. I have ordered a handful of the Scoop backups but the application requires that the values not be lost. So while the Scoop is a great option, a longer outage could drain it which would mean a potentially long drive to reload the values. In the past, I wrote the values to EEPROM and read the values every time the controller started.
It appears that, outside of adding off-board memory, environment variables might be the best bet for storing unique values. The problem is each installation will have unique variable values so it looks like one solution is to have a separate project for each deployment. In the field, I can use my phone to get on Notehub and set each variable. I have deployed two of these systems so far to see how they work for me and over the last six months the results have been great. Now I am ready to install more but I don’t want to go down an unsustainable path. Thought, comments, criticisms are welcome.
Tom
Hi @TJK ,
The Swan has 2MB of on-board flash, would that work for your application? You should be able to use the flash to retain your variable values in a non-volatile manner.
Additionally, rather than creating a new project for each deployment, can I propose you try the following suggestion. If you only need to store device specific local environment variables, you could do something similar to the following:
- Create a notefile with the extension
.dbx
which instructs Notecard to not sync this notefile with Notehub. e.g.installation.dbx
- Use the
var.get
/var.set
APIs to read and write to this local notefile to retrieve your variables.
Let me know what you think of this approach and if that might be a solution for your concern!
Thanks,
Alex
Hi Alex,
Thank you for your reply. I hope all is well.
The first thing I need to say is that I am not the brightest light in the chandelier so I apologize in advance for that.
Using the on-board flash was suggested to me and after I looked into this option it became apparent that this is a fairly complex endeavor and not the like the simple process of reading and writing to EEPROM. If there was a canned function for using flash, I would try using it for my application but the idea of writing my own routine seems to be beyond my skill level.
I looked at the documentation for the .dbx and var.get and var.set. This looks like it may do what I need but the devil is in the details.
The systems I need to monitor are generally remote and each one is unique. For example, I need to measure several variables specific to the system being monitored and get those values into the swan. The swan uses those values to operate equipment in the overall system. Using environment variables I can set the values with my cell phone at the remote site and test the system to make sure everything works (I think. I haven’t actually tried this).
How are the values set in your suggestion? Do I need to bring a computer to the site to download a specific program each time? Can they be changed with the Notehub later on without going back to the site?
Again, sorry for my confusion.
Tom
PS In your photo it looks like you are at the helm of a boat. Yes?
Hi @TJK ,
I can appreciate that! I have used libraries such as this one which use flash to emulate EEPROM, making the storage/retrieval of data a little more straight forward. Your mileage might vary if you intend to do a lot of reading a writing from flash so be weary of the limitations.
If you want to set device specific variables, remotely, I’d suggest using inbound notes and accepting the payload from your microcontroller, then writing this to a local .dbx. When you queue an inbound note from Notehub, you can do this on a device by device basis, allowing you to send specific configurations to unique devices.
And yes that is the helm of boat! I’m based in the UK and can often be found sailing on the south coast in the warmer months of the year.
Thanks,
Alex