create a config.js file to store setting values in json format? #297
Replies: 3 comments
-
Posted at 2014-07-21 by @gfwilliams Sounds like you might be trying to do two different things? For settings, presumably you can load and save the whole file in one go? so:
If the file is so big that it won't fit in memory and you need to pipe it, you need to pipe to the actual serial device rather than the function
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-21 by d0773d Thanks. I will give that code a go when I get home from work. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-07-22 by d0773d @gordon piping the data to Serial1 worked. I can now view the settings and sensor data in real time by piping it out to my Wifi module then out to my TCP server on the internet. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-07-20 by d0773d
What I would like to achieve is to store settings into a config file preferably in json format into a config file of some sort(maybe settings.js?) Which will then get loaded and updated/saved onto a sdcard.
Does anyone have an example that I can work from?
I managed to get this far. However, I am stuck at how to pipe the data to the console screen. If possible, I would like to eventually pipe the file data to a serial port and also pipe data from the serial port to the file located on the sdcard.
At the moment, the console is only receiving: {}. Inside the settings.js file I have:
The console.log should output the contents of settings.js, but instead console.log only outputs { }.
Beta Was this translation helpful? Give feedback.
All reactions