No announcement yet.

Data Storage On XPico Wifi

  • Filter
  • Time
  • Show
Clear All
new posts

  • Data Storage On XPico Wifi

    Hi there,

    I have a microcontroller that communicates with an html webpage through the Muxhttp interface.

    This works so far. However, the webpage only shows the datas that I last sent to it from the microcontroller, and eventually the datas that have been recorded by the webpage since the last page refresh. If i want to show stored datas, the only way i have just now, is to store the datas locally on my microcontroller and send them on demand to the webpage that requires them through the Mux.

    So i am wondering if there is a possibility to use the serial line ( mux or CLI) to write datas on the XPico Flash region ( Files Register , in a custom file, format is not important, could be xml...) , instead of sending directly datas to the htmlpage. So the website would actualise itself with the datas saved on the XPico Flash memory, and oldest datas would be saved on it too, instead of saving datas into my microcontrollers memory or external additional flash.

    I hope my question is clear, otherwise , i would be happy to explain it more in details

  • #2
    Hello EricG,
    Yes, you can store data in the file system of the xPico Wi-Fi from the command line on the serial port (and if you're in Mux, enter Command Line by typing D\r).

    Once you're in command line, you can:
    > file system
    file system> upload filename
    Now send the data that you want to store in the file. You can store any binary data in the file, so the way to terminate the upload is a timeout.

    You can also dump the contents of the data via the CLI:
    file system> cat filename    (for ASCII dump)
    file system> hexdump filename    (for HEX binary dump)
    You can also remove files, create directories, etc. Type ? after you do file system to see all the available commands.

    If the file is in the http/ directory, then it can be served normally via the web server (and your Javascript can process the data as necessary).

    Also, you can use the Web File System API to get to files (and modify them, upload new ones, create directories, etc) via HTTP transactions from the network side. See the "xPico Wifi File System Web API.pdf" document in this post for how to do it from the network side:



    • #3
      Hi Mariano,
      Thanks for the fast answer. Your answer helps. I already tried the file system access in the CL Interface, but couldn't totally figure out how the file access worked.

      I now have a small further question (i hate to play the killjoy), regarding the file system. Files can be created from raw data and removed through the CL Interface, but i'm wondering if there is also a possibility to append data to an existing file, other than having to dump the full file content into the ucontrller and upload it again with actualised data?

      The question find its ground in a low cost application in which we plan to integrate the xpico wifi part as an advanced monitoring option, in order to log datas on a regular basis(lets say every minute) and make them available for users via a web interface. Low cost application means we are using a low cost ucontroller ( STM8 8bits 16MHz) which isnt really ideal for exchange of large chuncks of data through serial communication...


      • #4
        Hi Eric,

        Unfortunately appending data to an existing file is not available. I'll be sending you a Private Message to put you in contact with your local Sales Representative and Field Applications Engineer so that we can request that feature.



        • #5

          Your feature is in. Go download from the New Releases forum, and you can now use
          upload -a <filename>
          to append to the file.


          • #6
            Hi Mariano,

            Thanks that's great news. I'll try it on our eval board.
            Is there any recommended/optimal written data size to preserve the Flash endurance of the device?