How to Transfer Data/Files from Raspberry Pi Pico to Local Computer (Programmatically) - Part 1
ฝัง
- เผยแพร่เมื่อ 31 พ.ค. 2024
- Learn how to write to files on your local computer so that you can save larger files using the Raspberry Pi Pico or Pico W in MicroPython. By the end of this video, you will be able to write to save data on your machine, such as sensor data, without having to use any storage on your Pico! You can also use the same method in this video to write files from Pico to a Local PC!
This has great applications for storing large amounts of data collected by your sensors.
Best of all? It is super simple and only requires some Python code.
Link to Blog Post and Website
shillehtek.com/blogs/news/how...
Where to buy BME280
www.amazon.com/dp/B0BQFV883T?...
TIMESTAMPS
00:00 Introduction
01:05 Pip Package (Terminal)
01:55 Local Code
04:35 Pico Code - วิทยาศาสตร์และเทคโนโลยี
If you enjoy such content please do not forget to like, comment, and subscribe! Would be great to support our content trying to get to 1000 subs in December :)
This was extremely helpful, Thank you
Glad you think so! Think it is a simpler alternative to MQTT if you do not want a third-party client :) Do not forget to subscribe buddy. Thanks!
It helped me a lot, thank you very much!
I am happy you liked it! Be sure to subscribe mate!
Thank you. Looking good.
Thank you Matt your comment means a lot!
got a sub from me, that worked great! thanks for the tutorial! glad to level up and unlock data logging for my accelerometersss
Thanks for the sub! I am very happy it was useful to you buddy :)
Hi, can i just ask what might be a stupid question but is the Pico W connected to your Mac via USB cable whilst you are transferring data over serial connection? If it is then why not use Thonny or some thing similar to transfer the data. I'm sorry but I am very new to the Pico and python and I need very basic info. Thank you in advance.
Welcome, Buddy! No question is considered stupid here - we all start as beginners, and I respect your learning journey.
Though the connection is via USB, the basic Pico program only has access to its internal storage. The local computer filesystem isn't directly accessible. To overcome this, I opted for serial communication. While there might be cleaner alternatives, I found serial communication to be simple and convenient. I couldn't get my Macbook's filesystem to mount on the Pico, leading me to develop this solution.
Hope you subscribe, watch other videos, and ask more questions!
Thanks but for me it's unusable. If you check temperature with a BMC280, it's for recording in other place than near the computer. So I will look on youtube to use le local network to transfer data. I have done it with Webserver on Pico and wget on computer (like Raspberry zero W), I would like a transfer as http, ftp or other protocoles. Thanks
AWS IoT is a great way to do these things, have you ever tried it?
Yes i've done. A Raspberry Pico W is checking the temperature and humidity, A Raspberry Zero 2W is sending a request by crontab; if the temperature is out of range, I send a pushbullet on my smartphone.@@mmshilleh
What if i do not want to save data to a file, i just want to read each line as it is received then process it (do a action then save data to a log)
You can easily do that if you slightly modify the code. I just showed one use case but it's possible to simply process it and do something else. I don't have an example sitting around but perhaps in a future video
@@mmshilleh would i need to loop and read the output 1 character at a time? then process it when i see a special char like a line break? maybe i should send a string length (eg 0022; should never get over 9000) and then read that many bytes?
Question:
1) Is there a way to choose when to run the Pico code rather than having to connect it and disconnect every time?
You would need a more sophisticated script for that. You can record time in Python and run portions of the script at different times or chronologically. You would probably have to do something like that. High-level answer but I think it is indeed possible mate!
I get the error that 'Serial' module not found. How do I install this module on the pico?
it should be lowercase 'serial' if you are referring to the pyserial package in your local setup buddy :) Hope that helps.
hi, i'm with the same problem...do you solved it?