Quantcast
Viewing all articles
Browse latest Browse all 4983

General • Re: Transfer data over wifi for pico for a high sampling rate

Thanks for your reply. Dont I need to run a script in C in the Pi4/5 to get the data and save it via USB?
Option 1. The simplest

Code:

cat /dev/ttyACM0 >yourfile.dat
Then you need to run another program to decode the base64 and separate each 24bits to two samples of 16 bits.


Option 2.
The other method is to create a application that read directly the usb port , do the conversion and write the data to a new file.

Python could be use on option 1. just import binascii and base64 module. (base64.b64_decode()).

On option 2 you should use 'C' but maybe python will work. Just open a file '/dev/ttyACM0' and readline. Like I said to minimize the number of bytes transfered the ADC sample is compress on 12bits and two samples made 3 bytes. Then because of the USB serial the data is then encode in base 64. The base64 block included A timeStamp in microsecond follow by 600 samples and each block are ended by a newline '\n'.


In reality the application could be run on option 1 or 2. You just need to specify the filename.
HI
Hope you are well. I was visiting my home country and could not try your code for data transfer using pico and pi over usb.
So for usb transfer all i need to do is run the picoadcusb.c in pico and run usbtodisk.py in my raspberry pi. Right???

Statistics: Posted by Pranjol93 — Sun Feb 11, 2024 4:30 am



Viewing all articles
Browse latest Browse all 4983

Trending Articles