-
Notifications
You must be signed in to change notification settings - Fork 190
v7 USB CDC serial data
In this document I will describe my research to make a USB serial demo.
v7 Has USB + / - exposed in the headers so you need to use an USB adapter that exposes the pins to give power to the board (VIN / GND) and connects the data to the USB+ and - data pins. OR you need to design a version which has a second USB-C port with that routed.
First let's install something to send Serial data communication. In Linux I use picocom
In my branch s3_color_implementation check the example: https://github.com/vroland/epdiy/tree/s3_color_implementation/examples/tinyusb-serial
That is a very simple example that will just make v7 present itself as an "USB device" and retype characters from your keyboard in the epaper display. To do that first we need to flash the Firmware and then connecting it through this built in USB port we need to check that appears correctly using list usb:
lsusb
Bus 001 Device 00X: ID 303a:4001 Espressif Systems Espressif Device
If something like this appears, that is your S3, presenting itself as USB device. Congrats you build a USB device!
Now let's send some characters. If you check the device list:
ls /dev/ttyA*
You should see something like /dev/ttyAC0 well that is the pipe or device file pointer to talk to this USB device. Let's open picocom and send some characters:
picocom /dev/ttyACM0
Then just type something and it should appear in the display.
Let's in this more advanced example receive a binary file. Since we are already decoding JPGs in another examples, let's set our mission to receive a small JPG to decode it, so we can send it "as is" to the display.
In order to do that you need to install an additional package (Only Linux example here, no idea how to do it in Windows)
sudo apt install lrzsz
Using picocom again like in last example we can press first CRTL + A and then CTRL + S and a file prompt will appear:
Type [C-a] [C-h] to see available commands Terminal ready
*** file: martin.jpg
$ sz -vv martin.jpg
That is supposedly opening the file with the sz program and sending it via USB serial. More to be written in this page soon!
epdiy.readthedocs.io WiKi rev. 1.0.1 Last updated Sept, 2023. Firmware & Hardware: vroland WiKi: martinberlin & collaborators