Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Device-Host connection. Send files from device to host.

    Scheduled Pinned Locked Moved LoPy
    5 Posts 2 Posters 37 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A Offline
      Andrés Millán Alcaide
      last edited by

      Hello everyone!

      I would like to generate a .csv with a large amount of data and be able to store it either on the SD or write that file directly to the host machine. In the SD according to the documentation I have seen that it is possible. My question would rather be if there is the possibility of being able to overwrite a file on the host machine with the data collected by LoPy.

      I have a LoPy 4 + Expansion Board 3 configuration.

      Thanks in advance.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @Andrés Millán Alcaide
        last edited by

        @Andrés-Millán-Alcaide there are probably a million ways to do that, depending on how you want them to communicate (via the serial port/USB cable, via WiFi, via Bluetooth...), whether you want to do updates on the fly or just fetch the data at fixed intervals, the volume of data, the frequency of the updates, whether the channel used is dedicated to that or not, what environment you have on the host...

        You’ll have to be a bit more specific about your needs, because as it stands there are a bit too many possible options, IMHO.

        A 1 Reply Last reply Reply Quote 2
        • A Offline
          Andrés Millán Alcaide @jcaron
          last edited by

          @jcaron yes, you are right, sorry for that. I am trying to collect the RSSI data from LoPy a store it into a .csv file in my host device. Probable the best option would be pass the data through USB.

          J 1 Reply Last reply Reply Quote 0
          • J Offline
            jcaron @Andrés Millán Alcaide
            last edited by

            @Andrés-Millán-Alcaide I'm not sure if going through the USB connection is "the best option", but we'll go with that.

            A very simple way of doing this is for you to just print the collected data, and then capture the data received to a file.

            If your host is running Linux or macOS, it can be as simple as cat /dev/nameofyourserialport >file.csv.

            You can probably do something similar using Windows (I think copy COMwhatever file.csv should do the trick).

            You may need to set the serial port parameters in some situations (using stty on Unix/macOS or modem on Windows -- note that on Unix/macOS you would probably need to keep the port open, so something like (stty whateversetttings ; cat >file.csv) < /dev/whateverserialport).

            This will fail if there are other things outputting to the LoPy "console". So you could at a prefix to your output so you can filter that (using grep).

            If you want to go one step further in terms of reliability (excluding any bad data, though you could still lose some), you could add a checksum to each output. In that case you'll need a custom program on the host to interpret that.

            A 1 Reply Last reply Reply Quote 1
            • A Offline
              Andrés Millán Alcaide @jcaron
              last edited by

              @jcaron Thank you very much, I will comment on my progress soon.

              Regards!

              1 Reply Last reply Reply Quote 0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              • 1 / 1
              • First post
                Last post

              Pycom on Twitter

              Pycom