Bluemix Application Freeboard on Node-RED not Saving - ibm-cloud

I've created a bluemix application that is using Node-RED to process my IoT sensors and I'm trying to use Freeboard as a dashboard. Only problem is the "Save Freeboard" button does nothing.
Any insight on how to fix this?

Where does Freeboard save it's data to? Is it backed by the filesystem or a database?
I'm not sure if Bluemix apps can save things to the "local" filesystem (and if it did it would not survive a app restart) and needs to use a database to store data.
Node-RED uses a CloudantDB instance to store flows and credentials.

If you are hosting your own freeboard, check the browser console for errors, by default what freeboard does is it tries download the JSON file with the layout to your computer when you click on "Save Freeboard".
Latest version will give you an option to save 'Minified' or 'Pretty' version of the JSON file.

Probably due to you fixing it but it seems to be working alright. Just make sure you actually use the url you get when saving or it won't load the saved json.
http://iotlabstart.mybluemix.net/freeboard/#start-73622
Edit: and make sure you're actually clicking either "pretty" or "minified" after "save".

Related

Data is not persisting for IndexedDB using Flutter and package Hive on web(chrome) browser

I'm using the flutter package Hive
The problem that I am encountering is that my website's data is not persisting for IndexedDB - web(chrome)
Has anyone else encountered inconsistency with data stored in IndexedDB for chrome?
Are there any additional steps outside of using the Hive package such as requesting persistent permission that I have to implement in order for the data to be stored?
Any feedback will be appreciated.
You don't even need to request the persistent storage permission to be able to store data. Persistent storage just makes it a bit more durable. So most likely, the data is never being written to IndexedDB in the first place. Could be an issue with your code or with a library you're using. Hard to say without seeing your code, especially since I've never used Hive.
This is a flutter project, using the hive package. It works fine on mobile devices, but when running the app in chrome the data gets lost after a refresh
Data after the initial load and initialisation
Empty boxes after refresh

IndexedDB persistence in PWA application

PWA application storage (IndexedDB) isn't able to provide data persistence.
In case that PWA is pinned to home screen it is possible to clear all application data from browser by clearing browsing history.
It might be unclear for users that cleaning browser data can affect pinned application and unsynchronised data will be lost.
Is there any way to avoid this?
The only way I see for now - turn back to native apps.
The clear storage mechanism in browsers is to put the user in control of their device.
This is why you as an application should never (native or web) assume your cached assets are cached.
If it is absolutely important to you to make sure you have core assets and data persisted then you need to have some sort of integrity check when the service worker initiates. That way you can restore cached state in case the application goes offline.
You also need to realize the operating system, looking at you iOS, will purge data when it feels like it (think when the available disk space gets critical), which takes you out fo control. It does this for native apps too as far as I know.
I do not know a way around that. The function in Chrome to "clear storage" (for example) does exactly that. I suppose it is reasonable for a user to be able to remove any data from their own device, but I agree it is not a good situation for the developer.
This is not possible.
The Storage API provides a StorageManager.persist() method to request the user explicit permission to persist data until deleted by the user itself:
if (navigator.storage && navigator.storage.persist)
navigator.storage.persist().then(function(persistent) {
if (persistent)
console.log("Storage will not be cleared except by explicit user action");
else
console.log("Storage may be cleared by the UA under storage pressure.");
});
If the local storage is running out of space, the User Agent will start automatically pruning cached resourced except the ones set as "persistent". However if the user itself chooses to clear the local data, there is no way to prevent this.
As far as I am aware, there is no event you can intercept in order to detect a browser clear action from the user.
See API reference doc :
https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist

How and which database to use with NWjs offline windows app to store data

i made a simplest application in nwjs which just takes an input of name .
now i can't store this value permanently because app is not connected with any database .
i know about mongodb but don't know how to integrate with javascript app.
i watched some tutorials how to use mongodb with apps but they in tutorials always use cmd to first start server (now a general software don't require , user to start servers manually etc).
Please help me if there is a way to store, fetch and perform other operations on data offline.
what i am missing ? Thanks
You may be looking for:
NeDB, a Mongo-like offline in-memory database
LinvoDB3, same than NeDB, but not in-memory (slower, but more scalable in terms of size)
LocalStorage a Web API

Where to store File/Images in Wildfly server?

I am using Wildfly 9.0.2.Final, while in development, all my files that uploaded via my web service and stored in resources/images are gone when I perform a full-publish (luckily this are development dummy images). In production, where is the best place to store or best practice to prevent files/images from missing?
If the files belong somehow to your application, place the somewhere inside the web application (and outside of WEB-INF). They will be accessible through the respective URL path.
If your application needs to store user data that gets uploaded dynamically during application runtime and shall persist even if you redeploy the application, then you better have a configurable directory on disk. One default option to find the JBoss/Wildfly data directory could be to query for the system property 'jboss.server.data.dir'.

How to make iOS app cache ALL request responses?

I'm starting to work on an app which will include in quite a few places data that I will download from my server each time user is asking to view them. Then, when user opens app again without any internet connection, app should let him view any content it previously downloaded, just loading it from the cache. The point of this is that the content changes from time to time and user needs to be able to see the last downloaded version if he can't connect to the server.
Problem is, I can set the cache to a certain size on disk, but I have to store ALL the content no matter the size. I suppose I'd have to set cache disk size to make it bigger when it's running out of space. What is a good way to do this?
P.S. Not sure if this is relevant, but I was thinking about trying AFNetworking for this project (previously I used ASIHTTPRequest).
If you're using NSURLCache as an on-disk cache, you can check the disk usage with currentDiskUsage. If this is approaching diskCapacity, you can increase it using setDiskCapacity. You should perform this check before you attempt to write to the cache.
I have worked on same type of project, I used AFNetworking and according to me storing the data in local database is better option then caching it... and at the time when user starts app just have one service call which just checks the database version. If its old version replace database and handle the case if network fails by displaying the older version.