Xinyuan-LilyGO / T-Display-S3-Long

36 stars 11 forks source link

So many issues... #1

Open d3mac123 opened 7 months ago

d3mac123 commented 7 months ago

Hi, just got my S3-Long. I followed all the instructions for the Arduino IDE Quick Start. As the instructions are not that clear,

(step 2) after installing the Arduino ESP32 (is the Arduino_ESP32_OTA the right one?), (steps 3) I unzipped the downloaded file (the entire github from https://github.com/Xinyuan-LilyGO/T-Display-S3-Long/tree/master), and I copied it to my Documents\Arduino\libraries folder (step 4) I copied the lib folder to my Documents\Arduino\libraries folder as well - shouldn't this be copied to \Library\Arduino15\libraries (just in case, I did it too) (step 5) Lastly, I configured the Tools as specified.

Issues: (step 6) The T-Display-S3-Long does NOT show in File->Examples->... (step 7) The board does not show in some of my USB ports. However, I made it to work in one port at least (step 8) I manually copied the touch example and uploaded it to the board - the display does not show anything (all black) but I could capture the touch via serial monitor;

No other example worked - I tried Step 9 several times.

Questions are:

nikthefix commented 5 months ago

Yes it should be possible to adjust the format. I'll try it tomorrow and get back to you here.

nik

nikthefix commented 5 months ago

@momosh13

Hi again. Regarding 12hr format for the flip clock... The simplest way is to retain internal 24hr time keeping and change what's displayed:

In factory_gui.cpp, In function void set_flip_time_anim(int hour, int minute, int second) , At line 74 add:

if (hour==0) hour=12;
if (hour>12) hour=hour-12;

At least this way you don't have to modify any libs and your code will work even if you change your time reference (such as, maybe in future you'd prefer to use a RTC or GPS).

nik

momosh13 commented 5 months ago

You did it !!! It's 12H Clock now. Thank you

nikthefix commented 5 months ago

@momosh13 Good . I will add it to my github. Thanks for pointing it out. nik

momosh13 commented 3 months ago

Hi nikthefix If you're still in this forum, I have a question for you, if I may? I don't know anybody, who my help me, but you:) I'm working on this project many months and almost no progress, I'm trying to send HEX command from Arduino / USB Host to USB device to control some functions. I tried it, Teensy 4.1 with https://github.com/PaulStoffregen/USBHost_t36 library, and Arduino USB Host Shield 2.0 with https://github.com/felis/USB_Host_Shield_2.0 library, no luck. I need to send this HEX

1b 00 a0 24 08 16 0a d7 ff ff 00 00 00 00 09 00 00 03 00 17 00 02 03 53 00 00 00 00 40 00 40 48 48 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 08 48 08 00 40 00 08 48 08 00 40 00 08 48 08 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 00 40 00 08 48 08 00 40 00 00 40 00 00 40 48

to (Vendor Specific) USB Device. I got the HEX, by sniffing communication between Windows control software and the device, with Wireshark. Please, maybe you can help me again. Thank you

nikthefix commented 3 months ago

@momosh13 I have some of these USB host boards so I can look into it with you. Which board are you using? There is the Uno shield and the smaller design from here:

https://circuitsathome.com/usb-host-shield-for-arduino-pro-mini/

There are cheap clones of the 'mini' circuits at home design version which are slightly different in the power delivery department. A small hardware mod is necessary to bring the clones in-line with the original. Details can be found here:

https://geekhack.org/index.php?topic=80421.0

What does the vendor specific device enumerate as in your computer device manager? Does it use a custom USB driver or is it class compliant?

I have the host shield working fine with the CDC USB of my laser cutter GRBL controller, and I've had it working well with keyboard / mouse and also FTDI.

These host boards are usually limited to driving only devices catered for in the libraries - CDC, keyboard, joystick, MSD etc. For custom devices (non-class compliant) you may have to write your own driver. But the Arduino lib you mention does have many device profiles - not all standard class compliant - so it's possible you could adapt one of these profiles.

I suspect that your device is USB-HID generic. If so then that's a good thing.

I suggest initially testing your hardware by trying the USB Keyboard profile - just to make sure that the 500ma power requirements are met, or at least sufficient to drive your device (assuming it's bus powered).

The ESP32-S3 can also act as host natively - bypassing the need for SPI comms.

https://github.com/tanakamasayuki/EspUsbHost

I've been using this solution myself and it's neat as it uses no extra hardware. You just need a dev board with 2 usb ports and a wire jumper to bridge 5v to the host port and a USB OTG cable.

nik

momosh13 commented 3 months ago

Thank you for reply I have two hardwere otions and i have no problem connecting to my device and read the info from it, the device is USB-HID.

  1. i have teensy 4.1 board, please see the picture IMG_3169

and with https://github.com/PaulStoffregen/USBHost_t36 library, example HIDDeviceInfo the serial monitor giving me this T4 1 info

  1. then i have Arduino USB Host Shield 2.0 with theensy 4.0, please see the picture IMG_3173

whit this one, https://github.com/felis/USB_Host_Shield_2.0 library, exsample USB_desc, i'm geting this

T4 0 info

So, my problem is, i don't now how to send the HEX command to my device, i have no idea.

About the HEX in the previous post. in the Wireshark, i see this

#1 2 3 4 5 6 7 8 9 10 11

momosh13 commented 3 months ago

I just got one of this to, if you thing, this will make it easier

51LRBUCGc+L _AC_SL1050_

nikthefix commented 3 months ago

@momosh13

OK all that info really helps.

First I'd try the Teensy setup and run the example:

https://github.com/PaulStoffregen/USBHost_t36/tree/master/examples/RawHID/RawHIDtoUSBHostRawHID

Copy the VID and PID from your HIDDeviceInfo dump into the example sketch and start experimenting with Report Descriptors from there.

Here's a useful tool for Windows which will allow you to test data strings to confirm functionality:

https://www.researchgate.net/figure/HID-terminal-program-used-to-send-commands-to-micro-controller_fig11_268323254

I think it's important to establish working HID comms between PC and Device using the HID terminal before migrating to the MCU as it'll probably save a lot of time in the end.

You'll probably also need vendor specific documentation for your device Report Descriptor format. This is not revealed in the HIDDeviceInfo dump so it's guesswork unless it's class compliant or you have documentation. However, you can reverse engineer it by looking closely at the HID terminal I/O while messing around.

Can I ask what the HID device product is? Also, all things being equal, do you need your final project to use Teensy or are you hoping to use ESP?

We should move this chat as it's not a Lilygo topic. I'll add a repo on my github (https://github.com/nikthefix). Let's carry on there.

nik

nikthefix commented 3 months ago

@momosh13

https://github.com/nikthefix/ESP32-S3-USB-HOST/issues/1

imjinoh commented 1 month ago

The screen showing this

IMG_2677

How did you reset from the crash?