I am wishing to move a configuration file for Azure Sphere. Naturally SCP over SSH would work nicely. Can anyone direct me to a solution? I will have to modify the file sometimes depending on the layout of the equipment in use.
Thanks.
I am wishing to move a configuration file for Azure Sphere. Naturally SCP over SSH would work nicely. Can anyone direct me to a solution? I will have to modify the file sometimes depending on the layout of the equipment in use.
Thanks.
move file into module?
module have "ssh" ( not sure for protocol over 443 ) only over "usb" ... you can pack files on compilation
I was think based on your notes and comments, there is a real Linux file system. My wish is to move into /home/???? a file that has details like configuration to drive my code. IE changing the configuration could say interrogate a sensor 10 times and hour or 20 time an hour. That way limiting the the program re compiles to real logic changes and not silly parameter changes.
I am up for another way if it makes more sense.
File System is real but is controled ( firewall ) from Pluton subsytem ... I dont know ( for now ) how to write file ... Pluton is as "dongle" ... hardware "sudo"
There is MutableStorage for user ( not explored from me - this days I will )
This is file in user root folder with permition for write
"home" folder is: /mnt/apps/GUID_FROM_APP_MANIFEST/ ....
By default you not have access to function open() but have API for opening this MutableFile
This days will explore ....
There are a few ways to move configuration data to a Sphere device . . .
If you only need to operate on a single device, option #3 is simplest. While option #1 should be easy and give you more flexibility in the structure of your data.
Brian
So... user files
READ ONLY Files
Packed files to application-image on compilation
User Home Dir ( read-only mount folder )
/mnt/apps/GUID_FROM_APP_MANIFEST/ packed_file_name.1 , packed_file_name.2 , ...
int Storage_OpenFileInImagePackage( "packed_file_name" );
return FD of /mnt/apps/GUID_FROM_APP_MANIFEST/packed_file_name
READ & WRITE Mutable Storage
User Home Dir (read-write mount folder, size = "MutableStorage": { "SizeKB": 8 }
/mnt/config/GUID_FROM_APP_MANIFEST/
Storage_OpenMutableFile() return FD of file name /mnt/config/GUID_FROM_APP_MANIFEST/default
Folder /mnt/config/GUID_FROM_APP_MANIFEST can store other files, but by default open() not exist ...
How to read, write, upload, download file/s ... user-ware
App: Azure Explore MUTABLE READ[0] MUTABLE WRITE[20] = "Mutable Storage Text" MUTABLE READ[20] Mutable Storage Text [TEST] OPEN: test.txt (fd = 4) No error information (0). FOLDER: /mnt/config/dfb1b8e6-90a9-4480-a8c6-6267e5aed1a9 FILE: /mnt/config/dfb1b8e6-90a9-4480-a8c6-6267e5aed1a9/test.txt (empty) FILE: /mnt/config/dfb1b8e6-90a9-4480-a8c6-6267e5aed1a9/default Mutable Storage Text
I thank you wizio for your sample. I think the answer lies in the mutable storage. To me it acts like home and has a clearly identifiable way to get an ID. That would be the device assigned value(like a user id). I can tie this back to a website I provide which can have the changing data with a database back store. WHen I want to affect the programming, I simple change the back store which drives the code. Just perfect.
Clem
Just hint: app_manifest.json can be used as read-only setting file
see: my ... var_1 ....
{ "Name": "", "Capabilities": { "Uart": ["$AVNET_AESMS_ISU0_UART"], "AllowedConnections": [] }, "CmdArgs": [], "EntryPoint": "", "SchemaVersion": 1, "ComponentId": "9FAFA94E-3CFA-4B1D-8A13-50B82539A9B7", "my" : { "var_1" : "1", "var_2" : "2", "var_3" : "3" } }
as example
void foo(){
int fd = Storage_OpenFileInImagePackage("app_manifest.json");
char json_buffer[1024];
read(fd, json_buffer, sizeof(json_buffer));
//PARSE JSON VARIABLES
close(fd);
}
the real file name is: /mnt/apps/GUID_FROM_APP_MANIFEST/app_manifest.json
Simple example how to use packed-image files with CURL as REST-API and certificates
https://github.com/Wiz-IO/platform-azure/tree/master/Examples/ArduinoCurlAmazonRestApi