element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Azure Sphere Starter Kit
  • Products
  • Dev Tools
  • Avnet Boards Community
  • Azure Sphere Starter Kit
  • More
  • Cancel
Azure Sphere Starter Kit
Forum Can I use SCP to move a file into Azure Sphere?
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Azure Sphere Starter Kit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 15 replies
  • Answers 6 answers
  • Subscribers 48 subscribers
  • Views 1572 views
  • Users 0 members are here
  • azure sphere
Related

Can I use SCP to move a file into Azure Sphere?

clem57
clem57 over 6 years ago

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.

  • Sign in to reply
  • Cancel

Top Replies

  • bwilless
    bwilless over 6 years ago +3 suggested
    There are a few ways to move configuration data to a Sphere device . . . If you only need to operate on one or two devices you could use a Direct Method call to send down a JSON object with your configuration…
  • wizio
    wizio over 6 years ago in reply to bwilless +3
    4. simple curl download
  • wizio
    wizio over 6 years ago in reply to clem57 +2 suggested
    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…
  • danzima
    0 danzima over 6 years ago

    peterfenn

    bwilless

    Hi folks, any advice on the above?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wizio
    0 wizio over 6 years ago

    move file into module?

    module have "ssh" ( not sure for protocol over 443 ) only over "usb" ... you can pack files on compilation

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • clem57
    0 clem57 over 6 years ago in reply to wizio

    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.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wizio
    0 wizio over 6 years ago in reply to clem57

    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 ....

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • bwilless
    0 bwilless over 6 years ago

    There are a few ways to move configuration data to a Sphere device . . .

     

    1. If you only need to operate on one or two devices you could use a Direct Method call to send down a JSON object with your configuration:
      1. https://www.element14.com/community/external-link.jspa?url=http%3A%2F%2Favnet.me%2Fazure_sphere_direct_method_blog
    2. If you want to send a file to be included with your application build, you can package the file up into the image_package file.  This Microsoft example (https://github.com/Azure/azure-sphere-samples/tree/master/Samples/ExternalMcuUpdate ) shows how to send a binary file to a Sphere device.  Note that the sample uses the binary file to update a connected MCU, but you can take the file and pull your configuration data.
    3. You could also use device twins to send configuration data to your device.  The OOB examples #2 and #3, use device twins to do things like change the LEDs.

     

    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

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • wizio
    0 wizio over 6 years ago in reply to bwilless

    4. simple curl download image

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wizio
    0 wizio over 6 years ago

    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

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • clem57
    0 clem57 over 6 years ago in reply to wizio

    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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • wizio
    0 wizio over 6 years ago

    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

    #include <applibs/storage.h>

     


    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

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • wizio
    0 wizio over 6 years ago

    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

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube